/* JARVIS17 landing prototype — vanilla HTML/CSS/JS */
/* Design system v1 — see DESIGN_SYSTEM.md for full reference */
/* Governance — see CLAUDE.md (zero hardcoded hex/px outside :root) */

:root {
  /* ─── Color: backgrounds ─── */
  --bg: #08090c;                              /* page background */
  --bg-pure: #000;                            /* pure black overlays */
  --bg-deep: #0a0c12;                         /* gradient endpoints */

  /* ─── Color: text ─── */
  --fg: #f6f7fa;                              /* primary */
  --fg-dim: rgba(246, 247, 250, 0.72);        /* secondary */
  --fg-faint: rgba(246, 247, 250, 0.5);       /* tertiary / labels */

  /* ─── Color: accent (cyan/teal — CEO finalized 2026-05-10) ─── */
  --accent: #00A1D8;                          /* base — borders, outlines, focus rings (matches button) */
  --accent-hover: #2EB2DF;                    /* button hover (lighter teal) */
  --accent-text: #52D6FC;                     /* text emphasis (light cyan, brighter for legibility) */
  --accent-button: #00A1D8;                   /* button backgrounds (deeper teal) */
  --btn-text: #FFFFFF;                        /* text on filled buttons (white for contrast) */

  /* ─── Color: accent layers (RGB derived from --accent #00A1D8) ─── */
  --gold-glow: rgba(0, 161, 216, 0.2);
  --gold-shadow-sm: rgba(0, 161, 216, 0.15);
  --gold-shadow-md: rgba(0, 161, 216, 0.28);
  --gold-shadow-lg: rgba(0, 161, 216, 0.5);

  /* ─── Color: glass surfaces ─── */
  --glass-bg: rgba(8, 9, 12, 0.55);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-surface: rgba(0, 0, 0, 0.6);
  --glass-surface-hover: rgba(0, 0, 0, 0.85);

  /* ─── Color: scrims (mobile text underlay) ─── */
  --scrim-strong: rgba(0, 0, 0, 0.82);
  --scrim-weak: rgba(0, 0, 0, 0.35);

  /* ─── Typography (cross-OS consistent — Mac and Windows render identically) ─── */
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Helvetica Neue', Arial, 'Segoe UI', sans-serif;
  --mono: 'Courier New', Menlo, Consolas, monospace;

  /* ─── Layout ─── */
  --content-max: clamp(380px, 42vw, 560px);
  --content-edge: clamp(24px, 5vw, 80px);
  --reveal-delay: 0.3s;

  /* ─── Responsive: Spacing scale (desktop defaults) ─── */
  --space-xs:  8px;
  --space-sm:  16px;
  --space-md:  24px;
  --space-lg:  40px;
  --space-xl:  64px;
  --space-2xl: 96px;

  /* ─── Responsive: Section / overlay padding ─── */
  --overlay-block: clamp(48px, 10vh, 120px);
  --overlay-inline: clamp(24px, 5vw, 64px);

  /* ─── Responsive: Typography scale (fluid) ─── */
  --type-display:  clamp(36px, 5vw, 72px);     /* scene-3 headline */
  --type-h1:       clamp(28px, 3.4vw, 48px);   /* hero title */
  --type-h2:       clamp(28px, 3.2vw, 56px);   /* section headers */
  --type-h3:       clamp(20px, 1.8vw, 28px);   /* card titles */
  --type-body:     clamp(15px, 1.05vw, 18px);  /* body / sub / lede */
  --type-body-sm:  clamp(13px, 1vw, 16px);     /* bullets */
  --type-caption:  clamp(10px, 0.9vw, 12px);   /* eyebrows / labels */
  --type-stat:     clamp(28px, 2.4vw, 36px);   /* stat ribbon numbers */
  --type-finale:   clamp(17px, 1.6vw, 24px);   /* scene-3 finale */
  --type-quote:    clamp(18px, 2vw, 28px);     /* reveal beats */
  --type-btn:      14px;                        /* button text (fixed) */

  /* ─── Touch target minimum (Apple HIG) ─── */
  --touch-min: 44px;

  /* ─── v2 investor pages: display typography (extra large editorial scale) ─── */
  --type-display-xl: clamp(56px, 8vw, 128px);    /* hero + CTA headlines */
  --type-display-lg: clamp(40px, 5.5vw, 80px);   /* funding rail numbers */
  --type-pullquote:  clamp(28px, 3.6vw, 56px);   /* about pull-quote */

  /* ─── v2 investor pages: aurora mesh colors (3 hue layers) ─── */
  --aurora-cyan:    rgba(0, 161, 216, 0.45);
  --aurora-indigo:  rgba(82, 60, 220, 0.32);
  --aurora-magenta: rgba(180, 50, 160, 0.18);

  /* ─── v2 investor pages: frosted glass inner glow ─── */
  --glow-inner:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.02);

  /* ─── Investor gate: PIN surface ─── */
  --pin-box-size:           clamp(56px, 10vw, 72px);
  --pin-box-gap:            clamp(10px, 1.8vw, 16px);
  --pin-box-radius:         8px;
  --pin-box-bg:             rgba(255, 255, 255, 0.04);
  --pin-box-border:         rgba(255, 255, 255, 0.12);
  --pin-box-focus-bg:       rgba(0, 161, 216, 0.08);
  --pin-box-active-border:  var(--accent);
  --pin-box-error-border:   #E05555;
  --pin-box-error-glow:     rgba(224, 85, 85, 0.25);
  --pin-box-success-border: var(--accent-text);
  --pin-box-success-glow:   var(--gold-shadow-md);
  --pin-digit-font-size:    clamp(24px, 4vw, 36px);
  --pin-error-red:          #E05555;
  --pin-error-red-dim:      rgba(224, 85, 85, 0.18);

  /* ─── Investor gate: overlay stacking ─── */
  --investor-overlay-z:     400;
  --investor-pin-z:         410;
  --investor-skip-delay:    3s;
}

/* ─── Responsive token overrides per breakpoint ─── */
/* Tablet portrait */
@media (max-width: 1024px) and (orientation: portrait) {
  :root {
    --space-lg: 32px;
    --space-xl: 48px;
    --space-2xl: 72px;
  }
}

/* Phone / narrow */
@media (max-width: 768px) {
  :root {
    --space-lg: 28px;
    --space-xl: 40px;
    --space-2xl: 56px;
  }
}

/* Short viewport (landscape phone, height < 500px) */
@media (max-height: 500px) {
  :root {
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --overlay-block: 16px;
    --type-display: clamp(28px, 4vw, 44px);
    --type-h1: clamp(22px, 3vw, 36px);
    --type-stat: clamp(22px, 2vw, 28px);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html { scroll-behavior: smooth; }

button { font: inherit; color: inherit; cursor: pointer; }

/* ─────────────────────── HERO ─────────────────────── */
.hero {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-pure);
}

.hero-video,
.hero-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
}

.hero-video {
  z-index: 1;
  opacity: 1;
  transition: opacity 0.6s ease-out;
}

.hero-poster {
  z-index: 2;
  opacity: 0;
  transition: opacity 1.2s ease-in 0.1s;
}

/* When video has ended → show poster, hide video */
.hero[data-stage="settled"] .hero-video { opacity: 0; }
.hero[data-stage="settled"] .hero-poster { opacity: 1; }

/* Loop video plays on its own — no ken-burns needed */

/* ─────────────────────── GRADIENT VIGNETTE ─────────────────────── */
.hero-gradient {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    /* left text dimmer (original desktop intensity) */
    linear-gradient(90deg, rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.42) 30%, rgba(0,0,0,0.0) 60%),
    /* bottom dimmer */
    linear-gradient(0deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 35%);
  opacity: 0;
  transition: opacity 1s ease-in 0.2s;
}
.hero[data-stage="settled"] .hero-gradient { opacity: 1; }

/* Right-side mirror (original intensity) */
.hero[data-text-side="right"] .hero-gradient {
  background:
    linear-gradient(270deg, rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.42) 30%, rgba(0,0,0,0.0) 60%),
    linear-gradient(0deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 35%);
}

.hero-content {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(48px, 8vh, 96px);
  padding-inline: var(--content-edge);
  max-width: calc(var(--content-max) + var(--content-edge) * 2);

  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 1.1s ease-out var(--reveal-delay),
    transform 1.1s ease-out var(--reveal-delay);
}
.hero[data-stage="settled"] .hero-content {
  opacity: 1;
  transform: translateY(0);
}

/* Right-side variant */
.hero[data-text-side="right"] .hero-content {
  margin-left: auto;
  text-align: right;
  align-items: flex-end;
}
.hero[data-text-side="right"] .hero-menu { align-items: flex-end; }
.hero[data-text-side="right"] .menu-item { text-align: right; flex-direction: row-reverse; }
.hero[data-text-side="right"] .menu-item .menu-name,
.hero[data-text-side="right"] .menu-item .menu-hint { text-align: right; }

/* ─────────────────────── BRAND ─────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(32px, 6vh, 64px);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.brand-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-weight: 600;
}
.brand-mark-num {
  color: var(--accent-text);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05em;
}

/* Pixel-art logo (replaces text brand-mark) */
.brand-logo {
  display: block;
  width: clamp(110px, 15vh, 180px);
  height: auto;
  aspect-ratio: 4 / 5;
  user-select: none;
  -webkit-user-drag: none;
  margin-top: clamp(24px, 7vh, 72px);
}

