/* ==========================================================================
   CognivaSoft — Reset, base typography, and browser surfaces
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-stretch: var(--wdth-body);
  line-height: var(--lh-body);
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

/* --- Ambient wash ----------------------------------------------------------
   Three soft radial pools in clay, ochre and pine, pinned to the viewport.
   Two jobs: it gives the flat canvas depth, and it puts something real
   behind the glass surfaces so their blur actually refracts something
   instead of faking it. Strength is driven by --aura and deliberately kept
   low — measured, it moves body-text contrast by under 0.6:1. */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;               /* above body's background, below all content */
  pointer-events: none;
  background:
    radial-gradient(58rem 40rem at 10% -8%,
      color-mix(in srgb, var(--clay) calc(var(--aura) * 100%), transparent), transparent 68%),
    radial-gradient(46rem 32rem at 92% 4%,
      color-mix(in srgb, var(--ochre) calc(var(--aura) * 78%), transparent), transparent 66%),
    radial-gradient(64rem 44rem at 52% 108%,
      color-mix(in srgb, var(--pine-soft) calc(var(--aura) * 90%), transparent), transparent 70%);
}

img, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select { font: inherit; color: inherit; }

button { background: none; border: 0; cursor: pointer; }

ul, ol { list-style: none; padding: 0; }

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

/* --- Headings -------------------------------------------------------------
   The display voice is Archivo at the wide end of its width axis. Same family
   as the body, so the page reads as one system rather than a pairing. */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-stretch: var(--wdth-display);
  font-weight: 620;
  letter-spacing: var(--tracking-display);
  line-height: var(--lh-snug);
  text-wrap: balance;
  color: var(--ink);
}

h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -0.025em; }
h4 { font-size: var(--fs-h4); letter-spacing: -0.015em; line-height: 1.3; }

p { text-wrap: pretty; max-width: var(--measure); }

strong { font-weight: 650; }

/* Emphasis inside a headline stays in the same family — italic, not a
   second typeface. Extra line-height reserves room for the descenders. */
em {
  font-style: italic;
  font-synthesis-style: none;
}

/* --- Shared text utilities ----------------------------------------------- */

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 62ch;
}

.muted { color: var(--text-muted); }

.prose { max-width: var(--measure); }

/* Used sparingly — at most one per three sections, per the eyebrow rule. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.65em;
  font-size: var(--fs-micro);
  font-weight: 600;
  font-stretch: 100%;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--accent-text);
}

.eyebrow::before {
  content: "";
  width: 1.6rem;
  height: 1px;
  background: currentColor;
  flex: none;
}

.eyebrow--plain::before { display: none; }

/* Mono is for numerals, measurements and metadata only. */
.num {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.04em;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* --- Browser surfaces ------------------------------------------------------
   The parts we did not draw still carry the design. */

::selection {
  background: var(--clay);
  color: var(--clay-fg);
}

/* Firefox can only take a flat colour; Blink/WebKit gets the clay-to-ochre
   brand gradient below. */
:root { scrollbar-color: var(--scrollbar) transparent; scrollbar-width: thin; }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }

::-webkit-scrollbar-thumb {
  background-image: linear-gradient(180deg, var(--clay) 0%, var(--ochre) 100%);
  border-radius: var(--radius-pill);
  /* The border is painted in the page colour, so it reads as padding and
     keeps the thumb visually slimmer than the track. */
  border: 3px solid var(--bg);
}

/* Thicken rather than recolour on hover — the gradient stays the constant. */
::-webkit-scrollbar-thumb:hover { border-width: 2px; }

::-webkit-scrollbar-corner { background: transparent; }

input, textarea, select { caret-color: var(--clay); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--radius-s);
}

/* --- Accessibility -------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 999;
  padding: 0.75rem 1.25rem;
  background: var(--pine);
  color: var(--on-dark);
  font-size: var(--fs-small);
  font-weight: 600;
  border-radius: var(--radius-pill);
  transition: top var(--dur) var(--ease-out);
}

.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- Reduced motion ------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
