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

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--text-mid);
  background: var(--graphite);
}

/* ---------- Headings ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-hi);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--fs-h1); letter-spacing: -0.03em; font-weight: 800; }
h2 { font-size: var(--fs-h2); letter-spacing: -0.03em; }
h3 { font-size: var(--fs-h3); line-height: 1.25; }
h4 { font-size: var(--fs-h4); line-height: 1.3; font-weight: 600; }

p { max-width: 68ch; }

strong { color: var(--text-hi); font-weight: 600; }

/* Azure emphasis inside headings */
.hl { color: var(--azure); font-style: italic; }

/* ---------- Links ---------- */
a { transition: color var(--dur-fast) var(--ease-out); }

.link-azure {
  color: var(--azure);
  position: relative;
  display: inline-block;
}
.link-azure::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-mid) var(--ease-out);
}
.link-azure:hover::after { transform: scaleX(1); }

/* ---------- Focus (accessibility, non-negotiable) ---------- */
:focus-visible {
  outline: 2px solid var(--azure-bright);
  outline-offset: 3px;
  border-radius: var(--r-tech);
}
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute;
  top: -100px; left: var(--sp-4);
  z-index: var(--z-loader);
  background: var(--azure);
  color: #fff;
  padding: var(--sp-3) var(--sp-5);
  border-radius: 0 0 var(--r-tech) var(--r-tech);
  font-weight: 600;
  transition: top var(--dur-mid) var(--ease-out);
}
.skip-link:focus { top: 0; }

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

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

.section--dark     { background: var(--graphite); }
.section--ink      { background: var(--ink); }
.section--light    { background: var(--concrete); }
.section--light h1,
.section--light h2,
.section--light h3,
.section--light h4 { color: var(--text-ink); }
.section--light p,
.section--light li { color: var(--text-ink-mid); }

/* Blueprint grid backdrop */
.section--grid::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--blueprint);
  background-size: 64px 64px;
  opacity: 0.6;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 78%);
}

/* Film grain — kills gradient banding on dark surfaces */
.grain::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.025;
  z-index: 2;
  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='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Section headers ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--azure);
  margin-bottom: var(--sp-4);
}
.eyebrow::before {
  content: '';
  width: 28px; height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.section-head { max-width: 780px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow::before { display: none; }
.section-head p {
  margin-top: var(--sp-4);
  font-size: var(--fs-lead);
  color: var(--text-mid);
}
.section-head--center p { margin-inline: auto; }

/* ---------- Utilities ---------- */
.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.text-center { text-align: center; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.no-scroll { overflow: hidden; }

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

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