/*
  Code Claimer family — design system. This file is a copy of Shuffle Code
  Claimer's public/theme.css, the reference for every claimer's site: keep the
  two in step rather than editing the tokens here.

  Three of the four accents are the family logo's own hues, sampled from
  Shuffle Code Claimer's logo: lime 84°, amber 36°, azure 204°. The logo's versions are
  pure neon (#97e903, #faa303, #02a1f4), which is unreadable as interface
  colour, so each is held at a lower chroma and a lightness that clears 4.5:1
  on the page. The hue is what carries the brand; the chroma is what made the
  old site look cheap.

  The fourth is red, and deliberately NOT the logo's magenta. The mark can
  carry magenta; an interface cannot, because this slot has to say "live",
  "failed" and "destructive" at once, and a pink error does not read as an
  error. Red is the site's own previous value for exactly this job.

  Each accent means exactly ONE thing. Never reach for one because it looks
  nice — reach for it because of what it says:

    signal  (lime)   an action, a gain, or you
    purse   (amber)  money: code value, totals, prices
    tally   (red)    live, right now, or a place lost
    azure            information and links; also the atmosphere behind the page

  Surfaces are mixed from the page's own indigo so cards sit IN the light
  rather than on top of it. Shadows carry that hue too — pure black shadows
  are what make a dark UI look flat.

  Everything below is either a token or a utility. Pages compose utilities;
  pages do not invent colours. If you need a colour that is not here, the
  design is wrong, not the palette.
*/

/* The web fonts are linked by each page (the public pages load them without
   holding up the first paint; the fallbacks below keep that swap still). */

/* Fallbacks sized to the web fonts. Until Unbounded and Manrope arrive, the
   text is set in Arial (Windows, Mac) or Roboto (Android) scaled to the same
   width and line, so the swap does not reflow the page. Ratios measured
   against the real fonts with canvas measureText. */
@font-face { font-family: "Unbounded Fallback"; src: local("Arial Bold"), local("Arial-BoldMT"); font-weight: 500 900; size-adjust: 131%; ascent-override: 76%; descent-override: 19%; line-gap-override: 0%; }
@font-face { font-family: "Unbounded Fallback R"; src: local("Roboto Bold"), local("Roboto-Bold"); font-weight: 500 900; size-adjust: 139%; ascent-override: 72%; descent-override: 18%; line-gap-override: 0%; }
@font-face { font-family: "Manrope Fallback"; src: local("Arial"), local("ArialMT"); font-weight: 100 549; size-adjust: 103%; ascent-override: 104%; descent-override: 29%; line-gap-override: 0%; }
@font-face { font-family: "Manrope Fallback"; src: local("Arial Bold"), local("Arial-BoldMT"); font-weight: 550 900; size-adjust: 101%; ascent-override: 106%; descent-override: 30%; line-gap-override: 0%; }
@font-face { font-family: "Manrope Fallback R"; src: local("Roboto"), local("Roboto-Regular"); font-weight: 100 549; size-adjust: 104%; ascent-override: 103%; descent-override: 29%; line-gap-override: 0%; }
@font-face { font-family: "Manrope Fallback R"; src: local("Roboto Bold"), local("Roboto-Bold"); font-weight: 550 900; size-adjust: 103%; ascent-override: 104%; descent-override: 29%; line-gap-override: 0%; }

