/* ============================================================================
   Rusik.CC — design system
   Dark product surface: near-black canvas, violet/cyan accent ramp, glass
   panels with a hairline gradient edge, and restrained motion. No external
   fonts or images, so the site works offline and the WebView2 launcher can
   reuse the same tokens.
   ========================================================================== */

:root {
  /* canvas */
  --bg:            #06070a;
  --bg-2:          #0a0c11;
  --bg-3:          #0e1118;

  /* glass */
  --panel:         rgba(255, 255, 255, 0.032);
  --panel-2:       rgba(255, 255, 255, 0.055);
  --line:          rgba(255, 255, 255, 0.075);
  --line-2:        rgba(255, 255, 255, 0.12);

  /* ink */
  --text:          #eef1f6;
  --muted:         #9aa4b4;
  --faint:         #626d80;

  /* accent ramp */
  --violet:        #a855f7;
  --violet-dim:    #7c3aed;
  --cyan:          #22d3ee;
  --orange:        #ff7a2f;
  --accent:        #ff7a2f;
  --accent-2:      #a855f7;

  /* semantic */
  --ok:            #34d399;
  --warn:          #fbbf24;
  --bad:           #f87171;

  --grad:          linear-gradient(135deg, #a855f7 0%, #6366f1 45%, #22d3ee 100%);
  --grad-warm:     linear-gradient(135deg, #ff7a2f 0%, #f43f5e 100%);

  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 26px;

  --shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.9);
  --glow-violet: 0 0 0 1px rgba(168, 85, 247, 0.35),
                 0 10px 40px -10px rgba(168, 85, 247, 0.55);
  --glow-cyan:   0 0 0 1px rgba(34, 211, 238, 0.35),
                 0 10px 40px -10px rgba(34, 211, 238, 0.45);

  --nav-h: 66px;
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.62 ui-sans-serif, 'Segoe UI Variable', 'Segoe UI', Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;

  /* Column layout so a short page still puts the footer on the viewport
     bottom instead of leaving a bare band of background under it. */
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; display: flex; flex-direction: column; }
.foot { flex: none; }

/* Two soft light sources and a faint grid. Fixed so they read as depth, not
   as decoration that scrolls away. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 520px at 18% -8%,  rgba(168, 85, 247, 0.20), transparent 62%),
    radial-gradient(820px 480px at 88% 4%,   rgba(34, 211, 238, 0.14), transparent 62%),
    radial-gradient(700px 520px at 50% 108%, rgba(255, 122, 47, 0.10), transparent 60%);
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 72%);
  pointer-events: none;
}

::selection { background: rgba(168, 85, 247, 0.35); color: #fff; }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: none; color: #67e8f9; }

h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; line-height: 1.15; font-weight: 700; }
h1 { font-size: clamp(34px, 5vw, 62px); }
h2 { font-size: clamp(22px, 2.6vw, 32px); }
h3 { font-size: 17px; letter-spacing: -0.01em; }
p { margin: 0; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.wrap-tight { max-width: 460px; margin: 0 auto; padding: 0 24px; }

/* ---------------------------------------------------------------- nav ---- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(6, 7, 10, 0.72);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 26px; width: 100%; }

.brand {
  /* gap must be 0: the ".CC" suffix is a bare text node, and a flex gap would
     push a space between "RUSIK" and ".CC". The mark carries its own margin. */
  display: flex; align-items: center; gap: 0;
  font-weight: 800; font-size: 16.5px; letter-spacing: -0.01em;
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand .mark {
  margin-right: 10px;
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--grad);
  box-shadow: 0 0 22px -4px rgba(168, 85, 247, 0.8);
  position: relative;
  flex: none;
}
.brand .mark::after {
  content: "";
  position: absolute; inset: 1px;
  border-radius: 7px;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.55), transparent 55%),
              linear-gradient(180deg, rgba(255,255,255,.10), transparent);
  mix-blend-mode: overlay;
}
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text;
           -webkit-text-fill-color: transparent; }

