:root {
  --bg: #0A0A0B;
  --white: #FFFFFF;
  --muted: rgba(255, 255, 255, 0.72);
  --soft: rgba(255, 255, 255, 0.6);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --accent: #638EFF;
  --steel: rgba(110, 140, 190, 1);
  --danger: #FF9C9C;
  --display: "Clash Display", "Inter", system-ui, sans-serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--white); }
body {
  font-family: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
main { flex: 1; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid rgba(143, 166, 207, 0.9); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Shared scene ---------- */
.scene {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
  padding: 0 24px;
}
.scene--page { padding: 120px 24px; }
.starfield { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.vignette {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 45%, rgba(10,10,11,0) 35%, rgba(10,10,11,0.55) 72%, rgba(10,10,11,0.95) 100%);
}
.glow {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 44%, rgba(99,142,255,0.16) 0%, rgba(99,142,255,0.05) 30%, rgba(10,10,11,0) 60%);
}

/* ---------- Hero ---------- */
.hero { min-height: max(680px, 100vh); min-height: max(680px, 100svh); }
.hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1040px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.dot {
  width: 7px; height: 7px; border-radius: 999px; background: var(--accent);
  box-shadow: 0 0 12px rgba(99, 142, 255, 0.8);
}
.outline-title { position: relative; z-index: 2; width: 640px; max-width: 100%; }
.outline-title svg { width: 100%; height: auto; display: block; overflow: visible; filter: drop-shadow(0 0 12px rgba(110, 140, 190, 0.22)); }
.outline-title text { font-family: var(--display); font-weight: 600; letter-spacing: 0.01em; }

.video-stage {
  position: relative; z-index: 1; width: 100%; height: 272px;
  display: flex; align-items: center; justify-content: center;
  overflow: visible; pointer-events: none;
}
.video-stage video {
  flex-shrink: 0;
  width: 940px; height: 546px;
  object-fit: cover;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(44% 56% at 50% 47%, #000 42%, transparent 100%);
          mask-image: radial-gradient(44% 56% at 50% 47%, #000 42%, transparent 100%);
}

.pill {
  position: relative; z-index: 3;
  display: inline-flex; align-items: center; justify-content: center; gap: 11px;
  padding: 15px 28px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--white);
  font-family: var(--text);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .4s cubic-bezier(.34,1.56,.64,1), background-color .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.pill:hover { transform: translateY(-2px) scale(1.04); background-color: rgba(110, 140, 190, 0.14); box-shadow: 0 0 28px rgba(110, 140, 190, 0.35); }
.pill:active { transform: scale(0.97); transition-duration: .15s; }
.pill--plain { letter-spacing: 0; text-transform: none; font-size: 15px; padding: 16px 28px 16px 26px; background-color: rgba(255,255,255,0.03); }
.pill[disabled] { cursor: default; color: rgba(255,255,255,0.6); border-color: rgba(143,166,207,0.35); background-color: rgba(110,140,190,0.08); transform: none; box-shadow: none; }

.subline {
  position: relative; z-index: 3;
  margin: 0;
  max-width: 560px;
  text-align: center;
  font-size: 18px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--muted);
  text-wrap: balance;
}

.scroll-cue { position: absolute; left: 0; right: 0; bottom: 20px; z-index: 3; display: flex; justify-content: center; pointer-events: none; }
.scroll-cue span { width: 1px; height: 46px; background: linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 100%); }

/* ---------- Page stack (connect / register / 404) ---------- */
.stack {
  position: relative; z-index: 2;
  width: 100%; max-width: 720px;
  display: flex; flex-direction: column; align-items: center; gap: 32px;
}
.lead {
  margin: 0; max-width: 600px; text-align: center;
  font-size: 20px; line-height: 1.55; letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.85); text-wrap: balance;
}
.page-title {
  margin: 0; text-align: center;
  font-family: var(--text); font-weight: 600;
  font-size: 44px; line-height: 1.1; letter-spacing: -0.03em;
}

/* Glass card */
.card {
  width: 460px; max-width: 100%;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  box-shadow: 0 0 48px rgba(110, 140, 190, 0.12);
}

/* ---------- Timer ---------- */
.timer-wrap { width: 460px; max-width: 100%; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.timer { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 30px 36px 32px; }
.label {
  display: flex; align-items: center; gap: 10px;
  font-weight: 500; font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--soft);
}
.label .bullet { width: 6px; height: 6px; border-radius: 999px; background: rgba(255,255,255,0.35); flex-shrink: 0; }
.timer.is-running .label .bullet { background: var(--accent); box-shadow: 0 0 10px rgba(99,142,255,0.8); animation: pulse 1.6s ease-in-out infinite; }
.timer.is-expired .label { color: var(--danger); }
.timer.is-expired .label .bullet { background: var(--danger); }

.digits {
  display: flex; align-items: center;
  font-family: var(--display); font-weight: 600;
  font-size: 88px; line-height: 1; letter-spacing: -0.02em;
  color: rgba(255,255,255,0.88);
  font-variant-numeric: tabular-nums;
  transition: color .4s ease;
}
.digits .d { display: inline-block; width: 0.72em; text-align: center; }
.digits .d.tick { animation: tick .45s cubic-bezier(.34,1.3,.64,1); }
.digits .colon { display: inline-block; padding: 0 0.08em; transform: translateY(-0.06em); opacity: 0.4; }
.timer.is-running .digits { color: var(--white); }
.timer.is-running .digits .colon { animation: blink 1s ease-in-out infinite; }
.timer.is-low .digits { color: var(--danger); }
.timer.is-expired .digits { color: rgba(255,255,255,0.35); }

