/* ==========================================================================
   BASE — reset, typography, layout primitives
   ========================================================================== */

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

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--tracking-normal);
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis-weight: none;
  overflow-x: hidden;
  min-height: 100svh;
  transition: background-color var(--dur) var(--ease-out),
              color var(--dur) var(--ease-out);
}

body.is-locked { overflow: hidden; }

img, svg, video, canvas { display: block; max-width: 100%; height: auto; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button { background: none; border: none; cursor: pointer; }

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

ul, ol { list-style: none; }

::selection {
  background: var(--text);
  color: var(--bg);
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-sunk); }
::-webkit-scrollbar-thumb {
  background: var(--brand-iron);
  border-radius: var(--r-pill);
  border: 3px solid var(--bg-sunk);
}
::-webkit-scrollbar-thumb:hover { background: var(--brand-smoke); }

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

/* Display: the Newsreader serif — used for major statements, Claude-style */
.display,
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-optical-sizing: auto;
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

.display-xl { font-size: var(--fs-display-xl); line-height: var(--lh-tight); }
.display-l  { font-size: var(--fs-display-l); }
.display-m  { font-size: var(--fs-display-m); }

.section-title { font-size: var(--fs-h1); }

.section-title em,
.display em {
  font-style: italic;
  color: var(--text-2);
}

p { text-wrap: pretty; }

.lead {
  font-size: var(--fs-lead);
  line-height: var(--lh-loose);
  color: var(--text-2);
  max-width: 62ch;
  font-weight: 400;
}

.muted { color: var(--text-3); }
.dim   { color: var(--text-2); }

/* Eyebrow / kicker label */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-3);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.eyebrow--dot::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 1;
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.02em;
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.shell {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.shell--narrow { max-width: var(--maxw-narrow); }

.section {
  position: relative;
  padding-block: var(--section-y);
}

.section--sunk { background: var(--bg-sunk); }
.section--tight { padding-block: clamp(3rem, 2rem + 4vw, 5.5rem); }

.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  max-width: 780px;
  margin-bottom: clamp(2.5rem, 1.5rem + 3.5vw, 4.5rem);
}

.section-head--wide { max-width: none; }

.section-head--split {
  max-width: none;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-7);
  flex-wrap: wrap;
}

.section-head--split > * { flex: 1 1 320px; }
.section-head--split .section-title { max-width: 16ch; }

.stack   { display: flex; flex-direction: column; gap: var(--sp-4); }
.stack-2 { display: flex; flex-direction: column; gap: var(--sp-2); }
.stack-5 { display: flex; flex-direction: column; gap: var(--sp-5); }
.stack-6 { display: flex; flex-direction: column; gap: var(--sp-6); }

.row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }

.hr {
  height: 1px;
  border: 0;
  background: var(--line);
  margin-block: var(--sp-8);
}

.sr-only {
  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: fixed;
  top: var(--sp-4);
  left: var(--sp-4);
  z-index: var(--z-loader);
  padding: var(--sp-3) var(--sp-5);
  background: var(--bg-inverse);
  color: var(--text-inverse);
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--dur) var(--ease-out);
}

.skip-link:focus-visible { transform: translateY(0); }

/* Noise overlay — the fine film Anthropic-ish surfaces have */
.grain {
  position: fixed;
  inset: 0;
  z-index: 750; /* over all content, under the header chrome */
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  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='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
