:root {
  --bg: #f8f5ef;
  --surface: #ffffff;
  --surface-alt: #efe9df;
  --ink: #1f1b16;
  --muted: #5f584f;
  --rule: #dcd4c6;
  --accent: #1f4d3a;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, #1f4d3a 12%, white);
  --radius: 4px;
  --radius-lg: 8px;
  --shadow: 0 1px 0 rgba(31,27,22,0.06);
  --max: 1080px;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;
}

/* Base stylesheet shared by every brand site. Theme variables are prepended at
   build time (see themes.ts); preset-specific layout variants live at the
   bottom under [data-preset="…"]. Keep it dependency-free. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; margin: 0 0 1em; }
li { margin-bottom: 0.35em; }
strong { font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: 20px; }
.section { padding-block: clamp(2.5rem, 6vw, 5rem); }
.section--alt { background: var(--surface-alt); }
.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.lede { font-size: 1.2rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }

/* Header */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 72px; flex-wrap: wrap;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--ink);
  letter-spacing: -0.01em;
  display: inline-flex; align-items: center; gap: 0.6rem;
}
.wordmark:hover { text-decoration: none; }
.wordmark__mark {
  width: 34px; height: 34px; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink);
  display: inline-grid; place-items: center;
  font-size: 0.95rem; font-weight: 700; letter-spacing: 0;
}
.wordmark img { height: 40px; width: auto; }
.nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.nav a { color: var(--ink); font-weight: 600; font-size: 0.95rem; }
.nav a[aria-current="page"] { color: var(--accent); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  border: 1px solid var(--accent);
}
.btn:hover { text-decoration: none; filter: brightness(0.94); }
.btn--ghost { background: transparent; color: var(--accent); }
.btn-row { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* Hero */
.hero { padding-block: clamp(3rem, 8vw, 7rem); border-bottom: 1px solid var(--rule); }
.hero__inner { display: grid; gap: 2rem; align-items: center; }
.hero h1 { max-width: 18ch; }
.hero__facts {
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--rule);
}
.hero__facts dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.hero__facts dd { margin: 0.2rem 0 0; font-weight: 600; }

/* Cards */
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card ul { margin-bottom: 0; color: var(--muted); font-size: 0.95rem; }
.card--link { color: inherit; display: block; }
.card--link:hover { text-decoration: none; border-color: var(--accent); }
.card__meta { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }

/* Steps */
.steps { counter-reset: step; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step { position: relative; padding-top: 3rem; }
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute; top: 0; left: 0;
  font-family: var(--font-display); font-size: 1.6rem; color: var(--accent); font-weight: 700;
}

/* Split layouts */
.split { display: grid; gap: 2.5rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 800px) { .split { grid-template-columns: 1fr 1fr; } }
.split--aside { grid-template-columns: 1fr; }
@media (min-width: 800px) { .split--aside { grid-template-columns: 2fr 1fr; } }

/* Portrait */
.portrait {
  width: 100%; max-width: 320px; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: var(--radius-lg); border: 1px solid var(--rule);
}
.portrait--placeholder {
  display: grid; place-items: center; background: var(--surface-alt);
  color: var(--muted); font-family: var(--font-display); font-size: 3rem;
}

/* Contact */
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.contact-list dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.contact-list dd { margin: 0.15rem 0 0; font-size: 1.05rem; }
.contact-list dl { margin: 0; }

/* Article / guides */
.article { max-width: 70ch; }
.article h2 { margin-top: 2.2rem; font-size: 1.5rem; }
.article p, .article li { font-size: 1.05rem; }
.note {
  background: var(--surface-alt); border-left: 3px solid var(--accent);
  padding: 0.9rem 1.1rem; border-radius: var(--radius); font-size: 0.95rem; color: var(--muted);
}

/* Legal */
.legal { display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .legal { grid-template-columns: 240px 1fr; } }
.legal__toc { position: sticky; top: 90px; align-self: start; font-size: 0.92rem; }
.legal__toc ol { list-style: none; padding: 0; margin: 0; }
.legal__toc li { margin-bottom: 0.5rem; }
.legal__toc a { color: var(--muted); }
.legal__doc { max-width: 75ch; }
.legal__doc section { scroll-margin-top: 90px; margin-bottom: 2.2rem; }
.legal__doc h2 { font-size: 1.35rem; }
.legal__meta { color: var(--muted); font-size: 0.95rem; margin-bottom: 2rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--surface-alt);
  padding-block: 2.5rem;
  font-size: 0.92rem;
  color: var(--muted);
}
.site-footer .wrap { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.site-footer h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink); margin-bottom: 0.6rem; }
.site-footer a { color: var(--ink); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer__legal { grid-column: 1 / -1; border-top: 1px solid var(--rule); padding-top: 1.2rem; font-size: 0.85rem; }

/* CTA band */
.cta-band { background: var(--ink); color: var(--bg); }
.cta-band h2 { color: inherit; }
.cta-band .btn { background: var(--bg); color: var(--ink); border-color: var(--bg); }

/* Preset variants ------------------------------------------------------- */

[data-preset="editorial"] .hero h1::after {
  content: ""; display: block; width: 72px; height: 3px; background: var(--accent); margin-top: 1.2rem;
}
[data-preset="editorial"] .site-header { border-bottom-width: 2px; }
[data-preset="editorial"] .card { box-shadow: none; }

[data-preset="modern"] .hero { border-bottom: 0; }
[data-preset="modern"] .hero__inner { grid-template-columns: 1fr; }
@media (min-width: 860px) { [data-preset="modern"] .hero__inner { grid-template-columns: 3fr 2fr; } }
[data-preset="modern"] .hero__panel {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #0b1a3a));
  color: var(--accent-ink); border-radius: var(--radius-lg); padding: 2rem;
}
[data-preset="modern"] .hero__panel h3 { color: inherit; }
[data-preset="modern"] .hero__panel ul { margin: 0; padding-left: 1.1em; }
[data-preset="modern"] .btn { border-radius: 999px; }
[data-preset="modern"] .nav a { font-weight: 500; }

[data-preset="classic"] .hero { text-align: center; }
[data-preset="classic"] .hero h1 { margin-inline: auto; }
[data-preset="classic"] .hero .lede { margin-inline: auto; }
[data-preset="classic"] .hero .btn-row { justify-content: center; }
[data-preset="classic"] .hero__facts { justify-items: center; text-align: center; }
[data-preset="classic"] .eyebrow { letter-spacing: 0.22em; }
[data-preset="classic"] .site-header { border-bottom: 3px double var(--rule); }
[data-preset="classic"] .card { border-top: 3px solid var(--accent); }

/* Draft markers: visible when a build runs with --draft */
.required-marker { background: #fff3cd; color: #7a4b00; padding: 0 0.3em; border-radius: 3px; font-weight: 700; }