.progress { width: 100%; height: 2px; border-radius: 2px; background: rgba(255,255,255,0.08); overflow: hidden; }
.progress i { display: block; height: 100%; width: 100%; border-radius: 2px; background: linear-gradient(90deg, #41527A, #8FA6CF, #56698F); opacity: .5; transition: width .25s linear, opacity .4s ease; }
.timer.is-running .progress i { opacity: 1; }
.timer.is-low .progress i, .timer.is-expired .progress i { background: linear-gradient(90deg, #8F5A6A, #FF9C9C); }

/* ---------- Registration form ---------- */
.form { display: flex; flex-direction: column; gap: 18px; padding: 32px 32px 30px; }
.field { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.field__label { font-weight: 500; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--soft); }
.field__box {
  display: flex; align-items: center; gap: 8px;
  height: 52px; padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color .25s ease, background .25s ease, box-shadow .25s ease;
}
.field__box:focus-within { border-color: rgba(143,166,207,0.65); background: rgba(110,140,190,0.07); box-shadow: 0 0 22px rgba(110,140,190,0.22); }
.field.has-error .field__box { border-color: rgba(255,156,156,0.55); }
.field__prefix { font-size: 16px; color: rgba(255,255,255,0.4); }
.field input {
  flex: 1; min-width: 0; height: 100%;
  border: none; outline: none; background: transparent; padding: 0;
  color: var(--white); font-family: var(--text); font-size: 16px; letter-spacing: -0.01em;
}
.field input::placeholder { color: rgba(255,255,255,0.38); }
.field input:-webkit-autofill { -webkit-text-fill-color: #fff; transition: background-color 9999s ease-out; }
.field__error { font-size: 12px; line-height: 1.4; color: var(--danger); min-height: 0; }
.field__error:empty { display: none; }
.eye { appearance: none; border: none; background: transparent; padding: 4px; margin: -4px; cursor: pointer; display: flex; color: rgba(255,255,255,0.5); border-radius: 6px; }
.eye:hover { color: rgba(255,255,255,0.8); }
.form .pill { width: 100%; height: 54px; margin-top: 8px; }
.form .pill:hover { transform: translateY(-2px) scale(1.02); }
.form-error { font-size: 12px; color: var(--danger); text-align: center; }
.form-error:empty { display: none; }
.spinner { width: 14px; height: 14px; border-radius: 999px; border: 1.5px solid rgba(255,255,255,0.25); border-top-color: #fff; animation: spin .8s linear infinite; }

/* ---------- 404 ---------- */
.eyebrow { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 500; font-size: 13px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); }
.eyebrow .dot { width: 7px; height: 7px; }
.holo {
  margin: 0;
  font-family: var(--display); font-weight: 600;
  font-size: 200px; line-height: 0.9; letter-spacing: -0.03em;
  background: linear-gradient(105deg, #F4F8FF 0%, #A9C8FF 16%, #C9B2FF 32%, #FFC2EC 46%, #BFFFF3 60%, #8FB2FF 76%, #EEF3FF 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.nf-title { margin: 0; text-align: center; font-family: var(--display); font-weight: 600; font-size: 34px; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
.nf-text { margin: 0; max-width: 480px; text-align: center; font-family: var(--display); font-size: 17px; line-height: 1.6; color: var(--muted); text-wrap: balance; }
.nf-copy { display: flex; flex-direction: column; align-items: center; gap: 18px; }

/* ---------- Footer ---------- */
.footer {
  position: relative; z-index: 2;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 28px 24px;
  display: flex; justify-content: center;
  background: var(--bg);
}
.footer p { margin: 0; font-family: var(--display); font-size: 13px; color: rgba(255,255,255,0.72); text-align: center; }

/* ---------- Entrance ---------- */
.appear { opacity: 0; animation: rise .7s cubic-bezier(.44,0,.56,1) forwards; animation-delay: var(--d, 0s); }
.appear--blur { animation-name: rise-blur; animation-duration: .9s; }

@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes rise-blur { from { opacity: 0; transform: translateY(28px); filter: blur(10px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes blink { 0%, 100% { opacity: .9; } 50% { opacity: .25; } }
@keyframes tick { from { transform: translateY(-0.35em); opacity: 0; filter: blur(4px); } to { transform: none; opacity: 1; filter: blur(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tablet ---------- */
@media (max-width: 1199.98px) {
  .outline-title { width: 470px; }
  .video-stage { height: 230px; }
  .video-stage video { width: 723px; height: 420px; }
  .holo { font-size: 160px; }
}

/* ---------- Phone ---------- */
@media (max-width: 809.98px) {
  .hero__content { gap: 20px; }
  .outline-title { width: 290px; }
  .video-stage { height: 180px; }
  .video-stage video { width: 540px; height: 314px; }
  .hero .pill { padding: 14px 22px; }
  .subline { font-size: 16px; }
  .stack { gap: 26px; }
  .lead { font-size: 17px; }
  .page-title { font-size: 34px; }
  .digits { font-size: 64px; }
  .timer { padding: 26px 24px 28px; }
  .form { padding: 26px 20px 24px; }
  .holo { font-size: 112px; }
  .nf-title { font-size: 30px; }
  .nf-text { font-size: 16px; }
  .scene--page { padding: 96px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .appear { opacity: 1; }
}
