/* ==========================================================================
   HyperReal X — implementation of Figma file "PH" (Project : HYPE - Site)
   Frames: 360 / 1280 / 1920 × {Hero, Statement 1/2, Statement 2/2, FAQ,
   Newsletter, Footer, TRAILER MODE}. All measurements below come from those
   frames; comments cite the source where a value is not self-evident.
   ========================================================================== */

:root {
  --font-sans: "Aktiv Grotesk Corp", "Aktiv Grotesk", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --white: #fff;
  --grey: #7f7f7f;          /* body copy */
  --edge: 20px;             /* outer margin at every breakpoint */
  --ui-h: 81px;             /* bottom UI bar */
  --col: min(320px, 100% - 2 * var(--edge)); /* content column */

  /* Content block top edge. Figma: 145px @640h, 185px @720h, 355px @1080h.
     = 50% − 175px − (h − 720px)/36 above 720px. Never closer than 96px to the
     logo. Percentages resolve against the panel height. */
  --content-top: max(96px, calc(50% - 175px - max(0px, (100% - 720px) / 36)));

  /* FAQ nav sits 29px above the bottom UI at every size (530→559, 610→639, 970→999). */
  --nav-top: calc(100% - 160px);

  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: #000;
  color: var(--grey);
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #000;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 13px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
  overflow-x: hidden;
}

img { display: block; max-width: none; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; font: inherit; }
a { color: inherit; text-decoration: none; }

:focus { outline: none; }
:focus-visible { outline: 1px solid var(--white); outline-offset: 4px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: var(--edge); top: 90px; z-index: 50;
  padding: 10px 14px; background: #000; color: var(--white);
  outline: 1px solid var(--white);
  transform: translateY(-300px);
}
.skip-link:focus, .skip-link:focus-visible { transform: none; }

/* ---------- Header: logo + tagline as one 360×80 vector (assets/logo.svg) ---------- */
.site-header {
  position: fixed; top: 0; left: 0; z-index: 20;
  width: 360px; max-width: 100%; height: 80px;
  pointer-events: none;
}
.site-header__home { display: block; width: 360px; max-width: 100vw; pointer-events: auto; }
.site-header__home:focus-visible { outline-offset: -6px; }
.site-header__logo { width: 360px; height: 80px; max-width: 100vw; height: auto; aspect-ratio: 360 / 80; }

/* ---------- Panels ---------- */
.panel {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: #000;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.panel__body {
  position: absolute;
  left: 50%;
  top: var(--content-top);
  width: var(--col);
  transform: translateX(-50%);
  text-align: center;
}

/* Copy blocks: 13/20 Medium #7f7f7f; empty Figma lines = 20px gaps. */
.copy p + p,
.copy__title + p,
.copy__strong + p { margin-top: 20px; }
/* Line breaks are fixed to Figma's rendered lines (explicit <br>s, soft wraps included),
   so copy never re-wraps by itself. Below 360px wide it may wrap again so nothing overflows. */
@media (min-width: 360px) {
  .copy :is(p, h2, h3):not(.newsletter__message), .faq__item :is(p, h3) { white-space: nowrap; }
}
.copy__title { color: var(--white); }                       /* Statement titles: Medium, white */
.copy__strong { color: var(--white); }                       /* white, Medium — same as statement titles (client request) */
/* Links in copy (footer e-mail): constant 1px underline, exactly the text width,
   drawn on the pixel grid; text and line turn white together on hover/focus. */
.copy a {
  display: inline-block; line-height: 20px;
  color: var(--grey);
  background: linear-gradient(currentColor, currentColor) 0 calc(100% - 2px) / 100% 1px no-repeat;
  transition: color .25s var(--ease);
}
.copy a:hover, .copy a:focus-visible { color: var(--white); }

/* ---------- 01 Hero ---------- */
.hero__bg { position: absolute; inset: 0; opacity: .5; }
.hero__globe {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}

