/* ============================================================
   quGradient · base
   Reset, document defaults, typographic rhythm, helpers.
   Light-first. Same structure as quMatrix; different ink.
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "ss01" 1;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

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

a {
  color: var(--brand-ink);
  text-decoration: none;
  text-underline-offset: 0.18em;
  transition: color var(--dur) var(--ease);
}
a:hover { color: var(--navy); text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  line-height: var(--lh-tight);
  letter-spacing: -0.022em;
  margin: 0 0 var(--s-4);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); letter-spacing: -0.032em; }
h2 { font-size: var(--fs-h2); letter-spacing: -0.028em; }
h3 { font-size: var(--fs-h3); line-height: var(--lh-snug); letter-spacing: -0.02em; }
h4 { font-size: var(--fs-h4); line-height: var(--lh-snug); letter-spacing: -0.014em; }

p { margin: 0 0 var(--s-4); max-width: 68ch; }
p:last-child { margin-bottom: 0; }

strong { font-weight: 600; color: var(--ink); }
small { font-size: var(--fs-sm); }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s-7) 0; }

code, kbd, samp { font-family: var(--font-mono); font-size: 0.875em; }

::selection { background: var(--cyan); color: var(--navy); }

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

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

.section { padding-block: clamp(3.5rem, 2rem + 7vw, 7rem); }
.section--tight { padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem); }
.bg-soft { background: var(--soft); }

/* dark sections invert ink */
.on-dark { background: var(--dark); color: var(--on-dark-ink); }
.on-dark h1, .on-dark h2, .on-dark h3, .on-dark h4 { color: var(--white); }
.on-dark a { color: var(--brand-2); }
.on-dark a:hover { color: #8fe9f6; }
.on-dark strong { color: var(--white); }

/* --- type utilities ---------------------------------------- */
.lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--muted);
  max-width: 60ch;
}
.on-dark .lead { color: var(--on-dark-ink); }

.display {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.036em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
.on-dark .display { color: var(--white); }

/* gradient text — the signature device, used sparingly on key words.
   Light context uses the darker navy→teal ramp for legibility; hero /
   .on-dark bands override to bright cyan in theme.css. */
.grad-text {
  background: var(--grad-ink);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.measure { max-width: 62ch; }
.center { text-align: center; }
.center .lead, .center p { margin-inline: auto; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* scroll-reveal (classes applied by JS only) */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
.reveal-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