/* Corner vignette — gradient fully transparent BEFORE container edge,
   so resize / sub-pixel rounding never reveals a visible boundary.
   Gradient radius is 25% larger than container — the visible circle ends
   inside the container, fully faded out. */
.brand-fixed-vignette {
  --vsize: clamp(420px, 55vmin, 680px);
  position: fixed;
  top: 0;
  left: 0;
  width: var(--vsize);
  height: var(--vsize);
  pointer-events: none;
  z-index: 999;
  background: radial-gradient(
    circle calc(var(--vsize) * 1.25) at 0 0,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.74) 6%,
    rgba(0, 0, 0, 0.55) 16%,
    rgba(0, 0, 0, 0.34) 32%,
    rgba(0, 0, 0, 0.17) 48%,
    rgba(0, 0, 0, 0.06) 66%,
    rgba(0, 0, 0, 0.00) 80%
  );
}

/* Global fixed brand mark — visible on every state / transition */
.brand-fixed {
  position: fixed;
  top: clamp(20px, 4vh, 48px);
  left: clamp(20px, 3vw, 48px);
  z-index: 1000;
  display: block;
  width: clamp(80px, 11vh, 130px);
  aspect-ratio: 4 / 5;
  pointer-events: auto;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.brand-fixed img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.brand-fixed:hover { opacity: 0.92; }

@media (max-width: 768px) {
  .brand-fixed {
    width: clamp(60px, 9vh, 90px);
    top: clamp(14px, 2.5vh, 24px);
    left: clamp(14px, 4vw, 24px);
  }
}

/* ─────────────────────── HEADLINE ─────────────────────── */
.hero-h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(40px, 5.5vw, 80px);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 0 clamp(12px, 1.8vh, 20px);
}
.hero-h1 .brand-num {
  color: var(--accent-text);
  font-style: italic;
  font-size: 1em;
}

.hero-h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: var(--fg);
  max-width: 52ch;
  margin: 0 0 clamp(16px, 2.4vh, 24px);
  text-wrap: balance;
}

.hero-h3 {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(14px, 1.05vw, 17px);
  line-height: 1.55;
  color: var(--fg-dim);
  max-width: 56ch;
  margin: 0 0 clamp(20px, 3vh, 28px);
}

.hero-title-em {
  font-style: italic;
  color: var(--accent-text);
}

/* Legacy compatibility — keep old class names alive in case anywhere else */
.hero-title { display: none; }
.hero-sub { display: none; }

/* ─────────────────────── STAT RIBBON ─────────────────────── */
.stat-ribbon {
  list-style: none;
  display: flex;
  gap: clamp(20px, 3vw, 36px);
  padding: 0;
  margin: 0 0 clamp(28px, 4vh, 40px) 0;
  font-family: var(--mono);
  flex-wrap: wrap;
}
.stat-ribbon li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--glass-border);
  padding-left: 14px;
}
.stat-ribbon li:first-child {
  border-left: 0;
  padding-left: 0;
}
.stat-ribbon strong {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(28px, 2.4vw, 36px);
  color: var(--accent-text);
  line-height: 1;
}
.stat-ribbon span {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

/* ─────────────────────── CTA ─────────────────────── */
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hero[data-text-side="right"] .hero-cta { justify-content: flex-end; }

.btn {
  appearance: none;
  border: 1px solid transparent;
  padding: 14px 22px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: transparent;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent-button);
  color: var(--btn-text);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost {
  border-color: var(--glass-border);
  color: var(--fg-dim);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  border-color: rgba(255,255,255,0.25);
  color: var(--fg);
}

/* ─────────────────────── ENTER-BUILDING CTA ─────────────────────── */
.btn-enter {
  display: inline-block;
  padding: 16px 36px;
  background: var(--accent-button);
  color: var(--btn-text);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.btn-enter:hover {
  transform: translateY(-2px) scale(1.02);
  background: var(--accent-hover);
  box-shadow: 0 0 0 4px var(--gold-shadow-sm), 0 12px 40px var(--gold-shadow-lg);
}

/* ─────────────────────── FLOOR REVEAL (cinematic placeholder) ─────────────────────── */
.floor-reveal[hidden] { display: none !important; }
.floor-reveal {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  animation: revealIn 0.6s ease-out;
  opacity: 1;
  transition: opacity 1s ease-out;
}
.floor-reveal.is-closing {
  opacity: 0;
}
@keyframes revealIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Cinematic transition video — fills viewport, behind text */
.floor-reveal-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  pointer-events: none;
  user-select: none;
}

/* Soft vignette — fades in synchronously with first beat */
.floor-reveal-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* ×1.25 darker for stronger text legibility */
  background:
    radial-gradient(ellipse 70% 80% at center, rgba(0,0,0,0.54) 0%, rgba(0,0,0,0.38) 40%, rgba(0,0,0,0.11) 75%, rgba(0,0,0,0.0) 100%);
  opacity: 0;
  transition: opacity 1.4s ease-out;
}
.floor-reveal-bg.is-visible {
  opacity: 1;
}

.floor-reveal-content {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(80px, 14vh, 140px) clamp(24px, 5vw, 64px) clamp(40px, 8vh, 80px);
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 4vh, 36px);
  min-height: 100vh;
  justify-content: center;
}

.floor-reveal-meta {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  border-left: 2px solid var(--accent);
  padding-left: 14px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.floor-reveal-meta.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.meta-time {
  color: var(--accent-text);
  font-style: italic;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.02em;
  text-transform: none;
}

.reveal-beat {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.1s ease-out, transform 1.1s ease-out;
}
.reveal-beat.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-beat {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

.reveal-beat-1 em {
  font-style: italic;
  color: var(--fg-dim);
}

/* Reveal beat-4 contains a button — center it within flex column */
.reveal-beat-4 {
  align-self: center;
}

/* ─────────── SCENE 3 OVERLAY (cinematic answer) ─────────── */
.scene-3-overlay[hidden] { display: none !important; }
.scene-3-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-pure);
  opacity: 0;
  transition: opacity 0.7s ease-out;
}
.scene-3-overlay.is-visible { opacity: 1; }

.scene-3-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.scene-3-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0) 50%, rgba(0,0,0,0.45) 100%);
}

@media (max-width: 768px) {
  .floor-reveal-content {
    justify-content: flex-start;
    padding: 90px 24px 48px;
  }
  .quote { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-beat,
  .floor-reveal-meta,
  .reveal-scroll-cue {
    animation: none !important;
  }
}

/* ─────────────────────── DEV TOOLS (toggle, can hide for prod) ─────────────────────── */
.dev-tools {
  display: none;  /* hidden on production — enable via ?debug=1 in JS if needed */
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 50;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.dev-tools.is-debug { display: flex; }
.dev-tools:hover { opacity: 1; }
.dev-tools button {
  background: rgba(0,0,0,0.6);
  color: white;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 6px 12px;
  border-radius: 4px;
  font: inherit;
}

/* ─────────────────────── MOBILE ─────────────────────── */
/* ─────────── THREE CLAIMS ─────────── */
.three-claims {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: clamp(80px, 12vh, 140px) clamp(24px, 5vw, 80px);
  max-width: 1280px;
  margin: 0 auto;
}
.claim {
  border-top: 1px solid var(--glass-border);
  padding-top: 24px;
}
.claim-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--accent-text);
  margin-bottom: 16px;
}
.claim p {
  font-family: var(--serif);
  font-size: clamp(20px, 1.8vw, 26px);
  line-height: 1.3;
  color: var(--fg);
}
.claim em {
  font-style: italic;
  color: var(--fg-dim);
}
.claim-highlight {
  border-top-color: var(--accent-text);
}
.claim-highlight p {
  color: var(--accent-text);
}
.claim-highlight em {
  color: var(--fg);
  font-style: normal;
  font-size: clamp(14px, 1vw, 16px);
  font-family: var(--sans);
  display: block;
  margin-top: 12px;
  line-height: 1.5;
}
@media (max-width: 768px) {
  .three-claims { grid-template-columns: 1fr; gap: 32px; padding: 64px 24px; }
}

/* ─────────── FLOORS SECTION + ELEVATOR ─────────── */
.floors-section {
  position: relative;
  padding: clamp(80px, 12vh, 140px) clamp(24px, 5vw, 80px) clamp(80px, 12vh, 140px);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}
.floors-header {
  max-width: 720px;
  margin: 0 auto clamp(48px, 6vh, 80px);
  text-align: center;
}
.floors-header h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 4vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}
.floors-header em {
  font-style: italic;
  color: var(--accent-text);
}
.floors-header p {
  font-size: clamp(15px, 1.05vw, 18px);
  color: var(--fg-dim);
  line-height: 1.55;
}

.elevator-panel {
  position: fixed;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  z-index: 50;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 8px 4px;
  opacity: 0;
  transition: opacity 0.4s ease-out;
  pointer-events: none;
}
.elevator-panel.is-active { opacity: 1; pointer-events: auto; }
.elevator-panel ol {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.elevator-panel a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 24px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--fg-faint);
  text-decoration: none;
  border-radius: 12px;
  transition: color 0.2s, background 0.2s;
}
.elevator-panel a:hover { color: var(--fg); }
.elevator-panel a.is-current {
  color: var(--accent-text);
  background: var(--gold-glow);
  font-weight: 600;
}
@media (max-width: 768px) { .elevator-panel { display: none; } }

