/* ════════════════════════════════════════════════════════════════
   Ai Gens — Mobile Portrait Site
   Exact match to desktop glass style, adapted for portrait
   ════════════════════════════════════════════════════════════════ */

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

:root {
  --ease-cinematic: cubic-bezier(0.16, 1, 0.3, 1);
  --nav-height: 52px;
  --nav-top: 0px;
  --glass-blur: 40px;
  --glass-saturate: 180%;
  --glass-bg: rgba(0,0,0,0.58);
  --glass-border: rgba(255,255,255,0.10);
  --glass-highlight: rgba(255,255,255,0.45);
  --glass-shadow: 0 8px 32px rgba(0,0,0,0.40);
  --nav-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: auto;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: #000;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
               'Helvetica Neue', Arial, sans-serif;
  color: #fff;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

/* ── Loader ───────────────────────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  transition: opacity 0.8s var(--ease-cinematic), visibility 0.8s;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Loader z-index must be above video */
#loader { z-index: 1000; }

.loader-wordmark {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}

.loader-bar-track {
  width: 160px;
  height: 1px;
  background: rgba(255,255,255,0.10);
  position: relative;
  overflow: hidden;
}

.loader-bar-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 0%;
  background: rgba(255,255,255,0.85);
  transition: width 0.15s linear;
}

.loader-pct {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.30);
  font-variant-numeric: tabular-nums;
}

/* ── Nav links (hidden on mobile, needed for subpage structure) ── */
.nav-links {
  display: none;
}
.nav-link {
  display: block;
  padding: 6px 14px;
  font-size: 13.5px;
  font-weight: 450;
  color: rgba(255,255,255,0.58);
  text-decoration: none;
  border-radius: 999px;
  transition: color 0.25s ease, background 0.25s ease;
}
.nav-link:hover { color: rgba(255,255,255,0.95); background: rgba(255,255,255,0.06); }
.nav-link.active { color: rgba(255,255,255,0.95); font-weight: 500; }

.cta-shine { display: none; }
.nav-top-highlight { display: none; }
.nav-reflection { display: none; }

/* ── Footer — shown on subpages ───────────────────────────────── */
#site-footer {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  z-index: 900;
  transform: translateX(-50%);
  pointer-events: none;
}

.footer-capsule {
  position: relative;
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 22px;
  border-radius: 999px;
  pointer-events: all;
  overflow: hidden;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.13);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.45);
}

.footer-top-highlight {
  position: absolute;
  top: 0; left: 20%; width: 60%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55) 50%, transparent);
  border-radius: 999px;
  pointer-events: none;
}

.footer-reflection { display: none; }

.footer-link {
  font-size: 12.5px;
  font-weight: 450;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  padding: 0 4px;
  transition: color 0.25s ease;
}
.footer-link:hover { color: rgba(255,255,255,0.92); }

.footer-divider {
  display: block;
  width: 1px;
  height: 12px;
  background: rgba(255,255,255,0.18);
  margin: 0 14px;
  flex-shrink: 0;
}

/* ── Scroll container + sticky stage ─────────────────────────── */
#scroll-container {
  position: relative;
}

#stage {
  position: sticky;
  top: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  height: var(--vh, 100vh);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

#cinematic-canvas {
  display: block;
  image-rendering: auto;
  position: relative;
  z-index: 1;
}

/* ── Intro video — sits on top of canvas during Phase 1 ─────── */
#intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  background: #000;
}

/* ── Scroll hint ──────────────────────────────────────────────── */
#scroll-hint {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 1;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

#scroll-hint.hidden { opacity: 0; }

.scroll-hint-text {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.40);
}

.scroll-hint-arrow {
  width: 20px;
  height: 28px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 10px;
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: 5px;
}

.scroll-hint-dot {
  width: 3px;
  height: 6px;
  background: rgba(255,255,255,0.50);
  border-radius: 2px;
  animation: scroll-dot 1.6s var(--ease-cinematic) infinite;
}

@keyframes scroll-dot {
  0%   { transform: translateY(0);   opacity: 1;   }
  60%  { transform: translateY(8px); opacity: 0.2; }
  100% { transform: translateY(0);   opacity: 1;   }
}

/* ════════════════════════════════════════════════════════════════
   HEADER — full-width bar flush to screen top
   ════════════════════════════════════════════════════════════════ */

#nav-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  pointer-events: none;
}

.nav-capsule {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(var(--nav-height) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: 20px;
  padding-right: 12px;
  pointer-events: all;

  /* Always dark glass — reads on any video frame */
  background: rgba(0,0,0,0.58);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 2px 20px rgba(0,0,0,0.35);
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity 0.3s ease;
}
.nav-logo:hover { opacity: 0.75; }

.logo-wordmark {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: rgba(255,255,255,0.92);
}

/* Right: CTA + hamburger */
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-cta {
  display: flex;
  align-items: center;
  padding: 7px 18px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.40);
  border-radius: 999px;
  color: rgba(255,255,255,0.96);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.40),
    0 2px 12px rgba(0,0,0,0.25);
  transition: background 0.2s ease, transform 0.2s ease;
}
.nav-cta:hover {
  background: rgba(255,255,255,0.26);
  transform: scale(1.03);
}

/* Hamburger */
.nav-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  border: none;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  pointer-events: all;
  transition: background 0.2s ease;
}
.nav-hamburger:hover { background: rgba(255,255,255,0.14); }

.nav-hamburger span {
  display: block;
  width: 14px;
  height: 1px;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
  transition: transform 0.35s var(--nav-ease), opacity 0.25s ease;
  transform-origin: center;
}
.nav-hamburger[aria-expanded="true"] span:first-child {
  transform: translateY(3px) rotate(45deg);
}
.nav-hamburger[aria-expanded="true"] span:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

