/* internal/web/static/style.css
 * 123infra beta portal. Values from the brand kit (123infra-marketing
 * brand/tokens.css and brand/templates/ui-style-guide) and the surfaces of
 * the landing page - mesh and grid backdrop, glass panels, mono eyebrows -
 * copied in as values. Nothing here is fetched from anywhere but this binary
 * (AGENTS.md law 10, WP7.1).
 *
 * Every text/background pairing is listed in contrast_test.go, which parses
 * the `--name: #rrggbb;` lines below: keep one color token per line.
 *
 * No @import. No url() except /static/fonts/*.ttf. No data: URIs (the CSP's
 * img-src is 'self'). Motion is decoration: everything is legible at rest,
 * and prefers-reduced-motion turns all of it off (WP7.3).
 */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/static/fonts/inter-400.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/static/fonts/inter-600.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/static/fonts/inter-700.ttf') format('truetype'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 800; font-display: swap; src: url('/static/fonts/inter-800.ttf') format('truetype'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/static/fonts/jetbrains-mono-500.ttf') format('truetype'); }

/* A registered property can be animated, which is what lets the current
   key share's ring rotate; browsers without @property just show it still. */
@property --spin {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

/* How much of the done page's ring is showing. Registered, so the mask that
   reveals it can animate; it rests at a full turn, so without JavaScript, or
   in a browser without @property, the ring is simply all there. */
@property --sweep {
  syntax: '<angle>';
  inherits: false;
  initial-value: 360deg;
}

:root {
  --color-bg: #06080c;
  --color-base: #0b0f16;
  --color-surface: #0b1220;
  --color-surface-raised: #141d2d;
  --color-panel: #0e1420;
  --border-subtle: #1e293b;
  --border-strong: #64748b;

  --text-primary: #e8edf4;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-quiet: #7f8ea6;

  --color-emerald: #34d399;
  --color-mint: #6ee7b7;
  --color-cyan: #22d3ee;
  --color-purple: #a78bfa;
  --color-amber: #fbbf24;
  --color-error: #f87171;
  --on-color-text: #06080c;

  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --brand-gradient: linear-gradient(135deg, var(--color-emerald), var(--color-cyan));
  --glass: linear-gradient(180deg, rgba(20, 28, 43, 0.84), rgba(11, 16, 26, 0.84));

  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 14px;
  --radius-lg: 20px;
  --focus-ring: 0 0 0 3px rgba(34, 211, 238, 0.55);
  --shell: 46rem;

  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--text-primary);
  font: 400 1rem/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
  isolation: isolate;
}

/* The landing page's hero ground, held still behind every page: three soft
   colour fields that drift, and a hairline grid fading out from the top. */
body::before {
  content: "";
  position: fixed;
  inset: -12%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(38% 34% at 16% 10%, rgba(52, 211, 153, 0.11), transparent 70%),
    radial-gradient(34% 30% at 86% 6%, rgba(34, 211, 238, 0.08), transparent 70%),
    radial-gradient(44% 40% at 62% 104%, rgba(167, 139, 250, 0.07), transparent 70%);
  animation: drift 28s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  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;
  -webkit-mask-image: radial-gradient(ellipse 75% 55% at 50% 0%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 75% 55% at 50% 0%, #000 20%, transparent 75%);
}

h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0 0 1rem; }
img, svg { max-width: 100%; }

a { color: var(--color-cyan); text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--color-mint); }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }

::selection { background: var(--color-emerald); color: var(--on-color-text); }

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

/* Hidden until app.js runs. Specific enough to beat .btn's display, so a
   JavaScript-only control never shows to someone who cannot use it. */
html:not(.js) .js-only { display: none; }

.ico { width: 1.25rem; height: 1.25rem; flex: none; display: inline-block; vertical-align: middle; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  background: var(--color-emerald);
  color: var(--on-color-text);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; color: var(--on-color-text); }

/* ---- top bar ------------------------------------------------------------- */
.topbar {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.25rem max(1rem, env(safe-area-inset-left, 0px)) 0.5rem;
  padding-inline: clamp(1rem, 4vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -0.015em;
}
.brand:hover { color: var(--text-primary); }
.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 9px;
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.28);
}
.brand-tag {
  font: 700 0.64rem/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-emerald);
  padding: 0.34rem 0.55rem;
  border: 1px solid rgba(52, 211, 153, 0.32);
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.09);
}

.topbar-note {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: 500 0.75rem/1 var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}

.pulse {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--color-emerald);
  box-shadow: 0 0 10px var(--color-emerald);
  animation: blink 2.4s ease-in-out infinite;
}

/* ---- shell ----------------------------------------------------------------- */
.shell {
  flex: 1;
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding-block: 1.5rem 3rem;
  padding-inline: max(1rem, env(safe-area-inset-left, 0px));
}

/* ---- key-share gauge (D12, WP7.2) -------------------------------------------
   Text first - "2 of 5 key shares" - and the gems as the second channel. */
.shares { margin: 0 0 2.25rem; }