.nav-links { display: flex; align-items: center; gap: 22px; margin-left: 6px; }
.nav-links a { color: var(--muted); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.spacer { flex: 1; }

.nav-user {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 13.5px;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; color: #0b0710;
  background: var(--grad);
}

/* ------------------------------------------------------------- buttons ---- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 44px; padding: 0 22px; border: 0; border-radius: 12px;
  font: 650 14px/1 inherit; cursor: pointer; white-space: nowrap;
  color: #0a0710; background: var(--grad-warm);
  box-shadow: 0 12px 34px -12px rgba(244, 63, 94, 0.7);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); color: #0a0710;
             box-shadow: 0 16px 42px -12px rgba(244, 63, 94, 0.85); }
.btn:active { transform: translateY(0); }

.btn.primary {
  background: var(--grad); color: #08060f;
  box-shadow: 0 12px 34px -12px rgba(168, 85, 247, 0.8);
}
.btn.primary:hover { box-shadow: 0 16px 44px -12px rgba(168, 85, 247, 0.95); }

.btn.ghost {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line-2);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--panel-2); border-color: rgba(255,255,255,.2);
                   color: var(--text); box-shadow: none; }

.btn.danger { background: transparent; border: 1px solid rgba(248, 113, 113, 0.35);
              color: var(--bad); box-shadow: none; }
.btn.danger:hover { background: rgba(248, 113, 113, 0.1); color: var(--bad); }

.btn.sm { height: 34px; padding: 0 14px; font-size: 12.5px; border-radius: 9px; }
.btn.block { width: 100%; }

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ------------------------------------------------------------- surfaces ---- */

.card {
  position: relative;
  border-radius: var(--r-lg);
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.014));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
/* Hairline gradient edge, brightest at the top: reads as a lit bevel. */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg,
              rgba(255,255,255,.22) 0%,
              rgba(255,255,255,.05) 34%,
              transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
.card.flat { box-shadow: none; background: var(--panel); }
.card h2 { margin-bottom: 6px; }
.card .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }

.section { padding: 76px 0; }
.section-head { max-width: 680px; margin: 0 auto 40px; text-align: center; }
.section-head p { color: var(--muted); margin-top: 12px; font-size: 15.5px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  height: 28px; padding: 0 12px; margin-bottom: 18px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--muted);
  font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.eyebrow .live {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* ---------------------------------------------------------------- hero ---- */

.hero { padding: 84px 0 64px; position: relative; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 56px; align-items: center;
}
.hero h1 span.grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .lead {
  color: var(--muted); font-size: 17px; line-height: 1.68;
  margin: 20px 0 30px; max-width: 52ch;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note { margin-top: 18px; color: var(--faint); font-size: 12.5px; }

/* Live panel mock: the launcher preview. */
.preview {
  border-radius: var(--r-xl);
  padding: 1px;
  background: linear-gradient(150deg, rgba(168,85,247,.6), rgba(34,211,238,.28) 40%, rgba(255,255,255,.06));
  box-shadow: 0 40px 90px -40px rgba(168, 85, 247, 0.7);
}
.preview-inner {
  border-radius: calc(var(--r-xl) - 1px);
  background: linear-gradient(180deg, #0c0f16, #080a0f);
  overflow: hidden;
}
.preview-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.02);
}
.preview-bar i {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(255,255,255,.16); display: block;
}
.preview-bar i:first-child { background: rgba(248, 113, 113, .6); }
.preview-bar i:nth-child(2) { background: rgba(251, 191, 36, .6); }
.preview-bar i:nth-child(3) { background: rgba(52, 211, 153, .6); }
.preview-title { margin-left: 8px; color: var(--faint); font-size: 11.5px; }
.preview-body { padding: 18px; display: grid; gap: 10px; }
.preview-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 13px; border-radius: 11px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  font-size: 12.5px;
}
.preview-row span:first-child { color: var(--muted); }
.preview-row b { font-weight: 600; }
.preview-cta {
  margin-top: 4px; height: 42px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--grad); color: #08060f;
  font-weight: 700; font-size: 13.5px;
  box-shadow: 0 14px 34px -14px rgba(168,85,247,.9);
}

/* --------------------------------------------------------------- stats ---- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}
.stat { background: #080a0f; padding: 22px 20px; }
.stat b {
  display: block; font-size: 26px; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat span { color: var(--faint); font-size: 11.5px; letter-spacing: .07em;
             text-transform: uppercase; }

/* ------------------------------------------------------------ features ---- */

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.feature { padding: 22px; }
.feature .ico {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; margin-bottom: 14px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.28);
  color: #c4b5fd;
}
.feature .ico svg { width: 18px; height: 18px; }
.feature h3 { margin-bottom: 7px; }
.feature p { color: var(--muted); font-size: 13.5px; line-height: 1.6; }