.floors-stack {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 4vh, 40px);
}
.floor-card {
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: clamp(24px, 4vw, 40px);
  background: rgba(255,255,255,0.015);
  scroll-margin-top: 80px;
}
.floor-card-header {
  display: flex;
  align-items: baseline;
  gap: 24px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.floor-num {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(36px, 3.6vw, 56px);
  color: var(--accent-text);
  line-height: 1;
}
.floor-card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(20px, 1.8vw, 28px);
  color: var(--fg);
  letter-spacing: -0.01em;
}
.floor-card ul {
  list-style: none;
  padding: 0;
}
.floor-card li {
  position: relative;
  padding-left: 18px;
  font-size: clamp(14px, 1vw, 16px);
  line-height: 1.55;
  color: var(--fg-dim);
  margin-bottom: 8px;
}
.floor-card li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent-text);
}
.floor-killer {
  border-color: var(--accent-text);
  background: linear-gradient(135deg, rgba(212,175,116,0.08) 0%, rgba(212,175,116,0.02) 100%);
}

/* ─────────── FINAL CTA ─────────── */
.cta-section {
  padding: clamp(80px, 14vh, 160px) clamp(24px, 5vw, 80px);
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}
.cta-section h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 4.2vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}
.cta-section p {
  font-size: clamp(15px, 1.1vw, 18px);
  color: var(--fg-dim);
  line-height: 1.6;
  margin-bottom: 32px;
}
.btn-register {
  display: inline-block;
  padding: 18px 40px;
  background: var(--accent-button);
  color: var(--btn-text);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.btn-register:hover {
  transform: translateY(-1px);
  background: var(--accent-hover);
  box-shadow: 0 8px 32px rgba(212, 175, 116, 0.3);
}
.cta-fineprint {
  margin-top: 24px;
  font-size: 11px;
  color: var(--fg-faint);
  font-style: italic;
}

@media (max-width: 768px) {
  .hero-content {
    max-width: 100%;
    justify-content: flex-end;
    padding-bottom: 48px;
    text-align: left !important;
    align-items: flex-start !important;
  }
  .hero[data-text-side="right"] .hero-content {
    margin-left: 0;
  }
  .hero-gradient {
    opacity: 1 !important;
    transition: none !important;
    /* mobile scrim ×1.25 darker (CEO 2026-05-09) */
    background:
      linear-gradient(0deg,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(0, 0, 0, 0.59) 35%,
        rgba(0, 0, 0, 0.42) 65%,
        rgba(0, 0, 0, 0.33) 100%) !important;
  }
  .hero-title { font-size: clamp(24px, 6.8vw, 40px); line-height: 1.12; }
  .hero-sub { font-size: 15px; }
  .menu-name { font-size: 19px; }
  .menu-hint { display: none; }
}

/* ─────────────────────── REDUCED MOTION ─────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none; }
  .hero-poster { opacity: 1 !important; animation: none !important; }
  .hero-content {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hero-gradient { opacity: 1 !important; }
}

/* ─────────── DESCEND CTA (secondary in hero) ─────────── */
.btn-descend {
  display: inline-block;
  padding: 16px 36px;
  background: transparent;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.btn-descend:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--gold-glow);
  color: var(--fg);                          /* keep text white on hover (CEO 2026-05-10) */
  box-shadow: 0 8px 24px var(--gold-shadow-sm);
}

/* ─────────── DESCENT + ENTRY OVERLAYS (Stage 7-8) ─────────── */
.descent-overlay[hidden] { display: none !important; }
.descent-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-pure);
  opacity: 0;
  transition: opacity 0.7s ease-out;
}
.descent-overlay.is-visible { opacity: 1; }

.descent-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.descent-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* ×1.25 darker */
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0) 50%, rgba(0,0,0,0.45) 100%);
}

/* "Войти в здание" CTA in descent overlay — ghost style (matches "Перейти ко входу" в hero) */
.descent-cta {
  position: fixed;
  bottom: calc(48px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 210;
  display: inline-block;
  padding: 16px 36px;
  background: transparent;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out, box-shadow 0.2s ease;
}
.descent-cta.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.descent-cta:hover {
  border-color: var(--accent);
  background: var(--gold-glow);
  color: var(--fg);
  box-shadow: 0 8px 24px var(--gold-shadow-sm);
  transform: translateX(-50%) translateY(-2px);
}

/* ─────────── Quote blocks in reveal beats ─────────── */
.quote {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.35;
  color: var(--fg);
  letter-spacing: -0.005em;
}
/* <em> inside .quote — same upright style as the rest, accent color only */
.quote em {
  font-style: normal;
  color: var(--accent-text);
}
/* .quote-highlight retained on beat-3 but visually identical to .quote
   (CEO 2026-05-09: «делаем также как и первые два абзаца») */
.quote-highlight {
  color: var(--fg);
}
.quote-highlight em {
  font-style: normal;
  color: var(--accent-text);
}

/* ─────────── UNIFIED BACK BUTTON (.btn-back) ─────────── */
/* Стандарт на всех overlay-ах: pill в стиле lang-drawer, peeks from right edge,
   2× выше lang pill, slide-in/out из-за правого края экрана. */
.btn-back {
  position: fixed;
  /* Top: gap below lang-drawer. Right: 0 — flush with right edge (slides in/out from offscreen). */
  top: calc(clamp(64px, 10vh, 100px) + env(safe-area-inset-top, 0px));
  right: 0;
  z-index: 250;
  /* Default state: parked just OFF-screen to the right. */
  transform: translateX(110%);
  opacity: 0;
  pointer-events: none;

  /* Visual — mirrors .lang-drawer__current rhythm, doubled height */
  height: 48px;
  padding: 0 18px 0 22px;
  border-radius: 9999px 0 0 9999px;  /* fully rounded on the left — capsule peeking from edge */
  background: rgba(0, 161, 216, 0.32);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(82, 214, 252, 0.20);
  border-right: 0;
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);

  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  box-sizing: border-box;

  transition:
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.4s ease,
    background 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease;
}

.btn-back svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

.btn-back__label {
  display: inline-block;
  white-space: nowrap;
  line-height: 1;
}

/* Slide IN from the right edge */
.btn-back.is-visible {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.btn-back:hover {
  background: rgba(0, 161, 216, 0.45);
  border-color: rgba(82, 214, 252, 0.55);
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(0, 161, 216, 0.35), 0 0 0 1px rgba(82, 214, 252, 0.18);
}
.btn-back:focus-visible {
  outline: 2px solid var(--accent-text, #52D6FC);
  outline-offset: 2px;
}

/* ─────────── SCENE-3 CONTENT OVERLAY (centered, soft vignette) ─────────── */
/* Lives over the looping office video; appears when forward video ends */
.scene-3-content {
  position: fixed;
  inset: 0;
  z-index: 205;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: clamp(60px, 10vh, 120px) clamp(24px, 5vw, 64px);
  gap: clamp(20px, 4vh, 36px);
  max-width: 720px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.2s ease-out, transform 1.2s ease-out;
  pointer-events: none;
}
.scene-3-content.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Vignette is intentionally hidden — soft radial fade-in same as reveal */
.scene-3-vignette {
  display: none !important;
}

/* Soft radial darkening behind centered text — fades in with content (×1.25 darker) */
.scene-3-bg {
  position: fixed;
  inset: 0;
  z-index: 204;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 80% at center, rgba(0,0,0,0.54) 0%, rgba(0,0,0,0.38) 40%, rgba(0,0,0,0.11) 75%, rgba(0,0,0,0.0) 100%);
  opacity: 0;
  transition: opacity 1.4s ease-out;
}
.scene-3-bg.is-visible {
  opacity: 1;
}

/* ─────────── SCENE-3 TEXT TYPOGRAPHY (clear hierarchy) ─────────── */

/* Eyebrow — tiny mono caps, gold accent, top label */
.scene-3-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 4px;
}

/* Headline — large display serif, italic emphasis */
.scene-3-headline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.scene-3-headline em {
  font-style: normal;
  color: var(--accent-text);
}

/* Lede — single line directly under headline */
.scene-3-lede {
  font-family: var(--sans);
  font-size: clamp(15px, 1.1vw, 18px);
  color: var(--fg);                    /* full white (CEO 2026-05-10) */
  letter-spacing: 0.01em;
  margin-top: -4px;
  margin-bottom: 8px;
}

/* Bullet list — clean, aligned, with gold em-dash */
.scene-3-bullets {
  list-style: none;
  padding: 18px 0;
  margin: 0;
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  align-self: center;
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  max-width: 540px;
}
.scene-3-bullets li {
  position: relative;
  padding-left: 22px;
  font-family: var(--sans);
  font-size: clamp(14px, 1.05vw, 16px);
  line-height: 1.55;
  color: var(--fg);                    /* full white for legibility (CEO 2026-05-10) */
}
.scene-3-bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent-text);
}
.scene-3-bullets li em {
  /* Keep semantic <em> but render as regular text — same color/weight as siblings (CEO 2026-05-10) */
  font-style: normal;
  color: inherit;
  font-weight: inherit;
}