:root {
  /* ---- Ground ------------------------------------------------------- */
  --night:        #05070e;   /* the page */
  --deck:         #0a0e17;   /* cards */
  --deck-2:       #111724;   /* raised rows, hover */
  --rule:         #1a2230;   /* borders, dividers */
  --rule-strong:  #273346;

  /* ---- Ink ---------------------------------------------------------- */
  --chalk:        #e8ecf3;   /* primary text   — 15:1 on deck */
  --steel:        #98a3b6;   /* secondary text —  7:1 on deck */
  --dim:          #7a8699;   /* tertiary text  — 4.9:1 on deck */

  /* ---- Accents: one meaning each ------------------------------------ */
  --signal:       #8fd94a;   /* lime 84°   — action, gain, you */
  --signal-deep:  #3f7a1f;
  --on-signal:    #05140a;   /* ink on a filled signal button */

  --purse:        #f0ad3c;   /* amber 36°  — money */
  --purse-light:  #ffd99a;
  --bronze:       #c98f52;
  --on-purse:     #140d02;

  /* Red, not the logo's magenta. Magenta is in the mark, but as interface
     colour it has to carry "live", "failed" and "destructive", and a pink
     error does not read as an error. This is the site's own previous --red,
     and at 351° it is unambiguously red — 7.17:1 on --deck, the best of
     every candidate measured. */
  --tally:        #fb7185;   /* red — live, failed, destructive */

  --azure:        #45b3f5;   /* azure 204° — information, links */
  --azure-deep:   #0d5fa8;

  /* Atmosphere only. Never carries meaning. */
  --haze:         #1d3f82;

  /* ---- Form --------------------------------------------------------- */
  --radius-card:  1.375rem;
  --radius-ctl:   0.875rem;
  --radius-chip:  0.5rem;

  --ease-glide:   cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-fast:       0.18s var(--ease-glide);
  --t-base:       0.3s var(--ease-glide);
  --t-slow:       0.35s var(--ease-glide);

  --font:         'Manrope', 'Manrope Fallback', 'Manrope Fallback R', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Unbounded', 'Unbounded Fallback', 'Unbounded Fallback R', 'Manrope', system-ui, sans-serif;
  --mono:         'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;

  /* One z-scale. No 9999s. */
  --z-base: 0;
  --z-raised: 10;
  --z-sticky: 100;
  --z-overlay: 1000;
  --z-modal: 1100;
  --z-toast: 1200;

  /* ---- Legacy aliases -------------------------------------------------
     The pages are being migrated one at a time. These keep an un-migrated
     page rendering against the new palette instead of breaking. Delete an
     alias once nothing references it. */
  --bg:            var(--night);
  --surface:       color-mix(in oklab, var(--chalk) 3.5%, transparent);
  --surface-hover: color-mix(in oklab, var(--chalk) 7%, transparent);
  --border:        color-mix(in oklab, var(--chalk) 8%, transparent);
  --border-strong: color-mix(in oklab, var(--chalk) 16%, transparent);
  --text:          var(--chalk);
  --text-muted:    var(--steel);
  --text-dim:      var(--dim);
  --accent:        var(--signal);
  --accent-light:  color-mix(in oklab, var(--signal) 70%, var(--chalk));
  --accent-l:      var(--accent-light);
  --accent-cyan:   var(--azure);
  --accent-dim:    color-mix(in oklab, var(--signal) 14%, transparent);
  --green:         var(--signal);
  --green-bg:      color-mix(in oklab, var(--signal) 10%, transparent);
  --red:           var(--tally);
  --red-bg:        color-mix(in oklab, var(--tally) 10%, transparent);
  --yellow:        var(--purse);
  --yellow-bg:     color-mix(in oklab, var(--purse) 10%, transparent);
  --blue:          var(--azure);
  /* guide.html paints headings with --grad. Two brand hues, not the old
     purple-to-cyan wash. */
  --grad:          linear-gradient(105deg, var(--signal) 0%, var(--azure) 100%);
  --grad-soft:     linear-gradient(105deg,
                     color-mix(in oklab, var(--signal) 16%, transparent),
                     color-mix(in oklab, var(--azure) 12%, transparent));
  --r-sm: 0.5rem;  --r-md: 0.875rem;  --r-lg: 1.375rem;  --r-xl: 1.75rem;
  --shadow:    0 28px 70px -32px color-mix(in oklab, var(--haze) 55%, var(--night));
  --shadow-lg: 0 40px 96px -40px color-mix(in oklab, var(--haze) 60%, var(--night));
}

/* ====================================================================== */
/*  Base                                                                  */
/* ====================================================================== */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--night);
  color: var(--chalk);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--signal); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--chalk); }

/* Visible for keyboard users, invisible for mouse users. Non-negotiable. */
:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
  border-radius: 4px;
}

/*
  The surfaces we did not draw.

  Selection, the caret, the scrollbar and underline offset all ship with
  browser defaults that belong to no design system. Leaving them is the
  cheapest tell that a page was assembled rather than built, so they are
  themed here once and every page inherits them.
*/
::selection { background: color-mix(in oklab, var(--signal) 30%, transparent); color: var(--chalk); }
::-moz-selection { background: color-mix(in oklab, var(--signal) 30%, transparent); color: var(--chalk); }

input, textarea, select, [contenteditable] { caret-color: var(--signal); }

