/* ══════════════════════════════════════════════════════════════════════════════════════════════════════════
   HOME, HIGH-TECH (2026-11): a path-traced hero that turns, a moving "built on" strip, then four sections, each a
   filmstrip of tabs over one panel at a time, with an optional short film. Behaviour: js/hx.js.

   Motion budget (tested in tools: see the review script):
     hero entrance   lines rise 1.0 s each, 110 ms apart; the rest fades in by 1.55 s
     hovers          160 ms; cards lift and light where the pointer is
     filmstrip       panels change in 380 ms (picture 420 ms); the bar slides 280 ms
     film dialog     opens 320 ms
     reveals         700 ms as each block enters the screen
   Everything eases out (fast start, soft landing). Reduced motion: no entrances, no marquee, no tilt.
   ══════════════════════════════════════════════════════════════════════════════════════════════════════════ */

/* ── Hero ─────────────────────────────────────── */
.hx-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: 100svh;
  margin-top: calc(-1 * var(--nav-h));
  padding-top: var(--nav-h);
  overflow: hidden;
}

/* The product photograph (tools/render/g1.py): the right side on wide screens, below the words on phones */
.hx-shot {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 50%;
  z-index: -1;
  margin: 0;
  overflow: hidden;
  background: #020303;
}

.hx-shot__drift {
  position: absolute;
  inset: 0;
}

/* The whole frame shows (contain): the turntable swings the temples out toward the edges */
.hx-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 50%;
}

/* Its edges melt into the page */
.hx-shot::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--paper) 0%, rgba(5, 8, 7, 0) 22%),
    linear-gradient(0deg, var(--paper) 0%, rgba(5, 8, 7, 0) 16%),
    linear-gradient(180deg, rgba(5, 8, 7, 0.7) 0%, rgba(5, 8, 7, 0) 14%);
}

/* A slow focus-in when the page opens, then the photo breathes */
@media (prefers-reduced-motion: no-preference) {
  .js .hx-shot img {
    opacity: 0;
    transform: scale(1.06);
    filter: blur(10px) brightness(0.6);
  }

  .js.is-ready .hx-shot img {
    animation: hx-shot-in 1.8s var(--ease-out) 0.15s forwards;
  }

  .hx-shot__drift {
    animation: hx-drift 26s ease-in-out infinite alternate;
  }
}

@keyframes hx-shot-in {
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes hx-drift {
  from {
    transform: scale(1) translate3d(var(--px, 0px), var(--py, 0px), 0);
  }

  to {
    transform: scale(1.045) translate3d(var(--px, 0px), var(--py, 0px), 0);
  }
}

.hx-hero__inner {
  position: relative;
  padding-block: clamp(72px, 12vh, 140px) clamp(88px, 12vh, 140px);
}

.hx-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: rgba(5, 8, 7, 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: var(--fs-xs);
  color: var(--ink-2);
}

.hx-status img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.hx-status b {
  font-weight: 600;
  color: var(--ink);
}

.hx-status .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(111, 240, 166, 0.18), 0 0 12px var(--accent);
}

.hx-sep {
  width: 1px;
  height: 14px;
  background: var(--line-strong);
}

.hx-title {
  margin-top: var(--space-6);
  max-width: 9.2em;
  font-size: clamp(2.9rem, 1rem + 4.6vw, 5.4rem);
  font-weight: 640;
  line-height: 0.94;
  letter-spacing: -0.052em;
  color: var(--ink);
}

.hx-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.hx-line > span {
  display: inline-block;
}

.hx-title em {
  font-style: normal;
  background: linear-gradient(100deg, #d4ffe7 0%, #6ff0a6 45%, #5eead4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hx-lead {
  max-width: 31em;
  margin-top: var(--space-6);
  font-size: clamp(1.06rem, 0.98rem + 0.4vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-2);
}

.hx-lead b {
  font-weight: 600;
  color: var(--ink);
}

.hx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

.hx-actions .btn svg {
  width: 18px;
  height: 18px;
}

.hx-actions .btn .mono {
  color: var(--ink-3);
  font-size: 0.85em;
}

.hx-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(32px, 6vh, 64px);
}

