/* Design tokens + global base. Source of truth: specimen.html / colors.md / design-philosophy.md.
   Loaded once for the whole site — do not redeclare :root or reset rules per-section. */

:root {
  --canvas: #ffffff;
  --surface: #f7f7f5;
  --ink: #15100e;
  --ink-muted: #6e6e73;
  --accent: #b53a3a;
  --accent-hover: #963030;
  --accent-soft: #f6e9e9;
  --line: #e5e5e5;
  --line-strong: rgba(17, 17, 17, 0.16);
  --focus-ring: var(--accent);
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 22px;
  --shadow-hover: 0 20px 40px -20px rgba(17, 17, 17, 0.22);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-sans: "neue-haas-grotesk-text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 10px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font-sans);
  font-size: 1.7rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
}

main {
  display: block;
}

/* ---- global grain: a whisper of texture over every section so flat fills read as
   roasted paper/kraft rather than vector color, not as a per-section concern ---- */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  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='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  opacity: 0.035;
  mix-blend-mode: overlay;
  pointer-events: none;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0.001ms !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0.001ms !important;
  }
}

/* ---- icon system (Material Symbols Rounded, weight 300-400, per design-philosophy.md #8) ---- */

.material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;
  vertical-align: middle;
}

.icon-16 { font-size: 16px; font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20; }
.icon-18 { font-size: 18px; font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20; }
.icon-20 { font-size: 20px; font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 20; }
.icon-22 { font-size: 22px; font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24; }
.icon-24 { font-size: 24px; font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24; }
.icon-28 { font-size: 28px; font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24; }
.icon-32 { font-size: 32px; font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 40; }
.icon-36 { font-size: 36px; font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 40; }

/* ---- shared typographic + accent utilities used identically across many sections ---- */

.accent-dot {
  color: var(--ink);
}

/* ---- canonical button (design-philosophy.md #9: primary buttons stay ink, not accent) ---- */

.button,
.button--ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 4.6rem;
  padding: 0 1.8rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  text-decoration: none;
  font: inherit;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), background-color 180ms var(--ease), color 180ms var(--ease);
}

.button {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.button--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.button .material-symbols-rounded {
  transition: transform 180ms var(--ease);
}

.button:hover,
.button:focus-visible {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.button:hover .material-symbols-rounded {
  transform: translateX(4px);
}

.button--ghost:hover,
.button--ghost:focus-visible {
  border-color: var(--ink);
}

@media (max-width: 560px) {
  body {
    font-size: 1.6rem;
  }
}

/* ---- shared scroll-reveal primitive, driven by static/js/reveal.js ---- */

[data-reveal] {
  opacity: 0;
  transform: translateY(20px) scale(0.985);
  transition: opacity 640ms var(--ease), transform 640ms var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