/* Finale — gold closing punchline */
.scene-3-finale {
  font-family: var(--serif);
  font-size: clamp(18px, 1.6vw, 24px);
  line-height: 1.4;
  color: var(--accent-text);
  letter-spacing: -0.005em;
  margin-top: 4px;
}
.scene-3-finale em {
  font-style: normal;
  color: var(--fg);                    /* full white (CEO 2026-05-10) */
  display: block;
  margin-top: 6px;
  font-size: 0.82em;
  letter-spacing: 0;
}

@media (max-width: 768px) {
  .scene-3-headline { font-size: 38px; }
  .scene-3-bullets li { font-size: 13.5px; }
  .scene-3-finale { font-size: 17px; }
}

@media (max-width: 768px) {
  .scene-3-content {
    right: 24px;
    left: 24px;
    bottom: 32px;
    max-width: 100%;
  }
  .scene-3-vignette {
    background:
      linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.6) 35%, rgba(0,0,0,0.2) 65%, rgba(0,0,0,0) 100%) !important;
  }
}

/* ─── Scene-3 CTA pair — uses hero button pattern (.btn-descend + .btn-enter) ─── */
.scene-3-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

@media (max-width: 768px) {
  .scene-3-cta {
    flex-direction: column;
    gap: 10px;
    margin-top: 22px;
  }
  .scene-3-cta .btn,
  .scene-3-cta .btn-enter {
    width: 100%;
    text-align: center;
  }
}

/* ─────────────────────── LANGUAGE SWITCHER ─────────────────────── */
/* ─── Lang drawer — discreet tab peeking from right edge ─── */
.lang-drawer {
  position: fixed;
  /* Top edge aligned with the logo's top inset on desktop */
  top: clamp(20px, 4vh, 48px);
  right: 0;
  z-index: 220;
  pointer-events: auto;
  font-family: var(--mono);
}

/* Current language tab — compact, semi-transparent, peeks subtly */
.lang-drawer__current {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px 5px 12px;
  background: rgba(0, 161, 216, 0.32);
  color: rgba(255, 255, 255, 0.92);
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid rgba(82, 214, 252, 0.20);
  border-right: 0;
  border-radius: 14px 0 0 14px;
  cursor: pointer;
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease;
  position: relative;
  z-index: 2;
  outline: none;
}
.lang-drawer__current:hover {
  background: rgba(0, 161, 216, 0.55);
  color: #fff;
  border-color: rgba(82, 214, 252, 0.45);
}
.lang-drawer.is-open .lang-drawer__current {
  background: rgba(0, 161, 216, 0.70);
  color: #fff;
  border-color: rgba(82, 214, 252, 0.55);
}
.lang-drawer__current:focus-visible {
  box-shadow: 0 0 0 2px var(--accent-text);
}

.lang-drawer__label {
  display: inline-block;
  min-width: 16px;
  text-align: center;
}

.lang-drawer__chevron {
  display: inline-flex;
  width: 9px;
  height: 9px;
  color: currentColor;
  opacity: 0.85;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.lang-drawer__chevron svg { width: 100%; height: 100%; display: block; }

.lang-drawer.is-open .lang-drawer__chevron {
  transform: rotate(180deg);
}

/* Hidden list — slides from right when open. Strong contrast for legibility. */
.lang-drawer__list {
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
  padding: 30px 0 4px;
  list-style: none;
  z-index: 1;
  background: rgba(8, 12, 18, 0.78);
  backdrop-filter: blur(14px) saturate(170%);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  border: 1px solid rgba(82, 214, 252, 0.28);
  border-right: 0;
  border-radius: 14px 0 0 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.40);
  min-width: 64px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(106%);
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.25s ease;
}

