/* CAlpha shared styles: colour tokens, type, buttons, fields, cards. */
:root {
  --bg: #0a0c0b;
  --surface: #111513;
  --surface-2: #171c19;
  --surface-3: #1e2420;
  --line: #262e2a;
  --line-strong: #36403b;
  --text: #e9f0ea;
  --muted: #8e9e96;
  --faint: #5f6d66;
  --accent: #c8f53c;
  --accent-ink: #0a0c0b;
  --accent-soft: rgba(200, 245, 60, 0.12);
  --good: #3fdc86;
  --warn: #f4b43c;
  --bad: #ff5b4e;
  --hot: #ff8b3c;
  --neutral: #9cb6c4;
  --good-soft: rgba(63, 220, 134, 0.12);
  --warn-soft: rgba(244, 180, 60, 0.13);
  --bad-soft: rgba(255, 91, 78, 0.13);
  --hot-soft: rgba(255, 139, 60, 0.13);
  --neutral-soft: rgba(156, 182, 196, 0.12);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 12px 32px -18px rgba(0, 0, 0, 0.8);
  --radius: 14px;
  --radius-sm: 9px;
  --font-display: "Bricolage Grotesque", "IBM Plex Sans", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f3ec;
  --surface: #ffffff;
  --surface-2: #f0eee5;
  --surface-3: #e7e4d8;
  --line: #dcd8ca;
  --line-strong: #c4bfae;
  --text: #121614;
  --muted: #59665f;
  --faint: #89938d;
  --accent: #1d6b37;
  --accent-ink: #ffffff;
  --accent-soft: rgba(29, 107, 55, 0.1);
  --good: #17844a;
  --warn: #a96d0e;
  --bad: #c62f27;
  --hot: #c0561a;
  --neutral: #47657a;
  --good-soft: rgba(23, 132, 74, 0.1);
  --warn-soft: rgba(169, 109, 14, 0.1);
  --bad-soft: rgba(198, 47, 39, 0.09);
  --hot-soft: rgba(192, 86, 26, 0.1);
  --neutral-soft: rgba(71, 101, 122, 0.09);
  --shadow: 0 1px 2px rgba(20, 30, 25, 0.05), 0 10px 30px -20px rgba(20, 30, 25, 0.35);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.08; margin: 0; letter-spacing: -0.02em; font-weight: 750; }
p { margin: 0; }
.mono { font-family: var(--font-mono); font-feature-settings: "zero" 1; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* wordmark: [CA]lpha */
.brand { display: inline-flex; align-items: baseline; gap: 0; font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.03em; text-decoration: none; color: var(--text); }
.brand .ca { font-family: var(--font-mono); font-weight: 600; color: var(--accent); font-size: 0.92em; letter-spacing: -0.04em; }

/* buttons */
.btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 11px;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  font: 600 15px/1 var(--font-body); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform 0.06s ease, background 0.15s ease, border-color 0.15s ease;
  touch-action: manipulation;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); border-color: var(--accent); }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* fields */
.field { display: block; width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 16px/1.3 var(--font-body); }
.field::placeholder { color: var(--faint); }
.field.mono { font-family: var(--font-mono); font-size: 15px; }
label.lbl { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card h3 { font-size: 18px; }
.kicker { font: 600 11.5px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

/* tone helpers */
.t-good { --tone: var(--good); --tone-soft: var(--good-soft); }
.t-warn { --tone: var(--warn); --tone-soft: var(--warn-soft); }
.t-bad { --tone: var(--bad); --tone-soft: var(--bad-soft); }
.t-hot { --tone: var(--hot); --tone-soft: var(--hot-soft); }
.t-neutral { --tone: var(--neutral); --tone-soft: var(--neutral-soft); }
.t-muted { --tone: var(--faint); --tone-soft: var(--surface-2); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--tone-soft, var(--surface-2)); color: var(--tone, var(--muted)); font: 600 12.5px/1.2 var(--font-body); border: 1px solid color-mix(in srgb, var(--tone, var(--line)) 30%, transparent); }

.notice { padding: 12px 14px; border-radius: 11px; background: var(--tone-soft, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--tone, var(--line)) 35%, transparent); font-size: 14.5px; }

.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font: 600 14px/1.2 var(--font-body); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 100; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } html { scroll-behavior: auto; } }

/* simple document pages (terms, privacy) */
.doc { max-width: 760px; margin: 0 auto; padding: 28px 16px 64px; }
.doc h1 { font-size: clamp(30px, 6vw, 42px); margin: 18px 0 6px; }
.doc h2 { font-size: 21px; margin: 32px 0 8px; }
.doc p, .doc li { color: var(--text); font-size: 16px; }
.doc p + p { margin-top: 10px; }
.doc ul { padding-left: 20px; margin: 8px 0; }
.doc li + li { margin-top: 6px; }
.doc .updated { color: var(--muted); font-size: 14px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; }