.hero__play {
  position: absolute; left: 50%; top: 50%;
  width: 320px; height: 320px;
  transform: translate(-50%, -50%);
}
.hero__ring {
  position: absolute; border: 1px solid var(--white); border-radius: 3000px;
  opacity: .1;
}
.hero__ring--outer { inset: 0; }
.hero__ring--inner { inset: 4px; }

.hero__button {
  position: absolute; left: 100px; top: 100px;
  width: 120px; height: 120px; border-radius: 50%;
}
/* The ring (Figma "Play": 2px white stroke, 120px) is drawn in CSS so only the ring grows;
   the triangle stays put. Hover: ring 120 → 140px fast, back to 120px slower on leave.
   Growing via inset keeps the stroke a crisp 2px (a scale() would thicken it). */
.hero__circle {
  position: absolute; inset: 0;
  border: 2px solid var(--white); border-radius: 50%;
  transition: inset .8s cubic-bezier(.45, 0, .25, 1);                /* leave: slower, soft settle */
}
.hero__icon { position: absolute; left: 0; top: 0; width: 120px; height: 120px; }
.hero__button:focus-visible { outline-offset: 6px; border-radius: 50%; }
/* "Watch Teaser": centred 119px right of the circle centre, 13/10 Medium (Figma 207:1364). */
.hero__label {
  position: absolute; left: calc(60px + 119px); top: 60px;
  transform: translate(-50%, calc(-50% - 1px));
  font-size: 13px; line-height: 10px; color: var(--white); white-space: nowrap;
}
@media (hover: hover) {
  .hero__button:hover .hero__circle {
    inset: -10px;                                                     /* 120 → 140px */
    transition-duration: .28s; transition-timing-function: cubic-bezier(.16, 1, .3, 1);  /* enter: fast */
  }
}

/* ---------- 04 FAQ ---------- */
.faq__label { color: var(--grey); }

/* Stage: one question at a time. Split answers (1/2, 2/2) change only the answer;
   a new question changes question + answer. Neighbours peek at 40% on desktop. */
.faq__stage {
  position: absolute; left: 0; right: 0;
  top: calc(var(--content-top) + 40px);
  bottom: 170px;
  touch-action: none;            /* horizontal drags are ours; vertical swipes page the site */
  cursor: grab;
}
.faq__stage.is-dragging { cursor: grabbing; user-select: none; }
.faq__stage:focus-visible { outline-offset: -2px; }
.faq__item {
  position: absolute; top: 0; left: 50%;
  width: var(--col); transform: translateX(-50%);
  text-align: center;
}
.faq__q { color: var(--white); }
.faq__a-wrap { position: relative; margin-top: 20px; }
.faq__part { margin-top: 20px; }                 /* "(1/2)": stays put, only the digit changes */
.faq__part + .faq__a-wrap { margin-top: 0; }
.faq__part-n { display: inline-block; }
.faq__a.is-leaving { position: absolute; left: 0; right: 0; top: 0; pointer-events: none; }
.faq__a p + p { margin-top: 20px; }
.faq__item.is-leaving { pointer-events: none; }
.faq__ghost { display: none; opacity: .4; cursor: pointer; }
.faq__ghost--prev { left: 0; }
.faq__ghost--next { left: 100%; }
@media (hover: hover) { .faq__ghost:hover { opacity: .55; transition: opacity .3s; } }

/* Desktop: next/previous question peeks at the viewport edge at 40% (Figma 212:1393, 212:1394). */
@media (min-width: 1024px) {
  .faq__ghost { display: block; }
}

