/* ============================================
   Base — typography, links, utilities
   ============================================ */

body {
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-feature-settings: "ss01", "cv11";
}

/* --- Headings — Manrope, generous tracking & line-height --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.018em;
}

h1, .display { line-height: 1.04; letter-spacing: -0.025em; font-weight: 700; }
h2 { line-height: 1.08; letter-spacing: -0.02em; }
h3 { letter-spacing: -0.015em; }

h5, h6 {
  font-family: var(--font-body);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.005em;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
h5 { font-size: var(--fs-h5); }
h6 { font-size: var(--fs-h6); }

.display {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.028em;
}

.display em, h1 em, h2 em, h3 em {
  font-style: normal;
  color: var(--accent-cyan);
  font-weight: 700;
}

/* --- Eyebrow / Kicker --- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand-mid);
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  display: inline-block;
}

.eyebrow.on-dark { color: var(--accent-cyan); }
.eyebrow.on-cyan { color: var(--accent-cyan); }

/* --- Lead / Intro paragraph --- */
.lead {
  font-size: var(--fs-lead);
  color: var(--muted);
  line-height: 1.55;
  max-width: 62ch;
}

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

a:hover { color: var(--brand-mid); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding-bottom: 4px;
  transition: gap var(--dur-base) var(--ease-out), color var(--dur-fast);
}

.link-arrow::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--ink);
  transform-origin: right;
  transition: transform 480ms var(--ease-out);
}

.link-arrow:hover {
  gap: var(--s-3);
  color: var(--brand-deep);
}

.link-arrow:hover::before {
  background: var(--accent-cyan);
  animation: link-underline-redraw 720ms var(--ease-out);
}

@keyframes link-underline-redraw {
  0%   { transform: scaleX(1); transform-origin: right; }
  49%  { transform: scaleX(0); transform-origin: right; }
  51%  { transform: scaleX(0); transform-origin: left; }
  100% { transform: scaleX(1); transform-origin: left; }
}

.link-arrow::after {
  content: "→";
  display: inline-block;
  transition: transform var(--dur-base) var(--ease-out);
}

.link-arrow:hover::after { transform: translateX(3px); }

/* --- Utility: container --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container-narrow {
  width: 100%;
  max-width: 880px;
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* --- Utility: section --- */
.section {
  padding-block: var(--section-y);
}

.section-tight { padding-block: clamp(3rem, 7vh, 5rem); }

.section-dark {
  background: var(--ink);
  color: var(--on-dark);
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4,
.section-dark h5,
.section-dark h6 { color: var(--on-dark); }

.section-dark .lead,
.section-dark .muted { color: var(--on-dark-muted); }

.section-soft { background: var(--brand-soft); }
.section-cream { background: var(--surface-2); }

/* --- Section header (title + intro pattern) --- */
.section-header {
  display: grid;
  gap: var(--s-5);
  max-width: 880px;
  margin-bottom: var(--s-9);
}

.section-header .lead { margin-top: var(--s-2); }

/* --- Two-column layout helper --- */
.split {
  display: grid;
  gap: clamp(2rem, 5vw, 5rem);
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; align-items: start; }
  .split-1-2 { grid-template-columns: 1fr 1.5fr; }
  .split-2-1 { grid-template-columns: 1.5fr 1fr; }
}

/* --- Stack helper --- */
.stack { display: grid; gap: var(--s-5); }
.stack-tight { display: grid; gap: var(--s-3); }
.stack-lg { display: grid; gap: var(--s-7); }

/* --- Misc --- */
.muted { color: var(--muted); }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.serif { font-family: var(--font-display); font-weight: 400; }
.mono { font-family: var(--font-mono); }

/* --- Selection --- */
::selection {
  background: var(--brand-deep);
  color: var(--on-dark);
}

/* --- Focus rings (a11y) — cyan, brand-consistent --- */
:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- Section index (e.g. "01 — Offer") shown in the corner of sections --- */
.section-index {
  position: absolute;
  top: var(--s-7);
  right: var(--container-pad);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  pointer-events: none;
}

.section-index .num {
  color: var(--accent-cyan);
}

.section-index::before {
  content: "";
  width: 36px;
  height: 1px;
  background: var(--accent-cyan);
}

.section-dark .section-index { color: var(--on-dark-muted); }

@media (max-width: 720px) {
  .section-index { display: none; }
}

/* --- Section that hosts an index needs relative positioning --- */
.section { position: relative; }
.section-tight { position: relative; }

/* --- Decorative angular divider used to break up dark sections --- */
.divider-angular {
  position: relative;
  height: 1px;
  background: var(--line);
  overflow: visible;
}

.divider-angular::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
}
