/* ============================================================================
   ZeroDelay — design system
   ----------------------------------------------------------------------------
   Hand-authored rather than generated. The old pages were built against a
   pre-compiled Tailwind bundle, which meant any new class silently rendered as
   nothing until someone re-ran a build this repo has no toolchain for. Plain
   CSS removes that failure mode entirely.

   Written RTL-first. Every directional rule uses logical properties
   (inline-start/inline-end, not left/right) so the layout mirrors correctly
   from the single dir="rtl" on <html>, instead of being patched per element
   the way the previous markup was.

   Loaded after vendor/css/fonts.css, which supplies the Estedad and
   JetBrains Mono faces from vendor/fonts/. Nothing here reaches the network:
   the site's CSP allows 'self' only.
   ========================================================================= */

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
  /* Surfaces. A deep blue-black rather than pure #000: at this scale a true
     black flattens every shadow and makes the glass panels read as flat
     rectangles. */
  --bg:            #07080c;
  --bg-soft:       #0b0d14;
  /* Surfaces are a real step lighter than --bg, not a hair. Every raised
     element paints one of these as an opaque base with its translucent
     gradient on top.

     Two separate failures are being avoided here. A card built only from a 4%
     white overlay disappears the moment the display shifts colour, because a
     night-mode / blue-light filter compresses exactly the blue end these
     surfaces are separated by. And a surface only a hair lighter than the page
     leaves the border doing all the delineation, so the card vanishes on any
     dim or low-contrast panel even with no filter at all.

     So the separation is carried by *luminance*, which no colour filter can
     remove: --surface sits at roughly 1.3:1 against --bg, which reads as
     clearly layered while still being unmistakably a dark theme. */
  --surface:       #1b1f2c;
  --surface-2:     #242936;
  --surface-3:     #2f3546;

  /* Borders reinforce the step rather than substituting for it. */
  --line:          rgba(255, 255, 255, 0.14);
  --line-strong:   rgba(255, 255, 255, 0.22);

  --fg:            #e9edf5;
  --fg-muted:      #97a1b5;
  /* Lifted from #626c80, which measured 3.1:1 against a card - under the 4.5:1
     minimum for text this size, and this token is used on exactly the small
     labels (stat captions, field hints, table headers) where that matters
     most. This value clears 5:1 on --surface and more on the page itself. */
  --fg-dim:        #8b95a9;

  /* The brand pair, pulled back from the old #00f3ff / #bc13fe. Those are
     fully saturated display primaries: legible as a 2px border, punishing as
     body text or a large fill. These keep the identity and survive being used
     at size. */
  /* Accent hues as bare RGB triples as well as hex.
     Every rgba() in this file references these rather than repeating the
     numbers, so an art-direction layer can change the whole palette by
     redefining five variables. Without this, 63 hardcoded literals stayed the
     old colour while the tokens moved and the page came out two-toned. */
  --accent-rgb:    34, 211, 238;
  --violet-rgb:    168, 85, 247;
  --green-rgb:     52, 211, 153;
  --red-rgb:       248, 113, 113;
  --amber-rgb:     251, 191, 36;

  --cyan:          #22d3ee;
  --cyan-deep:     #0891b2;
  --violet:        #a855f7;
  --violet-deep:   #7c3aed;

  --green:         #34d399;
  --amber:         #fbbf24;
  --red:           #f87171;

  --radius-sm:     10px;
  --radius:        16px;
  --radius-lg:     22px;
  --radius-xl:     28px;

  --shadow-sm:     0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow:        0 12px 32px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg:     0 32px 64px -24px rgba(0, 0, 0, 0.75);
  --glow-cyan:     0 0 40px -10px rgba(var(--accent-rgb), 0.45);
  --glow-violet:   0 0 40px -10px rgba(var(--violet-rgb), 0.4);

  --font:          'Estedad', system-ui, sans-serif;
  /* The Persian face sits inside the mono stack on purpose. JetBrains Mono
     carries no Persian glyphs at all - measured, not assumed: "۱۱۸" comes out
     the exact same width in JetBrains Mono as in generic monospace, which is
     what a browser does when the named font supplies nothing. Every Persian
     numeral and word in a .mono or .readout was therefore falling through to
     whatever the OS calls "monospace" (Consolas on Windows), which renders
     Persian thin and mismatched.

     Fallback is resolved per glyph, so this fixes it without costing anything:
     Latin runs like "RTT / ms" still get JetBrains Mono, and Persian gets
     Estedad - the same face as the rest of the page. Estedad ships `tnum`
     (checked in its GSUB table, not assumed), so the readouts stay
     column-aligned. */
  --font-mono:     'JetBrains Mono', 'Estedad', ui-monospace, monospace;

  --nav-h:         72px;
  --container:     1200px;

  --ease:          cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* The fixed header would otherwise cover the top of every anchored section. */
  scroll-padding-top: calc(var(--nav-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; }
p  { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a  { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; padding: 0; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: rgba(var(--accent-rgb), 0.3); color: #fff; }

/* Latin runs inside Persian text — version strings, endpoints, card numbers.
   Persian is RTL and these are not, so they need their own direction or the
   punctuation drifts to the wrong end. */
.ltr  { direction: ltr; unicode-bidi: isolate; }
.mono { font-family: var(--font-mono); direction: ltr; unicode-bidi: isolate; font-feature-settings: 'tnum'; }

/* Digits that change in place — timers, balances, counters — jump around as
   glyph widths differ. Tabular figures pin the column. */
.tnum { font-variant-numeric: tabular-nums; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}
.container-wide { max-width: 1360px; }
.container-narrow { max-width: 760px; }

.section { padding-block: 96px; position: relative; }
.section-sm { padding-block: 64px; }

.stack     { display: flex; flex-direction: column; }

/* The UA rule for [hidden] is display:none at element specificity, so any
   layout class on the same element wins and the "hidden" node stays on screen.
   The page toggles visibility with el.hidden in several places, so this has to
   hold regardless of what else the element is. */
[hidden] { display: none !important; }
.row       { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wrap      { flex-wrap: wrap; }
.grow      { flex: 1 1 auto; min-width: 0; }
.gap-4  { gap: 4px; }  .gap-6  { gap: 6px; }  .gap-8  { gap: 8px; }
.gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-14 { gap: 14px; } .gap-16 { gap: 16px; }
.gap-20 { gap: 20px; } .gap-24 { gap: 24px; } .gap-32 { gap: 32px; }

.grid { display: grid; gap: 20px; }
/* minmax(0, 1fr) everywhere, never a bare 1fr: a bare fr track keeps an
   automatic minimum, so one wide child - a table with a min-width, a long
   unbroken string - stretches the track and with it the whole page, instead
   of scrolling inside its own container. */
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* auto-fit rather than fixed columns: these grids hold a variable number of
   server nodes / packages coming from the API, not a designed count. */
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-auto-sm { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.hidden { display: none !important; }
.text-center { text-align: center; }
.text-start  { text-align: start; }
.mt-auto { margin-top: auto; }
.w-full { width: 100%; }

/* ── Background atmosphere ───────────────────────────────────────────────── */
/* Fixed, behind everything, and pointer-transparent. Two soft colour fields
   plus a faint grid: enough depth that the dark surfaces read as layered
   rather than as one flat page. */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-layer::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60vw 50vh at 78% -8%,  rgba(var(--accent-rgb), 0.13), transparent 62%),
    radial-gradient(52vw 46vh at 12% 12%,  rgba(var(--violet-rgb), 0.11), transparent 60%),
    radial-gradient(70vw 60vh at 50% 108%, rgba(var(--accent-rgb), 0.06), transparent 60%);
}
.bg-layer::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 72px 72px;
  /* Fade the grid out toward the edges so it never terminates in a hard line. */
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 25%, transparent 78%);
}

.page { position: relative; z-index: 1; }

/* ── Surfaces ────────────────────────────────────────────────────────────── */
.card {
  position: relative;
  /* Gradient for depth, --surface underneath so the card never relies on
     translucency alone to be seen. */
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.014)),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.card-hover:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg), var(--glow-cyan);
}
.card-flat { background: var(--surface-2); backdrop-filter: none; -webkit-backdrop-filter: none; }
.card-sm { padding: 18px; border-radius: var(--radius); }

