/* Base styles. Every value is a variable from tokens.css.
   Classes: .page (centred column), .skip-link, .visually-hidden.
   Load order: tokens.css, base.css, components/*.css */

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

/* The hidden attribute always hides, even on a .btn (display: inline-flex). */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  overflow-wrap: break-word;
}

h1, h2, h3, h4 {
  margin: 0 0 var(--space-3);
  line-height: var(--leading-tight);
  font-weight: 700;
}
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-base); }
p { margin: 0 0 var(--space-4); }

a { color: var(--link); text-underline-offset: 0.2em; }

img, svg { max-width: 100%; }

:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring);
  outline-offset: var(--focus-ring-gap);
}

/* Controls on dark grounds get the cream ring (plan 2.10): the footer (plum in light,
   near-black in dark), the WhatsApp panel (plum), the hero and the landing header while
   it sits over the hero (not once the cream bar is shown). */
.site-footer,
.on-dark,
.whatsapp-panel,
.hero,
.site-bar--over {
  --focus-ring: var(--focus-ring-on-dark);
}

/* A light card on a dark ground switches to a dark ring (the Butter card stays light in
   both themes, so the lavender link colour of the dark theme would vanish on it). */
.hero__card {
  --focus-ring: var(--plum);
}

.page {
  width: 100%;
  max-width: var(--w-public);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.skip-link {
  position: absolute;
  inset-block-start: var(--space-2);
  inset-inline-start: var(--space-2);
  z-index: var(--z-skip);
  padding: var(--space-3) var(--space-4);
  min-height: var(--tap-min);
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  border-radius: var(--radius-sm);
  transform: translateY(-300%);
}
/* The skip link can sit over the dark hero or the cream bar: Ink ring inside a Butter halo
   reads on both (a single ring colour cannot). */
.skip-link:focus { transform: none; }
.skip-link:focus-visible {
  outline-color: var(--ink);
  outline-offset: 0;
  box-shadow: 0 0 0 calc(2 * var(--focus-ring-width)) var(--butter);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
