/* =============================================================
   AFFAF PRINTERS | BASE
   Reset, document defaults, typography and layout primitives.
   Consumes tokens.css only. No raw colour or size values.
   ============================================================= */

/* -------------------------------------------------------------
   1. Reset
   ------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Clears the sticky header when jumping to an anchor */
  scroll-padding-top: var(--space-13);
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out);
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

::selection {
  background-color: var(--selection-bg);
}

/* A component that sets its own display would otherwise ignore the
   hidden attribute, which the filter, the field messages and the
   form success panel all rely on. */
[hidden] {
  display: none !important;
}

/* -------------------------------------------------------------
   2. Typography
   Headings carry the page. Plus Jakarta Sans, heavy and tight.
   ------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-display);
  color: var(--text);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  font-weight: var(--fw-heavy);
  line-height: var(--lh-display);
}

h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-heavy);
}

h3 { font-size: var(--fs-h3); }

h4 {
  font-size: var(--fs-card);
  line-height: var(--lh-snug);
}

p {
  text-wrap: pretty;
}

/* Standfirst paragraph under a headline */
.lead {
  font-size: var(--fs-lead);
  line-height: var(--lh-snug);
  color: var(--text-muted);
  max-width: 54ch;
}

/* Plain section label, for example 01  COLOUR */
.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  line-height: 1.4;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-muted);
}

a {
  color: var(--accent-text);
  text-decoration-thickness: var(--hairline);
  text-underline-offset: 0.18em;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover { color: var(--accent-hover); }

/* -------------------------------------------------------------
   3. Focus, one visible treatment across the whole site
   ------------------------------------------------------------- */
:focus-visible {
  outline: var(--rule) solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* -------------------------------------------------------------
   4. Layout primitives
   ------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
}

.section--alt {
  background-color: var(--bg-alt);
}

/* Two alternate bands in a row would read as one long block */
.section--alt + .section--alt {
  border-top: var(--hairline) solid var(--line);
}

/* Full bleed navy band. Navy in both themes; on the dark ground it
   is lifted slightly and given hairlines so the section reads. */
.band-ink {
  background-color: var(--band-ink-bg);
  border-block: var(--hairline) solid var(--band-ink-border);
  color: var(--on-ink);
}

.band-ink h1,
.band-ink h2,
.band-ink h3 { color: var(--on-ink); }

.band-ink .lead,
.band-ink .eyebrow { color: var(--on-ink-muted); }

/* The four colour signature stripe.
   Used in exactly three places: under the hero headline, on the top
   edge of the footer, and as the header border once scrolled. */
.stripe {
  height: var(--stripe-h);
  background-image: linear-gradient(
    to right,
    var(--cyan)      0    25%,
    var(--magenta)   25%  50%,
    var(--yellow)    50%  75%,
    var(--key-print) 75% 100%
  );
  border: 0;
}

.grid {
  display: grid;
  gap: var(--space-6);
}

.grid--3     { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4     { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1024px) {
  .grid--3,
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  /* The proof numbers stay two up on mobile, never one up */
  .grid--stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .grid--3,
  .grid--4 { grid-template-columns: minmax(0, 1fr); }
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

/* -------------------------------------------------------------
   5. Accessibility helpers
   ------------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Locks background scrolling while the mobile panel is open */
.is-locked {
  overflow: hidden;
}

/* -------------------------------------------------------------
   Reveal on scroll.
   Only armed when JavaScript is running, so a page whose script
   never arrives is fully visible rather than blank.
   ------------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Children of a revealed block arrive in sequence, 80ms apart */
.js .reveal .stagger > * {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}

.js .reveal.is-visible .stagger > * {
  opacity: 1;
  transform: none;
}

.stagger > *:nth-child(1) { transition-delay:   0ms; }
.stagger > *:nth-child(2) { transition-delay:  80ms; }
.stagger > *:nth-child(3) { transition-delay: 160ms; }
.stagger > *:nth-child(4) { transition-delay: 240ms; }
.stagger > *:nth-child(5) { transition-delay: 320ms; }
.stagger > *:nth-child(6) { transition-delay: 400ms; }
.stagger > *:nth-child(7) { transition-delay: 480ms; }
.stagger > *:nth-child(8) { transition-delay: 560ms; }

/* -------------------------------------------------------------
   6. Print
   Paper wants the contact details, the hours and the answers.
   It does not want navigation, buttons or decorative scenes.
   ------------------------------------------------------------- */
@media print {
  :root,
  [data-theme="dark"],
  [data-theme="light"] {
    --bg: #FFFFFF;
    --bg-alt: #FFFFFF;
    --surface: #FFFFFF;
    --text: #000000;
    --text-muted: #000000;
    --line: #999999;
    --accent-text: #000000;
  }

  body {
    background: #FFFFFF !important;
    color: #000000 !important;
  }

  .site-header,
  .site-footer,
  .mobile-panel,
  .wa-float,
  .to-top,
  .skip-link,
  .btn,
  .subnav,
  .filter-bar,
  .load-more,
  .scene-box,
  .ring-stage,
  .bloom,
  .street,
  .hero-scene svg,
  .quote-form,
  .form-success,
  .stripe {
    display: none !important;
  }

  /* The hero band must not print as a black rectangle. It redefines
     the colour tokens on itself, so those have to be reset here too,
     otherwise the phone and email print in near white. */
  .hero-dark,
  .hero-dark::before,
  .band-ink {
    --bg: #FFFFFF;
    --bg-alt: #FFFFFF;
    --surface: #FFFFFF;
    --text: #000000;
    --text-muted: #000000;
    --line: #999999;
    --accent-text: #000000;
    --on-ink: #000000;
    --on-ink-muted: #000000;
    background: #FFFFFF !important;
    color: #000000 !important;
  }

  .hero-dark h1,
  .hero-dark p,
  .band-ink h2,
  .band-ink p { color: #000000 !important; }

  /* Every answer prints, whatever the accordion was showing */
  .js .faq__item:not(.is-open) > .faq__panel { grid-template-rows: 1fr !important; }

  .faq__panel > div { overflow: visible !important; }

  .faq__icon { display: none !important; }

  a { text-decoration: underline; }

  .container { max-width: none; padding-inline: 0; }

  .section,
  .page-hero { padding-block: 1rem !important; }
}

/* -------------------------------------------------------------
   7. Reduced motion
   ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  /* Nothing is hidden waiting to animate in */
  .js .reveal,
  .js .reveal .stagger > * {
    opacity: 1;
    transform: none;
    transition: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