/* Firefox */
* { scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
/* WebKit */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--rule-strong);
  border-radius: 999px;
  border: 2px solid var(--night);   /* inset, so the thumb reads as a pill */
}
::-webkit-scrollbar-thumb:hover { background: color-mix(in oklab, var(--chalk) 26%, transparent); }
::-webkit-scrollbar-corner { background: transparent; }

/* Links that underline get room to breathe instead of striking through descenders. */
a { text-underline-offset: 0.2em; text-decoration-thickness: from-font; }

/*
  Every figure a reader compares — prices, counts, timers, table columns —
  lines up by default. Opt out deliberately, not by forgetting.
*/
table, .num, .mono, time, output, [data-nums] { font-variant-numeric: tabular-nums; }

/* Keyboard users land here first. */
.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  translate: -50% -120%;
  z-index: var(--z-toast);
  padding: 0.75rem 1.25rem;
  background: var(--signal);
  color: var(--on-signal);
  font-weight: 800;
  border-radius: 0 0 var(--radius-ctl) var(--radius-ctl);
  transition: translate var(--t-base);
}
.skip-link:focus { translate: -50% 0; }

/* ====================================================================== */
/*  Type                                                                  */
/* ====================================================================== */

/*
  Unbounded for headlines and big numbers. At display sizes the weight comes
  DOWN (700, not 800) and the tracking tightens — heavy-and-loose is what
  cheap looks like.
*/
.display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.03em;
  word-spacing: 0.05em;
  text-wrap: balance;
}
.display-xl { font-size: clamp(2.5rem, 5.6vw, 3.875rem); letter-spacing: -0.038em; }
.display-lg { font-size: clamp(1.9rem, 3.4vw, 2.375rem); letter-spacing: -0.032em; }
.display-md { font-size: 1.22rem; letter-spacing: -0.025em; }

/* Figures in tables, prices, stats and countdowns: columns must line up. */
.num { font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: -0.01em; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Body copy stops at a readable measure. */
.prose { max-width: 68ch; }
.prose p { text-wrap: pretty; }

.lede { font-size: 1.09rem; line-height: 1.68; color: var(--steel); }
.muted { color: var(--steel); }
.faint { color: var(--dim); }

/* Section eyebrow. Lowercase tracking, not a shouting all-caps pill. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--eyebrow-ink, var(--signal));
}

/* ====================================================================== */
/*  Surfaces                                                              */
/* ====================================================================== */

/*
  The card. Translucent, with the page's indigo mixed into the tint so the
  lights behind show through, a hairline border, a lit inner top edge, and a
  shadow carrying the haze hue. Set --panel-edge to colour the border.

  No backdrop-filter on cards in the page flow: with the backdrop animating,
  every card re-blurs its background every frame and scrolling stutters on
  phones. A denser tint looks the same. Real blur is kept for things that
  float over content — dialogs, popovers, fixed bars.
*/
.panel {
  position: relative;
  border-radius: var(--radius-card);
  background:
    linear-gradient(180deg,
      color-mix(in oklab, var(--chalk) 4.5%, transparent),
      color-mix(in oklab, var(--chalk) 1%, transparent)),
    color-mix(in oklab, var(--deck) 72%, color-mix(in oklab, var(--haze) 12%, transparent));
  border: 1px solid var(--panel-edge, color-mix(in oklab, var(--chalk) 8%, transparent));
  box-shadow:
    inset 0 1px 0 color-mix(in oklab, var(--chalk) 6%, transparent),
    0 28px 70px -32px color-mix(in oklab, var(--haze) 55%, var(--night));
}

/* Lighter glass for bars, chips and inputs. */
.glass {
  background:
    linear-gradient(180deg,
      color-mix(in oklab, var(--chalk) 5.5%, transparent),
      color-mix(in oklab, var(--chalk) 1.5%, transparent)),
    color-mix(in oklab, var(--deck) 58%, color-mix(in oklab, var(--haze) 10%, transparent));
  border: 1px solid color-mix(in oklab, var(--chalk) 9%, transparent);
}
.glass--float { backdrop-filter: blur(16px) saturate(1.3); }

/* A grid of glass cells split by hairlines. Each direct child is a cell. */
.tiles {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border-radius: var(--radius-card);
  background-color: color-mix(in oklab, var(--chalk) 8%, transparent);
  border: 1px solid color-mix(in oklab, var(--chalk) 8%, transparent);
}
.tiles > * {
  background-color: color-mix(in oklab, var(--deck) 80%, color-mix(in oklab, var(--haze) 10%, transparent));
}

/*
  Light along a card's top edge: a bright hairline fading out to the sides
  over a soft wash of --glow. Drawn on ::before behind the content, so text
  is never tinted. Mark the recommended plan with this, not with extra height.
*/
.edge-light { isolation: isolate; }
.edge-light::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent,
      color-mix(in oklab, var(--glow, var(--signal)) 55%, transparent), transparent)
      top center / 68% 1px no-repeat,
    radial-gradient(ellipse 75% 55% at 50% 0%,
      color-mix(in oklab, var(--glow, var(--signal)) 9%, transparent), transparent 70%);
}