.shares-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.9rem;
  font-family: var(--font-mono);
}
.shares-title {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.shares-count { font-size: 0.78rem; color: var(--text-tertiary); }
.shares-count strong { color: var(--color-emerald); font-weight: 500; }

.shares-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  position: relative;
}

/* The rail runs between the first and last gem centres; the lit part runs
   from the first gem to the share this page is earning. */
.shares-track::before,
.shares-track::after {
  content: "";
  position: absolute;
  top: 1.45rem;
  height: 2px;
  border-radius: 2px;
  pointer-events: none;
}
.shares-track::before { left: 10%; right: 10%; background: var(--line-strong); }
.shares-track::after {
  left: 10%;
  width: 0;
  background: var(--brand-gradient);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.55);
  transition: width 0.9s var(--ease-out);
}
.shares-track[data-shares-done="1"]::after { width: 20%; }
.shares-track[data-shares-done="2"]::after { width: 40%; }
.shares-track[data-shares-done="3"]::after { width: 60%; }
.shares-track[data-shares-done="4"]::after,
.shares-track[data-shares-done="5"]::after { width: 80%; }
.shares-track[data-shares-total="1"]::before,
.shares-track[data-shares-total="1"]::after { display: none; }

.share {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  position: relative;
  z-index: 1;
  min-width: 0;
}

/* A gem is a rounded square turned 45 degrees - a key bit - with its icon
   turned back upright. */
.share-gem {
  position: relative;
  width: 2.1rem;
  height: 2.1rem;
  margin-top: 0.4rem;
  display: grid;
  place-items: center;
  border-radius: 9px;
  transform: rotate(45deg);
  background: var(--color-base);
  border: 1px solid var(--line-strong);
  color: var(--text-quiet);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s;
}
.share-gem .ico { width: 1rem; height: 1rem; transform: rotate(-45deg); }

.share-label {
  font: 500 0.66rem/1.2 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-quiet);
  text-align: center;
  overflow-wrap: anywhere;
}

.share.is-done .share-gem {
  background: var(--brand-gradient);
  border-color: transparent;
  color: var(--on-color-text);
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.4);
}
.share.is-done .share-label { color: var(--text-secondary); }

.share.is-current .share-gem {
  background: var(--color-surface);
  border-color: transparent;
  color: var(--color-cyan);
  box-shadow: 0 0 22px rgba(34, 211, 238, 0.3);
}
.share.is-current .share-gem::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 11px;
  padding: 2px;
  background: conic-gradient(from var(--spin), var(--color-emerald), var(--color-cyan), rgba(34, 211, 238, 0.1), var(--color-emerald));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spin 3.2s linear infinite;
}
.share.is-current .share-label { color: var(--color-cyan); }

/* Set by app.js on a share earned since the last page: the gem lands. */
.share.is-forged .share-gem { animation: forge 0.9s var(--ease-out) both; }

/* ---- page head ------------------------------------------------------------ */
.step-head { margin: 0 0 1.5rem; }
.step-head--center { text-align: center; display: flex; flex-direction: column; align-items: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.1rem;
  padding: 0.38rem 0.8rem;
  font: 500 0.68rem/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-emerald);
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.08);
}
.eyebrow .ico { width: 0.9rem; height: 0.9rem; }
.eyebrow--muted { color: var(--text-tertiary); border-color: var(--line-strong); background: rgba(255, 255, 255, 0.03); }

h1 {
  font-size: clamp(2.05rem, 1.35rem + 3vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.032em;
  line-height: 1.08;
  margin: 0 0 1rem;
}

.grad {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 40rem;
  margin: 0 0 1.75rem;
  text-wrap: pretty;
}
.lead strong { color: var(--text-primary); font-weight: 600; }

.hint { font-size: 0.875rem; color: var(--text-tertiary); margin: 1rem 0 0; }

.section-title {
  margin: 2.75rem 0 1rem;
  font: 500 0.7rem/1 var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---- panels ------------------------------------------------------------------ */
.panel {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3.6vw, 2rem);
  margin: 0 0 1.25rem;
  box-shadow: 0 30px 80px -42px rgba(0, 0, 0, 0.85);
}

/* The landing page's lit edge: a 1px gradient border, brightest top-left. */
.panel--glow::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, rgba(52, 211, 153, 0.5), rgba(34, 211, 238, 0.16) 38%, transparent 62%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.panel--center { text-align: center; }
.panel--center .btn { margin-top: 0.5rem; }

.panel-kicker {
  margin: 0 0 1.1rem;
  font: 500 0.7rem/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-emerald);
}