/* A card that needs to lead the eye — the recommended plan, the active tier.
   The gradient ring is drawn as a border-box/padding-box mask so it stays
   crisp at any radius instead of being faked with an offset box-shadow. */
.card-feature {
  border-color: transparent;
  background:
    linear-gradient(160deg, rgba(var(--accent-rgb), 0.10), rgba(var(--violet-rgb), 0.06)) padding-box,
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(160deg, rgba(var(--accent-rgb), 0.55), rgba(var(--violet-rgb), 0.35)) border-box;
  box-shadow: var(--shadow-lg), var(--glow-cyan);
}

/* ── Typography helpers ──────────────────────────────────────────────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.02em;
}
.eyebrow::before {
  content: '';
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}

/* One step lighter across the scale than the sizes alone would suggest.
   Estedad's upper weights carry noticeably more ink than the face this
   replaced, so the headings that read as emphatic at 900 in the old font
   read as shouting in this one. The sizes are unchanged; only the weight
   moved. Numeric readouts keep their 900 on purpose - there the density is
   the point. */
.h-display { font-size: clamp(34px, 5.6vw, 62px); font-weight: 800; line-height: 1.2; letter-spacing: -0.025em; }
.h1 { font-size: clamp(28px, 3.6vw, 42px); font-weight: 800; letter-spacing: -0.02em; }
.h2 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; }
.h3 { font-size: 19px; font-weight: 700; }
.h4 { font-size: 16px; font-weight: 600; }

