/*
 * MindSparkd — the app's identity, on the web.
 *
 * The palette is lifted from `src/lib/theme.ts` in the mobile app: parchment
 * and cognac in light, charcoal and brass in dark. Newsreader and Archivo are
 * the identity's real faces -- the app falls back to system fonts because they
 * are not registered there yet, but the web can load them properly.
 *
 * This file is shared by every page: tokens, header, footer, and the reading
 * layout of the legal pages. The landing page adds `home.css` on top.
 */

:root {
  --bg: #EFE2CC;
  --surface: #F8EFE0;
  --surface-2: #E7D3B3;
  --border: #E2D0B4;
  --text: #2B1A10;
  --muted: #6A4A33;
  --faint: #7E5E45;
  --accent: #95522A;
  --accent-soft: rgba(149, 82, 42, 0.1);
  --brass: #C08A2E;
  --button-bg: #2B1A10;
  --button-text: #FBF3E6;

  /* Always dark, in both modes: the ink band, the privacy card, phone frames. */
  --ink: #16181B;
  --ink-surface: #1E2125;
  --ink-border: rgba(236, 230, 218, 0.14);
  --ink-text: #F4EEE3;
  --ink-muted: #BCB3A6;
  --cream: #FBF3E6;
  --gold: #D8A24B;

  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'Archivo', -apple-system, 'Segoe UI', sans-serif;

  --page: 1200px;
  --gutter: clamp(16px, 5vw, 80px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #16181B;
    --surface: #1E2125;
    --surface-2: #262A2F;
    --border: rgba(236, 230, 218, 0.14);
    --text: #F4EEE3;
    --muted: #BCB3A6;
    --faint: #9A9186;
    --accent: #D08A55;
    --accent-soft: rgba(196, 118, 63, 0.14);
    --brass: #D8A24B;
    --button-bg: #FBF3E6;
    --button-text: #16181B;
    --ink: #0F1113;
    --ink-surface: #1A1D21;
  }
}

:root[data-theme='dark'] {
  --bg: #16181B;
  --surface: #1E2125;
  --surface-2: #262A2F;
  --border: rgba(236, 230, 218, 0.14);
  --text: #F4EEE3;
  --muted: #BCB3A6;
  --faint: #9A9186;
  --accent: #D08A55;
  --accent-soft: rgba(196, 118, 63, 0.14);
  --brass: #D8A24B;
  --button-bg: #FBF3E6;
  --button-text: #16181B;
  --ink: #0F1113;
  --ink-surface: #1A1D21;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.bar {
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Header ------------------------------------------------------------ */

.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  padding-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.brand span {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
}

.site-nav a:hover { color: var(--text); }

.site-nav a.pill {
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 600;
}

.site-nav a.pill:hover { color: var(--button-text); opacity: 0.88; }

@media (max-width: 720px) {
  .site-nav a:not(.pill) { display: none; }
  .brand img { width: 34px; height: 34px; border-radius: 8px; }
  .brand span { font-size: 21px; }
}

/* Footer ------------------------------------------------------------ */

.site-footer {
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--faint);
}

.site-footer .bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 32px;
  padding-top: 28px;
  padding-bottom: 40px;
}

.site-footer p { margin: 0; }
.site-footer p a { color: var(--text); }

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.site-footer nav a {
  color: var(--faint);
  text-decoration: none;
}

.site-footer nav a:hover { color: var(--text); }

/* Legal pages ------------------------------------------------------- */

.wrap {
  max-width: calc(720px + 2 * var(--gutter));
  margin: 0 auto;
  padding: 8px var(--gutter) 96px;
}

.wrap h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 7vw, 52px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 28px 0 10px;
}

.wrap h2 {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 40px 0 10px;
}

.wrap h3 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  margin: 26px 0 6px;
}

.wrap p, .wrap li { color: var(--muted); }
.wrap li { margin-bottom: 7px; }
.wrap ul { padding-left: 22px; }

strong { color: var(--text); font-weight: 600; }

.lede {
  font-size: 19px;
  color: var(--muted);
  margin-top: 0;
}

.updated {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 30px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 24px;
  margin: 22px 0;
}

.card h2, .card h3 { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

.note {
  background: var(--accent-soft);
  border-radius: 14px;
  padding: 16px 20px;
  margin: 22px 0;
}

.note > :last-child { margin-bottom: 0; }
.wrap .note p { color: var(--text); }

ol.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
}

ol.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 42px;
  margin-bottom: 16px;
}

ol.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 27px;
  height: 27px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--cream);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