/* ====================================================================== */
/*  Meaningful colour                                                     */
/* ====================================================================== */

/*
  Money that catches the light: amber with a highlight swept across it.
  drop-shadow, not text-shadow, because the fill is the background.
*/
.money {
  background-image: linear-gradient(105deg,
    var(--purse) 0%, var(--purse) 38%, var(--purse-light) 50%,
    var(--purse) 62%, color-mix(in oklab, var(--purse) 70%, var(--bronze)) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 var(--money-glow, 18px) color-mix(in oklab, var(--purse) 24%, transparent));
  animation: shimmer 9s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 15% { background-position: 100% 0; }
  65%, 100% { background-position: 0% 0; }
}

/* A headline word, lit rather than painted: lifted toward chalk at the top. */
.neon {
  background-image: linear-gradient(180deg,
    color-mix(in oklab, var(--signal) 38%, var(--chalk)), var(--signal) 72%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 20px color-mix(in oklab, var(--signal) 26%, transparent));
}

/* Both fills are backgrounds, so they vanish in forced-colours mode. */
@media (forced-colors: active) {
  .money, .neon { background: none; color: CanvasText; filter: none; }
}

/* A chip borrows its accent at low strength instead of filling with it. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-chip);
  /* 11px is the floor at which tracked caps stay legible; 0.66rem landed at
     10.56 and every chip on the site read as fine print. */
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--chip-ink, var(--signal));
  background: color-mix(in oklab, var(--chip-ink, var(--signal)) 11%, transparent);
  border: 1px solid color-mix(in oklab, var(--chip-ink, var(--signal)) 26%, transparent);
}
.chip--signal { --chip-ink: var(--signal); }
.chip--purse  { --chip-ink: var(--purse); }
.chip--tally  { --chip-ink: var(--tally); }
.chip--azure  { --chip-ink: var(--azure); }

/* The live dot. Small, soft halo — a siren is not premium.
   It takes the colour of the chip around it: a red dot inside a green
   "Connected" chip read as a warning sitting next to its own reassurance.
   Standalone (no chip), it stays red — that is the "Live" siren on the
   marketing page. */
.live-dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--chip-ink, var(--tally));
  box-shadow: 0 0 10px 2px color-mix(in oklab, var(--chip-ink, var(--tally)) 45%, transparent);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ====================================================================== */
/*  Controls                                                              */
/* ====================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;            /* 44px touch target */
  padding: 0.82rem 1.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius-ctl);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: box-shadow var(--t-base), translate var(--t-base),
              background-color var(--t-base), border-color var(--t-base);
}

/*
  One glow recipe for every filled button, so they all light up the same way:
  a lit top edge and a coloured pool underneath that grows on hover and tucks
  in when pressed.
*/
.btn--fill {
  background: var(--btn-bg, var(--signal));
  color: var(--btn-ink, var(--on-signal));
  box-shadow:
    inset 0 1px 0 color-mix(in oklab, var(--chalk) 42%, transparent),
    0 12px 32px -14px color-mix(in oklab, var(--btn-bg, var(--signal)) 62%, transparent);
}
.btn--fill:hover {
  box-shadow:
    inset 0 1px 0 color-mix(in oklab, var(--chalk) 42%, transparent),
    0 18px 44px -16px color-mix(in oklab, var(--btn-bg, var(--signal)) 80%, transparent);
}
.btn--fill:active { translate: 0 1px; }

/*
  A filled button is an <a> often enough that the global `a:hover` rule was
  repainting its label chalk — chalk on lime measures 1.5:1, so the button
  went unreadable exactly when you pointed at it. The ink is pinned across
  every link state instead.
*/
.btn--fill,
.btn--fill:hover,
.btn--fill:focus,
.btn--fill:active,
.btn--fill:visited { color: var(--btn-ink, var(--on-signal)); }