.lead   { font-size: 17px; color: var(--fg-muted); line-height: 1.9; }
.muted  { color: var(--fg-muted); }
.dim    { color: var(--fg-dim); }
.small  { font-size: 13px; }
.tiny   { font-size: 12px; }

.grad-text {
  background: linear-gradient(100deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.text-cyan { color: var(--cyan); }
.text-violet { color: var(--violet); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-red  { color: var(--red); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: all 0.22s var(--ease);
}
.btn:hover { background: rgba(255, 255, 255, 0.09); border-color: var(--line-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn.is-loading { opacity: 0.5; pointer-events: none; }

.btn-primary {
  background: linear-gradient(100deg, var(--cyan), var(--cyan-deep));
  border-color: transparent;
  color: #04191d;
  box-shadow: var(--glow-cyan);
}
.btn-primary:hover {
  background: linear-gradient(100deg, #38dcf3, var(--cyan));
  box-shadow: 0 0 48px -8px rgba(var(--accent-rgb), 0.6);
}

.btn-violet {
  background: linear-gradient(100deg, var(--violet), var(--violet-deep));
  border-color: transparent;
  color: #fff;
  box-shadow: var(--glow-violet);
}
.btn-violet:hover { background: linear-gradient(100deg, #bb7bfa, var(--violet)); }

.btn-ghost { background: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }

.btn-danger { border-color: rgba(var(--red-rgb), 0.35); color: var(--red); background: rgba(var(--red-rgb), 0.08); }
.btn-danger:hover { background: rgba(var(--red-rgb), 0.16); }

.btn-lg { padding: 16px 32px; font-size: 15px; border-radius: 14px; }
.btn-sm { padding: 8px 15px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }

/* A spinner grafted onto whatever the button already contains, so a submitting
   button does not have to swap its label out and reflow the row. */
.btn.is-loading::after {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-inline-start-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Badges & pills ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}
/* Each badge paints its tint over an opaque dark floor rather than over
   whatever it happens to sit on, and the text is a lighter tint of the hue
   than the border. Without the floor, a violet badge on the pay-as-you-go
   card's teal gradient was two washes stacked and legible in neither. */
.badge-cyan {
  border-color: rgba(var(--accent-rgb), 0.4);
  background: linear-gradient(rgba(var(--accent-rgb), 0.16), rgba(var(--accent-rgb), 0.16)), rgba(8, 11, 17, 0.72);
  color: #7fe9fb;
}
.badge-violet {
  border-color: rgba(var(--violet-rgb), 0.45);
  background: linear-gradient(rgba(var(--violet-rgb), 0.18), rgba(var(--violet-rgb), 0.18)), rgba(8, 11, 17, 0.72);
  color: #dcb8ff;
}
.badge-green {
  border-color: rgba(var(--green-rgb), 0.4);
  background: linear-gradient(rgba(var(--green-rgb), 0.16), rgba(var(--green-rgb), 0.16)), rgba(8, 11, 17, 0.72);
  color: #7ff0c4;
}
.badge-amber {
  border-color: rgba(var(--amber-rgb), 0.4);
  background: linear-gradient(rgba(var(--amber-rgb), 0.16), rgba(var(--amber-rgb), 0.16)), rgba(8, 11, 17, 0.72);
  color: #fcd968;
}
.badge-red {
  border-color: rgba(var(--red-rgb), 0.4);
  background: linear-gradient(rgba(var(--red-rgb), 0.16), rgba(var(--red-rgb), 0.16)), rgba(8, 11, 17, 0.72);
  color: #fcb4b4;
}

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.dot-pulse { position: relative; }
.dot-pulse::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0.5;
  animation: ping 2s var(--ease-out) infinite;
}
@keyframes ping {
  0%   { transform: scale(0.7); opacity: 0.6; }
  70%, 100% { transform: scale(2.1); opacity: 0; }
}

/* ── Forms ───────────────────────────────────────────────────────────────── */
.field-group { display: flex; flex-direction: column; gap: 7px; }
.label { font-size: 13px; font-weight: 700; color: var(--fg-muted); }

.field {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--fg);
  font-size: 14.5px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field::placeholder { color: var(--fg-dim); }
.field:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}
.field:disabled { opacity: 0.55; cursor: not-allowed; }
.field.is-invalid { border-color: rgba(var(--red-rgb), 0.6); }
textarea.field { resize: vertical; min-height: 88px; line-height: 1.8; }
select.field { appearance: none; cursor: pointer; }

.field-hint  { font-size: 12px; color: var(--fg-dim); }
.field-error { font-size: 12px; color: var(--red); }

/* Segmented control — the packages/pay-as-you-go switch, and the auth
   login/register switch. One shared component so both read as the same idea. */
.segment {
  display: inline-flex;
  padding: 5px;
  gap: 4px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
}
.segment-btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--fg-muted);
  transition: all 0.22s var(--ease);
  white-space: nowrap;
}
.segment-btn:hover { color: var(--fg); }
.segment-btn.is-active {
  background: linear-gradient(100deg, var(--cyan), var(--cyan-deep));
  color: #04191d;
  box-shadow: var(--glow-cyan);
}

/* Points at an option the eye would otherwise slide past. It breathes for a
   few cycles and then holds a static ring, because an animation that never
   stops stops being read as a signal. The cue is dropped the moment either
   tab is clicked - by then it has done its job and is just noise. */
.segment-btn.is-cue {
  color: var(--fg);
  box-shadow: inset 0 0 0 1px rgba(var(--violet-rgb), 0.55);
  animation: segment-cue 2.4s var(--ease-out) 3;
}
.segment-btn.is-cue:hover { box-shadow: inset 0 0 0 1px rgba(var(--violet-rgb), 0.8); }
.segment-btn.is-cue.is-active { box-shadow: var(--glow-cyan); animation: none; }
@keyframes segment-cue {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(var(--violet-rgb), 0.5); }
  50%      { box-shadow: inset 0 0 0 1px rgba(var(--violet-rgb), 0.95),
                         0 0 20px -6px rgba(var(--violet-rgb), 0.75); }
}
@media (prefers-reduced-motion: reduce) {
  .segment-btn.is-cue { animation: none; }
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 60;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  border-block-end: 1px solid transparent;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s var(--ease);
}
/* Transparent over the hero, solid once the page moves. The class is toggled
   from JS on scroll. */
.site-header.is-stuck {
  background: rgba(7, 8, 12, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-block-end-color: var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--cyan), var(--violet));
  color: #04191d;
  font-size: 19px;
  box-shadow: var(--glow-cyan);
}
/* The logo artwork carries its own dark rounded plate, so the gradient tile
   behind it would show as a bright rim. When the mark holds an image it
   becomes a plain frame and lets the artwork be the logo. */
.brand-mark:has(img) {
  background: none;
  box-shadow: none;
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; border-radius: 11px; }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.brand-sub  { font-size: 11px; color: var(--fg-dim); line-height: 1.2; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-muted);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-link:hover { color: var(--fg); background: rgba(255, 255, 255, 0.06); }
.nav-link.is-active { color: var(--cyan); }

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border-radius: 11px;
  border: 1px solid var(--line);
  color: var(--fg-muted);
  place-items: center;
  font-size: 17px;
}

.mobile-menu {
  position: fixed;
  inset-block-start: var(--nav-h);
  inset-inline: 0;
  z-index: 55;
  padding: 18px 20px 24px;
  background: rgba(7, 8, 12, 0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-block-end: 1px solid var(--line);
  display: none;
  flex-direction: column;
  gap: 6px;
}
.mobile-menu.is-open { display: flex; }
.mobile-menu .nav-link { padding: 13px 14px; font-size: 15px; }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  padding-block: calc(var(--nav-h) + 72px) 88px;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-block-start: 34px;
}
.stat-tile {
  padding: 16px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  /* Opaque, and darker than the card it sits in, so the tile reads as inset
     rather than as a slightly different shade of the same nothing. */
  background: rgba(0, 0, 0, 0.28);
  text-align: center;
}
.stat-value { font-size: 26px; font-weight: 900; line-height: 1.1; letter-spacing: -0.02em; }
.stat-label { font-size: 12px; color: var(--fg-dim); margin-block-start: 5px; }

/* ── Live connection panel (hero right) ──────────────────────────────────── */
.console {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.014)),
    var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.console-head {
  padding: 15px 20px;
  border-block-end: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
}
.console-body { padding: 22px 20px; }

