/* ── alcoia — base ─────────────────────────────────────────────────────── */

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

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--alc-serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
}

/* barely-perceptible paper grain — the one texture exception in §6.4 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.025;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 180px 180px;
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }

/* ── type scale ──────────────────────────────────────────────────────── */

h1, h2, h3, h4 { font-family: var(--alc-serif); font-weight: 400; line-height: 1.15; }

/* width-driven, aspect ratio ~2.714:1 (1672x616 wordmark PNG) — targets
   roughly the scale the old clamp(1.75rem,4vw,2.5rem) text produced */
.hero-word {
  display: block;
  width: clamp(8rem, 18vw, 11rem);
  height: auto;
}

.h-hero {
  font-size: clamp(2.75rem, 7vw, 6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 400;
}

.h-section {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.h-sub {
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.3;
}

.lead {
  font-size: 1.375rem;
  font-weight: 300;
  line-height: 1.55;
  color: var(--ink);
}

p, li { max-width: var(--measure); }
.measure-none { max-width: none; }

.eyebrow {
  font-family: var(--alc-ui);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.caption {
  font-family: var(--alc-ui);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.ui-label {
  font-family: var(--alc-ui);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

em, .italic { font-style: italic; }

.tabular { font-variant-numeric: tabular-nums; }

/* ── layout ──────────────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: 78rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
  position: relative;
  z-index: 1;
}

.wrap-narrow { max-width: 52rem; }
.wrap-prose { max-width: 44rem; }

section, .section {
  padding-block: clamp(3.5rem, 8vw, 7rem);
  position: relative;
  z-index: 1;
}

.section-tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

.stack > * + * { margin-top: var(--gap, 1rem); }
.stack-sm { --gap: 0.5rem; }
.stack-md { --gap: 1.25rem; }
.stack-lg { --gap: 2rem; }
.stack-xl { --gap: 3.5rem; }

.grid { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* asymmetric split used by the home-page reading demo (§9.1) */
.grid-split {
  grid-template-columns: 1.1fr 1fr;
  align-items: start;
}

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-4, .grid-split { grid-template-columns: 1fr; }
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.vh {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--alc-ui);
  font-weight: 600;
  font-size: 0.875rem;
  transition: top 200ms var(--ease);
}
.skip-link:focus { top: 1rem; }

hr, .rule {
  border: none;
  border-top: 1px solid var(--rule);
}

/* ── focus ───────────────────────────────────────────────────────────── */

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--lilac-deep);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── selection ───────────────────────────────────────────────────────── */

::selection { background: var(--lilac-wash); color: var(--ink); }

/* ── reduced motion: content sits in its final state ────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* no-JS: everything ships visible; reveal states are added by JS only */
.no-js .reveal { opacity: 1; transform: none; }
