/*
 * Calder & Vale: editorial art direction (2026-10-12), loaded after the shared demo bundle.
 * "The monument": the colonnade fills the screen and a centred, oversized headline crosses the seam where the black
 * meets the stone; hairline grid rules frame it. Below: a numeral band, images that unmask as they arrive, and the
 * CONFIDENTIAL verdict that draws itself tight. All motion is CSS, and none of it runs under reduced motion.
 */

body[data-authored-demo][data-demo="calder-and-vale"] .hero {
  display: block;
  min-height: 100svh;
  padding: 0;
  text-align: center;
  background: #0a0a0b;
  isolation: isolate;
}

/* The colonnade: the lower two thirds of the screen, fading up into the black. */
body[data-authored-demo][data-demo="calder-and-vale"] .hero > img {
  position: absolute !important;
  inset: 30% 0 0 !important;
  width: 100% !important;
  height: 70% !important;
  min-height: 0;
  margin: 0;
  object-position: center 40%;
  z-index: -2;
  filter: brightness(1.35) contrast(1.08) saturate(1.1);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 28%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 28%);
}

body[data-authored-demo][data-demo="calder-and-vale"] .hero .veil {
  display: block;
  z-index: -1;
  background:
    linear-gradient(to bottom, transparent 70%, #0a0a0bb3 100%),
    radial-gradient(42% 26% at 50% 34%, #0a0a0b99, transparent 75%);
}

/* Hairline rules, as in an editorial grid. */
body[data-authored-demo][data-demo="calder-and-vale"] .hero::before {
  content: "";
  position: absolute;
  inset: 84px 5vw 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(90deg, #ffffff17 1px, transparent 1px);
  background-size: 25% 100%;
  border-right: 1px solid #ffffff17;
}

body[data-authored-demo][data-demo="calder-and-vale"] .hero .copy {
  position: relative;
  max-width: none;
  margin: 0 auto;
  padding: 150px 5vw 9vh;
}

body[data-authored-demo][data-demo="calder-and-vale"] .hero .copy > span {
  display: inline-block;
  padding: 0 14px;
  background: #0a0a0b;
}

body[data-authored-demo][data-demo="calder-and-vale"] .hero .copy h1 {
  margin: 30px auto 0;
  font-size: clamp(4.6rem, 10.6vw, 11.5rem);
  line-height: 0.84;
  letter-spacing: -0.065em;
  text-wrap: balance;
  text-shadow: 0 2px 40px #0a0a0bb3;
}

body[data-authored-demo][data-demo="calder-and-vale"] .hero .copy p {
  max-width: 560px;
  margin: 34px auto 0;
  color: #efe9df;
  text-shadow: 0 1px 18px #0a0a0b;
}

body[data-authored-demo][data-demo="calder-and-vale"] .hero .copy .dx-anchor {
  justify-content: center;
  margin-inline: auto;
  text-shadow: 0 1px 14px #0a0a0b;
}

body[data-authored-demo][data-demo="calder-and-vale"] .hero aside {
  position: absolute;
  right: 5vw;
  bottom: 6vh;
  order: initial;
  margin: 0;
  padding: 0 0 0 16px;
  text-align: left;
  border-top: 0;
  border-left: 2px solid #8d1f27;
}

/* ---- Numeral band (the old trust strip) ---- */
body[data-demo="calder-and-vale"] .lawTrust span {
  display: grid;
  gap: 10px;
  justify-items: start;
  padding: 44px 3vw 38px;
  text-align: left;
}

body[data-demo="calder-and-vale"] .lawTrust b {
  font: 400 clamp(3rem, 5.6vw, 5.8rem) / 0.9 "Demo Serif", Georgia, serif;
  letter-spacing: -0.05em;
  color: #e8e2d8;
  text-transform: none;
}

body[data-demo="calder-and-vale"] .lawTrust span:nth-child(odd) b {
  color: #c97a7d;
}

/* ---- Phones ---- */
@media (width <= 800px) {
  body[data-authored-demo][data-demo="calder-and-vale"] .hero > img {
    inset: 38% 0 0 !important;
    height: 62% !important;
  }

  body[data-authored-demo][data-demo="calder-and-vale"] .hero::before {
    background-size: 50% 100%;
  }

  body[data-authored-demo][data-demo="calder-and-vale"] .hero .copy {
    padding: 118px 20px 40px;
  }

  body[data-authored-demo][data-demo="calder-and-vale"] .hero .copy h1 {
    font-size: clamp(2.9rem, 12.4vw, 5rem);
    overflow-wrap: break-word;
  }

  body[data-authored-demo][data-demo="calder-and-vale"] .hero aside {
    display: none;
  }

  body[data-authored-demo][data-demo="calder-and-vale"] .hero .copy > a {
    max-width: calc(100% - 12px);
    text-align: left;
  }

  body[data-demo="calder-and-vale"] .lawTrust span {
    padding: 28px 20px 24px;
  }
}

/* ---- Scroll moments (where the browser supports scroll-driven animation) ---- */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    @keyframes cv-unmask {
      from {
        clip-path: inset(18% 8% 18% 8%);
        transform: scale(1.08);
      }
      to {
        clip-path: inset(0);
        transform: scale(1);
      }
    }

    /* Movement only, never a fade (2026-10-14): a 35% start left the verdict at 2.2:1 contrast until it was
       scrolled into view, and the numbers invisible. */
    @keyframes cv-verdict {
      from {
        letter-spacing: 0.22em;
      }
      to {
        letter-spacing: -0.02em;
      }
    }

    @keyframes cv-rise-number {
      from {
        transform: translateY(40%);
      }
    }

    body[data-demo="calder-and-vale"] .dx-gallery-item img {
      animation: cv-unmask linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 45%;
    }

    body[data-demo="calder-and-vale"] .result h2 {
      animation: cv-verdict linear both;
      animation-timeline: view();
      animation-range: entry 20% cover 50%;
    }

    body[data-demo="calder-and-vale"] .lawTrust b,
    body[data-demo="calder-and-vale"] .matters b {
      animation: cv-rise-number linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 90%;
    }
  }
}

/* Depth (2026-10-12). A law firm should feel steady, not playful: the warm shaft of light in the colonnade follows the pointer, nothing else moves. Pointer devices only; off under reduced motion. */
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  body[data-demo="calder-and-vale"] .hero .dx-light {
    z-index: -1;
    mix-blend-mode: screen;
    background: linear-gradient(90deg, transparent calc(50% + var(--dx-px, 0) * 30% - 7%), #ffb45a33 calc(50% + var(--dx-px, 0) * 30%), transparent calc(50% + var(--dx-px, 0) * 30% + 7%));
    -webkit-mask-image: linear-gradient(to bottom, transparent 28%, #000 55%);
    mask-image: linear-gradient(to bottom, transparent 28%, #000 55%);
  }
  body[data-demo="calder-and-vale"] .hero.is-lit .dx-light {
    opacity: 1;
  }
}
