/* Design tokens for gloam.valaciel.com.
 *
 * Ported from the app's own roles in app/src/theme/tokens.ts so the site and the
 * product cannot drift apart. This file is the reason a future /app zone inherits
 * a finished visual language instead of arriving with a second design.
 *
 * The accent SWAPS between schemes on purpose (UI-D6): brand navy is unreadable
 * on near-black, so dark mode uses brand gold. Do not "fix" this by using navy in
 * both.
 *
 * Light mode's page background is the brand warm base (#FBF1DC — the same value
 * as the app's splash and adaptive-icon background in app.json), not tokens.ts's
 * pure-white app background: a marketing page is brand surface, not a data
 * screen.
 */

:root {
  --bg: #fbf1dc; /* brand warm base */
  --surface: #ffffff;
  --border: #e2d9c4;
  --text: #14181f; /* tokens.ts textPrimary */
  --muted: #5b6472; /* tokens.ts textSecondary */
  --accent: #1f3566; /* brand navy */
  --accent-contrast: #ffffff;

  --measure: 34rem; /* readable line length */
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121417; /* tokens.ts black.background */
    --surface: #1c1f24;
    --border: #33373f;
    --text: #f2f3f5;
    --muted: #a8aeb8;
    --accent: #f0bc25; /* brand gold */
    --accent-contrast: #1a2340;
  }
}

/* Explicit overrides win in both directions, so a future theme toggle can stamp
 * data-theme on <html> and beat the media query. */
:root[data-theme="light"] {
  --bg: #fbf1dc;
  --surface: #ffffff;
  --border: #e2d9c4;
  --text: #14181f;
  --muted: #5b6472;
  --accent: #1f3566;
  --accent-contrast: #ffffff;
}

:root[data-theme="dark"] {
  --bg: #121417;
  --surface: #1c1f24;
  --border: #33373f;
  --text: #f2f3f5;
  --muted: #a8aeb8;
  --accent: #f0bc25;
  --accent-contrast: #1a2340;
}

/* ---------- base ---------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font);
  /* System fonts only. Not an aesthetic preference: a webfont request would be a
   * third-party dependency on the same host that serves the invite page, and
   * normalising that pattern is exactly what website.md §3.3 forbids. */
}

/* Wide content must scroll inside itself — the page body never scrolls sideways. */
img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 0.5rem;
}

h1 {
  font-size: clamp(2rem, 6vw, 2.75rem);
}

h2 {
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  margin-top: 2.5rem;
}

h3 {
  font-size: 1.0625rem;
  margin-top: 1.75rem;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.35rem;
}

small,
.muted {
  color: var(--muted);
}

/* ---------- layout ---------- */

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

.wrap--wide {
  max-width: 46rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.stack > * + * {
  margin-top: 1.25rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.lede {
  font-size: 1.125rem;
  color: var(--muted);
}

.pill {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.875rem;
}

footer.site {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

footer.site a {
  margin-right: 1rem;
  white-space: nowrap;
}

/* Legal pages: dense text, needs tighter rhythm and a visible document date. */
.doc h2 {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.doc__meta {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.doc th,
.doc td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.75rem 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

/* Any table wide enough to overflow scrolls in its own container. */
.scroll-x {
  overflow-x: auto;
}

/* Utility, not an inline style attribute: the CSP for this host omits
 * 'unsafe-inline' from style-src, which blocks style="" attributes as well as
 * <style> blocks. A class is the only way to do this here. */
.tight {
  margin-top: 0;
}
