/* ==========================================================================
   PULSE — reset, type scale, buttons, and the things every chapter uses.
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.5;
  overflow-x: hidden;
  /* the ground moves as the reader descends; the transition keeps a fast
     scroll from stepping between ramp stops */
  transition: background-color 300ms linear, color 300ms linear;
}

img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, p, figure, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; margin: 0; }

/* --- focus ----------------------------------------------------------------
   Visible, and never only a colour: a solid offset ring plus a shift in the
   underlying element's own state. Colour alone would fail for anyone who
   cannot separate the acid yellow from the bone. */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- layout --------------------------------------------------------------- */
.wrap {
  width: min(100% - var(--gut) * 2, var(--wrap));
  margin-inline: auto;
}

main > section { position: relative; }

/* --- type ----------------------------------------------------------------- */
.display {
  font-family: var(--display);
  font-weight: 400;
  line-height: 0.84;
  letter-spacing: -0.028em;
  text-transform: uppercase;
  text-wrap: balance;
}
.d-huge { font-size: var(--t-huge); }
.d-big  { font-size: var(--t-big); }
.d-mid  { font-size: var(--t-mid); line-height: 0.95; }

.mono {
  font-family: var(--mono);
  font-size: var(--t-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--glow);
  margin-bottom: clamp(1rem, 2.4vw, 2rem);
}

.lead {
  font-size: var(--t-lead);
  line-height: 1.5;
  max-width: 46ch;
  color: var(--ink-dim);
}
.lead--small { font-size: 1rem; }

.hint {
  color: var(--ink-faint);
  margin-top: 1.4rem;
}

/* The demo note is not small print. It is the sentence that stops a portfolio
   piece from reading as a real business with real dates, so it is legible. */
.demo-note {
  font-family: var(--mono);
  font-size: clamp(0.66rem, 0.85vw, 0.76rem);
  line-height: 1.7;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
  max-width: 62ch;
  margin-top: 1.5rem;
  padding-left: 0.9rem;
  border-left: 1px solid var(--rule);
}

/* --- buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  min-height: 48px;
  padding: 0.85rem 1.5rem;
  font-family: var(--mono);
  font-size: var(--t-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color var(--cut), color var(--cut),
              border-color var(--cut), transform var(--cut);
}
.btn:active { transform: translateY(1px); }

.btn--solid {
  background: var(--bone);
  color: var(--night);
}
.btn--solid:hover, .btn--solid:focus-visible {
  background: var(--glow);
  color: var(--night);
}

.btn--ghost {
  border-color: var(--rule);
  color: var(--ink);
}
.btn--ghost:hover, .btn--ghost:focus-visible {
  border-color: var(--ink);
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.btn__arrow { transition: transform var(--snap); }
.btn:hover .btn__arrow { transform: translateX(4px); }

/* --- skip link ------------------------------------------------------------ */
.skip {
  position: fixed;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 999;
  padding: 0.8rem 1.1rem;
  background: var(--acid);
  color: var(--night);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transform: translateY(-160%);
  transition: transform var(--snap);
}
.skip:focus-visible { transform: none; }

/* --- noscript ------------------------------------------------------------- */
.noscript {
  padding: 6rem var(--gut) 3rem;
  max-width: 62ch;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.6;
}
.noscript p { margin-bottom: 1rem; }
.noscript strong { font-family: var(--display); letter-spacing: 0.02em; }

/* --- cursor ---------------------------------------------------------------
   Small, and only on a fine pointer — core/cursor.js never mounts it otherwise.
   It takes its word from [data-cursor] on whatever is underneath. */
.cursor {
  position: fixed;
  top: 0; left: 0;
  z-index: 900;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--bone);
  pointer-events: none;
  opacity: 0;
  transition: width var(--snap), height var(--snap), margin var(--snap),
              background-color var(--snap), opacity var(--snap);
}
.has-cursor .cursor { opacity: 1; }
.cursor.is-active {
  width: 66px; height: 66px;
  margin: -33px 0 0 -33px;
  background: var(--glow);
}
.cursor.is-down { transform: scale(0.9); }
.cursor__word {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--night);
  opacity: 0;
  transition: opacity var(--cut);
}
.cursor.is-active .cursor__word { opacity: 1; }

/* --- the scrim behind the ticket panel ------------------------------------ */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: color-mix(in srgb, var(--night) 78%, transparent);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--snap), visibility 0s linear var(--snap);
}
.scrim.is-in { opacity: 1; visibility: visible; transition: opacity var(--snap), visibility 0s; }
