:root {
  --bg: #0b0d10;
  --bg-2: #111418;
  --panel: rgba(14, 17, 21, 0.72);
  --panel-hover: rgba(34, 39, 45, 0.86);
  --line: #5d646b;
  --line-soft: rgba(93, 100, 107, 0.45);
  --white: #ffffff;
  --text: #dfe4e8;
  --accent: #b9c3ce;
  --ice: #a9bcc9;
  --muted: #8f979f;
  --dim: #6f7883;
  --dark: #5d646b;
  --ok: #a3c9b0;
  --err: #c9a3a3;
  --radius: 4px;
  --maxw: 1180px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Unbounded", "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--white); }
i { font-style: normal; color: var(--dark); }
code, kbd {
  font: 600 0.88em/1 ui-monospace, "Cascadia Code", Consolas, monospace;
  padding: 0.2em 0.45em;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  white-space: nowrap;
}
kbd { box-shadow: inset 0 -2px 0 rgba(93, 100, 107, 0.5); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- background ---------- */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; display: block; }
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; gap: 28px;
  padding: 14px max(24px, calc((100vw - var(--maxw)) / 2));
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled { background: rgba(11, 13, 16, 0.78); backdrop-filter: blur(12px); border-color: var(--line-soft); }
.nav__logo { font: 800 18px/1 var(--font-head); color: var(--white); letter-spacing: 0.04em; cursor: pointer; user-select: none; }
.nav__logo span, .hero__title span, .footer__logo span { color: var(--accent); }
.nav__links { display: flex; gap: 22px; margin-left: auto; }
.nav__links a { color: var(--muted); font-weight: 600; font-size: 14px; font-variant: small-caps; letter-spacing: 0.06em; }
.nav__links a:hover, .nav__links a.is-active { color: var(--white); }
.nav__progress { position: absolute; left: 0; bottom: -1px; height: 1px; width: 0; background: var(--accent); box-shadow: 0 0 8px var(--ice); }