.faq__nav {
  position: absolute; left: 50%; top: var(--nav-top);
  width: var(--col); height: 50px;
  transform: translateX(-50%);
}
/* Gradient pill: transparent → white → transparent at 15% (Figma 55:1214). */
.faq__nav::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(255,255,255,0), #fff 50%, rgba(255,255,255,0));
  opacity: .15; pointer-events: none;
}
/* Positions relative to the 320px box centre (160): prev arrow 54, "01" 127, divider 159, "36" 176, next 256. */
.faq__arrow {
  position: absolute; top: 3px; width: 44px; height: 44px;
  display: grid; place-items: center;
}
.faq__arrow img { width: 9.192px; height: 15.557px; grid-area: 1 / 1; transition: opacity .25s; }
.faq__arrow--prev { left: calc(50% - 123.4px); }
.faq__arrow--next { left: calc(50% + 78.6px); }
.faq__arrow--prev .faq__arrow-on { transform: scaleX(-1); }
.faq__arrow--prev .faq__arrow-on { opacity: 1; }
.faq__arrow--prev .faq__arrow-off { opacity: 0; }
.faq__arrow--prev:disabled .faq__arrow-on { opacity: 0; }
.faq__arrow--prev:disabled .faq__arrow-off { opacity: 1; }
.faq__arrow--next:disabled .faq__arrow-on { opacity: .15; }
.faq__arrow:disabled { cursor: default; }
@media (hover: hover) {
  .faq__arrow:not(:disabled):hover img { transform-origin: center; }
  .faq__arrow--next:not(:disabled):hover .faq__arrow-on { transform: translateX(2px); }
  .faq__arrow--prev:not(:disabled):hover .faq__arrow-on { transform: scaleX(-1) translateX(2px); }
}
.faq__arrow img { transition: opacity .25s, transform .25s var(--ease); }

.faq__counter { position: absolute; inset: 0; color: var(--white); font-variant-numeric: tabular-nums; pointer-events: none; }
.faq__current, .faq__total { position: absolute; top: 14px; line-height: 20px; }
.faq__current { left: calc(50% - 33px); }
.faq__total { left: calc(50% + 16px); }
.faq__divider { position: absolute; left: calc(50% - 1px - 4.5px); top: 24px; width: 9px; height: 1px; transform: rotate(90deg); }

/* ---------- 05 Newsletter ---------- */
.newsletter__kicker + .copy__strong { margin-top: 20px; }
.newsletter__form { margin-top: 45px; }        /* field top = content top + 125 */
.newsletter__field {
  position: relative; width: calc(100% + 1px); height: 51px;
  /* Dotted rules: 1px dots, 4px gaps, 25% white (Figma 55:1033 / 55:1115). */
  background:
    repeating-linear-gradient(to right, rgba(255,255,255,.25) 0 1px, transparent 1px 5px) left top / 100% 1px no-repeat,
    repeating-linear-gradient(to right, rgba(255,255,255,.25) 0 1px, transparent 1px 5px) left bottom / 100% 1px no-repeat;
}
.newsletter__input {
  display: block; width: 100%; height: 51px;
  padding: 0 36px; border: 0; border-radius: 0; margin: 0;
  background: transparent; color: var(--white);
  font-size: 13px; line-height: 20px; text-align: center;
  caret-color: var(--white);
  -webkit-appearance: none; appearance: none;
}
.newsletter__input::placeholder { color: var(--grey); opacity: 1; }
.newsletter__input:placeholder-shown { caret-color: transparent; }
.newsletter__input:focus-visible { outline: none; }
.newsletter__field:focus-within { background:
    repeating-linear-gradient(to right, rgba(255,255,255,.6) 0 1px, transparent 1px 5px) left top / 100% 1px no-repeat,
    repeating-linear-gradient(to right, rgba(255,255,255,.6) 0 1px, transparent 1px 5px) left bottom / 100% 1px no-repeat; }
.newsletter__field.is-invalid { background:
    repeating-linear-gradient(to right, rgba(255,255,255,.9) 0 1px, transparent 1px 5px) left top / 100% 1px no-repeat,
    repeating-linear-gradient(to right, rgba(255,255,255,.9) 0 1px, transparent 1px 5px) left bottom / 100% 1px no-repeat; }
/* Caret bar 2×10 at 19/20 (Figma 55:1198); shown while the field is empty. */
.newsletter__caret {
  position: absolute; left: 19px; top: 20px; width: 2px; height: 10px;
  background: var(--white); pointer-events: none;
}
.newsletter__input:not(:placeholder-shown) + .newsletter__caret { display: none; }
.newsletter__input:focus + .newsletter__caret { animation: caret-blink 1.06s steps(1) infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }

