/* ============================================================
   Fablespin: shared theme
   Cozy storybook: midnight navy + warm cream + gold.
   Tokens, type, and components shared by every page.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=JetBrains+Mono:wght@400;500&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400;1,6..72,500;1,6..72,600&display=swap');

:root {
  /* surfaces: dark */
  --midnight: #0e1428;
  --midnight-2: #171f3b;
  --midnight-3: #222c50;
  /* surfaces: light */
  --cream: #f6ecdc;
  --cream-soft: #fbf4e6;
  --cream-2: #ece0c8;
  /* ink */
  --ink: #2a2540;
  --ink-mute: #6f6883;
  --ink-soft: #a39db4;
  /* accents */
  --gold: #e6b97a;
  --gold-deep: #c8956a;
  --terracotta: #c87456;
  --terracotta-deep: #b5663f;
  --sage: #a8c5b5;
  --rose: #d4a5a5;
  --lilac: #b8a8d4;
  /* type */
  --font-display: 'Newsreader', 'Source Serif 4', Georgia, serif;
  --font-ui: 'Geist', 'DM Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; }
a { color: var(--terracotta); }

/* ---- layout ---- */
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* ---- eyebrow / mono label ---- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.eyebrow.on-dark { color: var(--gold); }

/* ---- buttons ---- */
.btn {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 15px;
  line-height: 1;
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.btn-primary { background: var(--terracotta); color: var(--cream-soft); }
.btn-primary:hover { background: var(--terracotta-deep); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--cream); border: 1.5px solid rgba(246,236,220,.28); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-ghost-light { background: transparent; color: var(--ink); border: 1.5px solid rgba(42,37,64,.2); }
.btn-ghost-light:hover { border-color: var(--terracotta); color: var(--terracotta); }

/* ---- brand lockup ---- */
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.brand-name {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--cream);
}

/* ---- site header ---- */
.site-header { background: var(--midnight); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 18px; padding-bottom: 18px;
}
.site-nav a {
  font-family: var(--font-ui); font-size: 14.5px; font-weight: 500;
  color: var(--ink-soft); text-decoration: none; margin-left: 26px;
  transition: color .15s ease;
}
.site-nav a:hover { color: var(--cream); }
@media (max-width: 620px) { .site-nav { display: none; } }

/* ---- site footer ---- */
.site-footer { background: var(--midnight); color: var(--ink-soft); padding: 52px 0 34px; }
.site-footer .footer-grid {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 32px;
}
.site-footer .footer-tag {
  font-family: var(--font-display); font-style: italic;
  font-size: 16px; color: var(--gold); margin-top: 10px; max-width: 280px;
}
.site-footer .footer-links { display: flex; flex-direction: column; gap: 9px; }
.site-footer .footer-links a {
  color: var(--ink-soft); text-decoration: none; font-size: 14px;
  font-family: var(--font-ui); transition: color .15s ease;
}
.site-footer .footer-links a:hover { color: var(--gold); }
.site-footer .footer-base {
  width: 100%; border-top: 1px solid var(--midnight-3);
  margin-top: 30px; padding-top: 22px;
  font-size: 12.5px; color: var(--ink-mute); font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

/* ============================================================
   Document pages: privacy, terms, support
   ============================================================ */

.doc-hero { background: var(--midnight); padding: 30px 0 64px; position: relative; overflow: hidden; }
.doc-hero .wrap-narrow { position: relative; z-index: 1; }
.doc-hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 44px;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--cream);
  margin-top: 16px;
}
.doc-hero .doc-sub {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  color: var(--gold);
  margin-top: 10px;
}

.doc { padding: 56px 0 40px; }
.doc .wrap-narrow > .eyebrow { display: block; margin-bottom: 26px; }

.doc h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--ink);
  margin: 40px 0 12px;
}
.doc h2:first-of-type { margin-top: 0; }
.doc h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  color: var(--ink);
  margin: 26px 0 8px;
}
.doc p, .doc li {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.72;
  color: #3a3552;
}
.doc p { margin: 12px 0; }
.doc ul { margin: 12px 0; padding-left: 22px; }
.doc li { margin: 7px 0; }
.doc strong { font-weight: 600; color: var(--ink); }
.doc a { color: var(--terracotta); text-decoration: underline; text-underline-offset: 2px; }
.doc a:hover { color: var(--terracotta-deep); }
/* buttons inside .doc pages must keep their own button colours, not the .doc a link colour */
.doc a.btn { text-decoration: none; }
.doc a.btn-primary { color: var(--cream-soft); }
.doc a.btn-ghost-light { color: var(--ink); }
.doc a.btn-ghost { color: var(--cream); }
.doc code {
  font-family: var(--font-mono); font-size: 13.5px;
  background: var(--cream-2); padding: 1px 6px; border-radius: 5px; color: var(--ink);
}

/* meta line under page title */
.doc-meta {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em;
  color: var(--ink-mute); margin: 0 0 8px;
}

/* draft / review callout */
.doc-note {
  background: var(--cream-soft);
  border: 1px solid var(--cream-2);
  border-left: 3px solid var(--gold-deep);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 22px 0;
}
.doc-note p { font-size: 14.5px; line-height: 1.6; color: var(--ink-mute); margin: 6px 0; }
.doc-note p:first-child { margin-top: 0; }
.doc-note p:last-child { margin-bottom: 0; }
.doc-note strong { color: var(--gold-deep); }

/* tables in documents */
.doc table {
  width: 100%; border-collapse: collapse; margin: 18px 0;
  font-family: var(--font-ui); font-size: 14px;
}
.doc th, .doc td {
  text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--cream-2);
  vertical-align: top; color: #3a3552;
}
.doc th {
  font-weight: 600; color: var(--ink); background: var(--cream-soft);
  font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em;
}
.doc tr:last-child td { border-bottom: none; }

/* back-to-home link row */
.doc-back {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-ui); font-size: 14px; font-weight: 500;
  color: var(--ink-soft); text-decoration: none;
}
.doc-back:hover { color: var(--gold); }

@media (max-width: 620px) {
  .doc-hero h1 { font-size: 34px; }
  .doc table { font-size: 13px; }
  .doc th, .doc td { padding: 8px 9px; }
}
