/* ============================================================
   CORE — reset, theme tokens, layout shell, background, type
   Monochrome grey, dark -> light, single restrained accent.
   ============================================================ */

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

:root {
  --accent: #3d7bff;
  --accent-2: #74a4ff;
  --accent-ink: #ffffff;
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --maxw: 1180px;
  --bar-h: 54px;
  --radius: 18px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-num: "SF Mono", ui-monospace, "Roboto Mono", Menlo, Consolas, monospace;
}

/* ---------- THEMES ---------- */
body[data-theme="dark"] {
  --bg0: #0a0b0e;
  --bg1: #14161b;
  --surface: rgba(255,255,255,.045);
  --surface-2: rgba(255,255,255,.07);
  --surface-solid: #16181d;
  --fg: #eef1f5;
  --fg-strong: #ffffff;
  --muted: #98a0ab;
  --faint: #6b7280;
  --line: rgba(255,255,255,.10);
  --line-strong: rgba(255,255,255,.18);
  --shadow: 0 24px 70px rgba(0,0,0,.6), 0 4px 14px rgba(0,0,0,.4);
  --shadow-sm: 0 8px 24px rgba(0,0,0,.45);
  --grid: rgba(255,255,255,.045);
  --blob-a: rgba(61,123,255,.22);
  --blob-b: rgba(255,255,255,.05);
  color-scheme: dark;
}
body[data-theme="light"] {
  --bg0: #e9ebef;
  --bg1: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-solid: #ffffff;
  --fg: #1a1d23;
  --fg-strong: #0a0c10;
  --muted: #5b626d;
  --faint: #99a0ab;
  --line: rgba(15,23,42,.10);
  --line-strong: rgba(15,23,42,.16);
  --shadow: 0 30px 70px rgba(23,36,71,.16), 0 6px 18px rgba(23,36,71,.08);
  --shadow-sm: 0 10px 28px rgba(23,36,71,.10);
  --grid: rgba(15,23,42,.05);
  --blob-a: rgba(61,123,255,.18);
  --blob-b: rgba(15,23,42,.04);
  color-scheme: light;
}

html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--fg);
  background: radial-gradient(120% 120% at 50% 0%, var(--bg1) 0%, var(--bg0) 70%);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .9s var(--ease), color .6s var(--ease);
}

/* ---------- ANIMATED BACKGROUND ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-blob {
  position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(60px); opacity: .9; will-change: transform;
}
.bg-blob-1 { top: -20vmax; left: -10vmax; background: radial-gradient(circle, var(--blob-a), transparent 65%); animation: drift1 26s var(--ease) infinite alternate; }
.bg-blob-2 { bottom: -24vmax; right: -12vmax; background: radial-gradient(circle, var(--blob-b), transparent 60%); animation: drift2 32s var(--ease) infinite alternate; }
.bg-grid {
  position: absolute; inset: -2px;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 64px 64px; mask-image: radial-gradient(120% 100% at 50% 40%, #000 35%, transparent 85%);
  animation: gridmove 40s linear infinite;
}
.bg-vignette { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 35%, transparent 55%, rgba(0,0,0,.28)); }
body[data-theme="light"] .bg-vignette { background: radial-gradient(120% 90% at 50% 35%, transparent 60%, rgba(20,30,60,.06)); }

/* ---------- BARS ---------- */
.topbar, .botbar {
  position: fixed; left: 0; right: 0; height: var(--bar-h); z-index: 30;
  display: flex; align-items: center; gap: 16px; padding: 0 22px;
  background: color-mix(in srgb, var(--bg0) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
.topbar { top: 0; border-bottom: 1px solid var(--line); justify-content: space-between; }
.botbar { bottom: 0; border-top: 1px solid var(--line); }

.brand { display: flex; align-items: center; gap: 10px; font-size: 13px; letter-spacing: .01em; color: var(--muted); min-width: 0; }
.brand-mark { width: 14px; height: 14px; border-radius: 4px; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); flex: none; }
.brand-name { color: var(--fg-strong); font-weight: 700; }
.brand-sep { color: var(--faint); }
.brand-sub { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act {
  font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); padding: 5px 12px; border: 1px solid var(--line-strong); border-radius: 999px;
  white-space: nowrap;
}

.foot-title { font-size: 12.5px; color: var(--muted); min-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; align-items: center; gap: 10px; min-width: 140px; justify-content: flex-end; }
.navbtn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--fg); font-size: 19px; line-height: 1; cursor: pointer;
  display: grid; place-items: center; transition: transform .15s var(--ease), background .2s, border-color .2s;
}
.navbtn:hover { background: var(--surface-2); border-color: var(--accent); transform: translateY(-1px); }
.navbtn:active { transform: translateY(0) scale(.96); }
.counter { font-family: var(--font-num); font-size: 12px; color: var(--muted); letter-spacing: .04em; cursor: pointer; background: none; border: 1px solid transparent; border-radius: 8px; padding: 5px 9px; transition: background .2s, border-color .2s, color .2s; }
.counter:hover { background: var(--surface); border-color: var(--line-strong); color: var(--fg); }
.counter:focus-visible { outline: none; border-color: var(--accent); }
.counter #cur { color: var(--fg-strong); font-weight: 600; }
.counter-sep { margin: 0 5px; color: var(--faint); }