.hx-stat {
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  min-width: 132px;
  padding: 12px 16px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 8, 7, 0.45);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.hx-stat dd {
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.hx-stat dt {
  max-width: 12em;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--ink-3);
}

/* Scroll cue: a mouse outline with a dot running down it */
.hx-scroll {
  position: absolute;
  left: 50%;
  bottom: 26px;
  width: 24px;
  height: 38px;
  margin-left: -12px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  transition: opacity var(--dur-2) var(--ease-out);
}

.hx-scroll span {
  position: absolute;
  left: 50%;
  top: 7px;
  width: 3px;
  height: 7px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.is-scrolled-past .hx-scroll {
  opacity: 0;
}

@media (max-width: 480px) {
  .hx-role,
  .hx-sep {
    display: none;
  }
}

/* Phones and small tablets: the words, then the photograph, one after the other */
@media (max-width: 899px) {
  .hx-hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
  }

  .hx-hero__inner {
    padding-block: 28px 4px;
  }

  .hx-shot {
    position: relative;
    inset: auto;
    z-index: 0;
    width: 100%;
    aspect-ratio: 1 / 0.9;
  }

  .hx-shot::after {
    background:
      linear-gradient(180deg, var(--paper) 0%, rgba(5, 8, 7, 0) 16%),
      linear-gradient(0deg, var(--paper) 0%, rgba(5, 8, 7, 0) 18%);
  }

  .hx-stats {
    display: none;
  }

  .hx-scroll {
    display: none;
  }

  .hx-actions .btn {
    flex: 1 1 auto;
  }
}

/* The entrance: lines rise out of their own masks, then the rest fades up out of a blur */
@media (prefers-reduced-motion: no-preference) {
  .js .hx-line > span {
    transform: translateY(108%);
  }

  .js .hx-in {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(6px);
  }

  .js.is-ready .hx-line > span {
    animation: hx-rise 1s var(--ease-out) forwards;
    animation-delay: calc(120ms + var(--l, 0) * 110ms);
  }

  .js.is-ready .hx-in {
    animation: hx-fade 0.8s var(--ease-out) forwards;
    animation-delay: calc(200ms + var(--d, 0) * 110ms);
  }

  .hx-scroll span {
    animation: hx-wheel 1.8s var(--ease-out) infinite;
  }
}

@keyframes hx-rise {
  to {
    transform: none;
  }
}

@keyframes hx-fade {
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes hx-wheel {
  0% {
    transform: translateY(0);
    opacity: 1;
  }

  70% {
    transform: translateY(14px);
    opacity: 0;
  }

  100% {
    transform: translateY(0);
    opacity: 0;
  }
}

/* ── Built on: a strip that never stops moving ── */
.hx-marquee {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: 18px 0;
  border-block: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
  overflow: hidden;
}

.hx-marquee__label {
  flex: none;
  padding-left: var(--gutter);
  font-size: var(--fs-2xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.hx-marquee__window {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.hx-marquee__track {
  display: flex;
  width: max-content;
}

.hx-marquee ul {
  display: flex;
  gap: 44px;
  margin: 0;
  padding: 0 44px 0 0;
  list-style: none;
}

.hx-marquee li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  white-space: nowrap;
}

.hx-marquee li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
}

@media (prefers-reduced-motion: no-preference) {
  .hx-marquee__track {
    animation: hx-marquee 52s linear infinite;
  }

  .hx-marquee:hover .hx-marquee__track {
    animation-play-state: paused;
  }
}

@keyframes hx-marquee {
  to {
    transform: translateX(-50%);
  }
}

/* ── Section heads ────────────────────────────── */
.hx-head {
  display: grid;
  gap: var(--space-4);
  max-width: 46rem;
}

.hx-head--center {
  margin-inline: auto;
  text-align: center;
  justify-items: center;
}

.hx-head .h2 {
  font-size: clamp(2.2rem, 1.3rem + 3.2vw, 4rem);
  letter-spacing: -0.045em;
}

/* ── What I've built: a filmstrip of tabs above one panel at a time (js/hx.js initStrips) ── */
.hx-sec + .hx-sec {
  padding-top: 0;
}

/* The strip: thumbnails in a row, scrolling sideways when they don't fit */
.hx-strip__tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(168px, 1fr);
  gap: 12px;
  padding: 2px 2px 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.hx-strip__tabs::-webkit-scrollbar {
  display: none;
}

.hx-tab {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 8px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink-2);
  font: inherit;
  text-align: left;
  cursor: pointer;
  scroll-snap-align: start;
  transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out), color 160ms var(--ease-out), box-shadow 280ms var(--ease-out);
}

