/* Shared styles + fonts + theme — used by every page */
/* Brand system: Light Heather + Bright Sun · WCAG AAA throughout */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;0,9..144,800;1,9..144,300;1,9..144,400;1,9..144,500&family=Atkinson+Hyperlegible+Next:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,200;1,300;1,400;1,500;1,600;1,700;1,800&family=Lexend:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ── Core palette ── */
  --paper:      #FAF8F5;   /* Off-White — warm canvas, WCAG AAA base */
  --paper-2:    #F0EDE8;   /* Slightly warm mid-surface */
  --ink:        #1A1410;   /* Near-Black — 17.20:1 on Off-White (AAA) */
  --ink-2:      #1A1410;
  --rule:       #1A1410;
  --muted:      #5a4f46;   /* Mid-tone for secondary text */
  --accent:     #802D5D;   /* Light Heather — 8.08:1 on Off-White (AAA) */
  --accent-soft:#9E3A73;   /* Lighter heather for hover states */
  --highlight:  #F2C935;   /* Bright Sun — 11.45:1 on Near-Black (AAA) */
  --border:     rgba(26,20,16,0.15);
}

html, body { background: var(--paper); color: var(--ink); }
body {
  font-family: 'Atkinson Hyperlegible Next', 'Lexend', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Type scale ── */
.font-display { font-family: 'Fraunces', Georgia, serif; font-weight: 400; letter-spacing: -0.01em; }
.font-body    { font-family: 'Atkinson Hyperlegible Next', 'Lexend', system-ui, sans-serif; }
.font-ui      { font-family: 'Atkinson Hyperlegible Next', system-ui, sans-serif; letter-spacing: 0; }
.font-mono    { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ── Theme variants ── */
body.theme-dark {
  --paper:   #1A1410;
  --paper-2: #231d18;
  --ink:     #FAF8F5;
  --ink-2:   #FAF8F5;
  --rule:    #FAF8F5;
  --muted:   rgba(250,248,245,0.55);
  --border:  rgba(250,248,245,0.15);
}

/* ── Colour utilities ── */
/* accent is always Light Heather; highlight is always Bright Sun */

/* ── Typography helpers ── */
.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}
.rule-thin  { border-color: var(--border); }
.rule-bold  { border-color: var(--rule); }
.rule-double { border-top: 3px double var(--rule); }

.dropcap::first-letter {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 400;
  font-size: 5.2em;
  line-height: 0.85;
  float: left;
  padding: 0.05em 0.12em 0 0;
  color: var(--accent);
}
em.editorial {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 400;
}
.margin-note {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* ── Interactive ── */
.link-draw {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.35s ease;
}
.link-draw:hover { background-size: 100% 1.5px; }

/* ── Stamp pill ── */
.stamp {
  border: 1.5px solid var(--accent);
  color: var(--accent);
  padding: 5px 10px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.stamp::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

/* ── Selection ── */
::selection { background: var(--highlight); color: var(--ink); }

/* ── Cards ── */
.ticker-digit { display: inline-block; font-variant-numeric: tabular-nums; }
.surface-card { transition: transform 0.4s cubic-bezier(.2,.7,.2,1), border-color 0.3s, background 0.3s; }
.surface-card:hover { transform: translateY(-3px); }
html { scroll-behavior: smooth; }

/* ── Form inputs ── */
.editorial-input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--rule);
  padding: 14px 0 10px;
  font-family: 'Atkinson Hyperlegible Next', system-ui, sans-serif;
  font-size: 17px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.3s;
}
.editorial-input:focus { border-color: var(--accent); }
.editorial-input::placeholder { color: var(--muted); opacity: 0.7; }
.editorial-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Dark sections: flip accent to Bright Sun ── */
.dark-section,
section.dark-section,
[data-theme="dark"] {
  --accent: #F2C935;
  --accent-soft: #F2C935;
  --muted: rgba(250,248,245,0.55);
}

/* ── Highlight bar (Bright Sun accent on dark sections) ── */
.highlight-bar { background: var(--highlight); color: var(--ink); }