/* ---------- DOTS ---------- */
.dots { flex: 1; display: flex; align-items: center; justify-content: center; gap: 9px; flex-wrap: wrap; }
.dot {
  width: 8px; height: 8px; border-radius: 50%; border: none; padding: 0; cursor: pointer;
  background: var(--line-strong); transition: all .3s var(--ease); position: relative;
}
.dot:hover { transform: scale(1.4); background: var(--muted); }
.dot.active { width: 26px; border-radius: 999px; background: var(--accent); }
.dot.seen:not(.active) { background: var(--muted); }

/* ---------- STAGE & SLIDES ---------- */
.stage { position: fixed; top: var(--bar-h); bottom: var(--bar-h); left: 0; right: 0; z-index: 10; }
.slide {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: clamp(20px, 4vmin, 56px) clamp(24px, 6vw, 96px);
  opacity: 0; visibility: hidden; transform: scale(.985);
  transition: opacity .55s var(--ease), transform .7s var(--ease), visibility 0s linear .6s;
}
.slide.is-active { opacity: 1; visibility: visible; transform: none; transition: opacity .6s var(--ease), transform .8s var(--ease-out); }
.wrap { width: 100%; max-width: var(--maxw); }
.wrap.center { text-align: center; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }

/* ---------- TYPE ---------- */
.kicker {
  font-size: clamp(11px, 1.4vmin, 13px); font-weight: 700; letter-spacing: .28em; text-transform: uppercase;
  color: var(--accent); display: inline-flex; align-items: center; gap: 10px;
}
.kicker::before { content: ""; width: 26px; height: 2px; background: var(--accent); display: inline-block; border-radius: 2px; }
.wrap.center .kicker::before { display: none; }
.headline {
  font-size: clamp(2.1rem, 6.4vmin, 4.6rem); font-weight: 800; line-height: 1.02; letter-spacing: -.025em;
  color: var(--fg-strong);
}
.headline .hl { color: var(--accent); }
.display {
  font-size: clamp(3.4rem, 14vmin, 9.5rem); font-weight: 800; line-height: .9; letter-spacing: -.04em;
  color: var(--fg-strong); font-feature-settings: "tnum";
}
.sub { font-size: clamp(1rem, 2.3vmin, 1.45rem); color: var(--muted); line-height: 1.5; font-weight: 400; max-width: 40ch; }
.wrap.center .sub { max-width: 52ch; margin-inline: auto; }
.lead { font-size: clamp(1.15rem, 3vmin, 2rem); color: var(--fg); line-height: 1.35; font-weight: 500; }
.tag { color: var(--accent); font-weight: 700; }
.muted { color: var(--muted); }

/* ---------- REVEAL SYSTEM ---------- */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .65s var(--ease-out), transform .8s var(--ease-out); transition-delay: var(--d, 0s); }
[data-reveal="fade"] { transform: none; }
[data-reveal="left"] { transform: translateX(-30px); }
[data-reveal="right"] { transform: translateX(30px); }
[data-reveal="zoom"] { transform: scale(.9); }
.is-active [data-reveal] { opacity: 1; transform: none; }

/* ---------- OVERVIEW ---------- */
.overview {
  position: fixed; inset: 0; z-index: 50; background: color-mix(in srgb, var(--bg0) 92%, transparent);
  backdrop-filter: blur(8px); padding: 70px 40px; overflow: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; align-content: start;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .32s ease, visibility 0s linear .32s;
}
.overview.open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .32s ease; }
.overview .ov-card { opacity: 0; transform: translateY(12px) scale(.98); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.overview.open .ov-card { opacity: 1; transform: none; }
.ov-card {
  aspect-ratio: 16/9; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface);
  padding: 14px; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .2s var(--ease), border-color .2s; color: var(--fg);
}
.ov-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.ov-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.ov-num { font-family: var(--font-num); font-size: 12px; color: var(--accent); }
.ov-title { font-weight: 700; font-size: 14px; }
.ov-act { font-size: 10px; text-transform: uppercase; letter-spacing: .2em; color: var(--muted); }

/* ---------- HINT ---------- */
.hint {
  position: fixed; bottom: calc(var(--bar-h) + 14px); left: 50%; transform: translateX(-50%); z-index: 40;
  font-size: 11.5px; color: var(--muted); background: var(--surface); border: 1px solid var(--line);
  padding: 7px 14px; border-radius: 999px; backdrop-filter: blur(8px);
  transition: opacity .6s ease; box-shadow: var(--shadow-sm);
}
.hint b { color: var(--fg-strong); font-family: var(--font-num); }
.hint.hide { opacity: 0; pointer-events: none; }

/* ---------- RESPONSIVE BAR ---------- */
@media (max-width: 720px) {
  .brand-sub, .foot-title { display: none; }
  .dots { gap: 6px; }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  .bg-blob, .bg-grid { animation: none !important; }
  [data-reveal] { transition-duration: .35s; transform: none; }
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; }
}

/* ---------- BACKGROUND KEYFRAMES ---------- */
@keyframes drift1 { from { transform: translate(0,0) scale(1); } to { transform: translate(14vmax, 8vmax) scale(1.15); } }
@keyframes drift2 { from { transform: translate(0,0) scale(1.1); } to { transform: translate(-12vmax, -6vmax) scale(1); } }
@keyframes gridmove { from { background-position: 0 0, 0 0; } to { background-position: 64px 64px, 64px 64px; } }
