/* ─────────────────────────────────────────────
   Base — reset, typography, section rhythm.
   ───────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--text-on-desk);
  background: var(--bg-shelf-deep);
  font-optical-sizing: auto;
}

/* Themed scrollbar — gold thread on ledger cloth */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--gold-foil) var(--ledger-green-deep);
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ledger-green-deep); }
::-webkit-scrollbar-thumb {
  background: var(--gold-foil);
  border: 2px solid var(--ledger-green-deep);
  border-radius: 6px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 560;
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; max-width: var(--measure); }

a { color: inherit; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

img { max-width: 100%; display: block; }

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

::selection {
  background: var(--gold-foil);
  color: var(--ink);
}

.wrap {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Section surfaces: dark "shelf" vs paper "desk" */
.surface-shelf {
  background: var(--bg-shelf);
  color: var(--text-on-shelf);
}
.surface-desk {
  background-color: var(--bg-desk);
  color: var(--text-on-desk);
  /* laid-paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
}

/* Eyebrow: small-caps ledger label */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
}
.surface-desk .eyebrow { color: var(--oxblood); }

/* Ledger rule — double line, like a totals underline */
.ledger-rule {
  border: none;
  height: 5px;
  margin: 0;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  opacity: 0.35;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
