/*
 * Apex Atelier: editorial art direction (2026-10-12), loaded after the shared demo bundle.
 * "Cinema title": the car stays unobstructed; the title bar gains scale, the review line gets its own row (it
 * used to print over the description), and the spec numerals read as a hairline band.
 */

@media (min-width: 801px) {
  body[data-authored-demo][data-demo="apex-atelier"] .hero .copy {
    grid-template-rows: auto auto auto auto;
    row-gap: 18px;
  }

  body[data-authored-demo][data-demo="apex-atelier"] .hero .copy h1 {
    grid-row: 2 / span 3;
    /* 6.1vw (2026-10-14): at 6.5vw "Performance, composed." overran its box by about 4% at 1024-1440px. */
    font-size: clamp(3.4rem, 6.1vw, 7rem);
    line-height: 0.86;
    letter-spacing: -0.05em;
  }

  body[data-authored-demo][data-demo="apex-atelier"] .hero .copy h1 i {
    display: inline-block;
    margin-left: 0.6em;
  }

  body[data-authored-demo][data-demo="apex-atelier"] .hero .copy > p:not(.dx-anchor) {
    grid-column: 2;
    grid-row: 2;
    max-width: 440px;
  }

  body[data-authored-demo][data-demo="apex-atelier"] .hero .copy > a {
    grid-row: 3;
  }

  body[data-authored-demo][data-demo="apex-atelier"] .hero .copy > .dx-anchor {
    grid-column: 2;
    grid-row: 4;
    margin: 4px 0 0;
  }
}

/* Spec numerals: larger, separated by hairlines. */
body[data-demo="apex-atelier"] .hero .spec b {
  font-size: clamp(2.2rem, 3.4vw, 3.6rem);
  font-weight: 300;
  letter-spacing: -0.04em;
}

body[data-demo="apex-atelier"] .hero .spec span {
  padding-bottom: 12px;
  border-bottom: 1px solid #ffffff22;
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes ap-reveal {
    from {
      clip-path: inset(0 100% 0 0);
    }
  }

  body[data-demo="apex-atelier"] .hero .copy h1 i {
    animation: ap-reveal 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) 0.35s both;
  }
}

/* Depth (2026-10-12). Cars sell on paint and form: a specular highlight sweeps the bodywork as the pointer moves, and the car shifts against the room. Pointer devices only; off under reduced motion. */
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  body[data-demo="apex-atelier"] .hero > img {
    translate: calc(var(--dx-px, 0) * -10px) calc(var(--dx-py, 0) * -10px);
    transition: translate 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  body[data-demo="apex-atelier"] .hero .dx-light {
    z-index: 0;
    mix-blend-mode: soft-light;
    background: radial-gradient(28% 22% at calc(50% + var(--dx-px, 0) * 34%) calc(58% + var(--dx-py, 0) * 12%), #ffffffe6, transparent 70%);
  }
  body[data-demo="apex-atelier"] .hero.is-lit .dx-light {
    opacity: 0.9;
  }
}

/* Generated foreground and empty garage share the same full canvas. */
body[data-authored-demo][data-demo="apex-atelier"] .hero {
  isolation: isolate;
}
body[data-authored-demo][data-demo="apex-atelier"] .hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  scale: 1.08;
}
body[data-authored-demo][data-demo="apex-atelier"] .hero > .dx-garage-plate { z-index: -4; }
/* The empty garage lost the car's own shadow, so the cutout carries a contact shadow to sit on the floor. */
body[data-authored-demo][data-demo="apex-atelier"] .hero > .dx-layer-car {
  z-index: -3;
  filter: drop-shadow(0 10px 8px rgb(0 0 0 / 0.6)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.7));
}
@keyframes ap-drift-car {
  to {
    translate: 0 23vh;
  }
}
body[data-authored-demo][data-demo="apex-atelier"] .hero > .dx-light { z-index: -2; }
body[data-authored-demo][data-demo="apex-atelier"] .hero > .shade { z-index: -1; }
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  body[data-authored-demo][data-demo="apex-atelier"] .hero > .dx-layer-car {
    translate: calc(var(--dx-px, 0) * -22px) calc(var(--dx-py, 0) * -22px);
  }
}
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) and (hover: none) {
    body[data-authored-demo][data-demo="apex-atelier"] .hero > .dx-layer-car {
      /* Same scale as the garage, and only slightly faster than its 26vh drift, so the car stays on its floor. */
      animation-name: dx-settle, ap-drift-car;
      animation-duration: 2.4s, auto;
      animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1), linear;
      animation-fill-mode: both, both;
      animation-timeline: auto, scroll(root);
      animation-range: normal, 0 100vh;
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  body[data-authored-demo][data-demo="apex-atelier"] .hero > img {
    animation: none;
    translate: none;
    transition: none;
  }
}