/* ---- buttons (ui-style-guide: primary, secondary, ghost) ------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 2.9rem;
  padding: 0.75rem 1.35rem;
  font: 700 0.975rem/1.2 var(--font-sans);
  letter-spacing: -0.005em;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover { text-decoration: none; }
.btn .ico { width: 1.15rem; height: 1.15rem; }
.btn-lg { min-height: 3.35rem; padding: 0.9rem 1.7rem; font-size: 1.04rem; border-radius: 14px; }
.btn-sm { min-height: 2.3rem; padding: 0.45rem 0.9rem; font-size: 0.85rem; }
.btn-block { display: flex; width: 100%; }

.btn-primary {
  background: var(--brand-gradient);
  color: var(--on-color-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 10px 30px -12px rgba(52, 211, 153, 0.65);
}
/* A sheen crosses the button on hover. */
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.5) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.75s var(--ease-out);
}
.btn-primary:hover {
  color: var(--on-color-text);
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 18px 40px -14px rgba(34, 211, 238, 0.7);
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-primary:active { transform: translateY(0) scale(0.985); }

.btn-secondary {
  background: rgba(20, 29, 45, 0.72);
  color: var(--text-primary);
  border-color: var(--line-strong);
}
.btn-secondary:hover { color: var(--text-primary); border-color: rgba(52, 211, 153, 0.6); background: rgba(20, 29, 45, 0.95); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.05); }

/* Trailing arrows nudge forward on hover. */
.btn .ico:last-child:not(:first-child) { transition: transform 0.2s var(--ease); }
.btn:hover .ico:last-child:not(:first-child) { transform: translateX(3px); }

.btn:focus-visible { box-shadow: var(--focus-ring); border-radius: 12px; }

/* Set by app.js while a form is on its way: the label says what is
   happening and a spinner stands in for the leading icon. */
.btn.is-busy { pointer-events: none; }
.btn.is-busy .ico { display: none; }
.btn.is-busy::before {
  content: "";
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin-plain 0.8s linear infinite;
  flex: none;
}

.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.25rem; margin: 0.5rem 0 0; }
.cta-note { margin: 0; font: 500 0.78rem/1.4 var(--font-mono); color: var(--text-tertiary); }

/* ---- chips --------------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.3rem 0.62rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-tertiary);
  font: 500 0.7rem/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip::before { content: ""; width: 0.42rem; height: 0.42rem; border-radius: 50%; background: currentColor; flex: none; }
.chip--plain::before { display: none; }
.chip--ok { color: var(--color-emerald); border-color: rgba(52, 211, 153, 0.38); background: rgba(52, 211, 153, 0.09); }
.chip--act { color: var(--color-amber); border-color: rgba(251, 191, 36, 0.42); background: rgba(251, 191, 36, 0.09); }
.chip--act::before { animation: blink 1.2s ease-in-out infinite; }
.chip--bad { color: var(--color-error); border-color: rgba(248, 113, 113, 0.42); background: rgba(248, 113, 113, 0.09); }
.chip--wait::before { animation: blink 1.6s ease-in-out infinite; }
.chip--req { color: var(--color-emerald); border-color: rgba(52, 211, 153, 0.38); }

/* ---- messages --------------------------------------------------------------------- */
.toast, .error-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.5rem;
  padding: 0.85rem 1.05rem;
  border-radius: var(--radius);
  font-weight: 600;
}
.toast .ico, .error-banner .ico { width: 1.35rem; height: 1.35rem; }
.toast { border: 1px solid rgba(52, 211, 153, 0.38); background: linear-gradient(90deg, rgba(52, 211, 153, 0.13), rgba(34, 211, 238, 0.04)); }
.toast .ico { color: var(--color-emerald); }
.error-banner { border: 1px solid rgba(248, 113, 113, 0.45); background: rgba(248, 113, 113, 0.08); }
.error-banner .ico { color: var(--color-error); }

/* ---- welcome: the briefing ------------------------------------------------------ */
.quest { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; gap: 0.6rem; }
.quest-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(14, 20, 32, 0.8);
  transition: border-color 0.25s, transform 0.25s var(--ease-out), background-color 0.25s;
}
.quest-item:hover { border-color: rgba(52, 211, 153, 0.35); transform: translateX(4px); background: rgba(14, 20, 32, 0.85); }
.quest-gem {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--color-emerald);
  background: linear-gradient(160deg, rgba(52, 211, 153, 0.16), rgba(34, 211, 238, 0.05));
  border: 1px solid rgba(52, 211, 153, 0.24);
}
.quest-text { min-width: 0; }
.quest-title { display: block; font-weight: 700; letter-spacing: -0.01em; color: var(--text-primary); }
.quest-detail { display: block; font-size: 0.92rem; line-height: 1.5; color: var(--text-tertiary); }
.quest-num { font: 500 0.75rem/1 var(--font-mono); color: var(--text-quiet); letter-spacing: 0.06em; }

/* ---- sign-in steps: what linking gets you, first --------------------------------
   Compact: the icon sits beside the title rather than on a row of its own. */
.perks { list-style: none; margin: 0 0 1.25rem; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.perk {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.8rem 0.9rem 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(14, 20, 32, 0.78);
  transition: border-color 0.25s, transform 0.25s var(--ease-out);
}
.perk:hover { border-color: rgba(52, 211, 153, 0.35); transform: translateY(-2px); }
.perk-head { display: flex; align-items: center; gap: 0.6rem; }
.perk-head strong { font-size: 0.97rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; color: var(--text-primary); }
.perk-gem {
  width: 1.9rem;
  height: 1.9rem;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--color-emerald);
  background: linear-gradient(160deg, rgba(52, 211, 153, 0.16), rgba(34, 211, 238, 0.05));
  border: 1px solid rgba(52, 211, 153, 0.24);
}
.perk-gem .ico { width: 1rem; height: 1rem; }
.perk-detail { font-size: 0.86rem; line-height: 1.45; color: var(--text-tertiary); }
.perm-next { margin: 0.85rem 0 0; font: 500 0.78rem/1.5 var(--font-mono); color: var(--text-tertiary); text-align: center; }

