/* Hero: "render pass" preview. A concept site built from four stacked layers (wire, image, type, motion).
   data-pass on .rp picks how it renders: wire → clay → light → final. motion.js adds the pointer-driven
   exploded view (--rx, --ry, --gap), the cursor light (--lx, --ly) and the auto-cycle with a pause control.
   Without JS or with reduced motion it shows the final pass, flat, and the buttons still switch passes. */

.hero { position: relative; padding-block: clamp(2.5rem, 1.5rem + 4vw, 5.5rem) 0; overflow: hidden; isolation: isolate; }
/* Viewport grid + cursor spotlight */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px; background-position: -1px -1px; opacity: .45;
  mask-image: radial-gradient(ellipse 70% 80% at 70% 40%, #000 20%, transparent 75%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(520px circle at var(--mx, 70%) var(--my, 40%), rgb(201 247 85 / .07), transparent 70%);
}
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: center; }
.hero__title { font-size: var(--text-hero); font-weight: 800; letter-spacing: -.035em; line-height: .95; max-width: 11ch; }
.hero__accent { display: block; color: var(--lime); }
/* Rotating phrase: "like film." is the real headline; motion.js adds the others (aria-hidden) when motion is on.
   All phrases share one grid cell, so the headline keeps the size of the longest and never shifts. */
.motion .hero__accent { display: grid; }
.motion .hero__phrase { grid-area: 1 / 1; opacity: 0; }
.motion .hero__phrase.is-current { opacity: 1; }
/* A new phrase renders in like a pass: wipes up as a lime outline, then fills */
@keyframes phrase-in {
  0% { opacity: 1; transform: translateY(.3em); clip-path: inset(100% -.2em -.2em -.2em); color: transparent; -webkit-text-stroke-color: var(--lime); }
  50% { transform: none; clip-path: inset(-.2em); color: transparent; -webkit-text-stroke-color: var(--lime); }
  100% { opacity: 1; clip-path: inset(-.2em); color: var(--lime); -webkit-text-stroke-color: transparent; }
}
@keyframes phrase-out {
  from { opacity: 1; clip-path: inset(-.2em); }
  to { opacity: 0; transform: translateY(-.3em); clip-path: inset(-.2em -.2em 100% -.2em); }
}
.motion .hero__phrase.is-entering { -webkit-text-stroke: 2px transparent; animation: phrase-in 1100ms var(--ease) both; }
.motion .hero__phrase.is-leaving { animation: phrase-out 600ms var(--ease) both; }
.motion.is-paused .hero__phrase { animation-play-state: paused; }
.hero__lead { margin-top: 1.5rem; max-width: 36rem; color: #d9d6cf; font-size: clamp(1.0625rem, 1rem + .3vw, 1.2rem); }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.hero__facts { display: flex; flex-wrap: wrap; gap: .6rem 1.75rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); letter-spacing: .08em; }
.hero__facts b { color: var(--ivory); font-weight: 500; }

/* ---------- Render-pass stage ---------- */
/* overflow-anchor: none keeps the browser from anchoring scroll to moving layers (it caused a runaway scroll) */
.rp { position: relative; --gap: 0px; --rx: 0deg; --ry: 0deg; overflow-anchor: none; }
.rp__hud { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; color: var(--muted); font-size: .6875rem; }
.rp__hud b { color: var(--lime); font-weight: 500; }
.rp__hud-rec { display: inline-flex; align-items: center; gap: .5rem; }
.rp__hud-rec i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--red); }
.rp__hud-rec b { color: var(--ivory); font-variant-numeric: tabular-nums; }

