/* ============================================================================
   Audiominutes marketing site — tokens + shared chrome.

   Tokens are transcribed from the design handoff README (the authoritative table),
   not eyeballed from the markup.

   SCOPE: this file styles the SHARED CHROME (header, CTA band, footer) and provides
   the tokens. Page bodies still carry the prototype's inline styles — see RESPONSIVE.md
   for why that is staged rather than done in one pass.
   ============================================================================ */

:root {
  /* Colour */
  --ink:          #0E2B42;   /* headings, dark section backgrounds */
  --ink-deep:     #14232E;   /* body text, media backgrounds */
  --ink-2:        #243B4A;   /* nav links, list text */
  --body:         #3D4F5C;   /* long-form body copy */
  --muted:        #4A5D6B;   /* section intros */
  --muted-2:      #5B6B78;   /* card body copy */
  --muted-3:      #7B8B98;   /* secondary / meta */
  --muted-4:      #93A3AF;   /* labels, eyebrow small caps */
  --primary:      #2E8BCF;   /* buttons, accents, active state */
  --primary-dark: #1C6FAB;   /* hover, link colour, eyebrows */
  --primary-darker:#14507E;  /* link hover */
  --primary-light:#6FB4E2;
  --primary-light-2:#4FA3DE;
  --tint:         #E4F0F9;   /* badge / active-row background */
  --surface:      #F4F8FB;   /* page section background */
  --border:       #DCE6EE;   /* card borders */
  --border-light: #E3EBF2;   /* hairlines, dividers */
  --border-input: #C6D6E2;   /* inputs, secondary-button borders */
  --slate-mid:    #1E3648;
  --slate-mid-2:  #26445A;
  --alert:        #C0392B;
  --alert-bg:     #FBE9E7;
  --on-dark:      #A9BECD;   /* body copy on --ink */

  /* Layout */
  --max:      1200px;
  --pad-x:    40px;
  --header-h: 76px;

  --r-badge: 4px;  --r-btn: 6px;  --r-inner: 10px;
  --r-card: 12px;  --r-panel: 14px; --r-device: 18px;

  --shadow-hero: 0 24px 60px -28px rgba(14,43,66,0.35);
  --shadow-featured: 0 20px 50px -30px rgba(14,43,66,0.4);
}

/* ----------------------------------------------------------------------------
   PUBLIC SANS — self-hosted.

   Previously loaded from fonts.googleapis.com, which meant every visitor's browser
   announced itself to a third party before the page could finish rendering text.
   On a site aimed at UK public-sector buyers that is a data-protection question
   they may reasonably ask, as well as a latency cost on a CDN-served site.

   ONE FILE, 26KB, covering weights 300-800. It is the VARIABLE font, so a single
   request serves every weight the site uses (400/500/600/700/800) — static
   instances would have been five files and five requests.

   Latin subset only. Audited the built output: the sole characters outside it are
   ▶ and ❚ in the mock-up player panels, and neither exists in Public Sans's latin,
   latin-ext or vietnamese subsets — so they already fell back to a system font when
   Google served this, and nothing changes.

   No italic face. The one italic on the whole site is the word "transcribing…"
   inside a mock-up due to be replaced by a real screenshot; shipping a second 28KB
   file for it would be worse than letting the browser synthesise it.

   📜 SIL Open Font License 1.1 — see assets/fonts/LICENSE.txt, which is shipped
   alongside the font because the licence requires it to travel with the file.
   ---------------------------------------------------------------------------- */
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 300 800;
  src: url('/assets/fonts/public-sans-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

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

body {
  margin: 0;
  background: #fff;
  font-family: 'Public Sans', -apple-system, Helvetica, Arial, sans-serif;
  color: var(--ink-deep);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul { padding: 0; list-style: none; }
img { max-width: 100%; }

a { color: var(--primary-dark); }
a:hover { color: var(--primary-darker); }

/* FAQ accordions — native <details>; the marker is hidden and the + rotates on open. */
summary::-webkit-details-marker { display: none; }
summary { list-style: none; cursor: pointer; }
details[open] .chev { transform: rotate(45deg); }
.chev { transition: transform .18s ease; display: inline-block; }

/* ----------------------------------------------------------------------------
   ACCESSIBILITY — a visible focus ring on everything interactive.

   The prototype removes outlines on inputs and never adds a replacement, so it is
   keyboard-inaccessible as designed. This audience is UK public sector: buyers are
   themselves bound by the Public Sector Bodies Accessibility Regulations and will
   ask. Treated as a build-time requirement, not a later pass.
   ---------------------------------------------------------------------------- */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; left: -9999px;
  background: #fff; color: var(--ink); padding: 12px 20px;
  border: 2px solid var(--primary); border-radius: var(--r-btn);
  font-weight: 700; z-index: 100;
}
.skip-link:focus { left: 16px; top: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ----------------------------------------------------------------------------
   Shared chrome
   ---------------------------------------------------------------------------- */
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--pad-x); }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-light);
}
.site-header__inner { height: var(--header-h); display: flex; align-items: center; gap: 40px; }
.site-header__logo { display: flex; align-items: center; }
.site-header__logo img { height: 38px; width: auto; display: block; }