/* ---- sign-in steps: what the permission allows ---------------------------------- */
.perm { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.perm-col h3 {
  margin: 0 0 0.75rem;
  font: 500 0.7rem/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.perm-col--yes h3 { color: var(--color-emerald); }
.perm-col--no h3 { color: var(--text-tertiary); }
.perm ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.perm li { position: relative; padding-left: 1.6rem; color: var(--text-secondary); font-size: 0.95rem; line-height: 1.5; }
.perm li em { font-style: normal; color: var(--text-primary); font-weight: 600; }
.perm li::before { content: ""; position: absolute; left: 0.1rem; top: 0.3rem; width: 0.95rem; height: 0.95rem; border-radius: 50%; }
.perm-col--yes li::before { background: rgba(52, 211, 153, 0.16); box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.5); }
.perm-col--yes li::after {
  content: "";
  position: absolute;
  left: 0.42rem;
  top: 0.49rem;
  width: 0.32rem;
  height: 0.52rem;
  border: solid var(--color-emerald);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.perm-col--no li::before { background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--line-strong); }
.perm-col--no li::after {
  content: "";
  position: absolute;
  left: 0.33rem;
  top: 0.75rem;
  width: 0.5rem;
  height: 2px;
  background: var(--text-tertiary);
  transform: rotate(45deg);
  box-shadow: none;
}
.perm-note {
  margin: 1.25rem 0 1.5rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  background: rgba(6, 8, 12, 0.5);
  border: 1px dashed var(--line-strong);
  font-size: 0.875rem;
  color: var(--text-tertiary);
}
.perm-skip { margin-top: 0.6rem; }

/* The key a sign-in just earned, on the step that follows it (once). */
.earned {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(52, 211, 153, 0.36);
  background: linear-gradient(110deg, rgba(52, 211, 153, 0.13), rgba(34, 211, 238, 0.05) 60%, transparent);
}
.earned-gem {
  width: 2.4rem;
  height: 2.4rem;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--brand-gradient);
  color: var(--on-color-text);
  box-shadow: 0 0 22px rgba(52, 211, 153, 0.4);
}
.earned-gem .ico { width: 1.2rem; height: 1.2rem; }
.earned-text { display: flex; flex-direction: column; gap: 0.1rem; color: var(--text-secondary); }
.earned-text strong { color: var(--text-primary); font-weight: 700; }
.earned-kicker { font: 500 0.66rem/1.2 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--color-emerald); }

/* ---- terms ------------------------------------------------------------------------ */
.tldr {
  position: relative;
  margin: 0 0 1.25rem;
  padding: 1.35rem 1.5rem 1.4rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(52, 211, 153, 0.3);
  background: linear-gradient(160deg, rgba(52, 211, 153, 0.12), rgba(34, 211, 238, 0.04) 60%, rgba(14, 20, 32, 0.5));
}
.tldr h2 {
  margin: 0 0 0.6rem;
  font: 500 0.7rem/1 var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-emerald);
}
.tldr p { margin: 0; font-size: 1.1rem; line-height: 1.6; color: var(--text-primary); }

.doc { color: var(--text-secondary); line-height: 1.72; }
.doc h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; color: var(--text-primary); margin: 0 0 1.25rem; }
.doc--page h1 { font-size: clamp(2.05rem, 1.35rem + 3vw, 3rem); letter-spacing: -0.032em; line-height: 1.08; margin-bottom: 1.5rem; }
.doc h2 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text-primary); margin: 2rem 0 0.55rem; }
.doc h3 { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin: 1.5rem 0 0.4rem; }
.doc > :first-child { margin-top: 0; }
.doc p, .doc ul, .doc ol { margin: 0 0 1rem; }
.doc ul, .doc ol { padding-left: 1.3rem; }
.doc li { margin: 0.3rem 0; }
.doc li::marker { color: var(--color-emerald); }
.doc strong { color: var(--text-primary); font-weight: 600; }
.doc code { font: 500 0.88em var(--font-mono); background: rgba(52, 211, 153, 0.1); color: var(--color-mint); padding: 0.1rem 0.4rem; border-radius: 6px; }
.doc table { width: 100%; border-collapse: collapse; margin: 0 0 1rem; font-size: 0.95rem; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); }
.doc th { color: var(--text-primary); font-weight: 600; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

.receipt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.1rem;
  margin: 2rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px dashed var(--line-strong);
  font: 500 0.76rem/1.5 var(--font-mono);
  color: var(--text-tertiary);
}
.receipt-item, .receipt-link { display: inline-flex; align-items: center; gap: 0.45rem; min-width: 0; }
.receipt .ico { width: 1rem; height: 1rem; }
.receipt-hash code { color: var(--text-secondary); overflow-wrap: anywhere; word-break: break-all; }
.receipt-link { color: var(--color-cyan); }

