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

/* Warm editorial palette, matching the home page */
:root {
  --bg: #f7f2e8;
  --surface: #fffdf8;
  --border: #e4d9c6;
  --text: #1f1b16;
  --muted: #6b6154;
  --subtle: #a39a8a;
  --accent: #b4532a;
  --code-bg: #efe7d8;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1612;
    --surface: #241f19;
    --border: #3a3229;
    --text: #f3ece0;
    --muted: #a79c8a;
    --subtle: #6f6557;
    --accent: #e08a5f;
    --code-bg: #2c251e;
  }
}

:root[data-theme="dark"] {
  --bg: #1a1612;
  --surface: #241f19;
  --border: #3a3229;
  --text: #f3ece0;
  --muted: #a79c8a;
  --subtle: #6f6557;
  --accent: #e08a5f;
  --code-bg: #2c251e;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }

.site-header { border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 760px; margin: 0 auto; padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { font-family: Georgia, 'Iowan Old Style', serif; font-size: 18px; font-weight: 500; letter-spacing: 0; color: var(--text); text-decoration: none; }
.logo .dot { color: var(--accent); }
nav { display: flex; gap: 20px; align-items: center; }
nav a { font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; }
nav a:hover, nav a[aria-current="page"] { color: var(--text); }
.nav-mobile-toggle { display: none; background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; }

.wrap { max-width: 760px; margin: 0 auto; padding: 48px 24px 24px; }

.crumbs { font-size: 13px; color: var(--subtle); margin-bottom: 18px; }
.crumbs a { color: var(--muted); text-decoration: none; }

.tag { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }
h1 { font-family: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif; font-size: clamp(30px, 5vw, 42px); font-weight: 500; letter-spacing: -0.01em; line-height: 1.12; margin-bottom: 14px; }
.lede { font-size: 18px; color: var(--muted); margin-bottom: 28px; }

h2 { font-family: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif; font-size: 24px; font-weight: 500; letter-spacing: -0.01em; margin: 44px 0 12px; }
h3 { font-family: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif; font-size: 18px; font-weight: 500; margin: 26px 0 8px; }
p { margin: 0 0 14px; font-size: 16px; }
ul, ol { margin: 0 0 16px 22px; font-size: 16px; }
li { margin-bottom: 6px; }
strong { font-weight: 700; }

code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 14px; background: var(--code-bg); padding: 1px 6px; border-radius: 5px; }
pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; overflow-x: auto; margin: 0 0 18px; }
pre code { background: none; padding: 0; font-size: 13.5px; line-height: 1.55; }

.callout { border-left: 3px solid var(--accent); background: var(--surface); font-family: Georgia, 'Iowan Old Style', serif; padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 22px 0; font-size: 16px; }
.callout strong { color: var(--text); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; margin: 14px 0; }
.card h3 { margin: 0 0 6px; }
.card p, .card li { font-size: 15px; color: var(--muted); }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }

.steps { list-style: none; margin: 18px 0; padding: 0; }
.steps li { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; margin: 0 0 10px; }
.steps .n { font-weight: 800; color: var(--accent); min-width: 28px; font-size: 18px; }
.steps a { font-weight: 700; color: var(--text); text-decoration: none; }
.steps .d { display: block; font-size: 14.5px; color: var(--muted); margin-top: 2px; }

.next { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--border); margin-top: 48px; padding-top: 22px; font-size: 15px; flex-wrap: wrap; }
.next a { text-decoration: none; font-weight: 600; }
.next .label { display: block; font-size: 12px; color: var(--subtle); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }

.note { font-size: 13px; color: var(--subtle); margin-top: 36px; }
.sources li { font-size: 14px; }

footer { border-top: 1px solid var(--border); }
.footer-inner { max-width: 760px; margin: 0 auto; padding: 28px 24px; text-align: center; font-size: 12px; color: var(--muted); }

@media (max-width: 640px) {
  nav { display: none; }
  nav.open { display: flex; flex-direction: column; position: absolute; top: 56px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 24px; gap: 12px; }
  .nav-mobile-toggle { display: block; }
  .wrap { padding: 32px 16px 16px; }
}