/* ── Mobile menu panel ──────────────────────────────────────── */
.mobile-panel {
  position: fixed;
  top: calc(var(--nav-height) + env(safe-area-inset-top, 0px) + 8px);
  left: 16px;
  right: 16px;
  z-index: 880;
  padding: 20px;
  border-radius: 28px;
  background: rgba(10,10,10,0.75);
  backdrop-filter: blur(56px) saturate(160%);
  -webkit-backdrop-filter: blur(56px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 30px 80px rgba(0,0,0,0.50),
    inset 0 1px 0 rgba(255,255,255,0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition:
    opacity 0.35s var(--nav-ease),
    transform 0.35s var(--nav-ease);
}

.mobile-panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.mobile-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-link {
  display: block;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 450;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  border-radius: 14px;
  transition: color 0.2s ease, background 0.2s ease;
}
.mobile-link:hover { color: #fff; background: rgba(255,255,255,0.07); }

.mobile-cta {
  display: block;
  margin-top: 14px;
  padding: 13px 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.90);
  text-decoration: none;
  border-radius: 14px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.20);
  transition: background 0.2s ease;
}
.mobile-cta:hover { background: rgba(255,255,255,0.16); }

/* ════════════════════════════════════════════════════════════════
   STORY OVERLAY — portrait layout
   ════════════════════════════════════════════════════════════════ */

#story-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  pointer-events: none;
}

/* Story section — lower third of portrait screen */
.story-section {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  will-change: opacity, transform;
}

.story-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.62);
  text-shadow: 0 1px 12px rgba(0,0,0,0.70);
}

.story-headline {
  font-size: clamp(26px, 7vw, 38px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: #fff;
  margin: 0;
  text-shadow:
    0 2px 32px rgba(0,0,0,0.70),
    0 1px 4px rgba(0,0,0,0.50);
}

.story-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.story-bullets li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255,255,255,0.78);
  letter-spacing: -0.005em;
  line-height: 1.4;
  text-shadow: 0 1px 10px rgba(0,0,0,0.65);
}

.story-bullets li::before {
  content: '';
  flex-shrink: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
}

.story-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: rgba(255,255,255,0.96);
  text-decoration: none;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.36);
  border-radius: 999px;
  pointer-events: auto;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.30),
    inset 0 -1px 0 rgba(255,255,255,0.06),
    0 0 20px rgba(255,255,255,0.07),
    0 4px 20px rgba(0,0,0,0.35);
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.3s ease,
    box-shadow 0.3s ease;
}

.story-cta-btn:hover {
  transform: scale(1.04);
  background: rgba(255,255,255,0.24);
  border-color: rgba(255,255,255,0.52);
}

/* ── KPI clusters — compact row at top, below nav ─────────────── */
.kpi-cluster {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: auto;
  top: calc(86px + env(safe-area-inset-top, 0px));
  display: flex;
  flex-direction: row;
  gap: 10px;
  will-change: opacity, transform;
}

.kpi-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border-radius: 16px;
  min-width: 0;
  background: rgba(0,0,0,0.22);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow:
    0 16px 40px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

.kpi-number {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: rgba(255,255,255,0.96);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.kpi-unit {
  font-size: 16px;
  font-weight: 500;
  color: rgba(255,255,255,0.50);
  letter-spacing: -0.02em;
}

.kpi-label {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: rgba(255,255,255,0.42);
  margin-top: 2px;
}

/* ── Progress dots — horizontal strip at bottom center ───────── */
#story-progress {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  flex-direction: row;
  gap: 6px;
  z-index: 610;
  pointer-events: none;
}

.prog-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1), background 0.4s ease;
}

.prog-dot.active {
  width: 20px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.75);
}

/* ════════════════════════════════════════════════════════════════
   COOKIE BANNER — full desktop glass quality
   ════════════════════════════════════════════════════════════════ */

#cookie-banner {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  left: 16px;
  right: 16px;
  z-index: 950;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition:
    opacity 0.55s var(--ease-cinematic),
    transform 0.55s var(--ease-cinematic);
}

#cookie-banner.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

#cookie-banner.dismissed {
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}

.cookie-glass {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(40px) saturate(180%) brightness(110%);
  -webkit-backdrop-filter: blur(40px) saturate(180%) brightness(110%);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow:
    0 25px 80px rgba(0,0,0,0.40),
    0 4px 16px rgba(0,0,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.60),
    inset 0 -1px 0 rgba(255,255,255,0.04);
}

.cookie-glass::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  width: 60%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.55) 30%,
    rgba(255,255,255,0.80) 50%,
    rgba(255,255,255,0.55) 70%,
    transparent 100%
  );
  border-radius: 999px;
  pointer-events: none;
  z-index: 1;
}

.cookie-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
}

.cookie-text {
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.5;
  color: rgba(255,255,255,0.58);
  letter-spacing: -0.005em;
}

.cookie-policy-link {
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.22);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.cookie-policy-link:hover { color: #fff; border-color: rgba(255,255,255,0.55); }

.cookie-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.cookie-btn {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: transform 0.3s var(--nav-ease), background 0.3s var(--nav-ease);
}

.cookie-btn--secondary {
  color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
}
.cookie-btn--secondary:hover {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.11);
  transform: scale(1.03);
}

.cookie-btn--primary {
  color: rgba(255,255,255,0.92);
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.30);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 2px 12px rgba(0,0,0,0.20);
}
.cookie-btn--primary:hover {
  transform: scale(1.04);
  background: rgba(255,255,255,0.20);
}

/* ── Hidden ───────────────────────────────────────────────────── */
[hidden] { display: none !important; }