.sign .field { margin: 0 0 1.25rem; }
.field label { display: block; font-weight: 600; margin: 0 0 0.45rem; }

input[type="text"] {
  width: 100%;
  padding: 0.9rem 1rem;
  font: 500 1.05rem/1.3 var(--font-sans);
  color: var(--text-primary);
  background: rgba(6, 8, 12, 0.7);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="text"]:hover { border-color: var(--text-tertiary); }
input[type="text"]:focus { outline: none; border-color: var(--color-cyan); box-shadow: var(--focus-ring); }
input[type="text"][aria-invalid="true"] { border-color: var(--color-error); }

.field-error {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.55rem 0 0;
  color: var(--color-error);
  font-size: 0.875rem;
  font-weight: 600;
}
.field-error .ico { width: 1.05rem; height: 1.05rem; }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(6, 8, 12, 0.45);
  transition: border-color 0.2s, background-color 0.2s;
}
.consent:has(input:checked) { border-color: rgba(52, 211, 153, 0.55); background: rgba(52, 211, 153, 0.08); }
.consent:has(input[aria-invalid="true"]) { border-color: rgba(248, 113, 113, 0.55); }
.consent input[type="checkbox"] { width: 1.35rem; height: 1.35rem; margin: 0.12rem 0 0; accent-color: var(--color-emerald); flex: none; cursor: pointer; }
.consent label { margin: 0; font-weight: 500; color: var(--text-primary); cursor: pointer; }

/* The live signature (app.js mirrors the typed name into it). Hidden
   without JavaScript, where it could only ever show the placeholder. */
.sig {
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(6, 8, 12, 0.35);
}
.js .sig { display: flex; }
.sig-name {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line-strong);
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  overflow-wrap: anywhere;
}
.sig-name.is-empty { background: none; color: var(--text-quiet); font-weight: 600; }
.sig-meta { font: 500 0.72rem/1.4 var(--font-mono); letter-spacing: 0.04em; color: var(--text-tertiary); }

/* Reading progress for the terms, drawn by app.js along the top edge. */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; }
.read-progress span {
  display: block;
  height: 100%;
  background: var(--brand-gradient);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.7);
  transform-origin: left center;
  transform: scaleX(var(--read, 0));
}

/* ---- gate ------------------------------------------------------------------------- */
.tasks { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 0 0 1.5rem; }
.task {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--glass);
}
.task--required { border-color: rgba(52, 211, 153, 0.3); }
.task.is-done { border-color: rgba(52, 211, 153, 0.6); box-shadow: 0 0 40px -18px rgba(52, 211, 153, 0.6); }
.task-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.task-gem {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--color-emerald);
  background: linear-gradient(160deg, rgba(52, 211, 153, 0.16), rgba(34, 211, 238, 0.05));
  border: 1px solid rgba(52, 211, 153, 0.24);
}
.task.is-done .task-gem { background: var(--brand-gradient); color: var(--on-color-text); border-color: transparent; }
.task h2 { font-size: 1.12rem; font-weight: 700; letter-spacing: -0.01em; }
.task p { margin: 0; font-size: 0.92rem; color: var(--text-tertiary); }
.task p b { color: var(--text-secondary); font-weight: 600; }
.task-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: auto 0 0;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}
.task-status dt { color: var(--text-secondary); font-weight: 600; }
.task-status dd { margin: 0; }
.gate-check { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }

/* ---- provisioning --------------------------------------------------------------- */
.ellipsis::after { content: "…"; }

.status-list { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 0.75rem; }
.status {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.35rem 1rem;
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--glass);
  transition: border-color 0.4s, box-shadow 0.4s;
}
.status-gem {
  grid-row: span 2;
  align-self: start;
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
}
.status-name { font-weight: 700; letter-spacing: -0.01em; }
.status-detail { grid-column: 2 / -1; margin: 0; font-size: 0.92rem; color: var(--text-tertiary); }
.status-action { grid-column: 2 / -1; justify-self: start; margin-top: 0.6rem; }
.status.is-active { border-color: rgba(52, 211, 153, 0.36); }
.status.is-active .status-gem { background: var(--brand-gradient); color: var(--on-color-text); border-color: transparent; }
.status.is-invited { border-color: rgba(251, 191, 36, 0.38); box-shadow: 0 0 40px -20px rgba(251, 191, 36, 0.5); }
.status.is-invited .status-gem { color: var(--color-amber); border-color: rgba(251, 191, 36, 0.4); }
.status.is-failed { border-color: rgba(248, 113, 113, 0.45); }
.status.is-failed .status-gem { color: var(--color-error); }
.status.is-pending .status-gem { animation: breathe 2s ease-in-out infinite; }
/* Set by app.js when a target's state moved since the last refresh. */
.status.is-changed { animation: flare 1.4s var(--ease-out) both; }

