/* ==========================================================================
   Lacquer — shared design system
   Ported from the app's type + spacing + color tokens so the site and app
   can't drift. One source of truth: link this on every page, declare tokens
   nowhere else.
   ========================================================================== */

:root {
  /* Color — matches the app palette (web hex) */
  --bg: #F4F3F0;
  --surface: #FFFFFF;
  --text: #16150F;
  --secondary: #5A5852;
  --tertiary: #8A8780;
  --accent: #B4531F;
  --accent-hover: #8A3E17;
  --border: #E0DED8;   /* boxes, cards, inputs */
  --rule: #D8D5CE;     /* section rules, dividers */

  /* Families — same three as the app */
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Spacing — the app tokens, one job each … */
  --hair: 4px;
  --tight: 8px;
  --item: 12px;
  --group: 20px;
  --section: 32px;
  --gutter: 20px;
  /* … plus one web-only step: a page needs more air between major bands than
     a phone's largest mid-screen gap (32) or it reads as one column. */
  --band: 80px;

  /* Content caps — centered */
  --max-prose: 720px;   /* running prose */
  --max-wide: 1080px;   /* grids, hero, anything wider */
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;      /* body 16/23 */
  line-height: 23px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
img, svg { display: block; max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--section) 0; }

/* --- Type scale (px on web; same numbers as the app) --------------------- */
.t-display    { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 38px; letter-spacing: -0.01em; }
.t-screen     { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 32px; letter-spacing: -0.01em; }
.t-card       { font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 26px; }
.t-serif-sm   { font-family: var(--serif); font-weight: 400; font-size: 18px; line-height: 22px; }
.t-body       { font-size: 16px; line-height: 23px; }
.t-body-sec   { font-size: 15px; line-height: 21px; color: var(--secondary); }
.t-label      { font-size: 13px; line-height: 17px; }
.t-caption    { font-size: 12px; line-height: 16px; color: var(--tertiary); }
.t-section-label {
  font-family: var(--mono); font-size: 13px; line-height: 16px;
  letter-spacing: 1.2px; text-transform: uppercase; color: var(--tertiary);
}
.mono { font-family: var(--mono); }

/* --- Layout -------------------------------------------------------------- */
.wrap { max-width: var(--max-wide); margin: 0 auto; padding: 0 24px; }
.wrap-prose { max-width: var(--max-prose); margin: 0 auto; padding: 0 24px; }
.band { padding: var(--band) 0; }               /* between major page sections */
.band-tight { padding: var(--section) 0; }

/* --- Header / nav (identical on every page) ------------------------------ */
.site-header { padding: 22px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--group); }
.brand {
  display: flex; align-items: baseline; gap: var(--tight);
  font-family: var(--serif); font-weight: 500; font-size: 31px; letter-spacing: -0.01em;
  color: var(--text);
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand svg { width: 0.97em; height: 0.97em; transform: translateY(0.1446em); }
.site-nav { display: flex; align-items: center; gap: 28px; font-size: 15px; color: var(--secondary); }
.site-nav a { color: var(--secondary); }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--text); }

/* --- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 48px; padding: 0 22px; border-radius: 6px;
  font-family: var(--sans); font-size: 16px; font-weight: 500; line-height: 1;
  background: var(--text); color: var(--surface); border: 1px solid var(--text);
}
.btn:hover { text-decoration: none; color: var(--surface); opacity: .88; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--rule); }
.btn.secondary:hover { color: var(--text); border-color: var(--secondary); }
.btn.small { height: 40px; padding: 0 16px; font-size: 15px; }

/* --- Footer (identical on every page) ------------------------------------ */
.site-footer { border-top: 1px solid var(--rule); padding: var(--section) 0 48px; font-size: 14px; color: var(--secondary); margin-top: var(--band); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: var(--section); flex-wrap: wrap; }
.site-footer nav { display: flex; gap: var(--group); font-size: 14px; }
.site-footer a { color: var(--secondary); }
.site-footer a:hover { color: var(--text); }

/* --- Prose (Field Guide articles, legal pages) --------------------------- */
.prose { color: var(--text); }
.prose > * + * { margin-top: var(--group); }
.prose h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 32px; letter-spacing: -0.01em; margin-top: var(--section); }
.prose h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 26px; margin-top: var(--section); }
.prose p, .prose li { font-size: 17px; line-height: 1.62; color: var(--text); }
.prose p { max-width: 66ch; }
.prose .lead { font-size: 20px; line-height: 1.5; color: var(--secondary); max-width: 60ch; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-top: var(--tight); max-width: 64ch; }
.prose strong { font-weight: 600; }
.prose code, .prose .runout {
  font-family: var(--mono); font-size: 0.92em; background: var(--surface);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px;
}
.prose blockquote { border-left: 2px solid var(--accent); padding-left: var(--group); color: var(--secondary); }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 860px) {
  :root { --band: 56px; }
  .site-nav a.hide-m { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spin { animation: none !important; }
}
