/* Reset, type roles, page scaffolding and the reveal choreography. */

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}

h1, h2, h3 { margin: 0; font-weight: 400; text-wrap: balance; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent-lift);
  outline-offset: 3px;
  border-radius: 1px;
}

/* Keyboard users get a way past the fixed chrome. */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink); color: var(--bg);
  padding: .75rem 1.25rem;
  font-family: var(--font-mono); font-size: var(--t-mono);
  letter-spacing: .14em; text-transform: uppercase; text-decoration: none;
}
.skip:focus { left: 0; }

/* Stone grain: a tactile mineral tooth over the whole page. */
.grain {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: var(--grain-op); mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

/* ---------- type roles ---------- */
.mono {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* Inscriptional treatment: Roman monuments are letterspaced capitals. */
.inscribe {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .26em;
  font-size: var(--t-sm);
  color: var(--ink-2);
}

.lead { font-size: var(--t-lead); color: var(--ink-2); line-height: 1.6; max-width: var(--measure); }
.prose { display: grid; gap: 1.4rem; max-width: var(--measure); }
.prose p { color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 500; }

/* ---------- page scaffolding ---------- */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: var(--gutter);
}
main { margin-left: 0; }
@media (min-width: 1180px) {
  main, .topbar-inner, footer .wrap { padding-left: var(--rail-w); }
}

.sec { position: relative; padding-block: clamp(3.25rem, 7.5vh, 5.5rem); }
.sec + .sec { border-top: 1px solid var(--rule-soft); }

/* Section rule carved as bead and reel, the astragal's own ornament.
   It is chiselled in from the left as the section arrives. */
.sec-head { display: flex; align-items: baseline; gap: 1.25rem; margin-bottom: 2.5rem; }
.sec-head::after {
  content: "";
  flex: 1;
  align-self: center;
  height: 8px;
  background-image:
    radial-gradient(circle at 5px 50%, var(--rule) 0 3.4px, transparent 3.6px),
    linear-gradient(90deg, transparent 0 12px, var(--rule) 12px 15px, transparent 15px);
  background-size: 21px 8px;
  background-repeat: repeat-x;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.2s var(--ease) .15s;
}
.sec-head.is-in::after { clip-path: inset(0 0 0 0); }

/* ---------- reveal choreography ---------- */
.rv {
  opacity: 0; transform: translateY(22px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--d, 0ms);
}
.rv.is-in { opacity: 1; transform: none; }

/* Hero load sequence: the column is assembled from the shaft upward. */
.set {
  opacity: 0; transform: translateY(16px);
  animation: settle .95s var(--ease) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes settle { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  .set { animation: none; opacity: 1; transform: none; }
  .sec-head::after { clip-path: none; }
  * { transition-duration: .01ms !important; }
}