.btn--purse { --btn-bg: var(--purse); --btn-ink: var(--on-purse); }

.btn--ghost {
  background: color-mix(in oklab, var(--chalk) 4%, transparent);
  border-color: color-mix(in oklab, var(--chalk) 12%, transparent);
  color: var(--chalk);
}
.btn--ghost:hover { background: color-mix(in oklab, var(--chalk) 8%, transparent); }

/* Third tier, so a card is not always two competing buttons. */
.btn--quiet {
  padding: 0;
  min-height: 0;
  background: none;
  color: var(--signal);
  font-weight: 700;
}
.btn--quiet:hover { color: var(--chalk); }

.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  translate: none;
}

.input, .select, .textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.75rem 0.95rem;
  background: color-mix(in oklab, var(--night) 55%, transparent);
  border: 1px solid color-mix(in oklab, var(--chalk) 11%, transparent);
  border-radius: var(--radius-ctl);
  color: var(--chalk);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: color-mix(in oklab, var(--signal) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--signal) 16%, transparent);
}
.input[aria-invalid="true"] { border-color: var(--tally); }

/* Inline field error. Never window.alert(). */
.field-error {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--tally);
}

/* The same line used for a GOOD outcome ("Saved", "Session valid"). Without
   this it inherited .field-error's red and every success read as a failure. */
.field-error.field-ok { color: var(--signal); }

/* ====================================================================== */
/*  Interaction                                                           */
/* ====================================================================== */

/* A card you can click: rises, its edge brightens, it picks up a glow. */
.lift {
  transition: translate var(--t-slow), box-shadow var(--t-slow), border-color var(--t-slow);
}
/*
  The lit edge falls BELOW the card, like every other shadow on the page. A
  zero-offset halo ringing all four sides is decoration pretending to be
  depth, and it gives the light two contradictory directions at once.
*/
.lift:hover, .lift:focus-visible {
  translate: 0 -4px;
  border-color: color-mix(in oklab, var(--lift-glow, var(--signal)) 30%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in oklab, var(--chalk) 8%, transparent),
    0 34px 70px -34px color-mix(in oklab, var(--haze) 60%, var(--night)),
    0 18px 54px -30px var(--lift-glow, var(--signal));
}
.lift:active { translate: 0 -1px; transition-duration: 0.12s; }
@media (hover: none) { .lift:hover { translate: none; } }

/* A data row that answers the cursor. */
.row-hit { transition: background-color var(--t-fast); }
.row-hit:hover { background-color: color-mix(in oklab, var(--chalk) 3%, transparent); }

/* Arrow in a "more" link, nudged on hover. */
.arrow { transition: transform var(--t-base); }
a:hover .arrow, .btn:hover .arrow { transform: translateX(3px); }

/* The big hollow step numeral in a card corner. Decorative. */
.step-num {
  position: absolute;
  top: 1.15rem;
  right: 1.4rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 4.5rem;
  line-height: 0.8;
  letter-spacing: -0.045em;
  color: transparent;
  background: linear-gradient(180deg, color-mix(in oklab, var(--chalk) 8%, transparent), transparent 85%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-stroke: 1px color-mix(in oklab, var(--chalk) 11%, transparent);
  pointer-events: none;
  user-select: none;
}
@media (forced-colors: active) { .step-num { display: none; } }

/* Loading placeholder shaped like the content it replaces. Never a spinner. */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-ctl);
  background: color-mix(in oklab, var(--chalk) 6%, transparent);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent,
    color-mix(in oklab, var(--chalk) 9%, transparent), transparent);
  translate: -100% 0;
  animation: sweep 1.4s infinite;
}
@keyframes sweep { to { translate: 100% 0; } }

/* ====================================================================== */
/*  Atmosphere — the lit studio behind every public page                  */
/* ====================================================================== */