.ticker { display: flex; align-items: center; gap: 0.8rem; color: var(--text-tertiary); }
.ticker-text { margin: 0; font: 500 0.8rem/1.4 var(--font-mono); }
.ring { width: 1.6rem; height: 1.6rem; transform: rotate(-90deg); flex: none; }
.ring circle { fill: none; stroke-width: 3.5; }
.ring-track { stroke: var(--line-strong); }
.ring-fill {
  stroke: var(--color-cyan);
  stroke-linecap: round;
  stroke-dasharray: 97.4;
  stroke-dashoffset: 0;
}

/* ---- done: the unseal ---------------------------------------------------------- */
.unseal { display: flex; flex-direction: column; align-items: center; text-align: center; margin: 0 0 1.5rem; }
/* The vault is four stacked layers, each painted once: the glow, the empty
   track, the ring of arcs, and the brand tile as an image. Nothing in the
   sequence redraws a stroke - an animated stroke-dasharray re-rasterises the
   SVG on the main thread every frame, which is what made the ring lag. The
   ring is revealed by a conic mask instead, and the rest only ever moves
   with transform and opacity, which the compositor does on its own. */
.vault { position: relative; width: min(15rem, 62vw); aspect-ratio: 1; margin: 0 0 0.5rem; }
.vault-bloom, .vault-track, .vault-ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.vault-bloom {
  border-radius: 50%;
  background: radial-gradient(circle closest-side, rgba(52, 211, 153, 0.32), rgba(34, 211, 238, 0.08) 60%, transparent);
  animation: breathe 4.5s ease-in-out infinite;
}
.vault-ticks { fill: none; stroke: rgba(255, 255, 255, 0.09); stroke-width: 1; stroke-dasharray: 1.5 5.4; }
.vault-groove { fill: none; stroke: rgba(255, 255, 255, 0.05); stroke-width: 9; }
/* The arcs' stroke is set in the markup (stroke="url(#vault-g)"): a fragment
   reference from an external stylesheet is one more thing to trust a browser
   to resolve against the page rather than the stylesheet. */
