/* ============ NIO INTELLIGENCE — spec-exact ============ */

@font-face {
  font-family: 'Geist Pixel Circle';
  src: url('fonts/GeistPixel-Circle.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #000000;
  --text: #ffffff;
  --muted: #8e8e8e;
  --nav-text: #2e2e2e;
  --pill-dark: #28282a;
  --sign-in-text: #c8c8c8;
  --nav-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  --trust-bg: #28282a;
  --trust-border: rgba(255, 255, 255, 0.4);
  --trust-text: #c4c2c3;
  --font-sans: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: "BubbledotICG-FinePos", "Geist Pixel Circle", monospace;
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- background video ---------- */
.bg {
  position: absolute;
  inset: 0;
  background: #000;
  overflow: hidden;
}
.bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 0;
}

/* ---------- page: one viewport, three regions ---------- */
.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding: clamp(16px, 2.4vh, 28px) clamp(14px, 3vw, 32px);
}

.header { flex-shrink: 0; width: 100%; z-index: 1; }
.hero   { flex: 1; z-index: 1; }
.stats  { flex-shrink: 0; z-index: 1; }

/* ============ HEADER ============ */
.header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 2.8vw, 28px);
  max-width: 720px;
  margin: 0 auto;
  animation: slideDown 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-18px); }
  to   { opacity: 1; transform: none; }
}

.logo-btn {
  display: grid;
  place-items: center;
  width: clamp(40px, 4.4vw, 46px);
  height: clamp(40px, 4.4vw, 46px);
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--nav-shadow);
  flex-shrink: 0;
  text-decoration: none;
  transition: transform 0.3s ease;
}
.logo-btn:hover { transform: scale(1.04); }
.logo-btn img {
  width: 72%;
  height: 72%;
  object-fit: contain;
}

.nav-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #fff;
  height: clamp(44px, 5.2vw, 48px);
  max-width: 430px;
  flex: 1;
  padding: 4px 8px;
  border-radius: 999px;
  box-shadow: var(--nav-shadow);
}
.nav-link {
  position: relative;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(13px, 1.4vw, 15px);
  letter-spacing: -0.01em;
  color: var(--nav-text);
  opacity: 0.5;
  text-decoration: none;
  padding: 6px 12px;
  transition: opacity 0.25s ease;
}
.nav-link:hover { opacity: 0.75; }
.nav-link.active { opacity: 1; }
.nav-link.active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #000;
  transform: translateX(-50%);
  box-shadow: -5px 0 0 #000, 5px 0 0 #000;
}

.signin-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(44px, 5.2vw, 48px);
  padding: 0 clamp(18px, 2.4vw, 26px);
  border-radius: 999px;
  background: var(--pill-dark);
  color: var(--sign-in-text);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(13px, 1.4vw, 15px);
  letter-spacing: -0.01em;
  text-decoration: none;
  box-shadow: var(--nav-shadow);
  flex-shrink: 0;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.signin-pill:hover { background: #323234; color: #fff; transform: translateY(-1px); }

/* burger — mobile only */
.burger {
  display: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--pill-dark);
  box-shadow: var(--nav-shadow);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background-color 0.28s ease;
}
.burger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: #fff;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.28s ease;
}
.burger[aria-expanded="true"] { background: #fff; }
.burger[aria-expanded="true"] span { background: #000; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* mobile menu */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 40;
  animation: overlayIn 0.28s ease both;
}
.menu-overlay[hidden], .mobile-menu[hidden] { display: none; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.mobile-menu {
  position: fixed;
  top: calc(clamp(16px, 2.4vh, 28px) + 56px);
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, calc(100vw - 32px));
  background: #fff;
  border-radius: 28px;
  padding: 22px 18px 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  z-index: 41;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: menuIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes menuIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px) scale(0.98); }
  to   { opacity: 1; transform: translateX(-50%) none; }
}
.m-link {
  position: relative;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--nav-text);
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 14px;
  animation: linkIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.m-link:nth-child(1) { animation-delay: 0.05s; }