.meter { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.meter-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  transition: width 0.7s var(--ease-out);
}
.meter-green .meter-fill { background: linear-gradient(90deg, var(--green), var(--cyan)); }
.meter-amber .meter-fill { background: linear-gradient(90deg, var(--amber), #f97316); }
.meter-red   .meter-fill { background: linear-gradient(90deg, var(--red), #dc2626); }

/* Ping bars — a small sparkline of recent latency samples. */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 42px; }
.spark-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--cyan), rgba(var(--accent-rgb), 0.18));
  transition: height 0.5s var(--ease-out);
  min-height: 3px;
}

/* ── Feature cards ───────────────────────────────────────────────────────── */
.feature-icon {
  width: 50px; height: 50px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 20px;
  margin-block-end: 18px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
}
.feature-icon.is-cyan   { color: var(--cyan);   border-color: rgba(var(--accent-rgb), 0.3);  background: rgba(var(--accent-rgb), 0.1); }
.feature-icon.is-violet { color: var(--violet); border-color: rgba(var(--violet-rgb), 0.3);  background: rgba(var(--violet-rgb), 0.1); }
.feature-icon.is-green  { color: var(--green);  border-color: rgba(var(--green-rgb), 0.3);  background: rgba(var(--green-rgb), 0.1); }
.feature-icon.is-amber  { color: var(--amber);  border-color: rgba(var(--amber-rgb), 0.3);  background: rgba(var(--amber-rgb), 0.1); }