/*
  A pool of coloured light that drifts. The falloff is eased in the gradient
  itself: filter: blur would cost a full-screen blur pass per orb per frame.
  Only transform moves, so the drift runs on the compositor. Phones hold the
  light still — moving light repaints the whole screen, and the drift is too
  slow to notice on a small screen anyway.
*/
.orb {
  position: absolute;
  border-radius: 9999px;
  background: radial-gradient(circle at center,
    var(--orb-color) 0%,
    color-mix(in oklab, var(--orb-color) 62%, transparent) 22%,
    color-mix(in oklab, var(--orb-color) 32%, transparent) 40%,
    color-mix(in oklab, var(--orb-color) 12%, transparent) 56%,
    color-mix(in oklab, var(--orb-color) 3%, transparent) 68%,
    transparent 78%);
  opacity: var(--orb-opacity, 0.4);
  animation: orb-drift var(--orb-duration, 30s) ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes orb-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(var(--orb-x, 5vw), var(--orb-y, 4vh), 0) scale(1.08); }
  100% { transform: translate3d(calc(var(--orb-x, 5vw) * -0.7), calc(var(--orb-y, 4vh) * 1.4), 0) scale(0.95); }
}
@media (max-width: 40rem) { .orb { animation: none; will-change: auto; } }

/* A narrow wedge of light angled down from a top corner. */
.beam {
  position: absolute;
  top: -14%;
  width: 34rem;
  height: 128%;
  background: conic-gradient(from 168deg at 50% 0%,
    transparent 0deg,
    color-mix(in oklab, var(--beam-color, var(--chalk)) 9%, transparent) 8deg,
    color-mix(in oklab, var(--beam-color, var(--chalk)) 14%, transparent) 12deg,
    color-mix(in oklab, var(--beam-color, var(--chalk)) 9%, transparent) 16deg,
    transparent 24deg);
  mask-image: linear-gradient(to bottom, black 8%, transparent 76%);
  transform-origin: top center;
  animation: beam-sway 14s ease-in-out infinite alternate;
}
@keyframes beam-sway { from { transform: rotate(24deg); } to { transform: rotate(15deg); } }

/* The floor grid, brightest at the top of the screen and fading out. */
.floor-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in oklab, var(--signal) 4.5%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in oklab, var(--signal) 4.5%, transparent) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 85% 60% at 50% 0%, black 15%, transparent 78%);
}

/* Scan lines, like a broadcast monitor. */
.scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom,
    color-mix(in oklab, var(--chalk) 1.6%, transparent) 0 1px, transparent 1px 4px);
}

/* One tonal wash top-to-bottom, so stacked sections read as one surface. */
/*
  One tonal wash top-to-bottom, so stacked sections read as one surface. The
  vignette starts late and lands soft: pulled in any tighter it crushes the
  light pools behind it and the page goes flat black.
*/
.page-wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--haze) 9%, transparent) 0%,
      transparent 42%, color-mix(in oklab, var(--night) 52%, transparent) 100%),
    radial-gradient(ellipse at center, transparent 62%,
      color-mix(in oklab, var(--night) 58%, transparent) 100%);
}

/* The whole backdrop is decorative: aria-hidden, never interactive. */
.backdrop {
  position: absolute;
  inset: 0;
  z-index: var(--z-base);
  overflow: hidden;
  pointer-events: none;
}

/* ====================================================================== */
/*  Layout                                                                */
/* ====================================================================== */

.shell { max-width: 1200px; margin-inline: auto; padding-inline: 1.5rem; }
.shell--wide { max-width: 1440px; }
.section { padding-block: clamp(3.5rem, 7vw, 6rem); }
.stack { display: grid; gap: var(--stack, 1rem); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster, 0.875rem); }

/* Wide tables scroll in their own box rather than blowing out the page. */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* A standalone text link gets a 44px hit area on phones, without moving. */
@media (max-width: 40rem) {
  .tap {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    margin-block: calc((1lh - 2.75rem) / 2);
  }
}

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

/* ====================================================================== */
/*  Touch                                                                 */
/* ====================================================================== */

/*
  A finger needs about 44px; a mouse does not. This is gated on the POINTER,
  not the viewport, so a narrow window on a desktop keeps its compact controls
  and a large tablet still gets targets you can actually hit.
*/
@media (pointer: coarse) {
  .btn, .input, .select, .textarea { min-height: 2.75rem; }
  .chip { padding-block: 0.4rem; }
  /* Inline links in running text are exempt: they are read, not aimed at. */
  .tap, nav a, footer a { min-height: 2.75rem; display: inline-flex; align-items: center; }
  /* i18n.js injects the language switcher into every page, so it is sized here
     rather than four times over. */
  .lang-btn, .lang-item { min-height: 2.75rem; }
}

/* ====================================================================== */
/*  Motion preference                                                     */
/* ====================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
