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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
/* ScrollTrigger measures by jumping the scroll position; smooth CSS scrolling breaks that. */
html.motion { scroll-behavior: auto; }

body {
  min-height: 100vh;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -0.015em; line-height: 1.25; }
h4 { font-size: 1.05rem; letter-spacing: -0.01em; line-height: 1.35; }

p { color: var(--text-secondary); }

strong { font-weight: 650; color: var(--text-primary); }

::selection {
  background: rgba(1, 194, 196, 0.25);
  color: var(--navy);
}

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

/* Accessibility helpers ---------------------------------------------------- */
.sr-only {
  position: absolute !important;
  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: 12px;
  left: 12px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--t) var(--ease-out);
}
.skip-link:focus { transform: none; }

/* Text styles ---------------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 0 4px rgba(1, 194, 196, 0.14);
}
.eyebrow--plain::before { display: none; }

.display {
  font-size: var(--fs-display);
  letter-spacing: -0.035em;
  line-height: 1.02;
  font-weight: 750;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 62ch;
}

.muted { color: var(--text-muted); }
.small { font-size: var(--fs-small); }
.mono { font-family: var(--font-mono); font-size: 0.85em; letter-spacing: 0; }
.upper { text-transform: uppercase; letter-spacing: 0.12em; font-size: var(--fs-micro); font-weight: 700; font-family: var(--font-display); }
.text-accent { color: var(--accent); }
.text-gradient {
  background: var(--grad-ink);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-primary);
}
.link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0.25);
  transform-origin: left;
  opacity: 0.4;
  transition: transform var(--t) var(--ease-out), opacity var(--t);
}
.link:hover::after,
.link:focus-visible::after { transform: scaleX(1); opacity: 1; }
.link .icon { width: 18px; height: 18px; transition: transform var(--t) var(--ease-out); }
.link:hover .icon { transform: translateX(3px); }

/* Icons ------------------------------------------------------------------- */
.icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Prose (CMS markdown) --------------------------------------------------- */
.prose { max-width: 70ch; color: var(--text-secondary); font-size: 1.08rem; line-height: 1.8; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-top: 2.2em; color: var(--text-primary); }
.prose h3 { font-size: 1.3rem; margin-top: 1.8em; }
.prose h4 { margin-top: 1.6em; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--accent); }
.prose blockquote {
  border-left: 2px solid var(--accent-bright);
  padding: 0.3em 0 0.3em 1.2em;
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--text-primary);
}
.prose code { font-family: var(--font-mono); font-size: 0.88em; background: var(--surface-2); padding: 0.15em 0.4em; border-radius: 6px; }
.prose pre { background: var(--navy); color: #d8f3f3; padding: 1.2em 1.4em; border-radius: var(--radius); overflow-x: auto; font-size: 0.88rem; line-height: 1.6; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose hr { border: 0; height: 1px; background: var(--border); margin: 2.5em 0; }