/* ---------- buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 22px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--text);
  font: 600 15px/1 var(--font); font-variant: small-caps; letter-spacing: 0.08em;
  cursor: pointer; transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.btn:hover { background: var(--panel-hover); border-color: var(--accent); color: var(--white); transform: translateY(-1px); }
.btn--main { border-color: var(--accent); background: rgba(28, 33, 39, 0.85); color: var(--white); }
.btn--main:hover { border-color: var(--white); box-shadow: 0 0 0 4px rgba(185, 195, 206, 0.08), 0 8px 30px rgba(169, 188, 201, 0.15); }
.btn--small { height: 36px; padding: 0 14px; font-size: 13px; }
.btn--ghost { background: transparent; }
.btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }

.chip {
  display: inline-flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: rgba(14, 17, 21, 0.6); color: var(--text);
  font: 600 13px/1 var(--font); backdrop-filter: blur(6px);
}
.chip svg { width: 16px; height: 16px; color: var(--muted); }
.chip--ip { cursor: pointer; transition: border-color 0.2s; }
.chip--ip:hover { border-color: var(--accent); }
.chip--ip:hover svg { color: var(--white); }
.chip--muted { color: var(--muted); }
.chip__dot { width: 7px; height: 7px; border-radius: 1px; background: var(--dim); }
.chip--ip .chip__dot { background: var(--accent); }
[data-status][data-state="online"] .chip__dot { background: var(--ok); box-shadow: 0 0 0 0 rgba(163, 201, 176, 0.6); animation: pulse 2s infinite; }
[data-status][data-state="offline"] .chip__dot { background: var(--err); }
[data-status][data-state="loading"] .chip__dot { animation: blink 1s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(163, 201, 176, 0); } 100% { box-shadow: 0 0 0 0 rgba(163, 201, 176, 0); } }
@keyframes blink { 50% { opacity: 0.3; } }

/* ---------- hero ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 120px 24px 80px; position: relative;
}
.eyebrow { margin: 0 0 14px; color: var(--muted); font-weight: 600; font-size: 14px; font-variant: small-caps; letter-spacing: 0.18em; }
.hero__title {
  margin: 0; font: 800 clamp(64px, 13vw, 168px)/0.9 var(--font-head); color: var(--white);
  letter-spacing: 0.02em; text-shadow: 0 0 60px rgba(169, 188, 201, 0.25);
}
.hero__sub { margin: 18px 0 0; color: var(--accent); font-weight: 600; font-variant: small-caps; letter-spacing: 0.32em; font-size: clamp(14px, 1.6vw, 18px); }
.hero__lead { max-width: 560px; margin: 26px auto 0; color: var(--muted); font-size: 18px; }
.hero__lead b { color: var(--white); font-weight: 700; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; margin-top: 36px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 26px; }
.scroll-hint { position: absolute; bottom: 28px; left: 50%; width: 24px; height: 38px; margin-left: -12px; border: 1px solid var(--line); border-radius: 12px; }
.scroll-hint span { position: absolute; top: 8px; left: 50%; width: 2px; height: 8px; margin-left: -1px; background: var(--accent); border-radius: 1px; animation: wheel 1.8s infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

/* ---------- sections ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 110px 24px; }
.section__head { max-width: 720px; margin-bottom: 48px; }
.section h2 { margin: 0; font: 700 clamp(30px, 4vw, 46px)/1.1 var(--font-head); color: var(--white); }
.section__lead { margin: 18px 0 0; color: var(--muted); font-size: 17px; }

/* ---------- border visual ---------- */
.border-vis {
  border: 1px solid var(--line-soft); border-radius: 6px; padding: 28px;
  background: linear-gradient(180deg, rgba(17, 20, 24, 0.85), rgba(11, 13, 16, 0.85));
  backdrop-filter: blur(8px);
}
.border-vis__stage { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: center; }
.border-vis__map {
  position: relative; aspect-ratio: 1 / 1; width: min(100%, 460px); margin: 0 auto;
  overflow: hidden; border: 1px solid var(--line-soft); background: #0d1013;
}
.border-vis__terrain { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.border-vis__grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(11, 13, 16, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 13, 16, 0.35) 1px, transparent 1px);
  background-size: 12.5% 12.5%; background-position: center;
  box-shadow: inset 0 0 60px rgba(11, 13, 16, 0.9);
}
.border-vis__square {
  position: absolute; left: 50%; top: 50%; width: 10%; height: 10%;
  transform: translate(-50%, -50%);
  transition: opacity 0.6s;
  box-shadow: 0 0 30px rgba(169, 188, 201, 0.22), inset 0 0 18px rgba(169, 188, 201, 0.18);
}
.border-vis__square::before {
  content: ""; position: absolute; inset: 0; padding: 2px;
  background: repeating-linear-gradient(45deg, #dfe4e8 0 6px, #5d646b 6px 12px);
  background-size: 17px 17px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: stripes 0.9s linear infinite;
}
.border-vis__square.is-open { opacity: 0; }
@keyframes stripes { to { background-position: 17px 0; } }
.border-vis__label {
  position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
  font: 600 12px/1 var(--font); color: var(--accent); letter-spacing: 0.08em; white-space: nowrap;
}
.border-vis__coord {
  position: absolute; right: 0; bottom: -20px;
  font: 600 10px/1 var(--font); color: var(--muted); letter-spacing: 0.06em; white-space: nowrap;
}
.border-vis__square.is-big .border-vis__label { top: 10px; }
.border-vis__square.is-big .border-vis__coord { bottom: 10px; right: 10px; }
.border-vis__label, .border-vis__coord { text-shadow: 0 1px 3px #0b0d10, 0 0 8px #0b0d10; }
.border-vis__compass {
  position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 3px; background: rgba(11, 13, 16, 0.75);
  font: 700 11px/1 var(--font-head); color: var(--white);
}
.border-vis__compass::before { content: ""; position: absolute; top: -5px; left: 50%; margin-left: -3px; border: 3px solid transparent; border-bottom-color: var(--accent); border-top: 0; }
.border-vis__scale { position: absolute; left: 12px; bottom: 12px; width: calc(100% - 24px); display: flex; flex-direction: column; align-items: flex-start; gap: 5px; pointer-events: none; }
.border-vis__scale span { display: block; height: 5px; border: 1px solid var(--accent); border-top: 0; transition: width 0.2s; }
.border-vis__scale small, .border-vis__coords { font: 600 10px/1 var(--font); color: var(--accent); letter-spacing: 0.06em; text-shadow: 0 1px 3px #0b0d10; }
.border-vis__coords { position: absolute; left: 12px; top: 12px; color: var(--muted); }
.border-vis__platform { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--white); box-shadow: 0 0 12px var(--white); }
.readout__big { font: 800 64px/1 var(--font-head); color: var(--white); }
.readout__big small { font: 600 16px/1 var(--font); color: var(--muted); }
.readout__caption { margin-top: 10px; color: var(--accent); font-weight: 600; font-variant: small-caps; letter-spacing: 0.12em; }
.readout__unlock { min-height: 48px; margin-top: 14px; color: var(--muted); font-size: 15px; }
.readout__unlock b { color: var(--white); }
.readout__controls { display: flex; gap: 8px; margin-top: 18px; }

.stages { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(15, 1fr); gap: 6px; }
.stages li button {
  width: 100%; padding: 10px 0 8px; border: 1px solid var(--line-soft); border-radius: 3px;
  background: rgba(14, 17, 21, 0.6); color: var(--muted); cursor: pointer;
  font: 600 12px/1.2 var(--font); transition: all 0.2s; position: relative;
}
.stages li button:hover { border-color: var(--accent); color: var(--white); }
.stages li button.is-done { color: var(--text); border-color: var(--line); }
.stages li button.is-active { background: rgba(185, 195, 206, 0.12); border-color: var(--white); color: var(--white); }
.stages li button small { display: block; margin-top: 3px; font-size: 10px; color: var(--dark); font-variant: small-caps; letter-spacing: 0.08em; }
.stages li button.has-unlock::after { content: ""; position: absolute; top: -4px; right: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--ice); }

/* ---------- cards ---------- */
.lore-grid, .features { display: grid; gap: 16px; margin-top: 24px; }
.lore-grid { grid-template-columns: repeat(3, 1fr); }
.features { grid-template-columns: repeat(4, 1fr); }
.card {
  position: relative; padding: 26px; overflow: hidden;
  border: 1px solid var(--line-soft); border-radius: 6px;
  background: var(--panel); backdrop-filter: blur(8px);
  transition: border-color 0.25s, transform 0.25s;
}
.card:hover { border-color: var(--line); transform: translateY(-3px); }
.card h3 { margin: 16px 0 8px; font: 700 17px/1.3 var(--font-head); color: var(--white); }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card__icon {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid var(--line); border-radius: 4px; color: var(--accent);
  background: rgba(185, 195, 206, 0.05);
}
.card--glow::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(169, 188, 201, 0.13), transparent 60%);
}
.card--glow:hover::before { opacity: 1; }

