/* Base — resets, typography, layout primitives, header & footer. */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.62;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Quiet paper grain so the parchment never feels flat. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 12% 8%, rgba(191,90,60,.05), transparent 38%),
    radial-gradient(circle at 88% 92%, rgba(47,72,88,.05), transparent 42%);
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.16; color: var(--ink); }
h1 { font-size: var(--step-4); letter-spacing: -0.02em; }
h2 { font-size: var(--step-3); letter-spacing: -0.015em; }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
p { max-width: var(--reading); }
a { color: var(--clay-dark); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover { color: var(--clay); }
strong { font-weight: 600; }
img { max-width: 100%; display: block; }

::selection { background: var(--clay-soft); color: var(--ink); }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: var(--sp-3) var(--sp-4); border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

main { flex: 1 0 auto; outline: none; }

.wrap { max-width: var(--content); margin-inline: auto; padding-inline: var(--sp-5); width: 100%; }
.wrap-reading { max-width: 52rem; }

.band { padding-block: var(--sp-8); }
.band--sunken { background: var(--paper-2); border-block: 1px solid var(--line); }

.stack > * + * { margin-top: var(--sp-4); }
.stack-lg > * + * { margin-top: var(--sp-6); }
.muted { color: var(--ink-3); }
.center { text-align: center; }
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.lead { font-size: var(--step-1); color: var(--ink-2); line-height: 1.5; }

/* ---- Site header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,246,238,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  max-width: var(--content); margin-inline: auto;
  padding: var(--sp-3) var(--sp-5);
  display: flex; align-items: center; gap: var(--sp-4);
}
.brand { display: flex; align-items: center; gap: var(--sp-3); text-decoration: none; color: var(--ink); }
.brand__mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--clay); color: var(--paper);
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 600;
  flex: none;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,.18);
}
.brand__name { font-family: var(--font-display); font-size: 1.16rem; font-weight: 600; line-height: 1.05; }
.brand__name small { display: block; font-family: var(--font-body); font-size: .68rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.site-header nav { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }
.site-header nav a {
  color: var(--ink-2); text-decoration: none; font-weight: 500;
  font-size: var(--step--1); padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-sm);
}
.site-header nav a:hover { background: var(--surface-2); color: var(--ink); }
.site-header nav a.is-active { color: var(--clay-dark); }

/* ---- Footer ---- */
.site-footer {
  flex: none;
  background: var(--ink-blue); color: #d9dde0;
  padding-block: var(--sp-7);
  margin-top: var(--sp-8);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: var(--sp-6); justify-content: space-between; }
.site-footer h4 { color: var(--paper); font-size: 1.05rem; margin-bottom: var(--sp-2); }
.site-footer a { color: #e8c9bb; }
.site-footer p { font-size: var(--step--1); max-width: 32rem; }
.site-footer__cols { display: flex; gap: var(--sp-7); flex-wrap: wrap; }
.site-footer ul { list-style: none; padding: 0; font-size: var(--step--1); }
.site-footer li { margin-top: var(--sp-1); }

/* ---- Breadcrumb ---- */
.crumbs {
  display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center;
  font-size: var(--step--1); color: var(--ink-3);
  padding-block: var(--sp-4);
}
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--clay-dark); text-decoration: underline; }
.crumbs span[aria-hidden] { opacity: .5; }

@media (max-width: 640px) {
  .site-header nav a.hide-sm { display: none; }
  .band { padding-block: var(--sp-7); }
  .site-header__inner { padding-inline: var(--sp-4); gap: var(--sp-2); }
  .site-header nav a { white-space: nowrap; padding-inline: var(--sp-2); }
  .brand__name { font-size: 1rem; }
  .brand__name small { display: none; }
  .brand__mark { width: 34px; height: 34px; }
  .wrap { padding-inline: var(--sp-4); }
}