/* ── Pricing ─────────────────────────────────────────────────────────────── */
.plan { display: flex; flex-direction: column; height: 100%; }
.plan-price { display: flex; align-items: baseline; gap: 7px; margin-block: 14px 6px; }
.plan-amount { font-size: 34px; font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.plan-unit  { font-size: 13px; color: var(--fg-muted); }
.plan-was   { font-size: 13px; color: var(--fg-dim); text-decoration: line-through; }

.plan-features { display: flex; flex-direction: column; gap: 12px; margin-block: 22px; flex: 1; }
.plan-feature { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--fg-muted); }
.plan-feature i { color: var(--cyan); font-size: 12px; margin-block-start: 6px; flex: none; }

.plan-ribbon {
  position: absolute;
  inset-block-start: -12px;
  inset-inline-start: 50%;
  transform: translateX(50%);
  padding: 5px 16px;
  border-radius: 999px;
  background: linear-gradient(100deg, var(--cyan), var(--violet));
  color: #04191d;
  font-size: 12px;
  font-weight: 800;
  box-shadow: var(--glow-cyan);
  white-space: nowrap;
}

/* The pay-as-you-go calculator: a slider that turns toman into playable hours
   before anyone has to sign up. */
.calc-output {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-block-start: 22px;
}
.calc-cell {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.42);
  text-align: center;
}
.calc-value { font-size: 27px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.15; }
.calc-label { font-size: 12px; color: var(--fg-dim); margin-block-start: 4px; }