.vault-arc { fill: none; stroke-width: 9; stroke-linecap: round; }
.vault-ring {
  -webkit-mask-image: conic-gradient(#000 var(--sweep), transparent 0);
  mask-image: conic-gradient(#000 var(--sweep), transparent 0);
  will-change: transform;
}
.vault-core {
  position: absolute;
  left: 32%;
  top: 32%;
  width: 36%;
  height: 36%;
  border-radius: 25%;
  box-shadow: 0 0 40px rgba(52, 211, 153, 0.35);
  will-change: transform;
}
.unseal .eyebrow { margin-bottom: 0.9rem; }
.unseal-title { font-size: clamp(2.9rem, 1.6rem + 6vw, 4.6rem); margin-bottom: 0.75rem; }
.unseal .lead { margin-inline: auto; }

/* The sequence app.js plays once, on the first visit, after the page has
   settled: the ring fills in clockwise, the tile lands, the title rises.
   Without it the page is simply at rest. */
.is-celebrating .vault-ring { animation: sweep 1.15s cubic-bezier(0.6, 0, 0.2, 1) both; }
.is-celebrating .vault-core { animation: core-in 0.8s 0.65s var(--ease-out) both; }
.is-celebrating .unseal-title { animation: title-in 0.9s 0.95s var(--ease-out) both; }
.is-celebrating .unseal .lead,
.is-celebrating .unseal .eyebrow { animation: rise 0.7s 1.15s var(--ease-out) both; }

/* Held at the sequence's first frame until the tab is in view (app.js). */
.is-pending .vault-ring { --sweep: 0deg; }
.is-pending .vault-core,
.is-pending .unseal-title,
.is-pending .eyebrow,
.is-pending .lead { opacity: 0; }

/* The burst app.js draws over everything for two seconds, then removes. */
.burst { position: fixed; inset: 0; z-index: 80; pointer-events: none; }

.member { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.25rem; align-items: stretch; margin: 0 0 0.5rem; }

/* The founding-member card: a keycard with a holographic edge that follows
   the pointer (app.js sets --rx/--ry/--gx/--gy) and drifts slowly otherwise. */
.keycard {
  --rx: 0deg;
  --ry: 0deg;
  --gx: 30%;
  --gy: 20%;
  position: relative;
  aspect-ratio: 1.586;
  padding: 1.15rem 1.25rem;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: var(--text-primary);
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(52, 211, 153, 0.3), transparent 55%),
    radial-gradient(110% 90% at 100% 100%, rgba(167, 139, 250, 0.26), transparent 55%),
    linear-gradient(145deg, #121a2a, #0a0f18);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9), 0 0 50px -20px rgba(52, 211, 153, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.4s var(--ease-out);
  transform-style: preserve-3d;
}
.keycard::before {
  content: "";
  position: absolute;
  inset: -40% -60%;
  background: linear-gradient(115deg, transparent 38%, rgba(52, 211, 153, 0.14) 45%, rgba(34, 211, 238, 0.14) 50%, rgba(167, 139, 250, 0.14) 55%, transparent 62%);
  animation: holo 7s ease-in-out infinite alternate;
  will-change: transform;
  pointer-events: none;
}
.keycard-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--gx) var(--gy), rgba(255, 255, 255, 0.18), transparent 45%);
  pointer-events: none;
}
.keycard-top, .keycard-bottom { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.keycard-brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 800; letter-spacing: -0.015em; }
.keycard-brand img { width: 1.6rem; height: 1.6rem; border-radius: 7px; }
.keycard-tier { font: 500 0.62rem/1.2 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--color-mint); text-align: right; }
.keycard-chip {
  position: relative;
  width: 2.6rem;
  height: 1.95rem;
  border-radius: 6px;
  background: linear-gradient(135deg, #e3c77b, #b8913f 55%, #e8d39a);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.keycard-chip::after {
  content: "";
  position: absolute;
  inset: 0.35rem 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.28);
  border-radius: 3px;
  box-shadow: inset 0.55rem 0 0 -0.5rem rgba(0, 0, 0, 0.28), inset -0.55rem 0 0 -0.5rem rgba(0, 0, 0, 0.28);
}
.keycard-number {
  position: relative;
  margin: 0;
  font: 500 clamp(2.1rem, 1.4rem + 3vw, 2.9rem)/1 var(--font-mono);
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #ffffff, var(--color-mint) 55%, var(--color-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(52, 211, 153, 0.25);
  font-variant-numeric: tabular-nums;
}
.keycard-bottom { font: 500 0.72rem/1.2 var(--font-mono); letter-spacing: 0.04em; color: var(--text-secondary); }
.keycard-bottom span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The terminal is the landing page's, traffic lights and all. */
.term {
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(17, 22, 32, 0.92);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.8), 0 0 50px -30px rgba(52, 211, 153, 0.4);
}
.term-bar { display: flex; align-items: center; gap: 0.45rem; padding: 0.65rem 0.9rem; background: rgba(23, 29, 42, 0.95); border-bottom: 1px solid var(--line); }
.term-bar i { width: 0.62rem; height: 0.62rem; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { flex: 1; text-align: center; font: 500 0.66rem/1 var(--font-mono); color: var(--text-tertiary); margin-right: 1.5rem; }
.term-body {
  flex: 1;
  margin: 0;
  padding: 0.95rem 1.05rem;
  font: 500 0.76rem/1.75 var(--font-mono);
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre;
}
.t-prompt { color: var(--color-emerald); }
.t-dim { color: var(--text-quiet); }
.t-ok { color: var(--color-emerald); }
.t-accent { color: var(--color-cyan); }
.is-typing .t-line { animation: type-line 0.32s var(--ease-out) both; }
.is-typing .t-line:nth-child(2) { animation-delay: 0.45s; }
.is-typing .t-line:nth-child(3) { animation-delay: 0.6s; }
.is-typing .t-line:nth-child(4) { animation-delay: 0.75s; }
.is-typing .t-line:nth-child(5) { animation-delay: 0.9s; }
.is-typing .t-line:nth-child(6) { animation-delay: 1.05s; }
.is-typing .t-line:nth-child(7) { animation-delay: 1.2s; }
.is-typing .t-line:nth-child(8) { animation-delay: 1.35s; }
.is-typing .t-line:nth-child(9) { animation-delay: 1.5s; }

.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.65rem; }
.link-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color 0.25s, transform 0.25s var(--ease-out), box-shadow 0.25s;
}
.link-card:hover { color: var(--text-primary); border-color: rgba(52, 211, 153, 0.45); transform: translateY(-2px); box-shadow: 0 20px 40px -24px rgba(52, 211, 153, 0.55); }
.link-card > .ico { color: var(--text-quiet); transition: color 0.2s, transform 0.2s var(--ease); }
.link-card:hover > .ico { color: var(--color-emerald); transform: translate(2px, -2px); }
.link-gem, .download-gem {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--color-emerald);
  background: linear-gradient(160deg, rgba(52, 211, 153, 0.16), rgba(34, 211, 238, 0.05));
  border: 1px solid rgba(52, 211, 153, 0.24);
}
.link-text { display: flex; flex-direction: column; min-width: 0; }
.link-text strong { font-weight: 700; letter-spacing: -0.01em; }
.link-text span { font-size: 0.9rem; color: var(--text-tertiary); }

.downloads { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.download {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 0.9rem 0.8rem 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--glass);
}
.download-ver { font: 500 0.95rem/1 var(--font-mono); color: var(--text-primary); }

.join { margin: 1.25rem 0 0; }

.notes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.note {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(14, 20, 32, 0.55);
}
.note .ico { color: var(--color-emerald); margin-top: 0.1rem; }
.note p { margin: 0; font-size: 0.92rem; color: var(--text-secondary); }

/* ---- error -------------------------------------------------------------------------- */
.seal {
  width: 4.2rem;
  height: 4.2rem;
  display: grid;
  place-items: center;
  margin: 1rem 0 1.4rem;
  border-radius: 50%;
  color: var(--text-tertiary);
  border: 1px solid var(--line-strong);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05), transparent 70%);
  box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.02), 0 0 0 20px rgba(255, 255, 255, 0.015);
}
.seal .ico { width: 1.8rem; height: 1.8rem; }
.error-what { font-size: 1.08rem; color: var(--text-primary); }
.error-next { color: var(--text-secondary); }

