/* ==========================================================================
   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 (Figma "Logo": 360×80; logo 317×22 at 20/19; tagline at 20/46) ---------- */
.site-header {
  position: fixed; top: 0; left: 0; z-index: 20;
  width: 357px; max-width: 100%; height: 66px;
  pointer-events: none;
}
.site-header__home {
  position: absolute; left: var(--edge); top: 19px;
  display: block; pointer-events: auto;
}
.site-header__logo { width: 317px; height: 22px; max-width: calc(100vw - 2 * var(--edge)); }
.site-header__tagline {
  position: absolute; left: var(--edge); top: 46px;
  font-weight: 700; font-size: 12px; line-height: 20px; letter-spacing: -0.06px;
  color: var(--white); white-space: nowrap;
}

/* ---------- 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; }
.copy__title { color: var(--white); }                       /* Statement titles: Medium, white */
.copy__strong { color: var(--white); font-weight: 700; }    /* Bold, white */
.copy a { transition: color .2s; }
.copy a:hover { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 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; transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.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%;
}
.hero__button img { width: 120px; height: 120px; transition: transform .4s var(--ease); }
.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__play:has(.hero__button:hover) .hero__ring { opacity: .2; }
  .hero__button:hover img { transform: scale(1.04); }
}

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

.faq__track {
  --slide-w: 100%;
  position: absolute; left: 0; right: 0;
  top: calc(var(--content-top) + 40px);
  bottom: 170px;
  display: flex;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}
.faq__track::-webkit-scrollbar { display: none; }
/* Edge spacers let the first and last slide reach the centre (percentages here resolve against the full track width). */
.faq__track::before, .faq__track::after { content: ""; flex: 0 0 calc((100% - var(--slide-w)) / 2); }
.faq__track:focus-visible { outline-offset: -2px; }
.faq__track.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; user-select: none; }

.faq__slide {
  flex: 0 0 var(--slide-w);
  display: flex; justify-content: center;
  scroll-snap-align: center;
  opacity: var(--o, 1);
  will-change: opacity;
}
.faq__slide-inner { width: min(320px, 100% - 2 * var(--edge)); text-align: center; }
.faq__q { color: var(--white); font-weight: 700; }
.faq__q + .faq__a { margin-top: 20px; }
.faq__gap { display: block; height: 20px; }

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

.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-weight: 700; 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; }
.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; }
@media (prefers-reduced-motion: no-preference) {
  .scroll-ui__stem img { animation: stem 2.4s var(--ease) infinite; }
}
@keyframes stem {
  0%, 15% { transform: translateY(-10px); }
  55%, 100% { transform: translateY(0); }
}
/* Footer frame has no "Scroll to Explore" label (Figma 55:985 / 55:270). */
body[data-section="footer"] .scroll-ui__next { opacity: 0; visibility: hidden; }
body[data-section="footer"] .scroll-ui__stem img { animation: none; }

/* ---------- +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__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(100vmax - 2 * var(--edge));
  font-size: 16px; line-height: 25px; text-align: center;
  display: none;
}
/* Portrait phone: copy runs bottom-to-top so it reads once the device is turned (as rendered in Figma 77:304). */
.trailer__notice--rotate { transform: translate(-50%, -50%) rotate(-90deg); }
.trailer__notice--thanks { transform: translate(-50%, -50%); }
.trailer[data-state="rotate"] .trailer__notice--rotate,
.trailer[data-state="thanks"] .trailer__notice--thanks { display: block; animation: fade-in .5s var(--ease); }

.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); }
}

/* ---------- 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__track { position: relative; top: auto; bottom: auto; margin-top: 20px; }
  .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; }
}