.m-link:nth-child(2) { animation-delay: 0.1s; }
.m-link:nth-child(3) { animation-delay: 0.15s; }
.m-link:nth-child(4) { animation-delay: 0.2s; }
.m-link:hover { background: rgba(0, 0, 0, 0.04); }
.m-link.active { font-weight: 600; }
@keyframes linkIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.m-signin {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  border-radius: 999px;
  background: var(--pill-dark);
  color: var(--sign-in-text);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  animation: linkIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}
.m-dots {
  align-self: center;
  margin-top: 14px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #000;
  box-shadow: -8px 0 0 #000, 8px 0 0 #000;
  display: block;
  margin-bottom: 8px;
}

/* ============ HERO ============ */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 900px;
  width: 100%;
}

/* trust row */
.trust {
  --trust-size: clamp(36px, 4.5vw, 42px);
  display: inline-flex;
  align-items: center;
  margin-bottom: clamp(16px, 2.5vh, 26px);
}
.avatar {
  width: var(--trust-size);
  height: var(--trust-size);
  border-radius: 50%;
  background: var(--trust-bg);
  border: 1px solid var(--trust-border);
  padding: 5px;
  box-shadow: var(--nav-shadow);
  transition: transform 0.35s ease;
}
.avatar .inner {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
}
.avatar .inner i {
  font-size: calc(var(--trust-size) * 0.34);
  color: #111;
}
.a1 { z-index: 1; }
.a2 { z-index: 2; margin-left: calc(var(--trust-size) * -0.42); }
.a3 { z-index: 4; margin-left: calc(var(--trust-size) * -0.42); }
.a1:hover { transform: translateY(-2px); }
.a2:hover { transform: translateY(-4px); }
.a3:hover { transform: translateY(-2px); }

.trust-pill {
  display: inline-flex;
  align-items: center;
  height: var(--trust-size);
  background: var(--trust-bg);
  border: 1px solid var(--trust-border);
  border-radius: 999px;
  margin-left: calc(var(--trust-size) * -0.42);
  padding-left: calc(var(--trust-size) * 0.58);
  padding-right: 18px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(12px, 1.4vw, 13.5px);
  color: var(--trust-text);
  white-space: nowrap;
}

/* headline — dot-matrix display */
.headline {
  font-family: var(--font-display);
  font-weight: 400;
  color: #fff;                    /* solid white — no gradient, no shimmer */
  font-size: clamp(28px, 6.2vw, 80px);
  letter-spacing: -0.04em;
  line-height: 1.12;
}
.headline .line {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px);
  animation: headlineFade 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.headline .l1 { animation-delay: 0.12s; }
.headline .l2 { animation-delay: 0.3s; }
@keyframes headlineFade {
  to { opacity: 1; transform: none; }
}

/* subhead */
.subhead {
  max-width: min(500px, 92%);
  margin-top: clamp(18px, 2.6vh, 26px);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(calc(13.5px + 2pt), calc(1.55vw + 2pt), calc(16.5px + 2pt));
  color: #d0d0d0;
  opacity: 0.8;
  line-height: 1.55;
}

/* CTA */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: clamp(22px, 3.4vh, 34px);
  padding: clamp(11px, 1.6vh, 13px) clamp(22px, 3vw, 28px);
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(13.5px, 1.5vw, 14.5px);
  letter-spacing: -0.01em;
  text-decoration: none;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.15),
    0 0 22px rgba(255, 255, 255, 0.32),
    0 0 44px rgba(255, 255, 255, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: revealPulse 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--d, 0s);
}
.cta:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.22),
    0 0 30px rgba(255, 255, 255, 0.45),
    0 0 60px rgba(255, 255, 255, 0.2);
}
@keyframes revealPulse {
  0%   { opacity: 0; transform: translateY(22px) scale(0.98); filter: blur(6px);
         box-shadow: 0 0 0 1px rgba(255,255,255,0), 0 0 0 rgba(255,255,255,0), 0 0 0 rgba(255,255,255,0); }
  60%  { filter: blur(0); }
  100% { opacity: 1; transform: none; filter: blur(0);
         box-shadow: 0 0 0 1px rgba(255,255,255,0.15), 0 0 22px rgba(255,255,255,0.32), 0 0 44px rgba(255,255,255,0.12); }
}

