/*
 * HUAX site foundation: tokens, base type, buttons and links, navigation and footer.
 * Shared by the homepage (with assets/home/home.css) and the editorial pages (with editorial.css).
 * Palette from huax-shared.css; *-ink tokens are darker steps of the same hues for text (≥ 4.5:1 on paper).
 */
:root {
  --navy: #0E2A47;
  --navy-deep: #081A2E;
  --teal: #1FB8C4;
  --teal-deep: #0E8A94;
  --teal-ink: #0C767F;
  --gold: #F2A93B;
  --gold-deep: #C97F1D;
  --gold-ink: #986016;
  --paper: #FAFAF7;
  --paper-2: #F2F1EC;
  --white: #FFFFFF;
  --ink: #0E2A47;
  --ink-2: #2B405E;
  --ink-3: #5E6C82;
  --line: rgba(14, 42, 71, 0.10);
  --line-strong: rgba(14, 42, 71, 0.22);
  --gold-soft: rgba(242, 169, 59, 0.14);
  --teal-soft: rgba(31, 184, 196, 0.12);

  --font: "Schibsted Grotesk", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1320px;
  --nav-h: 64px;
  --cl0: max(var(--gutter), calc((100vw - var(--max)) / 2));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 12px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--teal-ink); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -64px; z-index: 100; padding: 10px 14px; background: var(--navy); color: var(--white); text-decoration: none; }
.skip:focus { top: 12px; }
.mono { font-family: var(--mono); font-size: 0.92em; letter-spacing: 0.02em; }

/* ------------------------------------------------------- buttons and links */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border: 0; border-radius: 999px;
  font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn-quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-quiet:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 14px; }
.text-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0; border: 0; background: none; color: var(--ink);
  font-size: 15.5px; font-weight: 600; text-align: left;
  text-decoration: underline; text-decoration-color: var(--teal); text-decoration-thickness: 1.5px; text-underline-offset: 5px;
  cursor: pointer;
}
.text-link:hover { color: var(--teal-ink); }
.btn-solid { background: var(--navy); color: var(--white); }
.btn-solid:hover { background: var(--navy-deep); }
.btn:disabled { cursor: default; opacity: 0.7; }

/* ------------------------------------------------------------------ forms */

.field { display: grid; gap: 6px; }
.field + .field { margin-top: 14px; }
.field label { color: var(--ink-2); font-size: 14px; font-weight: 600; }
.field input, .field select {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--white);
  color: var(--ink); font: inherit; font-size: 16px;
}
.field select {
  appearance: none; padding-right: 40px; cursor: pointer;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235E6C82' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center;
}
.field input:focus-visible, .field select:focus-visible { outline: 2px solid var(--teal-ink); outline-offset: 1px; border-color: var(--teal-ink); }
.consent { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; margin-top: 16px; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.consent input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--navy); }
.consent a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--teal); text-underline-offset: 3px; }
.kit-status { min-height: 1.5em; margin-top: 12px; font-size: 14.5px; line-height: 1.5; }
[data-state="done"] > .kit-status { color: var(--teal-ink); font-weight: 600; }
[data-state="error"] > .kit-status { color: var(--gold-ink); font-weight: 600; }

/* -------------------------------------------------------------- navigation */

.site-nav { position: sticky; top: 0; z-index: 50; background: var(--paper); transition: box-shadow 0.2s; }
.site-nav.is-scrolled { box-shadow: 0 1px 0 var(--line); }
.nav-in {
  display: flex; align-items: center; gap: 30px;
  max-width: calc(var(--max) + 2 * var(--gutter)); height: var(--nav-h);
  margin: 0 auto; padding: 0 var(--gutter);
}
.brand img { width: auto; height: 22px; }
.nav-links { margin-left: auto; }
.nav-links ul { display: flex; gap: 28px; }
.nav-links a { color: var(--ink-2); font-size: 14.5px; font-weight: 500; text-decoration: none; }
.nav-links a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--teal); text-underline-offset: 6px; }
/* The section a page belongs to is marked the way a link is on hover. */
.nav-links a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--teal); text-underline-offset: 6px; }
/* The menu button only exists on narrow screens, and only once menu.js has wired it up. */
.nav-toggle { display: none; }
@media (max-width: 720px) {
  :root { --nav-h: 58px; }
  .nav-links { display: none; }
  .nav-in .btn { margin-left: auto; }
  .brand img { height: 20px; }

  /* Mobile menu: the same links as a panel under the bar (menu.js adds .has-menu and .is-open). */
  .has-menu .nav-in { gap: 10px; }
  .has-menu .nav-in > .btn { order: 1; }
  .has-menu .nav-links { display: block; order: 2; margin-left: 0; }
  .nav-toggle:not([hidden]) { display: grid; place-items: center; width: 40px; height: 40px; margin-right: -8px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; }
  .nav-toggle::before, .nav-toggle::after { content: ""; grid-area: 1 / 1; width: 20px; height: 1.5px; border-radius: 1px; background: currentColor; transition: transform 0.2s; }
  .nav-toggle::before { transform: translateY(-4px); }
  .nav-toggle::after { transform: translateY(4px); }
  .nav-toggle[aria-expanded="true"]::before { transform: rotate(45deg); }
  .nav-toggle[aria-expanded="true"]::after { transform: rotate(-45deg); }
  .has-menu .nav-links ul { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 0; padding: 4px var(--gutter) 18px; background: var(--paper); box-shadow: 0 1px 0 var(--line), 0 28px 40px -30px rgba(14, 42, 71, 0.35); }
  .has-menu.is-open .nav-links ul { display: flex; }
  .has-menu .nav-links li + li { border-top: 1px solid var(--line); }
  .has-menu .nav-links a { display: block; padding: 14px 0; color: var(--ink); font-size: 19px; font-weight: 600; }
}

/* ------------------------------------------------------------------ footer */

.site-foot { border-top: 1px solid var(--line); }
.foot-in {
  display: grid; grid-template-columns: 1fr auto; gap: 24px 40px;
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 40px var(--gutter) 36px;
}
.foot-brand img { width: auto; height: 22px; }
.foot-brand p { max-width: 30em; margin-top: 12px; color: var(--ink-2); font-size: 14.5px; }
.foot-links { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px 22px; font-size: 14.5px; }
.foot-links a { color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.foot-fine { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13.5px; }
@media (max-width: 959px) {
  .foot-in { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}
