/* TokenForge — shared chrome styles for every page (header, nav, prose, tables,
   callouts, cards, CTA, forms, footer, consent banner).
   Design tokens live in /tokens.css — load that file BEFORE this one on every page.
   Fonts load via direct <link> tags in each page's <head> (no @import waterfall). */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body { font-family: var(--font-ui); background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--accent); }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header + nav */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 56px; padding: 0 20px; border-bottom: 1px solid var(--border); background: var(--surface);
  position: sticky; top: 0; z-index: 20; }
.site-logo { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600;
  color: var(--text); text-decoration: none; flex: none; }
.site-logo .accent { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.site-nav a { font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none;
  padding: 6px 10px; border-radius: var(--radius); }
.site-nav a:hover { color: var(--text); background: var(--bg); }
.site-nav a[aria-current="page"] { color: var(--accent); }
.theme-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); cursor: pointer; flex: none; }
.theme-btn:hover { border-color: var(--border-strong); }

/* Layout + prose */
.container { max-width: 760px; margin: 0 auto; padding: 40px 20px 56px; }
.container.wide { max-width: 1000px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin: 0 0 16px; }
.breadcrumb a { color: var(--muted); }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 28px; }
.byline { font-size: 14px; color: var(--muted); margin: 0 0 22px; }
.byline a { color: var(--muted); text-decoration: underline; }
.rf-diagram { display: block; width: 100%; max-width: 480px; height: auto; margin: 6px auto 22px; }
.prose pre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; overflow-x: auto; margin: 0 0 16px; font-size: 13px; line-height: 1.5; }
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 12px; }
.prose h2 { font-size: 22px; font-weight: 600; margin: 36px 0 12px; }
.prose h3 { font-size: 17px; font-weight: 600; margin: 24px 0 8px; }
.prose p, .prose li { font-size: 16px; color: var(--text); }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose strong { font-weight: 600; }
.prose code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.9em;
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--border); border-radius: var(--radius-card); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
thead th { background: var(--bg); color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: none; }

/* Callout */
.callout { background: var(--accent-weak); border: 1px solid var(--accent); border-radius: var(--radius-card);
  padding: 16px 18px; margin: 0 0 20px; }
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--accent); }

/* Cards (guides index) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card { display: block; padding: 20px; border-radius: var(--radius-card); background: var(--surface);
  border: 1px solid var(--border); text-decoration: none; color: var(--text); transition: border-color 120ms, box-shadow 120ms; }
.card:hover { border-color: var(--accent); box-shadow: var(--shadow-card); }
.card h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--text); }
.card p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }

/* CTA */
.cta { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 24px; text-align: center; margin: 36px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px;
  border-radius: var(--radius); font-weight: 600; text-decoration: none; cursor: pointer; border: 1px solid transparent;
  font-size: 15px; font-family: inherit; }
.btn-primary { background: var(--accent); color: var(--text-on-accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; }
.field label { font-size: 14px; font-weight: 500; color: var(--muted); }
.field input, .field textarea { font-family: inherit; font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.form-note { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 24px 20px; text-align: center; }
.footer-nav { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.footer-nav a { font-size: 13px; color: var(--accent); text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.site-footer span { font-size: 13px; color: var(--muted); }

/* GDPR consent banner */
.rf-consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; align-items: center;
  justify-content: center; gap: 16px; flex-wrap: wrap; padding: 14px 20px; background: var(--surface);
  border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(0,0,0,0.10); }
.rf-consent[hidden] { display: none; }
.rf-consent p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); max-width: 60ch; }
.rf-consent-actions { display: flex; gap: 8px; flex: none; }
.rf-consent .btn { padding: 7px 14px; font-size: 13px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