/* ============ STATS ============ */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 3vw, 32px);
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.s-icon {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 33px);
  color: #fff;
  line-height: 1;
}
.s-value {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(18px, 2.2vw, 26px);
  letter-spacing: -0.025em;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.s-label {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: clamp(11px, 1.2vw, 12.5px);
  color: var(--muted);
}

/* ============ BRAIN ORB ============ */
.brain-orb {
  position: relative;
  width: 140px;
  height: 140px;
  margin-bottom: clamp(8px, 1.4vh, 14px);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.brain-orb canvas {
  display: block;
  width: 140px;
  height: 140px;
}
.brain-orb:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.5);
  outline-offset: 6px;
}
.orb-hint {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(14px, 2.2vh, 22px);
  animation: reveal 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards, hintPulse 2.8s ease-in-out 1.2s infinite;
  animation-delay: var(--d, 0s), 1.2s;
}
@keyframes hintPulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

/* ============ BRAIN OVERLAY ============ */
.brain-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}
.brain-overlay[hidden] { display: none; }
.brain-veil {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: overlayIn 0.28s ease both;
}
.brain-sheet {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  background: rgba(20, 21, 22, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid #2d2e31;
  border-radius: 24px;
  padding: clamp(28px, 4.5vw, 48px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: sheetPop 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes sheetPop {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
.brain-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(24px, 3.5vw, 40px);
}
.brain-kicker {
  display: block;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.brain-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 5vw, 52px);
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: #fff;
}
.brain-close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--pill-dark);
  color: #c8c8c8;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.brain-close:hover { background: #fff; color: #000; transform: rotate(90deg); }

.brain-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 32px) clamp(24px, 4vw, 48px);
}
.brain-mod {
  opacity: 0;
  transform: translateY(12px);
  animation: modIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.brain-mod:nth-child(1) { animation-delay: 0.1s; }
.brain-mod:nth-child(2) { animation-delay: 0.17s; }
.brain-mod:nth-child(3) { animation-delay: 0.24s; }
.brain-mod:nth-child(4) { animation-delay: 0.31s; }
@keyframes modIn { to { opacity: 1; transform: none; } }
.bm-num {
  display: block;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: 10px;
}
.brain-mod h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(16px, 1.8vw, 19px);
  letter-spacing: -0.015em;
  color: #fff;
  margin-bottom: 8px;
}
.brain-mod p {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.6;
  color: #a8a8a8;
}

.brain-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: clamp(28px, 4vw, 40px);
  padding-top: 22px;
  border-top: 1px solid #2d2e31;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.bf-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: bfPulse 2.2s ease-in-out infinite;
}
@keyframes bfPulse {
  0%, 100% { opacity: 0.35; box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.25); }
  50%      { opacity: 1; box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
}

/* ============ shared entrance ============ */
.anim {
  opacity: 0;
  transform: translateY(22px) scale(0.98);
  filter: blur(6px);
  animation: reveal 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes reveal {
  to { opacity: 1; transform: none; filter: blur(0); }
}

/* ============ mobile ============ */
@media (max-width: 720px) {
  .header { justify-content: space-between; max-width: none; }
  .nav-pill, .signin-pill { display: none; }
  .logo-btn { width: 48px; height: 48px; }
  .burger { display: flex; }
  .headline { letter-spacing: -0.08em; line-height: 1.05; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .trust-pill { font-size: 12px; }
  .brain-grid { grid-template-columns: 1fr; }
}

@media (max-height: 760px) {
  .brain-orb, .brain-orb canvas { width: 96px; height: 96px; }
}

@media (max-width: 420px) {
  .headline { letter-spacing: -0.09em; line-height: 1.04; }
  .trust { --trust-size: 34px; }
}

@media (max-height: 700px) {
  .hero { justify-content: center; }
  .trust { margin-bottom: 14px; }
  .subhead { margin-top: 14px; }
  .cta { margin-top: 18px; }
}

/* ============ reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .anim, .headline .line, .cta {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .headline { color: #fff; }
  .bg-video { display: none; }
}