.hx-tab:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.hx-tab[aria-selected="true"] {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--ink);
  box-shadow: 0 0 44px -20px rgba(111, 240, 166, 0.7);
}

.hx-tab__thumb {
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: 11px;
  overflow: hidden;
  background: #020303;
}

.hx-tab__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
  transition: opacity 160ms var(--ease-out), transform 420ms var(--ease-out);
}

.hx-tab__thumb--phone img {
  object-position: 50% 12%;
}

.hx-tab:hover .hx-tab__thumb img,
.hx-tab[aria-selected="true"] .hx-tab__thumb img {
  opacity: 1;
}

.hx-tab:hover .hx-tab__thumb img {
  transform: scale(1.04);
}

.hx-tab__num {
  padding-inline: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.hx-tab__label {
  padding-inline: 6px;
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.25;
}

/* The stage: picture and words side by side; one panel shows */
.hx-strip__stage {
  margin-top: var(--space-4);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  box-shadow: 0 50px 100px -60px #000;
  touch-action: pan-y;
}

.hx-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.hx-panel[hidden] {
  display: none;
}

.hx-panel__media {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #040706;
}

.hx-panel__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hx-panel__media--render img {
  object-position: 50% 50%;
}

/* A phone screenshot, upright in a dark frame */
.hx-panel__media--phone {
  display: grid;
  place-items: center;
  background: radial-gradient(60% 60% at 50% 40%, rgba(111, 240, 166, 0.12), transparent 70%), #040706;
}

.hx-panel__media--phone img {
  width: auto;
  height: 86%;
  aspect-ratio: auto;
  border-radius: 28px;
  box-shadow: 0 0 0 6px #0b100e, 0 0 0 7px rgba(255, 255, 255, 0.14), 0 40px 80px -30px #000;
}

.hx-panel__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-4);
  padding: clamp(24px, 4.5vw, 64px);
}

.hx-panel__meta {
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.hx-panel__title {
  font-size: clamp(1.75rem, 1.1rem + 1.9vw, 2.75rem);
  font-weight: 650;
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hx-panel__text {
  max-width: 34em;
  color: var(--ink-2);
  font-size: 1.06rem;
  line-height: 1.6;
}

.hx-panel__facts {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 0.95rem;
}

.hx-panel__facts li {
  position: relative;
  padding-left: 20px;
}

.hx-panel__facts li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(111, 240, 166, 0.8);
}

.hx-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: var(--space-2);
}

/* Changing panels: the picture settles, the words slide in from the side you came from */
@media (prefers-reduced-motion: no-preference) {
  .hx-panel.is-entering .hx-panel__media img {
    animation: hx-pan-img 420ms var(--ease-out);
  }

  .hx-panel.is-entering .hx-panel__body > * {
    animation: hx-pan-in 380ms var(--ease-out) backwards;
  }

  .hx-panel.is-entering .hx-panel__body > :nth-child(2) { animation-delay: 30ms; }
  .hx-panel.is-entering .hx-panel__body > :nth-child(3) { animation-delay: 60ms; }
  .hx-panel.is-entering .hx-panel__body > :nth-child(4) { animation-delay: 90ms; }
  .hx-panel.is-entering .hx-panel__body > :nth-child(5) { animation-delay: 120ms; }
}

@keyframes hx-pan-img {
  from {
    opacity: 0.2;
    transform: scale(1.03);
  }
}