input[type='range'] {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}
input[type='range']::-webkit-slider-thumb {
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--cyan), var(--cyan-deep));
  border: 3px solid var(--bg);
  box-shadow: var(--glow-cyan);
  cursor: grab;
}
input[type='range']::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--cyan);
  border: 3px solid var(--bg);
  cursor: grab;
}

/* Amount presets on the top-up form. */
.chip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.chip {
  padding: 14px 12px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
  transition: all 0.2s var(--ease);
}
.chip:hover { border-color: rgba(var(--accent-rgb), 0.4); background: rgba(var(--accent-rgb), 0.07); }
.chip.is-active {
  border-color: var(--cyan);
  background: rgba(var(--accent-rgb), 0.13);
  box-shadow: var(--glow-cyan);
}
.chip-amount { font-size: 16px; font-weight: 800; }
.chip-note { font-size: 11.5px; color: var(--fg-dim); margin-block-start: 3px; }

/* ── Marquee (supported games) ───────────────────────────────────────────── */
.marquee { overflow: hidden; position: relative; }
.marquee::before, .marquee::after {
  content: '';
  position: absolute;
  inset-block: 0;
  width: 120px;
  z-index: 2;
  pointer-events: none;
}
.marquee::before { inset-inline-start: 0; background: linear-gradient(to inline-end, var(--bg), transparent); }
.marquee::after  { inset-inline-end: 0;  background: linear-gradient(to inline-start, var(--bg), transparent); }

.marquee-track {
  display: flex;
  gap: 14px;
  width: max-content;
  /* The track holds the item list twice; translating by exactly -50% lands on
     the start of the duplicate, so the loop has no visible seam. */
  animation: marquee 42s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
/* RTL flips the visual direction of the same translate, so the reverse track
   needs its own keyframes rather than a negated duration. */
[dir='rtl'] .marquee-track { animation-name: marquee-rtl; }
@keyframes marquee-rtl { from { transform: translateX(0); } to { transform: translateX(50%); } }

.game-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}
.game-chip:hover { border-color: rgba(var(--accent-rgb), 0.35); background: rgba(var(--accent-rgb), 0.07); }
.game-chip i { color: var(--cyan); font-size: 15px; }

/* ── Server / node list ──────────────────────────────────────────────────── */
.node {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.2s var(--ease);
}
.node:hover { border-color: rgba(var(--accent-rgb), 0.3); background: rgba(var(--accent-rgb), 0.05); }

/* Country code plate. Stands in for a flag: Windows has no flag emoji, so the
   glyph degrades to these same two letters anyway - drawn on purpose it is
   consistent everywhere instead of looking like a font failure. */
.node-code {
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  background: linear-gradient(150deg, rgba(var(--accent-rgb), 0.16), rgba(var(--violet-rgb), 0.1));
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* ── FAQ ─────────────────────────────────────────────────────────────────── */
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
  transition: border-color 0.2s var(--ease);
}
.faq-item[open] { border-color: rgba(var(--accent-rgb), 0.28); }
.faq-q {
  padding: 18px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  list-style: none;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: '\f078';                 /* fa-chevron-down */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 12px;
  color: var(--cyan);
  transition: transform 0.25s var(--ease);
  flex: none;
}
.faq-item[open] .faq-q::after { transform: rotate(180deg); }
.faq-a { padding: 0 20px 20px; color: var(--fg-muted); font-size: 14px; line-height: 1.95; }