/* ---------- steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 14px; }
.steps::before { content: ""; position: absolute; left: 23px; top: 24px; bottom: 24px; width: 1px; background: linear-gradient(var(--line), transparent); }
.step { display: grid; grid-template-columns: 48px 1fr; gap: 22px; align-items: start; }
.step__num {
  position: relative; z-index: 1; display: grid; place-items: center; width: 48px; height: 48px;
  border: 1px solid var(--accent); border-radius: 4px; background: var(--bg-2);
  font: 700 18px/1 var(--font-head); color: var(--white);
}
.step__body { padding: 20px 24px; border: 1px solid var(--line-soft); border-radius: 6px; background: var(--panel); backdrop-filter: blur(8px); }
.step__body h3 { margin: 0 0 6px; font: 700 17px/1.3 var(--font-head); color: var(--white); }
.step__body p { margin: 0; color: var(--muted); }
.note {
  display: flex; gap: 16px; align-items: flex-start; margin-top: 28px; padding: 20px 24px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 4px; background: rgba(28, 33, 39, 0.7);
}
.note__icon { color: var(--accent); padding-top: 2px; }
.note p { margin: 0; color: var(--muted); }
.note b { color: var(--white); }
.note .btn { margin-left: 12px; vertical-align: middle; }

/* ---------- faq ---------- */
.faq-layout { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 56px; align-items: start; }
.faq-side { position: sticky; top: 100px; }
.faq-side .section__lead { margin-bottom: 26px; }
.faq-side__card { display: grid; gap: 1px; border: 1px solid var(--line-soft); border-radius: 6px; overflow: hidden; background: var(--line-soft); }
.faq-side__row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 13px 18px; background: rgba(11, 13, 16, 0.92); font-size: 14px; }
.faq-side__row > span { color: var(--dim); font-variant: small-caps; letter-spacing: 0.1em; }
.faq-side__row b { color: var(--text); font-weight: 600; }
.faq-side__card .btn { margin: 0; border-radius: 0; justify-content: center; border: 0; }
.link-copy { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--white); font: 600 14px/1.4 var(--font); }
.link-copy svg { width: 15px; height: 15px; color: var(--muted); transition: color 0.2s; }
.link-copy:hover svg { color: var(--white); }
.link-copy--muted { color: var(--muted); font-weight: 500; }
.note .link-copy { font-size: inherit; vertical-align: baseline; }
.note + .note { margin-top: 12px; }
.faq { display: grid; gap: 10px; }
.faq details { border: 1px solid var(--line-soft); border-radius: 6px; background: var(--panel); backdrop-filter: blur(8px); transition: border-color 0.2s; }
.faq details[open] { border-color: var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 56px 18px 22px; position: relative; font-weight: 600; color: var(--text); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 22px; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 22px; transition: transform 0.2s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { margin: 0; padding: 0 22px 20px; color: var(--muted); }

/* ---------- cta ---------- */
.section--cta { padding-top: 40px; padding-bottom: 90px; }
.cta {
  position: relative; overflow: hidden; text-align: center; padding: 72px 32px;
  border: 1px solid var(--line-soft); border-radius: 6px;
  background: radial-gradient(ellipse at 50% 0%, rgba(169, 188, 201, 0.12), transparent 65%), rgba(11, 13, 16, 0.82);
  backdrop-filter: blur(8px);
}
.cta h2 { margin: 0; font: 700 clamp(30px, 4.4vw, 52px)/1.1 var(--font-head); color: var(--white); }
.cta .section__lead { max-width: 560px; margin-left: auto; margin-right: auto; }
.cta__frame {
  position: absolute; inset: 14px; pointer-events: none; padding: 2px; opacity: 0.55;
  background: repeating-linear-gradient(45deg, #dfe4e8 0 6px, #5d646b 6px 12px);
  background-size: 17px 17px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: stripes 1.4s linear infinite;
}

/* ---------- footer ---------- */
.footer { position: relative; background: rgba(8, 10, 12, 0.94); }
.footer__stripe {
  height: 3px; opacity: 0.7;
  background: repeating-linear-gradient(90deg, #dfe4e8 0 10px, #5d646b 10px 20px);
  background-size: 20px 3px; animation: stripeRun 1.6s linear infinite;
}
@keyframes stripeRun { to { background-position: 20px 0; } }
.footer__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 56px 24px 40px;
  display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px;
}
.footer__logo { font: 800 26px/1 var(--font-head); color: var(--white); }
.footer__brand p { margin: 14px 0 0; color: var(--muted); font-variant: small-caps; letter-spacing: 0.1em; }
.footer__brand .footer__muted { margin-top: 8px; color: var(--dim); font-variant: normal; letter-spacing: 0; font-size: 14px; max-width: 320px; }
.footer__col { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; font-size: 14px; }
.footer__col h4 { margin: 0 0 6px; color: var(--dim); font: 600 12px/1 var(--font); font-variant: small-caps; letter-spacing: 0.16em; }
.footer__col a { color: var(--muted); }
.footer__col a:hover { color: var(--white); }
.footer__status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.footer__bottom {
  max-width: var(--maxw); margin: 0 auto; padding: 18px 24px 26px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  border-top: 1px solid var(--line-soft); color: var(--dark); font-size: 12px;
}
.footer__bottom p { margin: 0; }
.footer__top { color: var(--muted); font-weight: 600; font-variant: small-caps; letter-spacing: 0.1em; white-space: nowrap; }
.footer__top:hover { color: var(--white); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 20; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 12px 20px; border: 1px solid var(--accent); border-radius: 4px; background: rgba(17, 20, 24, 0.95);
  color: var(--white); font-weight: 600; font-size: 14px; transition: opacity 0.25s, transform 0.25s;
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- easter egg ---------- */
.expand-flash { position: fixed; inset: 0; z-index: 30; pointer-events: none; border: 3px solid var(--white); animation: expand 1.4s ease-out forwards; }
@keyframes expand { from { clip-path: inset(48% 48%); opacity: 1; } to { clip-path: inset(0 0); opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .border-vis__stage, .faq-layout { grid-template-columns: 1fr; }
  .faq-side { position: static; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
  .stages { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 720px) {
  .nav__links { display: none; }
  .nav .btn { margin-left: auto; }
  .lore-grid, .features { grid-template-columns: 1fr; }
  .border-vis { padding: 18px; }
  .readout__big { font-size: 48px; }
  .section { padding: 80px 20px; }
  .cta { padding: 56px 22px; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .border-vis__square, .border-vis__square::before, .cta__frame, .footer__stripe, .scroll-hint span, [data-status] .chip__dot { animation: none; transition: none; }
}