/* --------------------------------------------------------------- steps ---- */

.steps { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.step { padding: 22px; position: relative; }
.step .num {
  font: 800 12px/1 inherit; letter-spacing: .1em;
  color: var(--cyan); margin-bottom: 12px; display: block;
}
.step h3 { margin-bottom: 7px; }
.step p { color: var(--muted); font-size: 13.5px; }

/* ---------------------------------------------------------------- plans ---- */

.plans { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.plan { padding: 24px; display: flex; flex-direction: column; }
.plan.hot { border-color: rgba(168, 85, 247, 0.4); }
.plan.hot::after {
  content: "popular";
  position: absolute; top: 16px; right: 16px;
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
  color: #d8c4ff; background: rgba(168,85,247,.16);
  border: 1px solid rgba(168,85,247,.34);
}
.plan .tag { color: var(--faint); font-size: 11.5px; letter-spacing: .1em;
             text-transform: uppercase; }
.plan .price {
  font-size: 38px; font-weight: 800; letter-spacing: -0.03em;
  margin: 10px 0 2px; font-variant-numeric: tabular-nums;
}
.plan .price small { font-size: 14px; font-weight: 500; color: var(--faint); }
.plan ul { list-style: none; margin: 18px 0 22px; padding: 0; display: grid; gap: 9px; }
.plan li { color: var(--muted); font-size: 13px; display: flex; gap: 9px; align-items: flex-start; }
.plan li::before {
  content: ""; width: 15px; height: 15px; flex: none; margin-top: 2px;
  border-radius: 50%;
  background: rgba(52, 211, 153, .14);
  border: 1px solid rgba(52, 211, 153, .4);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2334d399' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M4 8.5 6.5 11 12 5.5'/%3E%3C/svg%3E");
  background-size: 11px; background-position: center; background-repeat: no-repeat;
}
.plan .btn { margin-top: auto; }

/* ----------------------------------------------------------------- faq ---- */

.faq { display: grid; gap: 10px; max-width: 820px; margin: 0 auto; }
details.q {
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}
details.q[open] { background: var(--panel-2); border-color: var(--line-2); }
details.q summary {
  cursor: pointer; padding: 16px 18px;
  font-weight: 600; font-size: 14.5px;
  display: flex; align-items: center; gap: 12px;
  list-style: none;
}
details.q summary::-webkit-details-marker { display: none; }
details.q summary::after {
  content: "+"; margin-left: auto; color: var(--faint);
  font-size: 18px; font-weight: 400; line-height: 1;
}
details.q[open] summary::after { content: "−"; color: var(--cyan); }
details.q .a { padding: 0 18px 17px; color: var(--muted); font-size: 13.5px; line-height: 1.65; }

/* ----------------------------------------------------------------- cta ---- */

.cta-band {
  position: relative;
  border-radius: var(--r-xl);
  padding: 46px 40px;
  text-align: center;
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.28);
  background:
    radial-gradient(600px 220px at 50% 0%, rgba(168,85,247,.28), transparent 70%),
    linear-gradient(180deg, #0d0f17, #080a0f);
}
.cta-band h2 { margin-bottom: 10px; }
.cta-band p { color: var(--muted); margin-bottom: 24px; }
.cta-band .hero-actions { justify-content: center; }

/* -------------------------------------------------------------- footer ---- */

.foot {
  border-top: 1px solid var(--line);
  padding: 34px 0 44px;
  margin-top: 30px;
}
.foot .wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.foot .muted { color: var(--faint); font-size: 12.5px; }
.foot .links { display: flex; gap: 18px; margin-left: auto; }
.foot .links a { color: var(--faint); font-size: 12.5px; }
.foot .links a:hover { color: var(--text); }

/* ------------------------------------------------------------ forms ---- */

label.lbl {
  display: block; font-size: 11.5px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 7px;
}
input[type=text], input[type=password], input[type=number],
input[type=file], input[type=search], select, textarea {
  width: 100%;
  background: #080a0f;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  color: var(--text);
  padding: 12px 14px;
  font: 14px/1.4 inherit;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
input::placeholder { color: #4d5768; }
input:hover, select:hover, textarea:hover { border-color: rgba(255,255,255,.2); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(168, 85, 247, 0.6);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.16);
  background: #0a0c12;
}
.field { margin-bottom: 16px; }
.hint { color: var(--faint); font-size: 12px; margin-top: 6px; }

/* auth shell */
/* Fills whatever is left between the nav and the footer, so the card is centred
   in the free space and the footer still lands on the viewport bottom. A fixed
   min-height here would push the footer past the fold. */
.auth-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: grid; place-items: center;
  padding: 56px 0 80px;
}
.auth-card { width: 100%; max-width: 430px; padding: 30px; }
.auth-card h1 { font-size: 26px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 24px; }
.auth-foot { text-align: center; color: var(--faint); font-size: 13px; margin-top: 18px; }

/* ------------------------------------------------------------- notices ---- */

.note {
  border-radius: 11px; padding: 12px 14px;
  font-size: 13px; line-height: 1.55;
  border: 1px solid;
  margin-bottom: 16px;
}
.note.ok  { background: rgba(52,211,153,.09); border-color: rgba(52,211,153,.3); color: #a7f3d0; }
.note.bad { background: rgba(248,113,113,.09); border-color: rgba(248,113,113,.3); color: #fecaca; }
.note.info{ background: rgba(34,211,238,.08); border-color: rgba(34,211,238,.26); color: #a5f3fc; }
.note.mono {
  font-family: ui-monospace, 'Cascadia Mono', 'SF Mono', monospace;
  font-size: 12.5px; word-break: break-all; letter-spacing: .01em;
}

/* --------------------------------------------------------------- tables ---- */

.scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; color: var(--faint);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: .09em; text-transform: uppercase;
  padding: 0 12px 10px; white-space: nowrap;
}
td { padding: 12px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background .12s ease; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.022); }
.mono { font-family: ui-monospace, 'Cascadia Mono', 'SF Mono', monospace; }
.nowrap { white-space: nowrap; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase;
  border: 1px solid; white-space: nowrap;
}
.pill.ACTIVE  { color: #6ee7b7; border-color: rgba(52,211,153,.36); background: rgba(52,211,153,.1); }
.pill.UNUSED  { color: var(--muted); border-color: var(--line-2); background: rgba(255,255,255,.04); }
.pill.EXPIRED { color: #fcd34d; border-color: rgba(251,191,36,.36); background: rgba(251,191,36,.1); }
.pill.REVOKED { color: #fca5a5; border-color: rgba(248,113,113,.36); background: rgba(248,113,113,.1); }

/* ---------------------------------------------------------------- misc ---- */

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.stack { display: grid; gap: 16px; }

.page-head { padding: 44px 0 26px; }
.page-head h1 { font-size: clamp(26px, 3vw, 36px); }
.page-head p { color: var(--muted); margin-top: 8px; font-size: 14.5px; }

.dash { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.dash .card { padding: 16px 18px; }
.dash b {
  display: block; font-size: 24px; font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}
.dash span { color: var(--faint); font-size: 10.5px; letter-spacing: .09em;
             text-transform: uppercase; }
.dash .card.ok b  { color: var(--ok); }
.dash .card.warn b{ color: var(--warn); }
.dash .card.bad b { color: var(--bad); }

.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }

/* reveal on load, pure CSS, no JS dependency */
@media (prefers-reduced-motion: no-preference) {
  .hero h1, .hero .lead, .hero-actions, .preview {
    animation: rise .7s cubic-bezier(.2,.7,.2,1) both;
  }
  .hero .lead { animation-delay: .07s; }
  .hero-actions { animation-delay: .13s; }
  .preview { animation-delay: .1s; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* -------------------------------------------------------------- responsive */

/* Every single-column collapse uses minmax(0,1fr), not 1fr. A bare 1fr is
   minmax(auto,1fr), so a long unbreakable child (a hash, a key, a launcher row)
   widens the track past the viewport and the whole page clips. */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .features, .plans, .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .section { padding: 54px 0; }
  .hero { padding: 52px 0 40px; }
  .features, .plans, .steps, .grid-2, .grid-3, .grid-4, .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .nav-links { display: none; }
  .nav .wrap { gap: 12px; }
  /* Keep one call to action on a phone; two buttons plus the wordmark overflow. */
  .nav .inline .btn.ghost { display: none; }

  .cta-band { padding: 34px 22px; }
  .foot .links { margin-left: 0; }

  .hero h1 { font-size: clamp(30px, 9vw, 40px); }
  .card { padding: 18px; }
  .page-head { padding: 32px 0 20px; }
  .dash .card { padding: 14px; }
}

/* ------------------------------------------------------------ overflow ---- */

/* Grid and flex children default to min-width:auto, which means a long word,
   a hash or a nowrap cell inside them refuses to shrink and pushes the whole
   document wider than the viewport. Track sizing alone does not fix it: the
   item still overflows its track. Every layout container sets it to 0. */
html { overflow-x: hidden; }
html, body { max-width: 100%; }

.wrap, .wrap-tight { width: 100%; }

.hero-grid > *, .features > *, .plans > *, .steps > *, .stats > *, .dash > *,
.grid-2 > *, .grid-3 > *, .grid-4 > *, .stack > *, .faq > * {
  min-width: 0;
}

.card, .preview, .preview-inner, .preview-row, .stat, .feature, .plan, .step,
.note, .cta-band { min-width: 0; }

img, svg, video, canvas { max-width: 100%; height: auto; }

/* Long unbreakable tokens (keys, hashes, urls) wrap instead of widening. */
.mono, .note.mono { overflow-wrap: anywhere; }
td, th { overflow-wrap: anywhere; }
/* --------------------------------------------------------- feature ticks ---- */

/* Bullet lists inside the "modules" cards. Same check glyph as the plan cards
   so the two lists read as one system. */
.ticks { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 9px; }
.ticks li {
  display: flex; gap: 10px; align-items: flex-start;
  color: var(--muted); font-size: 13.5px; line-height: 1.55;
}
.ticks li::before {
  content: ""; width: 16px; height: 16px; flex: none; margin-top: 2px;
  border-radius: 50%;
  background-color: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.34);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2322d3ee' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M4 8.5 6.5 11 12 5.5'/%3E%3C/svg%3E");
  background-size: 11px; background-position: center; background-repeat: no-repeat;
}

/* Menu mock: the "on" state pill in the launcher preview. */
.preview-row b.on {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.32);
}
/* Menu mock footer: a quiet status line, not a second button. */
.preview-foot {
  margin-top: 2px; padding: 10px 12px; border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.11);
  color: var(--faint); font-size: 11.5px; text-align: center;
  letter-spacing: .02em;
}
/* Interactive menu replica: the rows are controls, so they need the states a
   control has, not the states a picture has. */
.preview-row { cursor: pointer; user-select: none; transition: border-color .15s, background .15s, transform .12s; }
.preview-row:hover { border-color: rgba(168,85,247,.45); background: rgba(255,255,255,.05); }
.preview-row:active { transform: scale(.995); }
.preview-row:focus-visible { outline: 2px solid rgba(168,85,247,.7); outline-offset: 2px; }
.preview-row b.off {
  color: var(--faint);
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
}
/* ------------------------------------------------------------------ menu --
 * Replica of the in-game menu, built from menu_imgui.cpp: same window chrome,
 * same left rail, same rows. It replaces the invented preview that used to sit
 * in the hero. Everything below is presentation; the behaviour is in index.html.
 */
.menu {
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, #0c0f16, #080a0f);
  border: 1px solid rgba(168,85,247,.35);
  box-shadow: 0 40px 90px -40px rgba(168, 85, 247, 0.65), inset 0 1px 0 rgba(255,255,255,.05);
}
.menu-inner { border-radius: calc(var(--r-xl) - 1px); overflow: hidden; }
.menu { display: flex; flex-direction: column; overflow: hidden; }
.menu-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.025);
}
.menu-bar i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.menu-bar i:nth-child(1) { background: rgba(248,113,113,.65); }
.menu-bar i:nth-child(2) { background: rgba(251,191,36,.65); }
.menu-bar i:nth-child(3) { background: rgba(52,211,153,.65); }
.menu-title { margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--text); letter-spacing: .01em; }
.menu-hint { margin-left: auto; font-size: 10.5px; color: var(--faint); }

.menu-main { display: grid; grid-template-columns: 128px 1fr; min-height: 396px; }
.menu-rail {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 8px; border-right: 1px solid var(--line);
  background: rgba(255,255,255,.015);
}
.menu-tab {
  text-align: left; padding: 8px 10px; border-radius: 8px;
  font-size: 12px; color: var(--muted); background: none; border: 0; cursor: pointer;
  transition: background .14s, color .14s;
}
.menu-tab:hover { background: rgba(255,255,255,.05); color: var(--text); }
.menu-tab.on { background: rgba(168,85,247,.18); color: #f3e8ff; }

.menu-page { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.menu-h { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: -.01em; }
.menu-sub { margin: -4px 0 6px; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.menu-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px; border-radius: 9px;
  border: 1px solid var(--line); background: rgba(255,255,255,.028);
  font-size: 12.5px; color: var(--muted); cursor: pointer; user-select: none;
  transition: border-color .14s, background .14s;
}
.menu-row:hover { border-color: rgba(168,85,247,.45); background: rgba(255,255,255,.05); }
.menu-row:focus-visible { outline: 2px solid rgba(168,85,247,.7); outline-offset: 2px; }
.menu-row b {
  flex: none; padding: 2px 9px; border-radius: 999px; font-size: 10px;
  font-weight: 700; letter-spacing: .06em; border: 1px solid transparent;
}
.menu-row b.on { color: #6ee7b7; background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.34); }
.menu-row b.off { color: var(--faint); background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.13); }
.menu-foot {
  padding: 9px 14px; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--faint); text-align: center;
  background: rgba(255,255,255,.015);
}
@media (max-width: 720px) {
  .menu-main { grid-template-columns: 96px 1fr; }
  .menu-hint { display: none; }
}
/* -------------------------------------------------------------- background --
 * The animated field sits behind everything and never intercepts a click, so the
 * page behaves exactly as it did before it appeared.
 */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 1;
}
body > header, body > main, body > footer { position: relative; z-index: 1; }

/* The hero lost its right-hand panel, so the copy owns the full width. */
.hero-grid.solo { grid-template-columns: minmax(0, 1fr); gap: 0; }
.hero-grid.solo > div { max-width: 760px; }

/* ---------------------------------------------------------------- reveals --
 * Elements start slightly low and transparent, then settle. Only transform and
 * opacity animate: both are compositor properties, so scrolling stays smooth on
 * machines that are already running a game.
 */
body.has-field .reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s cubic-bezier(.22,.61,.36,1); }
body.has-field .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  body.has-field .reveal { opacity: 1; transform: none; transition: none; }
  /* The field stays, it just stops moving. */
}