.lang-drawer.is-open .lang-drawer__list {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.lang-drawer__list li { margin: 0; }
.lang-drawer__list a {
  display: block;
  padding: 7px 14px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ffffff;
  text-decoration: none;
  text-align: right;
  transition: color 0.18s ease, background 0.18s ease;
}
.lang-drawer__list a:hover {
  color: var(--accent-text);
  background: rgba(0, 161, 216, 0.28);
}
/* Hide active language from list — it's already shown on the closed pill */
.lang-drawer__list a.is-active,
.lang-drawer__list li:has(a.is-active) {
  display: none;
}

/* Sync overall opacity with hero stage (preserve cinematic feel) */
.lang-drawer {
  opacity: 0;
  transition: opacity 1.1s ease-out var(--reveal-delay);
}
.hero[data-stage="settled"] ~ .lang-drawer,
body:not(:has(.hero[data-stage="intro"])) .lang-drawer {
  opacity: 1;
}
/* Fallback for browsers without :has — once any cinematic stage settles, JS flips a class */
.lang-drawer.is-revealed {
  opacity: 1;
}

@media (max-width: 768px) {
  .lang-drawer {
    /* Match the logo's smaller top inset on mobile */
    top: clamp(14px, 2.5vh, 24px);
  }
  .lang-drawer__current {
    padding: 4px 8px 4px 10px;
    font-size: 9px;
    gap: 4px;
  }
  .lang-drawer__list a {
    padding: 5px 10px;
    font-size: 9px;
  }
  .btn-back {
    /* Mobile: smaller pill, sits flush against right edge below lang-drawer */
    top: calc(clamp(48px, 8vh, 72px) + env(safe-area-inset-top, 0px));
    right: 0;
    height: 38px;
    padding: 0 14px 0 18px;
    font-size: 9px;
    gap: 6px;
    border-radius: 9999px 0 0 9999px;
  }
  .btn-back svg {
    width: 13px;
    height: 13px;
  }
}

/* ─── Brand "Jarvis17/JARVIS17" inline styling (number always accent) ─── */
.brand-num {
  color: var(--accent-text);
}

/* ─── DEV: temporary color picker for accent palette experimentation ─── */
.accent-picker-wrap[hidden] { display: none !important; }
.accent-picker-wrap {
  position: absolute;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  right: calc(24px + env(safe-area-inset-right, 0px));
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
  pointer-events: auto;
  opacity: 0;
  transition: opacity 1.1s ease-out var(--reveal-delay);
}
.hero[data-stage="settled"] .accent-picker-wrap { opacity: 1; }

.accent-picker-label {
  letter-spacing: 0.18em;
}

.accent-picker {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  cursor: pointer;
  background: var(--accent-button);
  appearance: none;
  -webkit-appearance: none;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.accent-picker:hover {
  transform: scale(1.08);
  border-color: var(--fg-dim);
}
.accent-picker::-webkit-color-swatch-wrapper { padding: 0; }
.accent-picker::-webkit-color-swatch { border: none; border-radius: 50%; }
.accent-picker::-moz-color-swatch { border: none; border-radius: 50%; }

.accent-picker-reset {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 4px 6px;
  transition: color 0.18s ease;
}
.accent-picker-reset:hover { color: var(--fg-dim); }

@media (max-width: 768px) {
  .accent-picker-wrap {
    opacity: 1 !important;
    transition: none !important;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: calc(16px + env(safe-area-inset-right, 0px));
    font-size: 9px;
    gap: 8px;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE FIXES (2026-05-10 — Architect/Designer/Code-reviewer synthesis)
   Phase 1: tokens (above)
   Phase 5: critical scroll + landscape + safe-area + touch + iOS quirks
   ═══════════════════════════════════════════════════════════════════ */

/* iOS Safari quirks — remove rubber-band black flash, tap-highlight */
html, body {
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

/* Safe-area-inset for bottom-pinned CTAs (home indicator clearance) */
@media (max-width: 768px) {
  .hero-cta {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .scene-3-cta {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

/* Floor-reveal: 100vh → 100dvh for iOS toolbar correctness */
.floor-reveal-content {
  min-height: 100vh;       /* fallback */
  min-height: 100dvh;      /* modern */
}

/* ─── SCENE-3 SCROLL: switch from center to scroll on short viewport ─── */
@media (max-height: 500px) {
  .scene-3-content {
    justify-content: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-top: 56px;       /* clear back button (48px + 8px gap) */
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    gap: clamp(8px, 2vh, 16px);
    /* Hide scrollbar — preserve cinematic feel */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .scene-3-content::-webkit-scrollbar {
    display: none;
  }
  /* Tighten typography on short viewport */
  .scene-3-bullets li { font-size: 13px; line-height: 1.4; }
  .scene-3-finale { font-size: 16px; }
  .scene-3-cta { gap: 8px; margin-top: 16px; }
  .scene-3-cta .btn,
  .scene-3-cta .btn-enter { padding: 12px 22px; }
}

/* Floor-reveal scroll on short viewport */
@media (max-height: 500px) {
  .floor-reveal-content {
    justify-content: flex-start;
    padding-top: 56px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    gap: clamp(12px, 3vh, 24px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }
  .floor-reveal-content::-webkit-scrollbar { display: none; }
  .quote { font-size: 16px; line-height: 1.3; }
}

/* ─── PHONE LANDSCAPE specific (compact hero + scroll fallback) ─── */
@media (orientation: landscape) and (max-height: 500px) {
  .hero-content {
    /* scroll if content overflows on cramped landscape */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
    /* hide scrollbar — keep cinematic feel */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .hero-content::-webkit-scrollbar { display: none; }
  /* Auto-margin trick: center content if fits, top-stick if overflows */
  .hero-content > *:first-child { margin-top: auto; }
  .hero-content > *:last-child { margin-bottom: auto; }

  .brand { margin-bottom: 8px; font-size: 11px; }
  .hero-title { font-size: clamp(20px, 3vw, 28px); margin-bottom: 8px; }
  .hero-sub { font-size: 13px; line-height: 1.4; max-width: 60ch; margin-bottom: 12px; }
  .stat-ribbon { display: none; }
  .hero-cta { gap: 8px; }
  .hero-cta .btn,
  .hero-cta .btn-enter { padding: 10px 22px; font-size: 13px; }
}

/* ─── STAT RIBBON: 3-col grid on narrow phone (CEO re-request 2026-05-10) ─── */
@media (max-width: 480px) {
  .stat-ribbon {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .stat-ribbon li {
    border-left: 0;
    padding-left: 0;
    align-items: flex-start;
  }
  .stat-ribbon strong {
    font-size: clamp(22px, 5.8vw, 28px);
  }
  .stat-ribbon span {
    font-size: 10px;
    letter-spacing: 0.04em;
    line-height: 1.25;
    word-wrap: break-word;
    hyphens: auto;
  }
}

/* ─── TOUCH TARGETS (≥44×44 Apple HIG) ─── */
@media (max-width: 768px) {
  .lang-switcher__item {
    min-height: var(--touch-min);
    padding: 14px 10px;
  }
  .accent-picker {
    width: 36px;
    height: 36px;
  }
  .accent-picker-reset {
    min-height: var(--touch-min);
    padding: 12px 10px;
  }
}

/* ─── PREVENT iOS INPUT ZOOM on color picker (font-size ≥16px) ─── */
.accent-picker { font-size: 16px; }

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE V2 (2026-05-10) — comprehensive scroll + safe-area
   Fix: scroll architecture must work on ALL mobile, not just short viewport.
   iPhone SE portrait 375×667 has 667px height but content may exceed it.
   ═══════════════════════════════════════════════════════════════════ */

/* --- Overlay scroll architecture: ALL mobile (max-width 768) --- */
@media (max-width: 768px) {
  .scene-3-content,
  .floor-reveal-content {
    /* flex-center if fits, scroll if overflows — uses min-height with auto-margin trick */
    justify-content: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-top: calc(72px + env(safe-area-inset-top, 0px));     /* clear back button + gap */
    padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .scene-3-content::-webkit-scrollbar,
  .floor-reveal-content::-webkit-scrollbar {
    display: none;
  }

  /* Auto-margin trick: content centered when shorter than container, sticks to top when overflows */
  .scene-3-content > *:first-child,
  .floor-reveal-content > *:first-child {
    margin-top: auto;
  }
  .scene-3-content > *:last-child,
  .floor-reveal-content > *:last-child {
    margin-bottom: auto;
  }

  /* Subtle scroll cue: bottom fade gradient hints scrollable content (only when content overflows visually). */
  .scene-3-overlay::after,
  .floor-reveal::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 60px;
    background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
    z-index: 215;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  .scene-3-overlay.is-visible::after,
  .floor-reveal:not([hidden])::after {
    opacity: 1;
  }
}

/* --- Hero scroll fallback for narrow portrait (iPhone SE worst case) --- */
@media (max-width: 768px) and (max-height: 720px) {
  .hero-content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-top: calc(56px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    scrollbar-width: none;
  }
  .hero-content::-webkit-scrollbar { display: none; }
  .hero-content > *:first-child { margin-top: auto; }
  .hero-content > *:last-child { margin-bottom: auto; }
  /* Tighten hero content gaps on small portrait */
  .brand { margin-bottom: clamp(16px, 3vh, 32px); }
  .hero-title { margin-bottom: clamp(12px, 2vh, 18px); }
  .hero-sub { margin-bottom: clamp(16px, 2.5vh, 24px); }
}

/* --- Safe area top для overlay back button (.btn-back) уже OK, но reveal/scene content padding-top нужен --- */
/* (covered by overlay scroll block above with safe-area-inset-top in padding-top) */

/* --- Picker repositioning to avoid CTA collision on phone landscape --- */
@media (orientation: landscape) and (max-height: 500px) {
  .accent-picker-wrap {
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    right: calc(8px + env(safe-area-inset-right, 0px));
    font-size: 8px;
    gap: 6px;
  }
  .accent-picker { width: 24px; height: 24px; }
  .accent-picker-reset { padding: 8px; min-height: 32px; }
  .accent-picker-label { display: none; }
}

/* ─── MOBILE OVERLAY SCRIMS: same bottom-up gradient as hero mobile ─── */
/* Replaces radial/vignette patterns with consistent linear gradient on phones.
   Applies to all overlay backdrops (floor-reveal-bg, scene-3-bg, descent-vignette). */
@media (max-width: 768px) {
  .floor-reveal-bg,
  .scene-3-bg,
  .descent-vignette {
    background:
      linear-gradient(0deg,
        rgba(0, 0, 0, 0.75) 0%,
        rgba(0, 0, 0, 0.59) 35%,
        rgba(0, 0, 0, 0.42) 65%,
        rgba(0, 0, 0, 0.33) 100%) !important;
  }
}

/* ─── Descent loop video — fades in after forward video ends ─── */
.descent-loop-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 1;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.descent-overlay.is-loop .descent-loop-video { opacity: 1; }

/* Skip transition (used during descent → entry handoff to prevent hero flash) */
.descent-overlay.no-transition { transition: none !important; }

/* Mobile portrait: smooth pan toward elevator panel in the last 1.5s of entry video.
   CEO 2026-05-15: 75% center puts BOTH button columns into the visible viewport instead
   of clipping the left column. SVG hotspots are re-cropped to match (see script.js). */
@media (max-width: 768px) and (orientation: portrait) {
  #entry-video,
  #entry-reverse {
    object-position: 50% center;
    transition: object-position 1.5s ease-in-out;
  }
  #entry-video.is-panned,
  #entry-reverse.is-panned {
    object-position: 75% center;
  }
  /* Cabin (held frame): pan to the elevator panel so the floor-button glows align (same 75% as entry) */
  #reception-video { object-position: 50% center; }
  #reception-video.is-panned { object-position: 75% center; }
}
@media (max-width: 480px) {
  #entry-video.is-panned,
  #entry-reverse.is-panned {
    object-position: 75% center;
  }
}

/* ─── Entry overlay elevator panel — SVG hotspots aligned via 1920×1080 viewBox slice ─── */
.entry-buttons {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 205;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease-out;
}
.entry-buttons.is-visible {
  opacity: 1;
}
.entry-btn-hot {
  fill: rgba(82, 214, 252, 0);
  stroke: rgba(82, 214, 252, 0);
  stroke-width: 2;
  cursor: pointer;
  pointer-events: auto;
  /* Suppress iOS 300ms click delay + long-press callout / text selection on SVG circles */
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: fill 0.2s ease-out, stroke 0.2s ease-out, filter 0.2s ease-out;
}
.entry-btn-hot:hover {
  fill: rgba(0, 161, 216, 0.28);
  stroke: rgba(82, 214, 252, 0.95);
  filter: drop-shadow(0 0 14px rgba(0, 161, 216, 0.85))
          drop-shadow(0 0 28px rgba(0, 161, 216, 0.55));
}
.entry-btn-hot:active {
  fill: rgba(0, 161, 216, 0.45);
  filter: drop-shadow(0 0 18px rgba(82, 214, 252, 1))
          drop-shadow(0 0 36px rgba(0, 161, 216, 0.7));
}
/*
  Touch "armed" state — set by JS after first tap on a floor circle (touch pointer).
  Visually distinct from :hover so user sees which floor they pre-selected,
  even after lifting finger. Only ever applied on touch-pointer interactions.
*/
.entry-btn-hot.is-touch-armed {
  fill: rgba(0, 161, 216, 0.5);
  stroke: rgba(82, 214, 252, 1);
  filter: drop-shadow(0 0 16px rgba(82, 214, 252, 1))
          drop-shadow(0 0 32px rgba(0, 161, 216, 0.8));
}

/* Mobile portrait: tighten the hotspot rings so they sit ON the buttons, not around them.
   The portrait viewBox crop magnifies the hit-areas, so smaller r keeps the highlight aligned. */
@media (max-width: 768px) and (orientation: portrait) {
  .entry-btn-hot { r: 20; }
}

/* ─── Investor entry CTA — fixed under the elevator buttons, fades in with the panel ─── */
.entry-investor-btn {
  position: fixed;
  left: 50%;
  bottom: calc(clamp(24px, 5vh, 56px) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(8px);
  z-index: 240;  /* above SVG hotspots, descent overlay, lang drawer */
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.6s ease-out 0.2s,
    transform 0.6s ease-out 0.2s,
    background 0.18s ease,
    box-shadow 0.18s ease;
  white-space: nowrap;
}
.entry-buttons.is-visible ~ .entry-investor-btn,
.entry-investor-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
@media (max-width: 768px) {
  .entry-investor-btn {
    /* Sit higher above iOS Safari's dynamic URL/nav bar; use dvh as primary, fallback for older browsers */
    bottom: max(56px, calc(7vh + env(safe-area-inset-bottom, 0px)));
    padding: 13px 26px;
    font-size: 14px;
    /* Stronger glow so the cyan CTA pops over the dark elevator panel */
    box-shadow: 0 0 0 4px var(--gold-shadow-sm), 0 12px 32px rgba(0, 161, 216, 0.55);
  }
}
@supports (bottom: 1dvh) {
  @media (max-width: 768px) {
    .entry-investor-btn {
      bottom: max(56px, calc(7dvh + env(safe-area-inset-bottom, 0px)));
    }
  }
}

/* ─── Floor info panel — appears on left side of entry overlay when hovering a button ─── */
.floor-info {
  position: fixed;
  left: clamp(28px, 5vw, 80px);
  top: 50%;
  transform: translateY(-50%) translateX(-12px);
  z-index: 210;
  max-width: clamp(280px, 36vw, 520px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease-out, transform 0.28s ease-out;
}
.floor-info.is-visible {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.floor-info__floor {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1;
  font-weight: 400;
  color: var(--accent-text, #52D6FC);
  letter-spacing: 0.02em;
  margin-bottom: clamp(6px, 0.8vh, 12px);
  text-shadow:
    0 2px 14px rgba(0, 0, 0, 0.85),
    0 0 28px rgba(0, 0, 0, 0.55);
}
.floor-info__name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(28px, 3.6vw, 52px);
  line-height: 1.05;
  font-weight: 400;
  color: #FFFFFF;
  letter-spacing: 0.005em;
  text-shadow:
    0 2px 18px rgba(0, 0, 0, 0.85),
    0 0 36px rgba(0, 0, 0, 0.6);
}
@media (max-width: 768px) {
  .floor-info {
    left: clamp(16px, 4vw, 32px);
    right: clamp(16px, 4vw, 32px);
    top: clamp(72px, 12vh, 110px);
    transform: translateY(0);
    max-width: none;
    text-align: left;
  }
  .floor-info.is-visible {
    transform: translateY(0);
  }
  .floor-info__floor {
    font-size: clamp(16px, 4vw, 22px);
  }
  .floor-info__name {
    font-size: clamp(22px, 6vw, 32px);
  }
}

/* ─── Floor info: touch-mode "Войти" CTA ───────────────────────────
   Hidden by default. Shown only when .floor-info has .is-touch-armed
   (added by JS after a touch tap on a floor button). Desktop hover
   never adds .is-touch-armed, so this stays invisible on mouse devices.
   Critical: parent .floor-info has pointer-events: none → CTA needs
   its own pointer-events: auto to be tappable.
*/
.floor-info__enter {
  display: none;
  margin-top: var(--space-md);
  padding: 14px 28px;
  min-height: var(--touch-min);
  min-width: 140px;

  background: var(--accent);
  color: var(--btn-text);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  pointer-events: auto;

  font-family: var(--sans);
  font-size: clamp(13px, 1.05vw, 15px);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;

  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease,
    opacity 0.15s ease;
}

.floor-info.is-touch-armed {
  /* Tooltip itself stays pointer-events:none — taps on its transparent area pass
     through to the elevator buttons underneath. The CTA child has its own
     pointer-events:auto and remains clickable. */
  /* Left accent strip — signals "this floor is pre-selected" */
  border-left: 3px solid var(--accent);
  padding-left: var(--space-sm);
}

.floor-info.is-touch-armed .floor-info__enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.floor-info__enter:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 16px var(--gold-shadow-md);
}

.floor-info__enter:active {
  opacity: 0.85;
  transform: scale(0.97);
}

.floor-info__enter:focus-visible {
  outline: 2px solid var(--accent-text, var(--accent));
  outline-offset: 3px;
}

/* Mobile (phone + iPad portrait) — tooltip keeps its default top-left position.
   CTA is HALF-WIDTH and left-aligned so it never reaches the elevator buttons on
   the right side of the panned video. Earlier we used width:100% which made the
   button stretch across the viewport and cover floor-15/17 / right column. */
@media (max-width: 768px) {
  .floor-info__enter {
    width: 50%;
    max-width: 200px;
    margin-top: var(--space-sm);
    align-self: flex-start;
  }
  /* Parent needs flex so align-self works on the CTA (otherwise it's just a block child) */
  .floor-info.is-touch-armed {
    display: flex;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .floor-info__enter {
    transition: none;
  }
  .floor-info__enter:active {
    transform: none;
  }
  .entry-btn-hot.is-touch-armed {
    transition: none;
  }
}


/* ═══════════════════════════════════════════════════════════════
   INVESTOR GATE — video overlay + PIN modal
   Added 2026-05-23 per design spec
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────── VIDEO OVERLAY ─────────────────────── */
.investor-overlay[hidden] { display: none !important; }

.investor-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--investor-overlay-z);
  background: var(--bg-pure);
  opacity: 0;
  transition: opacity 0.6s ease-out;
}
.investor-overlay.is-visible { opacity: 1; }
.investor-overlay.is-closing  { opacity: 0; pointer-events: none; }

.investor-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
}

/* Reverse video — hidden by default, shown on Cancel for back-to-lift transition */
.investor-video--reverse {
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 1;
}
.investor-video--reverse.is-active {
  opacity: 1;
}

/* Edge vignette — pure gradient, NO backdrop-filter (iOS Safari inset:0 + transition glitch) */
.investor-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,0.52) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.38) 0%, rgba(0,0,0,0) 18%),
    linear-gradient(0deg,   rgba(0,0,0,0.38) 0%, rgba(0,0,0,0) 18%);
}

/* investor-close reuses .btn-back — just needs z-index positioning within overlay */
.investor-close {
  position: absolute;
  top: clamp(16px, 4vh, 32px);
  left: clamp(16px, 4vw, 32px);
  z-index: 2;
}

/* Skip button — emerges from opacity:0 after --investor-skip-delay via CSS animation only */
.investor-skip {
  position: absolute;
  bottom: calc(clamp(32px, 6vh, 56px) + env(safe-area-inset-bottom, 0px));
  right: calc(clamp(24px, 4vw, 56px) + env(safe-area-inset-right, 0px));
  z-index: 2;
  appearance: none;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--fg-dim);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 10px 20px;
  min-height: var(--touch-min);
  border-radius: 999px;
  cursor: pointer;
  /* NO backdrop-filter — inside inset:0 overlay with transition */
  opacity: 0;
  animation: investorSkipReveal 0.5s ease-out var(--investor-skip-delay) forwards;
  transition: color 0.2s, border-color 0.2s;
}
.investor-skip:hover {
  color: var(--fg);
  border-color: rgba(255,255,255,0.22);
}
/* Hide skip when PIN gate is open — user is past intro context */
.investor-skip.is-hidden {
  opacity: 0 !important;
  pointer-events: none;
  transition: opacity 0.25s ease-out;
}
@keyframes investorSkipReveal {
  to { opacity: 1; }
}

/* Mobile: skip button centered on narrow screens for closer thumb reach */
@media (max-width: 480px) {
  .investor-skip {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}

/* Reduced motion: skip appears immediately */
@media (prefers-reduced-motion: reduce) {
  .investor-skip {
    animation: none;
    opacity: 1;
  }
}

/* ─────────────────────── PIN GATE ─────────────────────── */
.investor-pin[hidden] { display: none !important; }

.investor-pin {
  position: fixed;
  inset: 0;
  z-index: var(--investor-pin-z);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

/* Backdrop — pure tint, absolutely NO backdrop-filter
   (backdrop-filter on inset:0 with transition = confirmed iOS Safari glitch) */
.investor-pin__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  opacity: 0;
  transition: opacity 0.5s ease-out;
}
.investor-pin.is-visible .investor-pin__backdrop { opacity: 1; }

/* Aurora mesh — hue bleed from behind card, purely aesthetic */
.investor-pin__aurora {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 30% 60%, var(--aurora-cyan)   0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 70% 40%, var(--aurora-indigo) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.8s ease-out 0.2s;
}
.investor-pin.is-visible .investor-pin__aurora { opacity: 1; }

/* Glass card — enters with subtle lift */
.investor-pin__card {
  position: relative;
  z-index: 1;
  width: clamp(300px, 90vw, 420px);
  padding: clamp(32px, 5vh, 48px) clamp(24px, 5vw, 40px);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow:
    var(--glow-inner),
    0 32px 80px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-sm);
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  transition:
    opacity 0.5s ease-out 0.15s,
    transform 0.5s ease-out 0.15s;
}
.investor-pin.is-visible .investor-pin__card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Eyebrow — monospaced label, accent text */
.investor-pin__eyebrow {
  font-family: var(--mono);
  font-size: var(--type-caption);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: var(--space-xs);
}

/* Headline — Georgia editorial weight */
.investor-pin__headline {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -0.01em;
  color: var(--fg);
  line-height: 1.1;
}

/* Descriptor */
.investor-pin__desc {
  font-family: var(--sans);
  font-size: var(--type-body-sm);
  color: var(--fg-faint);
  margin-bottom: var(--space-sm);
}

/* PIN boxes row */
.investor-pin__boxes {
  display: flex;
  gap: var(--pin-box-gap);
  margin: var(--space-sm) 0;
}

/* Single digit box */
.pin-box {
  width: var(--pin-box-size);
  height: var(--pin-box-size);
  min-height: var(--touch-min);
  background: var(--pin-box-bg);
  border: 1px solid var(--pin-box-border);
  border-radius: var(--pin-box-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: var(--pin-digit-font-size);
  font-weight: 400;
  color: var(--fg);
  position: relative;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

/* Active box (current entry position) — cyan ring */
.pin-box.is-active {
  border-color: var(--pin-box-active-border);
  background: var(--pin-box-focus-bg);
  box-shadow:
    0 0 0 3px var(--gold-glow),
    0 0 12px var(--gold-glow);
}

/* Filled box */
.pin-box.is-filled {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
}

/* Blinking caret inside active+empty box */
.pin-box.is-active::after {
  content: '';
  display: block;
  width: 2px;
  height: 60%;
  background: var(--accent-text);
  border-radius: 2px;
  animation: pinCaret 1s step-end infinite;
}
/* Hide caret when digit is present */
.pin-box.is-active.is-filled::after { display: none; }

@keyframes pinCaret {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/*
  Hidden real input — visually hidden but focusable.
  font-size 16px is CRITICAL: below 16px iOS Safari auto-zooms the viewport.
*/
.investor-pin__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  top: 50%;
  left: 50%;
  font-size: 16px;
  -webkit-appearance: none;
}

/* Error message — space reserved to prevent layout shift */
.investor-pin__error {
  font-family: var(--sans);
  font-size: var(--type-caption);
  letter-spacing: 0.04em;
  color: var(--pin-error-red);
  min-height: 1.4em;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.investor-pin__error.is-visible { opacity: 1; }

/* Cancel — ghost pill matching .investor-skip style. Returns CEO back to landing/lift */
.investor-pin__cancel {
  appearance: none;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--fg-dim);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 10px 20px;
  min-height: var(--touch-min);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
  margin-top: var(--space-md);
  align-self: center;
}
.investor-pin__cancel:hover {
  color: var(--fg);
  border-color: rgba(255,255,255,0.22);
}
.investor-pin__cancel:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── Error state — horizontal glitch shimmer + red border pulse ─── */
@keyframes pinGlitch {
  0%   { transform: translateX(0);    clip-path: inset(0 0 0 0); }
  10%  { transform: translateX(-5px); clip-path: inset(20% 0 60% 0); }
  22%  { transform: translateX( 5px); clip-path: inset(60% 0 10% 0); }
  34%  { transform: translateX(-3px); clip-path: inset(10% 0 80% 0); }
  46%  { transform: translateX( 2px); clip-path: inset(0 0 0 0); }
  58%  { transform: translateX(0);    clip-path: inset(0 0 0 0); }
  100% { transform: translateX(0);    clip-path: inset(0 0 0 0); }
}

.investor-pin__boxes.is-error {
  animation: pinGlitch 0.32s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.investor-pin__boxes.is-error .pin-box {
  border-color: var(--pin-box-error-border);
  box-shadow:
    0 0 0 1px var(--pin-box-error-border),
    0 0 16px var(--pin-box-error-glow);
  transition: border-color 0.15s, box-shadow 0.15s;
}

/* ─── Success state — cyan pulse expand → fade to black → navigate ─── */
.investor-pin__boxes.is-success .pin-box {
  border-color: var(--pin-box-success-border);
  background: rgba(0, 161, 216, 0.12);
  box-shadow:
    0 0 0 2px var(--pin-box-success-border),
    0 0 20px var(--pin-box-success-glow);
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

@keyframes pinSuccessPulse {
  0%   { opacity: 0; transform: scale(0.96); }
  40%  { opacity: 0.6; transform: scale(1.03); }
  100% { opacity: 0; transform: scale(1.08); }
}
.investor-pin__card.is-success::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  box-shadow: 0 0 0 3px var(--accent-text), 0 0 32px var(--gold-shadow-md);
  animation: pinSuccessPulse 0.38s ease-out forwards;
  pointer-events: none;
}

@keyframes investorFadeOut {
  to { opacity: 0; }
}
.investor-pin.is-navigating {
  animation: investorFadeOut 0.28s ease-out 0.18s forwards;
  pointer-events: none;
}

/* ─── Exit-back animation (Cancel/Назад) — cinematic descent back to lift ─── */
.investor-pin.is-exiting { pointer-events: none; }

.investor-pin.is-exiting .investor-pin__card {
  opacity: 0;
  transform: translateY(48px) scale(0.94);
  transition:
    opacity 0.45s ease-in,
    transform 0.55s cubic-bezier(0.55, 0.05, 0.65, 0.2);
}

.investor-pin.is-exiting .investor-pin__backdrop {
  opacity: 0;
  transition: opacity 0.55s ease-in 0.05s;
}

.investor-pin.is-exiting .investor-pin__aurora {
  opacity: 0;
  transition: opacity 0.45s ease-in;
}

/* Overlay long-fade for back-to-lift — slower than instant close, cinematic */
.investor-overlay.is-closing-back {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease-in-out;
}

/* ─────────────────────── PIN ON-SCREEN KEYPAD ───────────────────────
   Primary input mechanism — works on every browser/device including
   in-app webviews where OS keyboard is unreliable.
   Native <input> remains as progressive enhancement for hardware kbd.
   ──────────────────────────────────────────────────────────────────── */
.investor-pin__keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xs);
  width: 100%;
  max-width: 280px;
  margin: var(--space-sm) auto 0;
}

.investor-pin__key {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 56px;
  padding: var(--space-xs);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--fg);
  font-family: var(--sans);
  font-size: var(--type-h3);
  font-weight: 400;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.08s ease,
    box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  touch-action: manipulation;
}

@media (hover: hover) {
  .investor-pin__key:hover {
    background: var(--glass-surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 4px 16px var(--gold-shadow-sm);
  }
}

.investor-pin__key:active {
  background: var(--accent);
  color: var(--btn-text);
  border-color: var(--accent);
  transform: scale(0.94);
  box-shadow: none;
}

.investor-pin__key:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--gold-glow);
}

.investor-pin__key--backspace {
  border-color: var(--gold-shadow-md);
  color: var(--fg-dim);
  font-size: var(--type-body);
}

@media (hover: hover) {
  .investor-pin__key--backspace:hover {
    border-color: var(--accent);
    color: var(--fg);
    background: var(--glass-surface);
  }
}

.investor-pin__key[disabled],
.investor-pin__key[aria-disabled="true"] {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}

.investor-pin__key-spacer {
  display: block;
  min-height: 56px;
}

/* Narrow phone */
@media (max-width: 480px) {
  .investor-pin__keypad {
    gap: 6px;
    max-width: 260px;
  }
  .investor-pin__key,
  .investor-pin__key-spacer {
    min-height: 52px;
    font-size: var(--type-body);
  }
}

/* Landscape phone — keypad shrinks so card still fits in tiny viewport */
@media (orientation: landscape) and (max-height: 500px) {
  .investor-pin__keypad {
    gap: 4px;
    margin-top: var(--space-xs);
    max-width: 220px;
  }
  .investor-pin__key,
  .investor-pin__key-spacer {
    min-height: var(--touch-min);
    font-size: var(--type-body-sm);
  }
}

/* Reduced motion — kill scale/transition on press */
@media (prefers-reduced-motion: reduce) {
  .investor-pin__key {
    transition: none;
  }
  .investor-pin__key:active {
    transform: none;
  }
}

/* ─── Mobile 375px portrait ─── */
@media (max-width: 480px) {
  .investor-pin__card {
    width: 100%;
    border-radius: var(--space-sm);
    padding: var(--space-lg) var(--space-md);
  }
  .investor-pin {
    --pin-box-size: clamp(52px, 18vw, 64px);
    --pin-box-gap: var(--space-xs);
  }
}

/* ─── Landscape phone / short viewport ─── */
@media (max-height: 500px) {
  .investor-pin {
    align-items: flex-start;
    overflow-y: auto;
    padding-top: 20px;
    padding-bottom: 20px;
  }
  .investor-pin__card {
    padding: 20px;
    gap: 8px;
  }
  .investor-pin__headline { font-size: 20px; }
  .investor-pin__desc     { display: none; }
}

/* ─── Reduced motion — disable all animations ─── */
@media (prefers-reduced-motion: reduce) {
  .investor-pin__card,
  .investor-pin__backdrop,
  .investor-pin__aurora,
  .pin-box { transition: none; }
  .pin-box.is-active::after        { animation: none; opacity: 1; }
  .investor-skip                   { animation: none; opacity: 1; }
  .investor-pin__boxes.is-error    { animation: none; }
  .investor-pin__boxes.is-error .pin-box {
    border-color: var(--pin-box-error-border);
    box-shadow: 0 0 0 2px var(--pin-box-error-border);
  }
  .investor-pin__card.is-success::before { animation: none; }
  .investor-pin.is-navigating            { opacity: 0; }
  .investor-overlay                      { transition: none; }
}

/* ─────────────────────── FLOOR CINEMATIC OVERLAYS (1-17) ─────────────────────── */
/* Reuses .descent-overlay base (overlay+video) + .scene-3-content/.scene-3-bg
   for the on-screen content panel that fades in after video ends.
   No .floor-*-specific styles needed — kept this comment as a hint to future devs. */

.floor-overlay { z-index: 220; }
.floor-overlay .floor-video { transition: opacity 0.25s ease; }

/* ─── Video buffering loader (Phase 1 no-skip gate) — subtle spinner shown only
   while a scene genuinely waits for its clip to buffer through. Tokens-only. ─── */
[id$="-overlay"].is-loading::after,
#floor-reveal.is-loading::after {
  content: "";
  position: absolute; top: 50%; left: 50%;
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 2px solid rgba(246, 247, 250, 0.16);
  border-top-color: var(--accent);
  border-radius: 50%;
  z-index: 6; pointer-events: none; opacity: 0;
  animation: jv-loader-spin .85s linear infinite, jv-loader-fade .2s ease .25s forwards;
}
@keyframes jv-loader-spin { to { transform: rotate(360deg); } }
@keyframes jv-loader-fade { to { opacity: .85; } }
@media (prefers-reduced-motion: reduce) {
  [id$="-overlay"].is-loading::after,
  #floor-reveal.is-loading::after { animation: jv-loader-fade .2s ease .25s forwards; }
}

/* ─── First-load boot loader (Phase 5) — premium splash while hero + first scenes buffer ─── */
.boot-loader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg, #08090c);
  opacity: 1; transition: opacity .7s ease;
}
.boot-loader.is-done { opacity: 0; pointer-events: none; }
.boot-loader[hidden] { display: none; }
.boot-loader__center { display: flex; flex-direction: column; align-items: center; gap: 30px; }
.boot-loader__logo {
  width: 96px; height: 96px; object-fit: contain;
  animation: boot-logo-breathe 2.2s ease-in-out infinite;
  filter: drop-shadow(0 0 20px var(--gold-glow, rgba(0,161,216,.22)));
}
.boot-loader__track {
  width: 180px; height: 2px; border-radius: 2px;
  background: rgba(246,247,250,0.12); overflow: hidden;
}
.boot-loader__fill {
  display: block; height: 100%; width: 0%;
  background: var(--accent, #00A1D8);
  box-shadow: 0 0 10px var(--accent, #00A1D8);
  transition: width .45s ease;
}
@keyframes boot-logo-breathe {
  0%, 100% { opacity: .6; transform: scale(.95); }
  50% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .boot-loader__logo { animation: none; opacity: 1; }
  .boot-loader { transition: none; }
}


/* "Как это работает?" cinematic chain — hard-hide ALL intermediate UI so nothing flashes between clips */
.chain-running #floor-reveal .floor-reveal-content,
.chain-running #floor-reveal-close,
.chain-running #descent-close,
.chain-running .descent-cta,
.chain-running #entry-close,
.chain-running #entry-buttons,
.chain-running #entry-investor-btn {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}


/* ─────────── Reception greeting (receptionist's welcome over the desk scene) ─────────── */
.reception-bg {
  position: fixed; inset: 0; z-index: 204; pointer-events: none;
  background: radial-gradient(ellipse 92% 96% at 50% 46%, rgba(0,0,0,0.66) 0%, rgba(0,0,0,0.52) 42%, rgba(0,0,0,0.22) 76%, rgba(0,0,0,0.0) 100%);
  opacity: 0; transition: opacity 1.3s ease-out;
}
.reception-bg.is-visible { opacity: 1; }

.reception-content {
  position: fixed; inset: 0; z-index: 206;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center;
  gap: clamp(16px, 2.6vh, 30px);
  max-width: 820px; margin: 0 auto;
  padding: clamp(56px, 10vh, 120px) clamp(24px, 5vw, 60px);
  opacity: 0; transform: translateY(22px);
  transition: opacity 1.1s ease-out, transform 1.1s ease-out;
  pointer-events: none;
}
.reception-content.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

.reception-greeting {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(18px, 1.95vw, 27px);
  line-height: 1.46;
  letter-spacing: 0.004em;
  color: var(--fg);
  margin: 0;
  text-shadow: 0 2px 22px rgba(0,0,0,0.62), 0 1px 3px rgba(0,0,0,0.5);
}
.reception-greeting em { font-style: normal; color: var(--accent-text); }

.reception-continue {
  display: inline-block;
  margin-top: clamp(10px, 2vh, 22px);
  padding: 15px 40px;
  background: transparent;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  pointer-events: auto;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.18s ease;
}
.reception-continue:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.42); transform: translateY(-1px); }

@media (max-width: 600px) {
  .reception-content { padding: clamp(40px, 8vh, 80px) 20px; gap: 14px; }
  .reception-greeting { font-size: clamp(15px, 4.2vw, 19px); line-height: 1.4; }
}


/* ─────────── Elevator floor journey ─────────── */
.floor-glow-svg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 207; pointer-events: none; }
.floor-glow-svg[hidden] { display: none; }
.floor-glow-c {
  fill: #6ED2FF;
  opacity: 0;
  filter: blur(7px);
  mix-blend-mode: screen;
  transition: opacity 0.45s ease-out;
}
.floor-glow-c.is-lit { opacity: 0.95; animation: floorPulse 1.7s ease-in-out infinite; }
@keyframes floorPulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }

.floor-journey {
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 208;
  width: min(48vw, 580px);
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(40px, 7vh, 96px) clamp(28px, 4vw, 60px);
  gap: clamp(10px, 1.6vh, 20px);
  background: linear-gradient(to right, rgba(0,0,0,0.86) 0%, rgba(0,0,0,0.62) 58%, rgba(0,0,0,0) 100%);
  opacity: 0; transform: translateX(-18px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
  pointer-events: none;
}
.floor-journey[hidden] { display: none !important; }
.floor-journey.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.floor-journey__inner { transition: opacity 0.26s ease-out; }
.floor-journey.is-changing .floor-journey__inner { opacity: 0; }
.floor-journey__num { font-family: var(--mono); font-size: clamp(34px, 4.4vw, 64px); line-height: 1; color: var(--accent-text); margin-bottom: 2px; }
.floor-journey__floorword { font-size: 0.34em; letter-spacing: 0.22em; text-transform: uppercase; color: var(--fg-faint); vertical-align: middle; margin-right: 8px; }
.floor-journey__label { font-family: var(--serif); font-size: clamp(22px, 2.5vw, 36px); line-height: 1.08; color: var(--fg); }
.floor-journey__text { font-family: var(--sans); font-size: clamp(13.5px, 1.15vw, 18px); line-height: 1.52; color: var(--fg-dim); margin: 6px 0 0; max-width: 30em; }
.floor-next {
  align-self: flex-start; margin-top: clamp(10px, 2vh, 24px);
  padding: 13px 34px; background: transparent; color: var(--fg);
  font-family: var(--sans); font-size: 14px; font-weight: 700; letter-spacing: 0.02em;
  border: 1px solid rgba(255,255,255,0.22); border-radius: 999px; cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.18s ease;
}
.floor-next:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.42); transform: translateY(-1px); }

