/*
  Tokens ported verbatim from frontend/src/index.css — the landing page and
  auth screens are server-rendered (no Tailwind build here), but they must
  read as the same product. Only the subset used outside the app: surfaces,
  ink, brand, fonts, shadows, radii. Keep values in sync by hand; there is no
  build step wiring the two together.
*/
:root {
  --canvas: oklch(97.5% 0.004 150);
  --surface: oklch(100% 0 0);
  --surface-sunken: oklch(94.5% 0.005 150);
  --border: oklch(90% 0.006 150);
  --border-strong: oklch(80% 0.008 150);

  --ink: oklch(24% 0.012 150);
  --ink-muted: oklch(45% 0.01 150);
  --ink-subtle: oklch(56% 0.008 150);
  --ink-inverse: oklch(98% 0.004 150);

  --brand: oklch(52% 0.13 252);
  --brand-hover: oklch(42% 0.13 252);
  --brand-soft: oklch(94% 0.03 252);
  --brand-on: oklch(100% 0 0);

  --font-text: "Archivo", system-ui, sans-serif;
  --font-num: "Roboto Mono", ui-monospace, monospace;

  --shadow-2: 0 1px 2px oklch(20% 0.01 150 / 0.06), 0 4px 12px oklch(20% 0.01 150 / 0.07);
  --shadow-3: 0 2px 4px oklch(20% 0.01 150 / 0.06), 0 12px 32px oklch(20% 0.01 150 / 0.12);
  --focus-ring: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: oklch(17% 0.008 150);
    --surface: oklch(21% 0.009 150);
    --surface-sunken: oklch(19% 0.008 150);
    --border: oklch(30% 0.010 150);
    --border-strong: oklch(42% 0.012 150);

    --ink: oklch(94% 0.005 150);
    --ink-muted: oklch(74% 0.008 150);
    --ink-subtle: oklch(62% 0.008 150);
    --ink-inverse: oklch(18% 0.008 150);

    --brand: oklch(70% 0.11 252);
    --brand-hover: oklch(78% 0.10 252);
    --brand-soft: oklch(30% 0.055 252);
    --brand-on: oklch(17% 0.008 150);

    --shadow-2: none;
    --shadow-3: 0 12px 32px oklch(0% 0 0 / 0.5);
    --focus-ring: 0 0 0 2px var(--canvas), 0 0 0 4px var(--brand);
  }
}

[data-theme="dark"] {
  --canvas: oklch(17% 0.008 150);
  --surface: oklch(21% 0.009 150);
  --surface-sunken: oklch(19% 0.008 150);
  --border: oklch(30% 0.010 150);
  --border-strong: oklch(42% 0.012 150);
  --ink: oklch(94% 0.005 150);
  --ink-muted: oklch(74% 0.008 150);
  --ink-subtle: oklch(62% 0.008 150);
  --ink-inverse: oklch(18% 0.008 150);
  --brand: oklch(70% 0.11 252);
  --brand-hover: oklch(78% 0.10 252);
  --brand-soft: oklch(30% 0.055 252);
  --brand-on: oklch(17% 0.008 150);
  --shadow-2: none;
  --shadow-3: 0 12px 32px oklch(0% 0 0 / 0.5);
  --focus-ring: 0 0 0 2px var(--canvas), 0 0 0 4px var(--brand);
}

* { box-sizing: border-box; }
/* Without this, browsers with a forced/heuristic dark mode (common on mobile
   Chrome) repaint colors on top of the real CSS instead of trusting our own
   @media (prefers-color-scheme: dark) block above — producing muddy, low-
   contrast buttons even though the underlying tokens have good contrast. */
html { color-scheme: light dark; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-text); font-weight: 700; line-height: 1.15; margin: 0 0 0.5em; }
p { margin: 0 0 1em; color: var(--ink-muted); }
a { color: var(--brand); }
.numeric { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.site-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.brand-mark { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.brand-mark .mark { display: block; }
.nav-links { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.nav-links a:not(.btn) { color: var(--ink-muted); text-decoration: none; font-size: 0.95rem; }
.nav-links a:not(.btn):hover { color: var(--ink); }

.lang-switch { display: flex; align-items: center; gap: 2px; margin: 0; }
.lang-option {
  background: none; border: none; padding: 4px 6px; border-radius: var(--radius-sm, 4px);
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-subtle);
  cursor: pointer;
}
.lang-option:hover { color: var(--ink-muted); }
.lang-option.active { color: var(--brand); }

/* Below this, the four nav items plus brand mark no longer fit on one row
   — drop the two in-page marketing links (still reachable by scrolling the
   landing page itself) and tighten spacing, keeping only the actions that
   matter from a phone: log in / sign up, or open the app / log out. */
@media (max-width: 640px) {
  .site-header { padding: 14px 16px; }
  .nav-links { gap: 10px; }
  .nav-secondary { display: none; }
  .btn { padding: 10px 14px; font-size: 0.9rem; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--radius-md); font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--brand); color: var(--brand-on); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-sunken); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

section { padding: 72px 0; }
section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.hero { padding: 96px 0 72px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); max-width: 20ch; margin: 0 auto 0.5em; }
.hero .lede { font-size: 1.15rem; max-width: 56ch; margin: 0 auto 2em; }
.hero .cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow-2);
}
.card h3 { font-size: 1.1rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; color: var(--brand); font-weight: 700; margin-bottom: 0.75em; }

form.stacked { display: flex; flex-direction: column; gap: 16px; max-width: 480px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--ink-muted); }
.field input, .field select, .field textarea {
  font: inherit; padding: 10px 12px; border-radius: var(--radius-md);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; box-shadow: var(--focus-ring); }
.field .errors { color: var(--brand-hover); font-size: 0.85rem; }
.helptext { color: var(--ink-subtle); font-size: 0.85rem; }
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; }

.messages { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-direction: column; gap: 8px; }
.messages li { padding: 12px 16px; border-radius: var(--radius-md); background: var(--brand-soft); color: var(--ink); font-size: 0.9rem; }

.site-footer { padding: 40px 0; border-top: 1px solid var(--border); color: var(--ink-subtle); font-size: 0.85rem; text-align: center; }
