/* speedrun.io — shared site stylesheet
   Used by: index.html, privacy.html, terms.html, data.html, api.html, archive.html
   Light/dark theme via [data-theme] on <html>, persisted in localStorage('srio-theme'). */

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

/* ── Theme tokens ──
   Dark = off-black charcoal, Light = off-white cream.
   Accent blue (#5b8db8) carried over from the main site unchanged
   in both modes so the brand reads consistently. */
:root {
  --bg: #121110;
  --surface: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.10);
  --text-primary: #f2ede4;
  --text-secondary: rgba(242,237,228,0.62);
  --text-muted: rgba(242,237,228,0.38);
  --accent: #5b8db8;
  --accent-dim: rgba(91,141,184,0.18);
  --accent-hover: #6fa0cc;
  --logo-fill: #f2ede4;
  --toggle-track: rgba(255,255,255,0.08);
  --toggle-thumb: #f2ede4;
}

:root[data-theme="light"] {
  --bg: #f6f1e7;
  --surface: rgba(20,20,18,0.03);
  --border: rgba(20,20,18,0.10);
  --text-primary: #262420;
  --text-secondary: rgba(38,36,32,0.68);
  --text-muted: rgba(38,36,32,0.42);
  --accent: #3f6d93;
  --accent-dim: rgba(63,109,147,0.12);
  --accent-hover: #335a7a;
  --logo-fill: #262420;
  --toggle-track: rgba(20,20,18,0.10);
  --toggle-thumb: #262420;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', 'DM Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

.content {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 clamp(24px, 5vw, 72px);
}

/* ── Theme toggle — small, top-left, fixed on every page ── */
.theme-toggle {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 10px 5px 5px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--text-secondary); }
.theme-toggle .track { position: relative; width: 26px; height: 15px; border-radius: 10px; background: var(--toggle-track); flex-shrink: 0; }
.theme-toggle .thumb { position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: var(--toggle-thumb); transition: transform 0.2s ease; }
:root[data-theme="light"] .theme-toggle .thumb { transform: translateX(11px); }
.theme-toggle .label { letter-spacing: 0.02em; text-transform: uppercase; }

/* ── Masthead — logo + wordmark, no nav, on every page ──
   One size everywhere (matches the original letter treatment). The whole
   block is centered as a unit via .letter-header, then .letter-header-inner
   left-aligns the logo/wordmark and offsets them by the same amount as the
   TOC column (width) + gap below, so the "S" in speedrun.io lines up with
   the eyebrow/title of the article or legal-body column underneath it. */
.letter-header { display: flex; justify-content: center; padding: 88px 0 48px; }
.letter-header-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  max-width: 956px; /* = toc (200) + gap (56) + main column (700) */
  padding-left: 256px; /* = toc (200) + gap (56) */
}
.letter-logo { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin-bottom: 18px; }
.letter-logo svg { width: 100%; height: 100%; fill: var(--logo-fill); transition: fill 0.25s ease; }
.letter-wordmark { font-family: 'DM Sans', sans-serif; font-size: 20px; font-weight: 500; letter-spacing: -0.01em; color: var(--text-primary); }

/* ── Content wraps ──
   .legal-wrap + main.legal : privacy / terms / data / api / archive
   .article-wrap + .article : index (the letter)
   Gap and max-width are now identical across both so the masthead offset
   above lines up with either kind of page. */
.legal-wrap { flex: 1; display: flex; justify-content: center; gap: 56px; padding: 8px 0 80px; align-items: flex-start; }
.article-wrap { flex: 1; display: flex; justify-content: center; padding: 8px 0 40px; gap: 56px; }

main.legal { flex: 1; min-width: 0; max-width: 700px; }
.article { flex: 1; min-width: 0; max-width: 700px; }

/* ── TOC sidebar — shared by every page ── */
.toc { width: 200px; position: sticky; top: 48px; flex-shrink: 0; align-self: flex-start; }
.toc-label { font-size: 10px; font-weight: 500; letter-spacing: 0.10em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; }
.toc ol { list-style: none; display: flex; flex-direction: column; gap: 2px; margin-bottom: 24px; }
.toc ol li a { font-size: 12px; font-weight: 400; color: var(--text-muted); text-decoration: none; line-height: 1.5; display: block; padding: 4px 0 4px 10px; border-left: 1px solid var(--border); transition: color 0.15s, border-color 0.15s; }
.toc ol li a:hover, .toc ol li a.active { color: var(--text-primary); border-left-color: var(--accent); }
.sitemap { margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--border); }

.toc-toggle { display: none; }

/* ── Legal page heading block (privacy / terms / data / api) ── */
.legal-eyebrow { font-size: 11px; font-weight: 500; letter-spacing: 0.10em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; font-family: 'DM Sans', sans-serif; }
.legal-title { font-family: 'DM Sans', sans-serif; font-size: clamp(28px, 3.6vw, 40px); font-weight: 300; letter-spacing: -0.02em; color: var(--text-primary); margin-bottom: 10px; }
.legal-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 40px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }

.legal-body h2 { font-size: 20px; font-weight: 500; color: var(--text-primary); letter-spacing: -0.01em; margin: 40px 0 14px; scroll-margin-top: 32px; }
.legal-body p { font-size: 15px; color: var(--text-secondary); line-height: 1.75; margin-bottom: 16px; }
.legal-body p strong, .legal-body li strong { color: var(--text-primary); font-weight: 600; }
.legal-body ul { list-style: none; margin: 0 0 18px; }
.legal-body ul li { font-size: 15px; color: var(--text-secondary); line-height: 1.7; padding-left: 18px; position: relative; margin-bottom: 8px; }
.legal-body ul li::before { content: '—'; position: absolute; left: 0; color: var(--accent); font-size: 12px; top: 2px; }
.legal-body a { color: var(--accent); text-decoration: none; }
.legal-body a:hover { color: var(--accent-hover); text-decoration: underline; }
.legal-body code { font-family: 'JetBrains Mono', monospace; font-size: 13px; background: var(--accent-dim); color: var(--accent); padding: 2px 7px; border-radius: 4px; }

