/* =========================================================
   BASE — the reset, the typography, and the page furniture

   Everything in here applies to the whole page. The parts of
   the page that are only used once live in sections.css.

   ------------------------------------------------------------
   Reset      *  img  a  button
   Page       html  body  body.scroll-locked
   Headings   h1,h2,h3  ::selection  :focus-visible
   Layout     .container  .section
   Aids       .screen-reader-only  .skip-link
   Overlays   .noise-overlay  .scroll-progress  .scroll-progress span
   Reveal     .js [data-reveal]  .js [data-reveal].is-visible
   ========================================================= */

/* --- reset --- */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
img{max-width:100%;display:block}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}

/* --- the page itself --- */
html{scroll-behavior:smooth;scroll-padding-top:calc(var(--header-height) + 1rem);-webkit-text-size-adjust:100%}
body{font-family:var(--font-body);background-color:var(--color-background);
  background-image:radial-gradient(rgba(23,32,51,.12) 0.0625rem,transparent 0.075rem);
  background-size:1.375rem 1.375rem;
  color:var(--color-ink);font-size:1rem;line-height:1.65;
  -webkit-font-smoothing:antialiased;overflow-x:hidden;transition:color .4s ease}
/* stops the page scrolling while a popup or the menu is open */
body.scroll-locked{overflow:hidden}

/* --- headings and selection --- */
h1,h2,h3{font-family:var(--font-heading);font-weight:600;line-height:1.12;letter-spacing:-.01em;color:var(--color-heading)}
::selection{background:var(--color-gold);color:#172033}
:focus-visible{outline:2px solid var(--color-accent);outline-offset:3px;border-radius:0.375rem}

/* --- layout primitives --- */
/* the centred column that every section sits in */
.container{width:min(73.75rem,92%);margin-inline:auto}
/* the vertical rhythm between sections */
.section{padding:clamp(3.5rem,7vw,6rem) 0;position:relative}

/* --- reading aids --- */
/* hidden on screen, but still read aloud by screen readers */
.screen-reader-only{position:absolute;width:0.0625rem;height:0.0625rem;padding:0;margin:-0.0625rem;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
/* the "skip to content" link, parked off screen until it is focused */
.skip-link{position:fixed;top:-3.75rem;left:1rem;z-index:300;background:var(--color-gold);color:#172033;
  padding:.6rem 1.1rem;border-radius:0.625rem;font-weight:700;transition:top .25s}
.skip-link:focus{top:0.75rem}

/* --- page overlays --- */
/* a faint paper noise over the whole page */
.noise-overlay{position:fixed;inset:0;z-index:140;pointer-events:none;opacity:.045;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E")}
/* the thin bar at the top showing how far you have scrolled */
.scroll-progress{position:fixed;top:0;left:0;right:0;height:0.1875rem;z-index:150}
.scroll-progress span{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--color-gold),var(--color-accent))}

/* --- reveal on scroll --- */
/* The .js class is added by a tiny script in the <head>. It means
   "this browser has JavaScript", so the hidden state only applies
   where JavaScript can undo it. Without JavaScript nothing is hidden. */
.js [data-reveal]{opacity:0;transform:translateY(1.75rem);
  transition:opacity .7s ease,transform .8s cubic-bezier(.22,1,.36,1)}
.js [data-reveal].is-visible{opacity:1;transform:none}