.newsletter__submit {
  position: relative; display: block; width: 100%; height: 50px; margin-top: 19px; /* CTA top = content top + 195 */
  color: var(--white); font-size: 13px; line-height: 10px; text-transform: uppercase;
}
.newsletter__submit::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(255,255,255,0), #fff 50%, rgba(255,255,255,0));
  opacity: .15; transition: opacity .3s var(--ease);
}
.newsletter__submit-label { position: relative; }
@media (hover: hover) { .newsletter__submit:hover::before { opacity: .25; } }
.newsletter__submit:active::before { opacity: .3; }
.newsletter__submit[aria-busy="true"] { cursor: progress; }
.newsletter__submit[aria-busy="true"] .newsletter__submit-label { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.newsletter__message { min-height: 20px; margin-top: 20px; white-space: pre-line; }
.newsletter__hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }   /* bot trap */
.newsletter__message[data-tone="error"] { color: var(--white); }
.newsletter__message[data-tone="success"] { color: var(--white); }

/* ---------- Bottom UI (Figma "UI", 81px) ---------- */
.scroll-ui {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: var(--ui-h);
  pointer-events: none;
}
.scroll-ui__line { position: absolute; left: var(--edge); right: var(--edge); top: 0; width: calc(100% - 2 * var(--edge)); height: 1px; }
.scroll-ui__tick { position: absolute; top: 0; width: 4px; height: 1px; background: var(--white); }
.scroll-ui__tick--left { left: var(--edge); }
.scroll-ui__tick--right { right: var(--edge); }
.scroll-ui__next {
  position: absolute; left: 50%; top: 21px; transform: translateX(-50%);
  padding: 10px 16px;
  font-size: 13px; line-height: 10px; color: var(--white); white-space: nowrap;
  pointer-events: auto;
  transition: opacity .4s var(--ease), visibility .4s;
}
.scroll-ui__stem {
  position: absolute; left: calc(50% - 1px); top: 71px; width: 1px; height: 10px; overflow: hidden;
}
/* The Figma line asset (10×1, preserveAspectRatio="none") drawn at 1×10 instead of rotated:
   rotating a 1px SVG makes Chrome resample it to ~25% intensity. */
.scroll-ui__stem img { width: 1px; height: 10px; }
/* Footer frame has no "Scroll to Explore" label (Figma 55:985 / 55:270). */
body[data-section="footer"] .scroll-ui__next { opacity: 0; visibility: hidden; }

/* ---------- +1 Teaser (Figma "TRAILER MODE") ---------- */
.trailer {
  position: fixed; inset: 0; z-index: 100;
  background: #000; color: var(--white);
  opacity: 0; transition: opacity .35s var(--ease);
}
.trailer[hidden] { display: none; }
.trailer.is-open { opacity: 1; }
.trailer__frame { position: absolute; inset: 0; }
/* Phone held upright: show the whole teaser screen turned sideways (landscape). */
@media (orientation: portrait) and (pointer: coarse) and (max-width: 767px) {
  .trailer__frame {
    inset: auto; left: 50%; top: 50%;
    width: 100vh; height: 100vw;
    width: 100dvh;
    transform: translate(-50%, -50%) rotate(-90deg);
  }
}
.trailer__stage { position: absolute; inset: 0; display: none; }
.trailer__video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.trailer[data-state="loading"] .trailer__stage,
.trailer[data-state="playing"] .trailer__stage,
.trailer[data-state="error"] .trailer__stage { display: block; }

.trailer__notice {
  position: absolute; left: 50%; top: 50%;
  width: 448px; max-width: calc(100% - 2 * var(--edge));
  transform: translate(-50%, -50%);
  font-size: 16px; line-height: 25px; text-align: center; color: var(--white);
  display: none;
}
/* Tap prompt: the whole screen is the target. */
.trailer__notice--tap {
  inset: 0; width: auto; max-width: none; transform: none;
  display: none; place-items: center; padding: 0 var(--edge);
  cursor: pointer;
}
.trailer[data-state="tap"] .trailer__notice--tap { display: grid; }
.trailer__notice--tap:focus-visible { outline-offset: -8px; }
.trailer[data-state="thanks"] .trailer__notice--thanks { display: block; }   /* appears instantly; JS fades it out */

