:root {
  color-scheme: light;

  --color-page: #faf8f4;
  --color-panel: #ffffff;
  --color-panel-raised: #f3f0ea;
  --color-ink: #1b2233;
  --color-ink-soft: #3d4558;
  --color-muted: #6c7283;
  --color-rule: #e6e1d8;
  --color-rule-strong: #d3cdc1;
  --color-blue: #2456a6;
  --color-orange: #e0662a;
  --color-orange-text: #b04a16;

  /* Section tones, chosen per section in src/content/sections/*.yaml */
  --tone-sea: #2456a6;
  --tone-green: #2f7f86;
  --tone-rust: #e0662a;
  --tone-plum: #7a4ea3;
  --tone-gold: #d99a20;

  /*
   * Helvetica Neue is commercial, so it is never served as a web font: Apple
   * devices render their installed copy, everyone else gets Inter (loaded from
   * Google Fonts, and only downloaded when Helvetica Neue isn't installed).
   */
  --font-display: "Helvetica Neue", Helvetica, "Inter", Arial, sans-serif;

  --radius: 10px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--color-page);
}

body {
  background: var(--color-page);
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: 1.125rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Two soft colour fields far behind the page. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(55vmax 45vmax at 95% -5%, color-mix(in srgb, var(--color-blue) 9%, transparent), transparent 70%),
    radial-gradient(50vmax 40vmax at -5% 105%, color-mix(in srgb, var(--color-orange) 9%, transparent), transparent 70%);
}

::selection {
  background: var(--color-blue);
  color: #fff;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 3px;
}

.label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Text in a section's tone, darkened enough to read on the light page. */
[style*="--tone"] {
  --tone-text: color-mix(in srgb, var(--tone) 62%, var(--color-ink));
}

/*
 * Flat buttons. The default is a soft fill in --button-color; --primary is a
 * solid fill with white text. No gradients, highlights or shadows.
 */
.button {
  --button-color: var(--color-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.25rem;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--button-color) 10%, var(--color-page));
  color: color-mix(in srgb, var(--button-color) 62%, var(--color-ink));
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

:where(a, button).button:hover {
  background: color-mix(in srgb, var(--button-color) 18%, var(--color-page));
}

.button--primary {
  background: var(--button-color);
  color: #fff;
}

:where(a, button).button--primary:hover {
  background: color-mix(in srgb, var(--button-color) 85%, var(--color-ink));
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: none;
  }
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--color-ink);
  color: #fff;
  text-decoration: none;
  translate: 0 -200%;
}

.skip-link:focus-visible {
  translate: 0 0;
}

/* Set by src/scripts/scroll-story.ts while the page is moving. */
html.is-scrolling [data-story] {
  pointer-events: none;
}

/* Lenis smooth scrolling (from lenis/dist/lenis.css, which the package doesn't export). */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis:not(.lenis-autoToggle).lenis-stopped {
  overflow: clip;
}

.lenis [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}

/*
 * RGB split on hover: a faint blue/orange fringe that eases in and settles.
 * Offsets scale with the text (in em) so large headings show it as clearly as
 * links do, with a pixel floor for small text; they stay well under a stroke's
 * width, so the text itself never doubles or blurs. Headings always carry the
 * settled fringe; hovering them (and links, buttons, .glitch text) plays the swell.
 */
:root {
  --glitch-settle: max(0.9px, 0.022em);
  --glitch-peak: max(1.8px, 0.045em);
  --glitch-blue: color-mix(in srgb, var(--color-blue) 52%, transparent);
  --glitch-orange: color-mix(in srgb, var(--color-orange) 58%, transparent);
}

:where(h1, h2, h3, h4),
.glitch,
:where(a, button):hover,
:where(a, button):focus-visible,
.glitch:hover,
.person:hover .glitch {
  text-shadow:
    calc(var(--glitch-settle) * -1) 0 0 var(--glitch-blue),
    var(--glitch-settle) 0 0 var(--glitch-orange);
}

:where(h1, h2, h3, h4):hover,
:where(a, button):hover,
:where(a, button):focus-visible,
.glitch:hover,
.person:hover .glitch {
  animation: rgb-glitch 520ms var(--ease-out);
}

@keyframes rgb-glitch {
  0%,
  100% {
    text-shadow:
      calc(var(--glitch-settle) * -1) 0 0 var(--glitch-blue),
      var(--glitch-settle) 0 0 var(--glitch-orange);
  }
  35% {
    text-shadow:
      calc(var(--glitch-peak) * -1) 0 0 var(--glitch-blue),
      var(--glitch-peak) 0 0 var(--glitch-orange);
  }
}

@media (prefers-reduced-motion: reduce) {
  :where(h1, h2, h3, h4):hover,
  :where(a, button):hover,
  :where(a, button):focus-visible,
  .glitch:hover,
  .person:hover .glitch {
    animation: none;
  }
}
.logo[data-astro-cid-f7espo7c] {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1;
  color: var(--color-ink);
  text-shadow: 0 0 0 var(--color-blue),
      0 0 0 var(--color-orange);
  transition: transform .26s var(--ease-out),
      text-shadow .26s var(--ease-out);
}

a:hover > .logo[data-astro-cid-f7espo7c], a:focus-visible > .logo[data-astro-cid-f7espo7c] {
  transform: translateY(-1px);
  text-shadow: -2px 0 0 color-mix(in srgb, var(--color-blue) 45%, transparent),
      2px 0 0 color-mix(in srgb, var(--color-orange) 55%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .logo[data-astro-cid-f7espo7c] {
    transition: none;
  }
}
