/* ==========================================================================
   Base — reset, typography, layout primitives, motion scaffolding
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, video, svg { display: block; max-width: 100%; height: auto; }
img { background: var(--surface-container); }

a { color: inherit; text-decoration: none; }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

ul[role="list"] { list-style: none; padding: 0; }

:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

::selection { background: rgb(var(--primary-rgb) / 0.16); color: var(--primary-deep); }

/* --- Headings --- */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
  text-wrap: balance;
}

p { text-wrap: pretty; }

/* --- Layout primitives --- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: 960px; }

.section { padding-block: var(--space-section); }
.section--tight { padding-block: clamp(2.5rem, 2rem + 3vw, 5rem); }

.prose { max-width: var(--maxw-prose); }
.prose p + p { margin-top: var(--space-4); }

.stack > * + * { margin-top: var(--space-4); }
.stack-lg > * + * { margin-top: var(--space-6); }

/* Section label: a quiet gold cue, no decorative dash */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-head);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.005em;
  color: var(--secondary-strong);
}

.display {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: var(--tracking-display);
}
.display em { font-style: italic; color: var(--primary); font-weight: 500; }

.h-accent { color: var(--primary); }

.lead {
  font-size: var(--text-lg);
  color: var(--ink-muted);
  max-width: 56ch;
}

.text-muted { color: var(--ink-muted); }

/* --- Material Symbols sizing --- */
.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  line-height: 1;
  user-select: none;
}

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

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100%;
  z-index: var(--z-toast);
  background: var(--primary);
  color: var(--on-dark);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: top var(--dur-fast) var(--ease-out-quart);
}
.skip-link:focus { top: var(--space-4); }

/* --- Reveal-on-scroll: enhance an already-visible default --- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity var(--dur-slow) var(--ease-out-expo),
    transform var(--dur-slow) var(--ease-out-expo);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }

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

/* No-JS safety: never leave content hidden if JS fails to run */
.no-js .reveal { opacity: 1; transform: none; }