.rp__scene {
  position: relative; aspect-ratio: 400 / 260; container-type: inline-size;
  transform-style: preserve-3d; transform: perspective(1600px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 900ms var(--ease);
}
/* Layers are picture only: pulled apart and tilted, they reach over the pass buttons and must not catch their clicks */
.rp__layer {
  position: absolute; inset: 0; border-radius: 6px; overflow: hidden; pointer-events: none;
  transform: translateZ(calc(var(--i) * var(--gap)));
  transition: transform 900ms var(--ease), opacity 600ms var(--ease), box-shadow 600ms var(--ease), background-color 600ms var(--ease), border-color 600ms var(--ease);
}
.rp__layer--wire { --i: 0; border: 1px solid var(--line-strong); background: var(--raised); }
.rp__layer--image { --i: 1; }
.rp__layer--type { --i: 2; }
.rp__layer--motion { --i: 3; overflow: visible; }

.rp__wire-svg, .rp__motion-svg { width: 100%; height: 100%; }
.rp__wire-svg { fill: none; stroke: var(--lime); stroke-width: 1; vector-effect: non-scaling-stroke; opacity: .2; transition: opacity 600ms var(--ease); }
.rp__wire-svg * { vector-effect: non-scaling-stroke; }
.rp__layer--image img { width: 100%; height: 100%; object-fit: cover; transition: filter 700ms var(--ease), opacity 700ms var(--ease); }

/* The concept site's own type and UI, sized in container units so it scales with the stage */
.rp__mock { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 0 4.5cqi 4cqi; background: linear-gradient(90deg, rgb(10 11 9 / .9) 35%, rgb(10 11 9 / .1)); transition: background 700ms var(--ease); }
.rp__mock-nav { display: flex; align-items: center; gap: 3.5cqi; height: 11.5cqi; font-size: 2.1cqi; color: #d9d6cf; }
.rp__mock-nav b { margin-right: auto; font: 750 2.8cqi/1 var(--font-display); font-stretch: var(--wide); color: var(--ivory); }
.rp__mock-nav em { font-style: normal; font-weight: 600; padding: 1.2cqi 2.2cqi; border-radius: .6cqi; background: var(--lime); color: var(--graphite); }
.rp__mock-kicker { margin-top: 6cqi; font: 500 1.9cqi/1 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--red-text); }
.rp__mock-title { margin-top: 2.5cqi; max-width: 11ch; font: 800 8.4cqi/.92 var(--font-display); font-stretch: 125%; letter-spacing: -.03em; color: var(--ivory); }
.rp__mock-cta { align-self: flex-start; margin-top: 4cqi; padding: 1.6cqi 2.8cqi; border-radius: .6cqi; background: var(--ivory); color: var(--graphite); font-weight: 600; font-size: 2.1cqi; }
.rp__mock-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5cqi; margin-top: auto; }
.rp__mock-cards span { padding: 2cqi; border: 1px solid rgb(244 240 232 / .25); border-radius: .6cqi; background: rgb(16 17 15 / .6); font-size: 1.9cqi; color: #d9d6cf; }
.rp__mock * { transition: color 600ms var(--ease), background-color 600ms var(--ease), border-color 600ms var(--ease), box-shadow 600ms var(--ease); }

.rp__motion-svg { fill: none; }
.rp__curve { stroke: var(--lime); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 0; opacity: 0; transition: opacity 600ms var(--ease); }
.rp__keys rect { fill: var(--graphite); stroke: var(--lime); vector-effect: non-scaling-stroke; transform-box: fill-box; transform-origin: center; transform: rotate(45deg); opacity: 0; transition: opacity 600ms var(--ease); }
.rp__playhead { fill: var(--red); opacity: 0; transition: opacity 600ms var(--ease); }

/* Cursor light, used by the light pass */
.rp__light { position: absolute; inset: 0; transform: translateZ(calc(2.5 * var(--gap))); pointer-events: none; opacity: 0; border-radius: 6px; mix-blend-mode: screen; background: radial-gradient(40% 60% at var(--lx, 30%) var(--ly, 30%), rgb(255 240 210 / .38), transparent 70%); transition: opacity 600ms var(--ease); }

/* --- Pass: wire --- */
.rp[data-pass="wire"] .rp__wire-svg { opacity: 1; }
.rp[data-pass="wire"] .rp__layer--wire { background: var(--graphite); border-color: var(--lime); }
.rp[data-pass="wire"] .rp__layer--image img { opacity: 0; }
.rp[data-pass="wire"] .rp__mock { background: transparent; }
.rp[data-pass="wire"] .rp__mock :is(p, b, span, em) { color: transparent; background: transparent; border-color: transparent; box-shadow: inset 0 0 0 1px rgb(201 247 85 / .55); }
.rp[data-pass="wire"] .rp__mock-nav span, .rp[data-pass="wire"] .rp__mock-nav b { box-shadow: none; }
.rp[data-pass="wire"] :is(.rp__curve, .rp__keys rect) { opacity: 1; }

/* --- Pass: clay (untextured, matte grey) --- */
.rp[data-pass="clay"] .rp__layer--wire { background: #5f5d58; border-color: #77746e; }
.rp[data-pass="clay"] .rp__layer--image img { filter: grayscale(1) contrast(.45) brightness(1.15); opacity: .55; }
.rp[data-pass="clay"] .rp__mock { background: linear-gradient(90deg, rgb(70 68 64 / .92) 35%, rgb(70 68 64 / .2)); }
.rp[data-pass="clay"] .rp__mock :is(p, b, span) { color: #e3e0d9; }
.rp[data-pass="clay"] .rp__mock-kicker { color: #cfccc5; }
.rp[data-pass="clay"] .rp__mock-nav em, .rp[data-pass="clay"] .rp__mock-cta { background: #a9a59d; color: #3b3a37; }
.rp[data-pass="clay"] .rp__mock-cards span { background: #6c6a65; border-color: #85827b; }
.rp[data-pass="clay"] .rp__keys rect { opacity: .6; stroke: #cfccc5; }

/* --- Pass: light (clay + a key light that follows the cursor) --- */
.rp[data-pass="light"] .rp__layer--wire { background: #4d4b47; }
.rp[data-pass="light"] .rp__layer--image img { filter: grayscale(.85) contrast(.8) brightness(.95); opacity: .85; }
.rp[data-pass="light"] .rp__mock { background: linear-gradient(90deg, rgb(40 39 36 / .9) 35%, rgb(40 39 36 / .15)); }
.rp[data-pass="light"] .rp__mock :is(p, b, span) { color: #f1eee8; }
.rp[data-pass="light"] .rp__mock-kicker { color: #ffd9a8; }
.rp[data-pass="light"] .rp__mock-nav em, .rp[data-pass="light"] .rp__mock-cta { background: #d8d3c9; color: #2c2b28; }
.rp[data-pass="light"] .rp__mock-cards span { background: rgb(60 58 54 / .8); }
.rp[data-pass="light"] .rp__light { opacity: 1; }
.rp[data-pass="light"] .rp__playhead { opacity: .8; }

/* --- Pass: final --- */
.rp[data-pass="final"] .rp__wire-svg { opacity: 0; }
.rp[data-pass="final"] .rp__playhead { opacity: 1; }

/* Exploded view: each layer casts a shadow onto the one below and the wire layer gets a lime edge */
.motion .rp.is-exploded .rp__layer { box-shadow: 0 30px 60px -30px rgb(0 0 0 / .9); }
.motion .rp.is-exploded .rp__layer--wire { border-color: rgb(201 247 85 / .5); }
.motion .rp.is-exploded .rp__layer--motion { box-shadow: none; }

/* Controls */
.rp__controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1rem; }
.rp__passes { display: inline-flex; padding: 3px; gap: 3px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--raised); }
.rp__btn {
  min-height: 2.5rem; padding: .45rem .8rem; border: 0; border-radius: 3px; background: transparent; color: var(--muted);
  font: 500 .875rem/1 var(--font-body); cursor: pointer; transition: background-color var(--fast), color var(--fast);
}
.rp__btn .mono { margin-right: .35rem; font-size: .625rem; color: var(--clay); letter-spacing: .04em; }
.rp__btn:hover { color: var(--ivory); background: var(--raised-2); }
.rp__btn[aria-pressed="true"] { background: var(--lime); color: var(--graphite); }
.rp__btn[aria-pressed="true"] .mono { color: var(--graphite); }
.rp__pause { display: inline-flex; align-items: center; gap: .55rem; min-height: 2.5rem; padding: 0 .9rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: transparent; color: var(--ivory); font: 500 .8125rem/1 var(--font-body); cursor: pointer; }
.rp__pause:hover { border-color: var(--ivory); }
.rp__pause-icon { width: 10px; height: 12px; border-inline: 3px solid currentColor; }
.rp__pause.is-paused .rp__pause-icon { border: 0; width: 0; height: 0; border-left: 10px solid currentColor; border-block: 6px solid transparent; }
.rp__caption { margin-top: .75rem; }

/* Ticker band */
.hero__ticker { overflow-anchor: none; margin-top: clamp(3rem, 2rem + 4vw, 6rem); border-block: 1px solid var(--line); overflow: hidden; padding-block: clamp(.9rem, .6rem + 1vw, 1.5rem); }
.ticker__track { display: flex; align-items: center; width: max-content; }
.ticker__track span { white-space: nowrap; font: 800 clamp(1.6rem, 1rem + 3vw, 3.75rem)/1 var(--font-display); font-stretch: 125%; letter-spacing: -.03em; color: transparent; -webkit-text-stroke: 1px #5a5e57; }
.ticker__track i { font-style: normal; color: var(--red); font-size: clamp(.8rem, .6rem + .8vw, 1.4rem); margin-inline: .8em; }
@keyframes ticker { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
.motion .ticker__track { animation: ticker 50s linear infinite; }
.motion.is-paused .ticker__track { animation-play-state: paused; }

/* Intro */
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
.motion .hero__copy > * { animation: rise 900ms var(--ease) both; }
.motion .hero__copy > :nth-child(2) { animation-delay: 80ms; }
.motion .hero__copy > :nth-child(3) { animation-delay: 160ms; }
.motion .hero__copy > :nth-child(4) { animation-delay: 240ms; }
.motion .hero__copy > :nth-child(5) { animation-delay: 320ms; }
.motion .hero__visual { animation: rise 1100ms 200ms var(--ease) both; }

@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__title { max-width: 12ch; }
}
@media (max-width: 480px) {
  .rp__btn { padding: .45rem .55rem; font-size: .8125rem; }
  .rp__btn .mono { display: none; }
  .rp__passes { width: 100%; }
  .rp__btn { flex: 1; }
}