/* Tables and status badges — used on api.html / data.html */
.legal-body table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: 14px; }
.legal-body table th { padding: 8px 12px; text-align: left; border-bottom: 2px solid var(--border); color: var(--text-primary); font-weight: 500; }
.legal-body table td { padding: 8px 12px; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.tier-badge { display: inline-block; font-size: 11px; font-weight: 500; letter-spacing: 0.03em; color: var(--accent); background: var(--accent-dim); border-radius: 4px; padding: 2px 8px; margin-left: 8px; vertical-align: middle; }
.status-live { color: var(--accent); font-weight: 500; }

/* ── Article (letter) heading block + body — index.html only ── */
.article-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 500; letter-spacing: 0.10em; text-transform: uppercase; color: var(--accent); margin-bottom: 20px; }
.article-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.article-title { font-size: clamp(32px, 4.2vw, 50px); font-weight: 300; letter-spacing: -0.02em; line-height: 1.12; color: var(--text-primary); margin-bottom: 16px; scroll-margin-top: 24px; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; font-size: 13px; color: var(--text-muted); font-weight: 400; margin-bottom: 48px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }

.article-body h2 { font-size: 22px; font-weight: 500; color: var(--text-primary); letter-spacing: -0.01em; margin: 48px 0 16px; scroll-margin-top: 32px; }
.article-body h3 { font-size: 17px; font-weight: 500; color: var(--text-primary); margin: 32px 0 10px; }
.article-body p { font-size: 15px; font-weight: 400; color: var(--text-secondary); line-height: 1.75; margin-bottom: 18px; }
.article-body p strong { color: var(--text-primary); font-weight: 600; }
.article-body ul { list-style: none; margin: 0 0 20px; }
.article-body ul li { font-size: 15px; font-weight: 400; color: var(--text-secondary); line-height: 1.7; padding-left: 18px; position: relative; margin-bottom: 8px; }
.article-body ul li::before { content: '—'; position: absolute; left: 0; color: var(--accent); font-size: 12px; top: 2px; }
.article-body a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
.article-body a:hover { color: var(--accent-hover); text-decoration: underline; }
.article-body blockquote { border-left: 2px solid var(--accent); padding: 16px 0 16px 24px; margin: 32px 0; font-size: 16px; font-weight: 400; color: var(--text-primary); line-height: 1.7; font-style: italic; }
.article-body hr { border: none; height: 1px; background: var(--border); margin: 48px 0; }

/* Pill link — matches the .nav-cta button style used site-wide */
.pill-link {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary) !important;
  background: var(--accent-dim);
  border: 1px solid rgba(91,141,184,0.32);
  text-decoration: none !important;
  letter-spacing: -0.01em;
  padding: 8px 18px;
  border-radius: 999px;
  transition: background 0.2s, border-color 0.2s;
  margin: 4px 0 8px;
}
.pill-link:hover { background: rgba(91,141,184,0.28); border-color: rgba(91,141,184,0.52); text-decoration: none !important; }

.placeholder-tag { display: inline-block; font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); background: var(--accent-dim); border-radius: 4px; padding: 2px 7px; margin-bottom: 10px; }

.signature { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--border); }
.signature .sig-name { font-size: 16px; font-weight: 500; color: var(--text-primary); }
.signature .sig-role { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ── Footer — shared by every page ── */
footer { display: flex; flex-direction: column; gap: 6px; padding: 24px 0 32px; border-top: 1px solid var(--border); }
.footer-bottom { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; }
.footer-brand { font-size: 13px; color: var(--text-muted); font-weight: 400; }
.footer-copy { font-size: 13px; color: var(--text-muted); font-weight: 400; margin-left: 6px; }
.footer-sep { width: 1px; height: 10px; background: var(--border); margin: 0 12px; }
.footer-legal { display: flex; gap: 16px; align-items: center; }
.footer-legal a { font-size: 13px; color: var(--text-muted); text-decoration: none; font-weight: 400; transition: color 0.2s; }
.footer-legal a:hover, .footer-legal a.active { color: var(--text-primary); }
.footer-disclaimer { font-size: 11px; color: var(--text-muted); opacity: 0.75; line-height: 1.5; text-align: center; margin-top: 4px; }

/* ── Upload form — archive.html ── */
.upload-form { margin: 8px 0 32px; }
.upload-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 36px 24px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.upload-drop:hover { border-color: var(--accent); background: var(--accent-dim); }
.upload-drop-label { font-size: 15px; font-weight: 500; color: var(--text-primary); }
.upload-drop-hint { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.upload-drop.has-file { border-style: solid; border-color: var(--accent); }
.upload-drop.has-file .upload-drop-label { color: var(--accent); }

.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 16px;
  padding: 13px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.submit-btn:hover:not(:disabled) { background: var(--accent-hover); }
.submit-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Mobile TOC ── */
@media (max-width: 860px) {
  .toc { display: none; }

  .toc-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    margin-bottom: 24px;
  }
  .toc-toggle:hover { color: var(--text-primary); border-color: var(--accent); }

  .legal-wrap { flex-direction: column; padding-top: 0; align-items: stretch; }
  .article-wrap { flex-direction: column; align-items: center; }
  .letter-header { padding: 56px 0 32px; }
  .letter-header-inner { max-width: none; padding-left: 0; }
}
