/* First Round blog — one stylesheet, no framework, no JS.
   Tokens mirror src/constants/colors.ts so the reading page looks like the product.
   Display face is FatFrank (public/fonts/FatFrank-Regular.ttf, exported to /fonts/).
   FatFrank ships a single weight — never set font-weight on it, a synthesised bold falls back to
   a system face on some platforms (see reference-fatfrank-android). Body text is system sans. */

@font-face {
  font-family: 'FatFrank';
  src: url('/fonts/FatFrank-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --deep-navy: #13213b;
  --navy: #1e2d4c;
  --ink: #19223a;
  --orange: #f8a602;
  --cream: #fff8ec;
  --white: #fcfcfc;

  /* light is the default: cream page, ink type */
  --bg: var(--cream);
  --surface: #fffdf8;
  --text: var(--ink);
  --muted: #6a7489;
  --rule: #e5dccb;
  --accent: #a86e00; /* orange darkened to clear 4.5:1 on cream */
  --accent-ink: var(--deep-navy);
  --code-bg: #efe6d5;

  --measure: 70ch;
  --display: 'FatFrank', 'Trebuchet MS', system-ui, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--deep-navy);
    --surface: #1a2a49;
    --text: var(--cream);
    --muted: #97a2b9;
    --rule: #2c3d5e;
    --accent: var(--orange);
    --accent-ink: var(--deep-navy);
    --code-bg: #22334f;
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  /* 17px on a phone, easing to 18px on a desktop — a reading page, not an app screen. */
  font-size: clamp(1.0625rem, 0.98rem + 0.35vw, 1.125rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ---- chrome ---------------------------------------------------------- */

header.site, footer.site {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  font-size: 0.9375rem;
}

header.site { border-bottom: 1px solid var(--rule); }

footer.site {
  border-top: 1px solid var(--rule);
  margin-top: 4rem;
  color: var(--muted);
  justify-content: center;
  gap: 0.35rem;
  padding-bottom: 3rem;
}

footer.site a { color: var(--muted); }

.brand {
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
}

.back { color: var(--muted); text-decoration: none; }
.back:hover { color: var(--accent); }

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 0;
}

/* ---- rhythm ---------------------------------------------------------- */
/* One rule: every block gets bottom margin, headings claim space above them.
   That is the whole vertical rhythm system. */

article > * { margin: 0 0 1.25rem; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

h1, .index-title {
  font-size: clamp(2.125rem, 1.4rem + 3.2vw, 3.25rem);
  margin: 0.25rem 0 1rem;
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.08;
}

article h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 1.9rem);
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

article h3 {
  font-size: 1.25rem;
  margin-top: 2.25rem;
  color: var(--accent);
}

article h4 { font-size: 1.0625rem; margin-top: 1.75rem; font-family: var(--body); font-weight: 700; }

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.5rem;
  font-weight: 700;
}

.lede {
  font-size: 1.1875rem;
  line-height: 1.55;
  color: var(--muted);
  margin-bottom: 1rem;
}

.meta {
  font-size: 0.875rem;
  color: var(--muted);
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration: none; }

strong { font-weight: 700; }

ul, ol { padding-left: 1.4rem; }
li { margin-bottom: 0.5rem; }
li::marker { color: var(--accent); }

blockquote {
  margin: 2rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}
blockquote p { margin: 0; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Wide content scrolls inside itself — the page body never scrolls sideways. */
.table-wrap { overflow-x: auto; margin: 1.75rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
th, td { text-align: left; padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--rule); }
th { font-weight: 700; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }

/* ---- index ----------------------------------------------------------- */

.posts { list-style: none; padding: 0; margin: 2.5rem 0 0; }
.posts li { margin: 0; border-top: 1px solid var(--rule); }

.posts a {
  display: block;
  padding: 1.75rem 0;
  color: inherit;
  text-decoration: none;
}
.posts time { font-size: 0.8125rem; color: var(--muted); letter-spacing: 0.03em; }
.posts h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.375rem, 1.1rem + 1.1vw, 1.75rem);
  margin: 0.35rem 0 0.4rem;
}
.posts p { margin: 0; color: var(--muted); font-size: 0.9375rem; line-height: 1.55; }
.posts a:hover h2 { color: var(--accent); }

/* ---- the one CTA ----------------------------------------------------- */

.cta {
  margin: 4rem 0 0;
  padding: 2rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
}
.cta h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}
.cta p { margin: 0 0 1.25rem; color: var(--muted); font-size: 0.9375rem; }

.btn {
  display: inline-block;
  background: var(--orange);
  color: var(--deep-navy);
  font-weight: 700;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  /* the product's tactile bottom edge */
  box-shadow: 0 3px 0 #cf8600;
}
.btn:hover { transform: translateY(1px); box-shadow: 0 2px 0 #cf8600; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .btn:hover { transform: none; }
}

/* ---- print: the quiz posts are meant to come out of a printer -------- */

@media print {
  :root { --bg: #fff; --text: #000; --muted: #444; --rule: #ccc; --accent: #000; }
  header.site, footer.site, .cta { display: none; }
  body { font-size: 11pt; line-height: 1.45; }
  main { max-width: none; padding: 0; }
  article h2 { break-after: avoid; margin-top: 1.5rem; padding-top: 0.75rem; }
  li, tr { break-inside: avoid; }
  a { color: #000; text-decoration: none; }
}