.trailer__status {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(320px, 100% - 2 * var(--edge));
  padding: 14px 16px; text-align: center; font-size: 13px; line-height: 20px;
  background: rgba(0,0,0,.6);
  display: none; pointer-events: none;
}
.trailer[data-state="loading"] .trailer__status:not(:empty),
.trailer[data-state="error"] .trailer__status:not(:empty) { display: block; }

/* Close: 40px circle, white 10%, at top-right 20/20; × from two 2×16 bars (Figma 181:3663). */
.trailer__close {
  position: absolute; top: max(var(--edge), env(safe-area-inset-top)); right: max(var(--edge), env(safe-area-inset-right));
  width: 40px; height: 40px; border-radius: 1000px; z-index: 2;
  background: rgba(0,0,0,.35); /* invisible over the dark footage; keeps the × legible over bright frames */
}
.trailer__close::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--white); opacity: .1; transition: opacity .25s;
}
@media (hover: hover) { .trailer__close:hover::before { opacity: .2; } }
.trailer__x, .trailer__x::before {
  position: absolute; left: 19px; top: 12px; width: 2px; height: 16px; background: var(--white);
}
.trailer__x { transform: rotate(-135deg); }
.trailer__x::before { content: ""; left: 0; top: 0; transform: rotate(90deg); }

@keyframes fade-in { from { opacity: 0; } }

html.is-locked, html.is-locked body { overflow: hidden; }
html.is-locked { scroll-snap-type: none; }

/* ---------- Portrait screens (phones, tablets) — Figma 360 frames ---------- */
@media (max-aspect-ratio: 1/1) {
  /* Figma 210:1387: globe 1138×640 at x −400 (= 51.4% across), plus a 50%→100% darkening ramp. */
  .hero__globe { object-position: 51.4% 50%; }
  .hero__bg::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 50%, rgba(0,0,0,.85));
  }
}

/* Very narrow phones (< 360px): keep the play label inside the ring. */
@media (max-width: 359px) {
  .hero__play { transform: translate(-50%, -50%) scale(.9); }
}

/* ---------- Paged mode (html.fp, enabled by main.js) ----------
   Sections stay in place; their content is choreographed in main.js with the
   Web Animations API (staggered, interruptible). CSS holds only the resting
   states: content of the current section visible, everything else hidden.
   Without JS (or on short landscape screens) the page scrolls normally. */
html.fp, html.fp body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.fp { scroll-snap-type: none; scroll-behavior: auto; }
html.fp .panel {
  position: fixed; inset: 0; height: auto;
  background: transparent; scroll-snap-align: none;
  z-index: 1; pointer-events: none;
}
html.fp .panel.is-current { z-index: 2; pointer-events: auto; }
html.fp .panel [data-reveal],
html.fp .panel .hero__globe { opacity: 0; }
html.fp .panel.is-current [data-reveal],
html.fp .panel.is-current .hero__globe { opacity: 1; }
html.fp .panel [data-reveal] { will-change: opacity, translate; }

/* ---------- Short landscape screens (phones turned sideways) ----------
   The fixed-position composition needs ~560px of height; below that the
   panels flow naturally instead of clipping. */
@media (max-height: 540px) and (orientation: landscape) {
  html { scroll-snap-type: none; }
  .site-header { position: absolute; }
  .scroll-ui { display: none; }
  .panel { height: auto; min-height: 100svh; overflow: visible; padding: 96px 0 64px; scroll-snap-align: none; }
  .panel__body { position: relative; left: auto; top: auto; transform: none; margin: 0 auto; }
  .hero { display: grid; place-items: center; }
  .hero__play { position: relative; left: auto; top: auto; transform: scale(.8); }
  .faq__stage { position: relative; top: auto; bottom: auto; margin-top: 20px; min-height: 300px; }
  .faq__nav { position: relative; top: auto; left: auto; transform: none; margin: 24px auto 0; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