.nav { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.nav a { font-size: 15px; font-weight: 600; color: var(--ink-2); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--primary); }
/* Active state is driven by the page's own URL in base.njk, not by client state. */
.nav a[aria-current="page"] { border-bottom-color: var(--primary); color: var(--primary-dark); }
.nav a.nav--portal { color: var(--muted-2); }
.nav a.nav--cta { color: #fff; background: var(--primary); font-weight: 700; padding: 11px 20px; border-radius: var(--r-btn); border-bottom: 0; }
.nav a.nav--cta:hover { background: var(--primary-dark); color: #fff; }

.nav-toggle { display: none; }

/* Closing CTA band — every page, above the footer */
.cta-band { background: var(--ink); padding: 56px 0; }
.cta-band__inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta-band h2 { font-size: 34px; line-height: 1.12; letter-spacing: -.02em; font-weight: 800; color: #fff; max-width: 560px; text-wrap: balance; }
.cta-band p { margin-top: 12px; font-size: 17px; line-height: 1.6; color: var(--on-dark); max-width: 520px; }

.btn { display: inline-block; font-weight: 700; font-size: 15px; padding: 15px 28px; border-radius: var(--r-btn); text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); color: #fff; }
.btn--secondary { background: #fff; color: var(--ink-deep); border-color: var(--border-input); }
.btn--secondary:hover { border-color: var(--primary); color: var(--ink-deep); }
.btn--inverse { background: #fff; color: var(--ink); }
.btn--inverse:hover { background: #D9EAF7; color: var(--ink); }

.site-footer { padding: 56px var(--pad-x) 40px; border-top: 1px solid var(--border-light); }
.site-footer__grid { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; }
.site-footer img { height: 34px; width: auto; display: block; }
.site-footer__desc { margin-top: 16px; font-size: 15px; line-height: 1.6; color: var(--muted-3); max-width: 340px; }
.site-footer h4 { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-4); }
.site-footer ul { margin-top: 14px; display: grid; gap: 9px; }
.site-footer a { font-size: 15px; color: var(--body); text-decoration: none; }
.site-footer a:hover { color: var(--primary); }
.site-footer__bar { max-width: var(--max); margin: 40px auto 0; padding-top: 24px; border-top: 1px solid var(--border-light); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer__bar, .site-footer__bar a { font-size: 14px; color: var(--muted-4); }

/* ----------------------------------------------------------------------------
   PAGE-BODY GRIDS — mobile-first.

   The prototype puts `grid-template-columns` in the STYLE ATTRIBUTE of every
   grid. Inline styles beat stylesheets, so those grids could not be made to
   reflow from here at all — not without `!important` on every rule.

   tools/extract-from-design.mjs now lifts `display:grid`, the columns and the
   gap out of the attribute and re-attaches the design's exact values as custom
   properties (--cols, --g). The trick that makes this work: a class reads
   `var(--cols)` only INSIDE a min-width query, so below that breakpoint the
   inline value is never read and the class wins. An inline custom property is a
   VALUE, not a DECLARATION — only the latter blocks the cascade.

   So the 1440px rendering stays character-for-character what the design
   specifies, and everything narrower is ours.

   Two behaviours, named for what they do rather than what they contain:
     .g-stack   1 col, design cols from 960px.   2-ups, splits, CTA bands.
     .g-cards   1 col, 2 from 640px, design from 960px.   3-up / 4-up rows.

   Grids INSIDE the five product mock-ups are deliberately NOT converted — they
   are placeholder markup due to be replaced by real screenshots, so responsive
   work on them would be thrown away. See RESPONSIVE.md.
   ---------------------------------------------------------------------------- */
/* Section gutters. The design's 40px is inline on all 22 sections, so the gutter could not
   be reduced from CSS — 80px of a 360px screen spent on empty margin. The vertical rhythm is
   a per-section design decision and is preserved exactly (--pt/--pb); only the gutter is
   shared, and it follows --pad-x, which the chrome already reduces below 900px. */
.sec { padding-block: var(--pt, 0) var(--pb, 0); padding-inline: var(--pad-x); }

/* Long-form legal prose (the privacy policy). Lifted from the live site, which styled it with
   its own stylesheet — these rules replace `.container` + `.section-title` from that file. */
.prose { max-width: 760px; margin: 0 auto; }
.prose p { margin-top: 14px; font-size: 17px; line-height: 1.7; color: var(--body); }
.prose h2.section-title { margin-top: 40px; font-size: 22px; line-height: 1.25; font-weight: 700; color: var(--ink); }
.prose h2.section-title:first-of-type { margin-top: 28px; }
.prose a { color: var(--primary-dark); }
.prose strong { color: var(--ink); }

/* Feature icons — a deliberate addition to the design (see tools/feature-icons.mjs).
   Decorative: every one sits above an <h3> that already names the feature, so they are
   aria-hidden and must never be announced. Colour comes from here, not from the SVG, so the
   palette stays in one place. */
.feat-icon { display: block; color: var(--primary); margin-bottom: 14px; }

/* Service-stat strip. Four short figures, so 2-up on a phone rather than the g-cards default
   of one — a single column of four numbers is a lot of scrolling for very little content. */
.stat-strip { grid-template-columns: 1fr; }
@media (min-width: 640px) { .stat-strip { grid-template-columns: var(--cols); } }
@media (prefers-contrast: more) { .feat-icon { color: var(--primary-dark); } }

.g { display: grid; }

/* Design gaps go up to 72px, which is most of a phone screen spent on nothing.
   Capped below the desktop breakpoint, exact above it.

   🔴 Row and column are set SEPARATELY and must stay that way. `gap` accepts two values, and
   three of these grids use them (gap:36px 32px). Wrapping the shorthand as
   `min(var(--g), 28px)` expands to `min(36px 32px, 28px)` — invalid, so the browser drops the
   declaration entirely and those grids get NO gap at all, at every width. min() has to see
   one length. */
.g { row-gap: min(var(--g-row, 28px), 28px); column-gap: min(var(--g-col, 28px), 28px); }
@media (min-width: 960px) {
  .g { row-gap: var(--g-row, 28px); column-gap: var(--g-col, 28px); }
}

.g-stack, .g-cards { grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .g-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .g-stack { grid-template-columns: var(--cols, 1fr 1fr); }
  .g-cards { grid-template-columns: var(--cols, repeat(3, 1fr)); }
}

/* The mock-up panels are fixed-height (420px hero, 380px, 230px card media) and
   would otherwise crop their contents on a narrow screen. Only the OUTER frames
   are touched; their internals are placeholder markup. */
@media (max-width: 640px) {
  [style*="height:420px"] { height: 320px !important; }
  [style*="height:380px"] { height: 300px !important; }
}

/* ----------------------------------------------------------------------------
   RESPONSIVE — the prototype has none. It is designed at ~1440px only.

   These are the CHROME breakpoints, written max-width (desktop-first) before
   the page-body work above, which is mobile-first. Left as they are rather than
   flipped for consistency: they are correct, they are tested, and rewriting
   working breakpoints to match a convention is how visual regressions get in.
   ---------------------------------------------------------------------------- */
@media (max-width: 900px) {
  :root { --pad-x: 20px; }

  .nav { gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
  .nav a { font-size: 14px; }
  .site-header__inner { gap: 16px; height: auto; min-height: var(--header-h); padding-block: 10px; }

  .cta-band h2 { font-size: 27px; }
  .site-footer__grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 560px) {
  .nav { gap: 14px; }
  .nav a.nav--cta { padding: 9px 14px; }
  .cta-band { padding: 40px 0; }
  .btn { padding: 13px 22px; }
}

/* Visually hidden, still announced. Used for the "(opens in a new tab)" warning on the
   portal link — WCAG 2.2 AA technique G201 wants the warning in the accessible name, and
   the design has no room for it on screen.

   🔴 NOT `display:none` and NOT `visibility:hidden` — both remove the text from the
   accessibility tree as well as from the page, which would make this markup look correct and
   do nothing. The clip-path rectangle is what keeps it readable to a screen reader. */
.vh {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
