:root {
  --bg: #faf9f5;
  --surface: #f0eee6;
  --card: #ffffff;
  --ink: #141413;
  --muted: #5e5d59;
  --border: #e8e6dc;
  --accent: #d97757;
  --accent-hover: #c15f3c;
  --on-accent: #141413;
  --band: #141413;
  --on-band: #faf9f5;
  --radius: 18px;
  --serif: "Fraunces", "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141413;
    --surface: #1f1e1d;
    --card: #1f1e1d;
    --ink: #faf9f5;
    --muted: #b0aea5;
    --border: #30302e;
    --band: #d97757;
    --on-band: #141413;
  }
}
:root[data-theme="dark"] {
  --bg: #141413;
  --surface: #1f1e1d;
  --card: #1f1e1d;
  --ink: #faf9f5;
  --muted: #b0aea5;
  --border: #30302e;
  --band: #d97757;
  --on-band: #141413;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, svg { max-width: 100%; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); }
h3 { font-size: 1.35rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.eyebrow {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent-hover); margin-bottom: 14px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .eyebrow { color: var(--accent); } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px;
  font: 600 0.98rem var(--sans); text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { padding: 9px 18px; font-size: 0.9rem; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; text-decoration: none; letter-spacing: -0.02em; }
.brand span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a:not(.btn) { text-decoration: none; color: var(--muted); font-weight: 500; font-size: 0.95rem; }
.nav-links a:not(.btn):hover { color: var(--ink); }
@media (max-width: 640px) { .nav-links a:not(.btn) { display: none; } }

/* Hero */
.hero { text-align: center; padding: 88px 0 72px; }
.hero h1 { max-width: 14ch; margin: 0 auto 24px; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .sub { max-width: 620px; margin: 0 auto 36px; font-size: 1.2rem; color: var(--muted); }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Credentials strip */
.strip { border-block: 1px solid var(--border); background: var(--surface); }
.strip ul { list-style: none; margin: 0; padding: 22px 0; display: grid; gap: 14px 32px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .strip ul { grid-template-columns: repeat(3, 1fr); } }
.strip li { font-size: 0.95rem; color: var(--muted); display: flex; gap: 10px; align-items: baseline; }
.strip li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transform: translateY(-1px); }
.strip strong { color: var(--ink); font-weight: 600; }

/* Sections */
section { padding: 88px 0; }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head p { color: var(--muted); font-size: 1.1rem; margin-top: 14px; }

.grid { display: grid; gap: 20px; }
@media (min-width: 800px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; display: flex; flex-direction: column; gap: 10px;
}
.card p { color: var(--muted); margin: 0; }
.card .tag { align-self: flex-start; font-size: 0.78rem; font-weight: 600; padding: 4px 12px; border-radius: 999px; background: var(--surface); color: var(--muted); margin-bottom: 6px; }
.card .more { margin-top: auto; padding-top: 18px; font-weight: 600; text-decoration: none; color: var(--ink); }
.card .more span { color: var(--accent); transition: margin 0.15s; }
a.card { text-decoration: none; color: inherit; transition: transform 0.15s, border-color 0.15s; }
a.card:hover { transform: translateY(-3px); border-color: var(--accent); }
a.card:hover .more span { margin-left: 4px; }

.pillar { background: var(--surface); border-radius: var(--radius); padding: 36px; }
.pillar p { color: var(--muted); }
.pillar ul { margin: 18px 0 0; padding-left: 1.1em; color: var(--muted); }
.pillar li { margin-bottom: 6px; }

/* CTA band */
.cta-band { background: var(--band); color: var(--on-band); text-align: center; border-radius: 28px; padding: 72px 24px; }
.cta-band h2 { margin-bottom: 16px; }
.cta-band p { max-width: 520px; margin: 0 auto 30px; opacity: 0.85; font-size: 1.1rem; }
.cta-band .btn-primary { background: var(--accent); color: #141413; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cta-band .btn-primary { background: #141413; color: #faf9f5; } }
:root[data-theme="dark"] .cta-band .btn-primary { background: #141413; color: #faf9f5; }

.footer { padding: 40px 0 56px; color: var(--muted); font-size: 0.9rem; }
.footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer a { text-decoration: none; border-bottom: 1px solid var(--border); }

/* Reader pages */
.reader { max-width: 700px; margin: 0 auto; padding: 56px 16px 40px; }
.reader .back { display: inline-block; margin-bottom: 36px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.reader .back:hover { color: var(--ink); }
.reader h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 20px; }
.reader h2 { font-size: 1.5rem; margin: 2em 0 0.6em; }
.reader p, .reader li { font-family: var(--serif); font-size: 1.12rem; line-height: 1.7; }
.reader ol, .reader ul { padding-left: 1.4em; }
.note {
  font-family: var(--sans); font-size: 0.92rem; color: var(--muted);
  background: var(--surface); border-left: 3px solid var(--accent);
  border-radius: 6px; padding: 14px 18px; margin: 0 0 32px;
}
.reader .note { font-family: var(--sans); font-size: 0.92rem; line-height: 1.55; }
.scale { list-style: none; padding: 0 !important; margin: 0 0 1.4em; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--card); }
.scale li { display: flex; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--border); font-family: var(--sans); font-size: 0.97rem; line-height: 1.5; }
.scale li:last-child { border-bottom: 0; }
.scale b { flex: none; width: 1.6em; font-family: var(--serif); font-size: 1.2rem; color: var(--accent); }
pre.preamble {
  white-space: pre-wrap; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px; font: 0.88rem/1.6 ui-monospace, "SF Mono", Menlo, monospace; margin: 0 0 1.6em;
}
.reader-cta { margin: 56px 0 0; padding: 36px; border-radius: var(--radius); background: var(--surface); text-align: center; }
.reader-cta h2 { margin: 0 0 8px; font-size: 1.6rem; }
.reader-cta p { font-family: var(--sans); font-size: 1rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, a.card { transition: none; }
}