@keyframes hx-pan-in {
  from {
    opacity: 0;
    transform: translateX(var(--from, 24px));
  }
}

/* Arrows, count and a bar that slides to the chosen tab */
.hx-strip__nav {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: var(--space-4);
}

.hx-strip__count {
  min-width: 4.2em;
  font-size: 0.8rem;
  color: var(--ink-3);
}

.hx-strip__track {
  position: relative;
  flex: 1;
  height: 2px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--line);
}

.hx-strip__track i {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(100% / var(--n, 4));
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  transition: transform 280ms var(--ease-out);
}

.hx-arrow {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.hx-arrow:hover {
  border-color: var(--line-hover);
  background: var(--accent-soft);
}

.hx-arrow:active {
  transform: scale(0.94);
}

.hx-arrow svg {
  width: 20px;
  height: 20px;
}

.hx-arrow--prev svg {
  transform: scaleX(-1);
}

@media (max-width: 860px) {
  .hx-panel {
    grid-template-columns: 1fr;
  }

  .hx-panel__media--render,
  .hx-panel__media--phone {
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 560px) {
  .hx-strip {
    margin-top: var(--space-8);
  }

  .hx-strip__tabs {
    grid-auto-columns: 138px;
    gap: 10px;
    margin-inline: calc(-1 * var(--gutter, 16px));
    padding-inline: var(--gutter, 16px);
    scroll-padding-inline: var(--gutter, 16px);
  }

  .hx-tab__label {
    font-size: 0.9rem;
  }

  .hx-strip__stage {
    border-radius: 22px;
  }

  .hx-panel__body {
    gap: var(--space-3);
    padding: 22px 20px 26px;
  }

  .hx-panel__text {
    font-size: 1rem;
  }
}

/* ── What I've built: the deck (js/hx.js initDeck). The card leans toward the pointer (--rx, --ry) and catches the
   light where it points (--mx, --my); its rim is a lit gradient that turns with it (--ang). A new card turns in from
   the side it came from; a thin bar under each thumbnail counts down to the next ── */
.hx-deck__room {
  margin-top: var(--space-4);
  perspective: 1800px;
}

.hx-deck .hx-strip__stage {
  position: relative;
  margin-top: 0;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-origin: 50% 50%;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(111, 240, 166, 0.06), transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  box-shadow: 0 60px 120px -60px #000, 0 40px 90px -60px rgba(111, 240, 166, 0.35);
  will-change: transform;
}

/* A lit rim: brightest on the side the light comes from */
.hx-deck .hx-strip__stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(var(--ang, 135deg), rgba(111, 240, 166, 0.7), rgba(255, 255, 255, 0.1) 28%,
      rgba(255, 255, 255, 0.02) 60%, rgba(150, 210, 255, 0.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}

/* The shine: a soft glare under the pointer, and a faint film of colour that slides as the card tilts */
.hx-deck__shine {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--mx, 30%) var(--my, 0%), rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04) 24%, transparent 52%),
    linear-gradient(115deg, transparent 32%, rgba(111, 240, 166, 0.07) 44%, rgba(150, 210, 255, 0.06) 52%, transparent 64%);
  background-size: 100% 100%, 250% 100%;
  background-position: 0 0, var(--mx, 30%) 0;
  mix-blend-mode: screen;
  opacity: var(--shine, 0.55);
  transition: opacity 400ms var(--ease-out);
}

/* A gleam sweeps across each new card */
.hx-deck__shine::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.16) 50%, transparent 62%);
  transform: translateX(-120%);
}

.hx-panel__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #040706;
}

.hx-frontier {
  display: grid;
  gap: 6px;
  max-width: 34em;
  padding: 14px 16px;
  border: 1px solid var(--accent-line);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(111, 240, 166, 0.09), rgba(111, 240, 166, 0.02));
  color: var(--ink);
  font-size: 0.97rem;
  line-height: 1.5;
}

.hx-frontier__tag {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

/* The countdown under the chosen thumbnail */
.hx-deck .hx-tab {
  position: relative;
  overflow: hidden;
}

.hx-tab__time {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), #9fe7ff);
  box-shadow: 0 0 12px rgba(111, 240, 166, 0.8);
  transform: scaleX(0);
  transform-origin: left;
}