/* ---- footer -------------------------------------------------------------------------- */
.footer {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 1.5rem max(1rem, env(safe-area-inset-left, 0px)) 2.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  font-size: 0.82rem;
  color: var(--text-tertiary);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.footer-links a { color: var(--text-secondary); text-decoration: none; }
.footer-links a:hover { color: var(--color-emerald); }
.footer-note { margin: 0; display: inline-flex; align-items: center; gap: 0.5rem; font: 500 0.72rem/1.4 var(--font-mono); color: var(--text-tertiary); }
.footer-note .ico { width: 1rem; height: 1rem; color: var(--color-emerald); }

/* ---- entrance ----------------------------------------------------------------------
   Blocks rise into place in order - only when the reader has not asked for
   less motion. Under reduce there is no animation at all, rather than a very
   short one: a 0.01ms animation still paints its first frame at opacity 0,
   and a page caught on that frame is blank. */
@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: rise 0.7s var(--ease-out) both; }
  .reveal:nth-child(2) { animation-delay: 0.06s; }
  .reveal:nth-child(3) { animation-delay: 0.12s; }
  .reveal:nth-child(4) { animation-delay: 0.18s; }
  .reveal:nth-child(5) { animation-delay: 0.24s; }
  .reveal:nth-child(6) { animation-delay: 0.3s; }
  .reveal:nth-child(n+7) { animation-delay: 0.36s; }
  .quest.reveal .quest-item { animation: rise 0.6s var(--ease-out) both; }
  .quest.reveal .quest-item:nth-child(2) { animation-delay: 0.08s; }
  .quest.reveal .quest-item:nth-child(3) { animation-delay: 0.16s; }
  .quest.reveal .quest-item:nth-child(4) { animation-delay: 0.24s; }
  .quest.reveal .quest-item:nth-child(5) { animation-delay: 0.32s; }
  .perks.reveal .perk { animation: rise 0.6s var(--ease-out) both; }
  .perks.reveal .perk:nth-child(2) { animation-delay: 0.08s; }
  .perks.reveal .perk:nth-child(3) { animation-delay: 0.16s; }
  .toast, .error-banner { animation: rise 0.6s var(--ease-out) both; }
  .earned { animation: rise 0.6s var(--ease-out) both; }
  .earned-gem { animation: pop 0.9s 0.15s var(--ease-out) both; }
  .ring-fill { animation: countdown 5s linear both; }
}

/* ---- keyframes ------------------------------------------------------------------------ */
@keyframes drift { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-2.5%, 1.5%, 0) scale(1.06); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes spin { to { --spin: 360deg; } }
@keyframes spin-plain { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes forge {
  0% { transform: rotate(45deg) scale(0.4); opacity: 0.3; }
  55% { transform: rotate(45deg) scale(1.22); opacity: 1; }
  100% { transform: rotate(45deg) scale(1); }
}
@keyframes pop {
  0% { transform: scale(0.4); opacity: 0.3; }
  55% { transform: scale(1.18); opacity: 1; }
  100% { transform: none; }
}
@keyframes breathe { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(0.97); } }
@keyframes flare {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7); }
  100% { box-shadow: 0 0 0 18px rgba(52, 211, 153, 0); }
}
@keyframes countdown { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 97.4; } }
@keyframes sweep { from { --sweep: 0deg; } to { --sweep: 360deg; } }
@keyframes core-in {
  0% { opacity: 0; transform: scale(0.3) rotate(-20deg); }
  60% { opacity: 1; transform: scale(1.12) rotate(4deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes title-in { from { opacity: 0; transform: translateY(18px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes holo { from { transform: translateX(-22%); } to { transform: translateX(22%); } }
@keyframes type-line { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

/* ---- small screens ---------------------------------------------------------------------- */
@media (max-width: 40rem) {
  .perks { grid-template-columns: 1fr; }
  .member { grid-template-columns: 1fr; }
  .notes { grid-template-columns: 1fr; }
}
@media (max-width: 36rem) {
  .tasks { grid-template-columns: 1fr; }
  .perm { grid-template-columns: 1fr; gap: 1rem; }
  .topbar-note { display: none; }
  .quest-num { display: none; }
  .quest-item { grid-template-columns: auto 1fr; }
  .gate-check .btn { width: 100%; }
  .cta .btn { width: 100%; }
}
@media (max-width: 26rem) {
  .share-label { font-size: 0.56rem; letter-spacing: 0.04em; }
  .share-gem { width: 1.85rem; height: 1.85rem; }
  .shares-track::before, .shares-track::after { top: 1.33rem; }
  .shares-title { display: none; }
}

/* ---- reduced motion (WP7.3) --------------------------------------------------------------
   Everything that would still move - the drifting backdrop, pulses, the
   current share's ring, the keycard - stops where it stands. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .keycard { transform: none !important; }
}