/* ── Steps ───────────────────────────────────────────────────────────────── */
/* The number and the text it introduces are two separate things; at a 14px gap
   they read as one crowded block. This also stops the box from squashing when
   the heading beside it wraps. */
.step-row { display: flex; align-items: flex-start; gap: 20px; }
.step-row > div { min-width: 0; }

.step-num {
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--cyan);
  font-weight: 800;
  font-size: 15px;
  flex: none;
}

/* Progress rail on the payment page. */
.steps { display: flex; align-items: center; gap: 0; }
.steps .step { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--fg-dim); }
.steps .step-dot {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-size: 12px;
  flex: none;
}
.steps .step.is-active { color: var(--cyan); }
.steps .step.is-active .step-dot { border-color: var(--cyan); background: rgba(var(--accent-rgb), 0.14); }
.steps .step.is-done { color: var(--green); }
.steps .step.is-done .step-dot { border-color: var(--green); background: rgba(var(--green-rgb), 0.14); }
.steps .step-line { flex: 1; height: 1px; background: var(--line-strong); margin-inline: 12px; min-width: 20px; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 520px; }
/* For tables that live in a half-width card. Without this the ledger scrolls
   sideways inside its own panel on an ordinary desktop, which reads as broken
   rather than as a deliberate overflow affordance. */
.table-compact { min-width: 380px; font-size: 13px; }
.table-compact th, .table-compact td { padding: 11px 12px; }
.table th {
  padding: 13px 16px;
  text-align: start;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--fg-dim);
  background: rgba(255, 255, 255, 0.03);
  border-block-end: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 14px 16px; border-block-end: 1px solid var(--line); }
.table tr:last-child td { border-block-end: none; }
.table tbody tr { transition: background 0.15s var(--ease); }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

/* ── Dashboard shell ─────────────────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  padding-block: calc(var(--nav-h) + 32px) 64px;
}
.side-nav {
  /* A grid item still contributes its min-content width to the track even with
     overflow-x: auto - so once this rail turns horizontal on narrow screens,
     its non-wrapping links would push the whole page wider than the viewport.
     min-width: 0 lets the track ignore that and the rail scroll on its own. */
  min-width: 0;
  position: sticky;
  inset-block-start: calc(var(--nav-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-muted);
  transition: all 0.2s var(--ease);
}
.side-link i { width: 18px; text-align: center; font-size: 15px; flex: none; }
.side-link:hover { background: rgba(255, 255, 255, 0.06); color: var(--fg); }
.side-link.is-active {
  background: linear-gradient(100deg, rgba(var(--accent-rgb), 0.16), rgba(var(--accent-rgb), 0.04));
  color: var(--cyan);
  /* Marks the active item on the side the reader's eye starts from. */
  box-shadow: inset 3px 0 0 var(--cyan);
}
[dir='rtl'] .side-link.is-active { box-shadow: inset -3px 0 0 var(--cyan); }