.hx-deck.is-auto .hx-tab[aria-selected="true"] .hx-tab__time {
  animation: hx-time var(--dwell, 9s) linear forwards;
}

.hx-deck.is-paused .hx-tab__time {
  animation-play-state: paused !important;
}

@keyframes hx-time {
  to {
    transform: scaleX(1);
  }
}

.hx-deck__pause .i-play,
.hx-deck__pause[aria-pressed="true"] .i-pause {
  display: none;
}

.hx-deck__pause[aria-pressed="true"] .i-play {
  display: block;
}

.hx-deck:not(.is-auto) .hx-deck__pause {
  display: none;
}

.hx-deck__pause svg {
  transform: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  .hx-deck .hx-panel.is-entering {
    animation: hx-flip-in 820ms cubic-bezier(0.2, 0.75, 0.15, 1) both;
  }

  .hx-deck.is-sweeping .hx-deck__shine::after {
    animation: hx-gleam 1100ms cubic-bezier(0.3, 0.6, 0.2, 1) 120ms both;
  }

  .hx-deck .hx-tab[aria-selected="true"] .hx-tab__thumb img {
    animation: hx-pan-img 600ms var(--ease-out);
  }
}

@keyframes hx-flip-in {
  from {
    opacity: 0;
    transform: perspective(1600px) rotateY(calc(var(--flip, 1) * 42deg)) translateX(calc(var(--flip, 1) * 4%)) scale(0.96);
    filter: brightness(1.5);
  }

  55% {
    opacity: 1;
  }
}

@keyframes hx-gleam {
  from {
    transform: translateX(-120%);
  }

  to {
    transform: translateX(120%);
  }
}

/* ── More: a sheet with the whole story of one card ── */
.hx-more {
  width: min(1100px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100% - 48px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background:
    radial-gradient(80% 50% at 100% 0%, rgba(111, 240, 166, 0.08), transparent 60%),
    var(--surface);
  color: var(--ink);
  box-shadow: 0 80px 160px -60px #000, 0 0 140px -60px rgba(111, 240, 166, 0.35);
  overflow: auto;
  overscroll-behavior: contain;
}

.hx-more::backdrop {
  background: rgba(2, 4, 3, 0.8);
  backdrop-filter: blur(10px);
}

.hx-more__panel {
  position: relative;
  display: grid;
  gap: clamp(22px, 3.2vw, 40px);
  padding: clamp(22px, 4.5vw, 56px);
}

.hx-more__close {
  position: sticky;
  top: 0;
  z-index: 2;
  justify-self: end;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: -44px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(12, 18, 16, 0.86);
  backdrop-filter: blur(8px);
  color: var(--ink);
  cursor: pointer;
}

.hx-more__close:hover {
  border-color: var(--line-hover);
}

.hx-more__close svg {
  width: 20px;
  height: 20px;
}

.hx-more__head {
  display: grid;
  gap: var(--space-3);
  padding-right: 56px;
}

.hx-more__title {
  font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3.1rem);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

/* The summary: what, why, frontier */
.hx-sum {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.hx-sum > div {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
}

.hx-sum dt {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.hx-sum dd {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.55;
}

/* The stack: the picture, and a key to its plates */
.hx-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(20px, 3.5vw, 48px);
  align-items: center;
  margin: 0;
}

.hx-stack img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 22px;
  background: #020303;
  box-shadow: 0 0 0 1px var(--line);
}

.hx-stack__title {
  margin-bottom: 10px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.hx-layers {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 0.95rem;
  line-height: 1.5;
}

.hx-layers li {
  position: relative;
  padding: 12px 0 12px 3.2em;
  border-top: 1px solid var(--line);
}

.hx-layers li span {
  position: absolute;
  left: 0;
  top: 13px;
  font-size: 0.78rem;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(111, 240, 166, 0.6);
}

.hx-layers b {
  display: block;
  color: var(--ink);
  font-weight: 620;
}

.hx-more__cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 56px);
}