.reception-final {
  position: fixed; inset: 0; z-index: 206;
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  gap: clamp(14px, 2.4vh, 28px);
  max-width: 880px; margin: 0 auto;
  padding: clamp(48px, 9vh, 110px) clamp(24px, 5vw, 60px);
  opacity: 0; transform: translateY(20px);
  transition: opacity 1.1s ease-out, transform 1.1s ease-out;
  pointer-events: none;
}
.reception-final[hidden] { display: none !important; }
.reception-final.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.reception-register { margin-top: clamp(8px, 1.6vh, 18px); pointer-events: auto; }

@media (max-width: 700px) {
  .floor-journey { width: 100vw; background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.68) 55%, rgba(0,0,0,0.2) 100%); justify-content: flex-end; padding-bottom: clamp(40px,9vh,90px); }
  .floor-glow { width: 18px; }
}


/* Scroll hint — appears when entering the elevator cabin, fades after the first advance */
.scroll-hint {
  position: fixed; left: 50%; bottom: clamp(26px, 5vh, 54px); transform: translateX(-50%);
  z-index: 209; display: flex; flex-direction: column; align-items: center; gap: 10px;
  opacity: 0; pointer-events: none; transition: opacity 0.6s ease-out;
}
.scroll-hint.is-visible { opacity: 0.85; }
.scroll-hint__mouse {
  width: 26px; height: 42px; border: 2px solid rgba(255,255,255,0.55);
  border-radius: 14px; position: relative;
}
.scroll-hint__mouse::after {
  content: ''; position: absolute; left: 50%; top: 8px;
  width: 4px; height: 8px; background: #fff; border-radius: 2px;
  transform: translateX(-50%);
  animation: scrollDot 1.6s ease-in-out infinite;
}
@keyframes scrollDot {
  0% { opacity: 0; transform: translate(-50%, 0); }
  25% { opacity: 1; }
  55% { opacity: 1; transform: translate(-50%, 13px); }
  100% { opacity: 0; transform: translate(-50%, 13px); }
}
.scroll-hint__text { font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(255,255,255,0.72); }
@media (max-width: 700px) { .scroll-hint { bottom: auto; top: clamp(76px, 13vh, 130px); } }
