/* ═══════════════════════════════════════════════════════════════════
 *  frAIgrant content site styles (blog, glossary, about, disclosure)
 *  Single source of truth for all fraigrant.com content pages.
 *  Self-contained: pulls brand tokens locally so each page can link only
 *  this one file. Mirrors the look of terms.html / privacy.html.
 *  Brand rule reminder: no em-dashes anywhere in copy.
 * ═══════════════════════════════════════════════════════════════════ */

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

:root {
  --bg:          #09160E;
  --surface:     #0E2016;
  --surface-2:   #152B1D;
  --surface-3:   #1A3423;
  --border:      #1C3D28;
  --border-2:    #244D33;
  --text:        #EDE8D5;
  --text-muted:  rgba(237,232,213,0.62);
  /* Accessibility (WCAG 2.1 AA): faint raised 0.30 -> 0.55 so small meta text
     (bylines, breadcrumbs, footer) meets 4.5:1 on --bg and all surfaces. */
  --text-faint:  rgba(237,232,213,0.55);
  --mint:        #5DFFA8;
  --mint-pale:   rgba(93,255,168,0.08);
  --mint-border: rgba(93,255,168,0.22);
  --amber:       #E8B84B;
  --amber-pale:  rgba(232,184,75,0.10);
  --amber-border:rgba(232,184,75,0.25);
  --font-head:   'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:   'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:   'JetBrains Mono', 'Fira Code', monospace;
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --radius-full: 9999px;
}

html { scroll-behavior: smooth; background: var(--bg); }

/* ── Accessibility ── */
/* Skip link: visually hidden until keyboard focus, then revealed top-left. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--mint);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 0 0 var(--radius-md) 0;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* Visible keyboard focus indicator. Never remove outlines. */
:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav-cta, .cta-btn, .related-card, .post-card, .nav-links a, footer a, a { transition: none; }
  .nav-cta:hover, .cta-btn:hover, .related-card:hover, .post-card:hover { transform: none; }
}

body {
  font-family: var(--font-body);
  background: transparent;
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* Full-page bubble background (matches the home page), injected by bubbles.js.
   Sits behind all content: body is transparent so the html background shows
   through, with the canvas layered above it and the page content above that. */
#bg-bubbles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ── Nav ── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(9,22,14,0.88);
  backdrop-filter: blur(12px);
  z-index: 50;
}
.nav-left { display: flex; align-items: center; gap: 26px; }
.wordmark {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}
.wordmark .ai { color: var(--mint); }
.nav-links { display: flex; gap: 22px; }
.nav-links a {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--mint); }
.nav-cta {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--mint);
  padding: 9px 18px;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.nav-cta:hover { background: #4AEF96; box-shadow: 0 0 20px rgba(93,255,168,0.18); }

/* ── Article shell ── */
.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 28px 96px;
}
.wrap-wide { max-width: 1040px; }

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 26px;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--mint); }

.eyebrow {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mint);
  margin-bottom: 14px;
}

h1 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 2.85rem);
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 14px;
}

.byline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.byline .dot { color: var(--border-2); }
.byline strong { color: var(--text-muted); font-weight: 500; }

.lede {
  font-size: 18px;
  color: var(--text-muted);
  margin: 24px 0 8px;
  line-height: 1.7;
}

h2 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin: 48px 0 14px;
  padding-top: 8px;
  scroll-margin-top: 80px;
}
h3 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.12rem;
  margin: 28px 0 8px;
  color: var(--text);
}

p { margin-bottom: 16px; color: var(--text-muted); }
p strong { color: var(--text); font-weight: 600; }
em { color: var(--text); font-style: italic; }

ul, ol { margin: 6px 0 20px; padding-left: 24px; }
li { margin-bottom: 10px; color: var(--text-muted); }
li strong { color: var(--text); font-weight: 600; }

a { color: var(--mint); }
a:hover { opacity: 0.8; }

/* Inline glossary-style link: dotted mint underline */
.term {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dotted var(--mint);
  cursor: help;
}
.term:hover { color: var(--mint); opacity: 1; }

hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

/* ── Callouts ── */
.callout {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-left: 3px solid var(--mint);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin: 26px 0;
}
.callout.amber { border-left-color: var(--amber); }
.callout p:last-child { margin-bottom: 0; }
.callout .label {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mint);
  display: block;
  margin-bottom: 8px;
}
.callout.amber .label { color: var(--amber); }

/* ── Table of contents ── */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin: 30px 0 8px;
}
.toc-title {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 12px;
}
.toc ol { padding-left: 20px; margin: 0; }
.toc li { margin-bottom: 6px; }
.toc a { color: var(--text); text-decoration: none; font-size: 14px; }
.toc a:hover { color: var(--mint); }

/* ── In-article CTA box ── */
.cta-box {
  background: linear-gradient(135deg, var(--surface), rgba(93,255,168,0.05));
  border: 1px solid var(--mint-border);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  margin: 40px 0;
  text-align: center;
}
.cta-box h3 {
  margin-top: 0;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.cta-box p { margin-bottom: 18px; }
.cta-btn {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--mint);
  padding: 12px 26px;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all 0.2s;
}
.cta-btn:hover { background: #4AEF96; box-shadow: 0 0 24px rgba(93,255,168,0.22); opacity: 1; transform: translateY(-1px); }

/* ── Related / read next ── */
.related { margin-top: 56px; }
.related-title {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 16px;
}
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.related-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}
.related-card:hover { border-color: var(--mint-border); transform: translateY(-2px); opacity: 1; }
.related-card .k {
  font-family: var(--font-head);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mint);
}
.related-card .t {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-top: 6px;
  line-height: 1.35;
}

/* ── Blog index ── */
.index-head { max-width: 760px; margin: 0 auto; padding: 64px 28px 8px; }
.post-list {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 28px 96px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.post-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}
.post-card:hover { border-color: var(--mint-border); transform: translateY(-2px); opacity: 1; }
.post-card .k {
  font-family: var(--font-head);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mint);
}
.post-card h2 {
  margin: 8px 0 8px;
  font-size: 1.4rem;
  padding-top: 0;
  color: var(--text);
}
.post-card p { margin-bottom: 12px; }
.post-card .meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }

/* ── Glossary ── */
.glossary-section { margin-top: 40px; }
.glossary-section h2 { margin-bottom: 6px; }
.gloss-item {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  scroll-margin-top: 80px;
}
.gloss-item:last-child { border-bottom: none; }
.gloss-term {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--text);
  margin-bottom: 4px;
}
.gloss-term .pron { font-family: var(--font-mono); font-size: 12px; color: var(--mint); font-weight: 400; margin-left: 8px; }
.gloss-def { color: var(--text-muted); margin-bottom: 0; }
.alpha-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 20px 0 8px;
}
.alpha-nav a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.alpha-nav a:hover { color: var(--mint); border-color: var(--mint-border); opacity: 1; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 36px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 22px;
  text-align: center;
  font-size: 13px;
  color: var(--text-faint);
}
.footer-wordmark { font-family: var(--font-head); font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.footer-wordmark .ai { color: var(--mint); }
footer a { color: var(--mint); text-decoration: none; transition: opacity 0.2s; }
footer a:hover { opacity: 0.7; }
footer .sep { color: var(--border-2); }

@media (max-width: 640px) {
  .wrap { padding: 40px 20px 72px; }
  .nav { padding: 14px 18px; }
  .nav-links { display: none; }
  .related-grid { grid-template-columns: 1fr; }
  .index-head { padding: 44px 20px 4px; }
  .post-list { padding: 22px 20px 72px; }
}