.hx-more__cols section {
  display: grid;
  align-content: start;
  gap: var(--space-4);
}

.hx-more__cols p {
  color: var(--ink-2);
  line-height: 1.6;
}

.hx-more__h {
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.hx-steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  color: var(--ink-2);
}

.hx-steps li {
  position: relative;
  padding-left: 44px;
  min-height: 30px;
  line-height: 1.5;
  counter-increment: step;
}

.hx-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--accent-line);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font: 600 0.8rem/1 var(--font-mono, monospace);
}

.hx-more__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: var(--space-2);
  border-top: 1px solid var(--line);
  padding-top: clamp(18px, 2.5vw, 28px);
}

@media (prefers-reduced-motion: no-preference) {
  .hx-more[open] {
    animation: hx-reel-in 360ms var(--ease-out);
  }

  .hx-more[open]::backdrop {
    animation: hx-reel-fade 360ms var(--ease-out);
  }
}

@media (max-width: 860px) {
  .hx-sum,
  .hx-stack,
  .hx-more__cols {
    grid-template-columns: 1fr;
  }

  .hx-stack img {
    max-width: 560px;
  }
}

@media (max-width: 560px) {
  .hx-more {
    width: calc(100% - 16px);
    max-height: calc(100% - 16px);
    border-radius: 22px;
  }

  .hx-more__panel {
    padding: 20px 18px 24px;
  }

  .hx-sum > div {
    padding: 14px 16px;
  }
}

/* ── The short films: a square player in a dialog, only when asked ── */
.hx-reel {
  width: min(92vw, calc(100svh - 150px), 820px);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}

.hx-reel::backdrop {
  background: rgba(2, 4, 3, 0.84);
  backdrop-filter: blur(10px);
}

.hx-reel__panel {
  position: relative;
  outline: none;
}

.hx-reel__video {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 22px;
  background: #000;
  box-shadow: 0 0 0 1px var(--line-strong), 0 60px 120px -40px #000, 0 0 120px -40px rgba(111, 240, 166, 0.35);
}

.hx-reel__title {
  margin-top: 14px;
  text-align: center;
  color: var(--ink-3);
  font-size: 0.9rem;
}

.hx-reel__close {
  position: absolute;
  top: -56px;
  right: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  cursor: pointer;
}

.hx-reel__close:hover {
  border-color: var(--line-hover);
}

.hx-reel__close svg {
  width: 20px;
  height: 20px;
}

@media (prefers-reduced-motion: no-preference) {
  .hx-reel[open] {
    animation: hx-reel-in 320ms var(--ease-out);
  }

  .hx-reel[open]::backdrop {
    animation: hx-reel-fade 320ms var(--ease-out);
  }
}

@keyframes hx-reel-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
}

@keyframes hx-reel-fade {
  from {
    opacity: 0;
  }
}

/* The hero's turntable fades in over the still once it can play */
.hx-shot__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 50%;
  opacity: 0;
  transition: opacity 900ms var(--ease-out);
}

.hx-shot__video.is-playing {
  opacity: 1;
}

/* ── Contact: a lit panel ─────────────────────── */
.hx-cta {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 6vw, 72px);
  border: 1px solid var(--accent-line);
  border-radius: 32px;
  background:
    radial-gradient(70% 90% at 85% 0%, rgba(111, 240, 166, 0.16), transparent 60%),
    radial-gradient(60% 80% at 0% 100%, rgba(94, 234, 212, 0.08), transparent 60%),
    rgba(255, 255, 255, 0.02);
  box-shadow: 0 0 120px -50px rgba(111, 240, 166, 0.5);
}

.hx-cta .h2 {
  font-size: clamp(2.6rem, 1.4rem + 5vw, 5rem);
}

.hx-cta .lead {
  max-width: 38em;
  margin-top: var(--space-4);
}

.hx-cta .spec {
  margin-top: var(--space-10);
}

/* Generic reveal stagger inside a group */
.reveal[style*="--i"] {
  transition-delay: calc(var(--i) * 70ms);
}