.panel { display: none; }
.panel.is-active { display: block; animation: fade-up 0.35s var(--ease-out); }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ── Toasts ──────────────────────────────────────────────────────────────── */
.toast-host {
  position: fixed;
  inset-block-end: 24px;
  inset-inline-end: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: min(380px, calc(100vw - 40px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px 17px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(15, 18, 25, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 600;
  pointer-events: auto;
  animation: toast-in 0.32s var(--ease-out);
}
.toast i { margin-block-start: 3px; flex: none; }
.toast.is-out { animation: toast-out 0.25s var(--ease) forwards; }
.toast-ok    { border-color: rgba(var(--green-rgb), 0.4); }
.toast-ok i  { color: var(--green); }
.toast-err   { border-color: rgba(var(--red-rgb), 0.4); }
.toast-err i { color: var(--red); }
.toast-info i { color: var(--cyan); }

@keyframes toast-in  { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(0.97); } }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 150; display: none; }
.modal.is-open { display: block; }
.modal-veil {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 7, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade 0.22s var(--ease);
}
.modal-box {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  animation: modal-in 0.3s var(--ease-out);
}
/* translate(-50%) moves toward the inline start in LTR and the inline end in
   RTL, so the sign has to flip with the direction. */
[dir='rtl'] .modal-box { transform: translate(50%, -50%); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; } to { opacity: 1; } }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  border-block-start: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  padding-block: 52px 30px;
  margin-block-start: 60px;
}
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 36px; }
.footer-title { font-size: 14px; font-weight: 700; margin-block-end: 14px; }
.footer-link { display: block; font-size: 13.5px; color: var(--fg-muted); padding-block: 5px; transition: color 0.2s var(--ease); }
.footer-link:hover { color: var(--cyan); }

/* ── Links that sit inside a sentence ────────────────────────────────────── */
/* .footer-link is display:block because the footer stacks it, so it cannot be
   reused mid-paragraph: three breadcrumbs become three lines. These two are
   the inline counterparts, used by the generated /games pages and by any
   prose link on the hand-written ones. */
.link-inline {
  color: var(--cyan);
  border-block-end: 1px solid rgba(var(--accent-rgb), 0.35);
  transition: border-color 0.2s var(--ease);
}
.link-inline:hover { border-block-end-color: var(--cyan); }

.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--fg-dim);
}
.crumb a { color: var(--fg-muted); transition: color 0.2s var(--ease); }
.crumb a:hover { color: var(--cyan); }
.footer-bottom {
  margin-block-start: 40px;
  padding-block-start: 22px;
  border-block-start: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--fg-dim);
}
.social {
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid var(--line);
  color: var(--fg-muted);
  transition: all 0.2s var(--ease);
}
.social:hover { color: var(--cyan); border-color: rgba(var(--accent-rgb), 0.4); background: rgba(var(--accent-rgb), 0.08); }

/* ── Skeletons ───────────────────────────────────────────────────────────── */
.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--fg-dim);
}
.empty i { font-size: 34px; opacity: 0.35; margin-block-end: 14px; display: block; }

/* ── Scroll reveal ───────────────────────────────────────────────────────── */
/* Replaces the AOS library. One IntersectionObserver in app.js adds .is-in. */
.reveal {
  opacity: 0;
  transform: translateY(24px) scale(0.985);
  transition: opacity 0.48s var(--ease-out), transform 0.48s var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; will-change: auto; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  /* minmax(0, 1fr), not 1fr: a bare 1fr track has an automatic minimum, which
     lets a wide child (the ledger table, the horizontal nav rail) stretch it
     past the viewport instead of scrolling inside it. */
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .side-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    /* The active item's inset shadow is on the inline edge, which reads as an
       underline once the rail is horizontal. Move it to the bottom. */
    padding: 8px;
  }
  .side-nav .side-link { white-space: nowrap; }
  .side-link.is-active, [dir='rtl'] .side-link.is-active { box-shadow: inset 0 -3px 0 var(--cyan); }
}

@media (max-width: 768px) {
  .section { padding-block: 64px; }
  .nav-links { display: none; }
  .nav-toggle { display: grid; }
  /* The mobile menu already carries these two, and three controls plus a
     two-line brand does not fit a 375px header. */
  .header-cta { display: none; }
  .brand-name { font-size: 17px; }
  .brand-sub { display: none; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-block: calc(var(--nav-h) + 44px) 60px; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-value { font-size: 21px; }
  .toast-host { inset-inline: 16px; inset-block-end: 16px; max-width: none; }
  .calc-output { grid-template-columns: minmax(0, 1fr); }
  .marquee::before, .marquee::after { width: 56px; }
}

@media (max-width: 560px) {
  .grid-2, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 20px; }
  .steps .step span:not(.step-dot) { display: none; }
}

/* Honour the OS setting. Everything here is decoration; none of it carries
   meaning that is lost when it stops moving. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
