/* ==========================================================================
   Light Astra — base
   Fonts, reset, document defaults, typography, focus, utilities, print and
   forced-colours. Reads tokens.css; paints no component.
   ========================================================================== */

/* ---- fonts (self-hosted, OFL; variable weight axes) ----------------------- */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/manrope-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("../fonts/roboto-mono-latin.woff2") format("woff2");
}

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--milk);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 100%;
  line-height: var(--leading-normal);
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-size: var(--text-base);
  overflow-x: clip;
  background: var(--milk);
}

main {
  flex: 1 0 auto;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
  font-style: italic;   /* alt text, when it shows, reads as a caption */
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

hr {
  border: 0;
  border-top: var(--border);
}

address {
  font-style: normal;
}

/* ---- typography ---------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
  overflow-wrap: break-word;
}

h1 {
  font-size: var(--display-1);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h2 {
  font-size: var(--display-2);
  line-height: 1.08;
  letter-spacing: var(--tracking-tight);
}

h3 {
  font-size: var(--title);
}

h4 {
  font-size: var(--title-sm);
}

p,
li {
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-decoration-color: var(--hairline-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--dur-fast) var(--ease-out), text-decoration-color var(--dur-fast) var(--ease-out);
}

a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

strong,
b {
  font-weight: 700;
  color: var(--ink);
}

small {
  font-size: var(--text-sm);
}

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

::selection {
  background: var(--ink);
  color: var(--milk);
}

/* ---- focus ----------------------------------------------------------------- */
:focus {
  outline: none;
}

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

.theme-ink :focus-visible {
  outline-color: var(--milk);
}

/* ---- the running text style (legal pages, long copy) ----------------------- */
.prose {
  max-width: var(--container-text);
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
}

.prose > * + * {
  margin-top: 1.1em;
}

.prose h2 {
  margin-top: 2.2em;
  font-size: var(--display-3);
}

.prose h3 {
  margin-top: 1.8em;
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
}

.prose li + li {
  margin-top: 0.4em;
}

/* ---- utilities ------------------------------------------------------------ */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--milk);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
  transition: transform var(--dur-fast) var(--ease-out);
}

.skip-link:focus-visible {
  transform: none;
  outline-color: var(--milk);
  outline-offset: -4px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--ink-3);
}

.theme-ink .eyebrow {
  color: var(--on-ink-muted);
}

.caption {
  font-size: var(--text-sm);
  color: var(--ink-3);
}

.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  color: var(--ink-2);
}

.num {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.text-ink {
  color: var(--ink);
}

.text-muted {
  color: var(--ink-3);
}

.text-center {
  text-align: center;
}

.nowrap {
  white-space: nowrap;
}

.flow > * + * {
  margin-top: var(--flow, 1rem);
}

/* ---- forced colours (Windows high contrast) -------------------------------- */
@media (forced-colors: active) {
  .skip-link,
  .btn {
    border: 1px solid ButtonText;
  }

  .star-mark,
  .rule--star::after,
  .bullets li::before {
    forced-color-adjust: none;
    background-color: CanvasText;
  }
}

/* ---- print ----------------------------------------------------------------- */
@media print {
  html {
    background: #fff;
  }

  .site-header,
  .site-footer,
  .milk,
  .cta-band,
  .skip-link,
  .menu-toggle {
    display: none !important;
  }

  .reveal-pending,
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }
}

/* The hidden attribute always wins, whatever display a component sets (contact-form.js
   hides the form, the status panel and mode-only fields with it). */
[hidden] {
  display: none !important;
}