/* Softer hovers on the cards: the site is a shop window, not a control panel. */
.card, .tier, .faq-item { transition: border-color .2s, transform .2s, background .2s; }
.card:hover, .tier:hover { border-color: rgba(168,85,247,.4); transform: translateY(-2px); }
/* The field is bright enough to compete with body copy, so the hero text sits on
   a soft pool of darkness. The particles stay visible everywhere else. */
.hero-grid.solo > div { position: relative; }
.hero-grid.solo > div::before {
  content: "";
  position: absolute;
  inset: -48px -64px;
  z-index: -1;
  background: radial-gradient(115% 90% at 28% 42%, rgba(6,8,13,.94), rgba(6,8,13,0) 72%);
  pointer-events: none;
}
/* ------------------------------------------------------------- animation --- */
/* Reading progress: a hairline that fills as the page is read. Scaled, not
   resized, so it never triggers layout while scrolling. */
#progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 100%;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, #a855f7, #22d3ee);
  z-index: 60; pointer-events: none;
}

/* The nav gains weight once the page moves, so it stays readable over the field. */
header.nav.scrolled {
  background: rgba(8, 10, 15, .82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: rgba(255,255,255,.09);
  box-shadow: 0 10px 30px -18px rgba(0,0,0,.9);
}
header.nav { transition: background .25s, box-shadow .25s, border-color .25s; }

/* Buttons: the primary one sweeps a light band across on hover. */
.btn { transition: transform .16s, box-shadow .2s, background .2s, border-color .2s; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { position: relative; overflow: hidden; }
.btn.primary::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.28) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .6s ease;
}
.btn.primary:hover::after { transform: translateX(120%); }

/* FAQ rows open smoothly instead of snapping. */
details.q { transition: background .2s, border-color .2s; }
details.q[open] > summary { color: var(--text); }
details.q summary { transition: color .18s; }

@media (prefers-reduced-motion: reduce) {
  .btn, .btn.primary::after { transition: none; }
  .btn.primary::after { display: none; }
}