/* ─────────────────────────────────────────────────────────────────────────
   goodbuds.club — risograph plate
   Three inks on warm stock: black, fluorescent pink, blue. Flat colour only.
   No gradients, no glass, no glow. Everything is printed.
   ───────────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: "Plate";
  src: url("fonts/display-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Stock";
  src: url("fonts/body-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Stock";
  src: url("fonts/body-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Slug";
  src: url("fonts/mono-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f4eee1;
  --paper-deep: #f1ead9;
  --black: #1e1a19;
  --pink: #ff4b94;
  --blue: #0b6fbf;
  --over: #12266d; /* pink x blue, overprinted */

  --measure: 34rem;
  --gut: clamp(1.25rem, 5vw, 4.5rem);
  --rule: 2px solid var(--black);
  --rule-thick: 6px solid var(--black);
}

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

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

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--black);
  font-family: "Stock", "Lato", Helvetica, Arial, sans-serif;
  font-size: clamp(1rem, 0.94rem + 0.3vw, 1.125rem);
  line-height: 1.62;
  overflow-x: hidden;
  /* paper tooth */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.28'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

::selection {
  background: var(--pink);
  color: var(--paper);
}

/* ─── type ─────────────────────────────────────────────────────────────── */

h1,
h2,
h3,
.plate {
  font-family: "Plate", "Lato", Helvetica, Arial, sans-serif;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 0.92;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0 0 1.1em;
  max-width: var(--measure);
}

a {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 2px solid var(--pink);
  padding-bottom: 1px;
}
a:hover,
a:focus-visible {
  background: var(--pink);
  color: var(--paper);
  border-bottom-color: var(--black);
}
a:focus-visible {
  outline: 3px solid var(--black);
  outline-offset: 2px;
}

strong {
  font-weight: 700;
}

.slug {
  font-family: "Slug", "Courier 10 Pitch", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.5;
}

.pink {
  color: var(--pink);
}
.blue {
  color: var(--blue);
}
.over {
  color: var(--over);
}

/* misregistration: the plate printed three times, slightly out of line.
   The visible text is the black pass; the ghosts are decorative. */
.misreg {
  position: relative;
  display: inline-block;
  isolation: isolate;
}
.misreg::before,
.misreg::after {
  content: attr(data-plate);
  position: absolute;
  inset: 0;
  z-index: -1;
  mix-blend-mode: multiply;
  pointer-events: none;
  user-select: none;
}
.misreg::before {
  color: var(--pink);
  transform: translate(0.05em, 0.028em);
}
.misreg::after {
  color: var(--blue);
  transform: translate(-0.036em, -0.022em);
}

/* ─── layout ───────────────────────────────────────────────────────────── */

.sheet {
  width: 100%;
  max-width: 78rem;
  margin: 0 auto;
  padding-inline: var(--gut);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--black);
  color: var(--paper);
  padding: 0.75rem 1rem;
  z-index: 99;
  border: none;
}
.skip:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* ─── masthead ─────────────────────────────────────────────────────────── */

.masthead {
  border-bottom: var(--rule-thick);
}
.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.85rem;
  flex-wrap: wrap;
}
.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: none;
  color: var(--black);
  font-family: "Plate", Helvetica, sans-serif;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}
.mark:hover,
.mark:focus-visible {
  background: none;
  color: var(--black);
}
.mark svg {
  display: block;
  width: 2rem;
  height: 1.35rem;
}
.masthead nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}
.masthead nav a {
  border-bottom: none;
  color: var(--black);
  font-family: "Slug", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.masthead nav a[aria-current="page"] {
  background: var(--black);
  color: var(--paper);
  padding: 0.28rem 0.5rem;
}
.masthead nav a:hover,
.masthead nav a:focus-visible {
  background: var(--pink);
  color: var(--paper);
  padding: 0.28rem 0.5rem;
}

/* ─── poster fold ──────────────────────────────────────────────────────── */

.poster {
  position: relative;
  border-bottom: var(--rule-thick);
  padding-block: clamp(2.25rem, 6vw, 4.5rem) clamp(2rem, 5vw, 3.5rem);
}
.poster-grid {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 60rem) {
  .poster-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
  }
}

.poster h1 {
  font-size: clamp(3.2rem, 12vw, 8rem);
  line-height: 1.04;
  text-transform: lowercase;
}
.poster h1 span {
  display: block;
}
.poster h1 .line-2 {
  padding-left: 0.09em;
}
.poster h1 .line-3 {
  padding-left: 0.18em;
}

.standfirst {
  font-size: clamp(1.15rem, 0.98rem + 0.75vw, 1.5rem);
  line-height: 1.42;
  max-width: 30rem;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
}

.stamp {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 1.75rem;
  border: 3px solid var(--black);
  padding: 0.7rem 0.95rem;
  transform: rotate(-1.4deg);
  background: var(--paper);
  max-width: 24rem;
}
.stamp b {
  font-family: "Plate", Helvetica, sans-serif;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.stamp span {
  font-family: "Slug", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.5;
}

/* ─── the press (canvas) ───────────────────────────────────────────────── */

.press {
  position: relative;
  border: var(--rule);
  background: var(--paper-deep);
  aspect-ratio: 4 / 3.15;
  overflow: hidden;
}
.press canvas {
  display: block;
  width: 100%;
  height: 100%;
}
/* the plate is printed on the same stock as everything else */
.press::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.3'/%3E%3C/svg%3E");
}
.press-fallback {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.press.live .press-fallback {
  display: none;
}
.press-caption {
  border-top: var(--rule);
  padding: 0.55rem 0.7rem;
  display: flex;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
  align-items: baseline;
  background: var(--paper);
}
.press-caption .slug {
  color: var(--black);
}
.key {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}
.key li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "Slug", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  display: inline-block;
  flex: none;
}
.dot.solo {
  background: var(--blue);
  opacity: 0.55;
}
.dot.pair {
  background: var(--pink);
}
.dot.flow {
  background: var(--over);
  width: 1.1rem;
  height: 0.28rem;
  border-radius: 0;
}

/* ─── section grammar ──────────────────────────────────────────────────── */

.band {
  border-bottom: var(--rule-thick);
  padding-block: clamp(2.75rem, 7vw, 5.5rem);
}
.band.inked {
  background: var(--black);
  color: var(--paper);
}
.band.inked a {
  color: var(--paper);
  border-bottom-color: var(--pink);
}
.band.inked a:hover,
.band.inked a:focus-visible {
  background: var(--pink);
  color: var(--black);
}
.band.pinked {
  background: var(--pink);
  color: var(--black);
}

.band-head {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin-bottom: clamp(1.5rem, 3.5vw, 2.75rem);
  border-bottom: var(--rule);
  padding-bottom: 0.6rem;
}
.band.inked .band-head {
  border-bottom-color: var(--paper);
}
.band-head h2 {
  font-size: clamp(1.6rem, 1.1rem + 2vw, 2.85rem);
}
.band-head .slug {
  margin-left: auto;
  white-space: nowrap;
  opacity: 0.75;
}

.lede {
  font-family: "Plate", Helvetica, sans-serif;
  font-weight: 700;
  font-size: clamp(1.7rem, 1.05rem + 3.1vw, 3.6rem);
  line-height: 1.03;
  letter-spacing: -0.025em;
  max-width: 20ch;
  margin: 0;
  text-wrap: balance;
}

/* numbered steps — a printed list, not a card grid */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}
.steps > li {
  counter-increment: step;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.9rem clamp(1rem, 3vw, 2.5rem);
  padding-block: clamp(1.35rem, 3vw, 2.1rem);
  border-top: var(--rule);
  align-items: start;
}
.steps > li:last-child {
  border-bottom: var(--rule);
}
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  font-family: "Plate", Helvetica, sans-serif;
  font-size: clamp(2.6rem, 1.4rem + 5vw, 5.5rem);
  line-height: 0.78;
  color: var(--pink);
  letter-spacing: -0.04em;
}
.steps h3 {
  font-size: clamp(1.25rem, 1rem + 1vw, 1.85rem);
  margin-bottom: 0.5rem;
}
.steps p {
  margin-bottom: 0;
}

/* the flow diagram — printed, no invented numbers */
.flow {
  display: grid;
  gap: 0;
  border: var(--rule);
  grid-template-columns: 1fr;
}
@media (min-width: 52rem) {
  .flow {
    grid-template-columns: repeat(4, 1fr);
  }
}
.flow > div {
  padding: clamp(1rem, 2.4vw, 1.6rem);
  border-top: var(--rule);
  position: relative;
}
.flow > div:first-child {
  border-top: none;
}
@media (min-width: 52rem) {
  .flow > div {
    border-top: none;
    border-left: var(--rule);
  }
  .flow > div:first-child {
    border-left: none;
  }
}
.flow h3 {
  font-size: 1.05rem;
  margin-bottom: 0.55rem;
  line-height: 1.12;
}
.flow p {
  font-size: 0.94rem;
  margin: 0;
  max-width: none;
}
.flow .n {
  font-family: "Slug", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  display: block;
  margin-bottom: 0.75rem;
  color: var(--blue);
}
.band.inked .flow {
  border-color: var(--paper);
}
.band.inked .flow > div {
  border-color: var(--paper);
}
.band.inked .flow .n {
  color: var(--pink);
}

/* spec list — every row traceable to src/ */
.spec {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  border-top: var(--rule);
}
@media (min-width: 44rem) {
  .spec {
    grid-template-columns: minmax(11rem, 15rem) minmax(0, 1fr);
  }
}
.spec dt {
  font-family: "Slug", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 1rem 0 0.25rem;
  color: var(--blue);
}
.spec dd {
  margin: 0;
  padding: 0 0 1rem;
  border-bottom: var(--rule);
}
@media (min-width: 44rem) {
  .spec dt {
    padding: 1.05rem 1.25rem 1.05rem 0;
    border-bottom: var(--rule);
  }
  .spec dd {
    padding: 1.05rem 0;
  }
}
.spec dd p {
  margin: 0;
  max-width: 46ch;
}
.spec dd .val {
  font-family: "Plate", Helvetica, sans-serif;
  font-size: 1.15rem;
  display: block;
  margin-bottom: 0.15rem;
}

/* a taped-on notice: the honesty callouts */
.notice {
  border: 3px solid var(--black);
  background: var(--paper);
  padding: clamp(1.1rem, 2.6vw, 1.9rem);
  max-width: 46rem;
  position: relative;
}
.notice + .notice {
  margin-top: clamp(1.25rem, 3vw, 2rem);
}
.notice h3 {
  font-size: clamp(1.15rem, 1rem + 0.8vw, 1.6rem);
  margin-bottom: 0.6rem;
}
.notice p:last-child {
  margin-bottom: 0;
}
.notice .tape {
  position: absolute;
  top: -0.7rem;
  left: 1.4rem;
  background: var(--pink);
  color: var(--black);
  font-family: "Slug", monospace;
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.24rem 0.55rem;
  border: 2px solid var(--black);
  transform: rotate(-1.6deg);
}
.notice.two .tape {
  background: var(--blue);
  color: var(--paper);
  transform: rotate(1.2deg);
}

/* handshake diagram (pairing page) — three plates, stacked when narrow */
.handshake {
  border: var(--rule);
  background: var(--paper);
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 48rem) {
  .handshake {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.handshake figure {
  margin: 0;
  padding: clamp(1.1rem, 2.6vw, 1.7rem);
  border-top: var(--rule);
}
.handshake figure:first-child {
  border-top: none;
}
@media (min-width: 48rem) {
  .handshake figure {
    border-top: none;
    border-left: var(--rule);
  }
  .handshake figure:first-child {
    border-left: none;
  }
}
.handshake svg {
  display: block;
  width: 100%;
  max-width: 15rem;
  height: auto;
  margin-block: 0.9rem;
}
.handshake .n {
  font-family: "Slug", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blue);
}
.handshake .n.pink-n {
  color: var(--pink);
}
.handshake figcaption code {
  display: block;
  background: none;
  padding: 0;
  font-size: 0.8rem;
  margin-bottom: 0.2rem;
}
.handshake figcaption span {
  font-size: 0.9rem;
  opacity: 0.75;
}

/* worked example, unmistakably an example */
.example {
  border: 3px dashed var(--black);
  padding: clamp(1.1rem, 2.6vw, 1.9rem);
  background: var(--paper-deep);
}
.example h3 {
  font-size: 1.3rem;
  margin-bottom: 0.35rem;
}
.example ol {
  margin: 1rem 0 0;
  padding-left: 1.35rem;
}
.example li {
  margin-bottom: 0.5rem;
  max-width: var(--measure);
}
.example li:last-child {
  margin-bottom: 0;
}
.example .warn {
  font-family: "Slug", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--over);
  display: block;
  margin-bottom: 0.9rem;
}

.two-up {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: 1fr;
}
@media (min-width: 56rem) {
  .two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

.prose > * {
  max-width: var(--measure);
}
.prose h3 {
  font-size: clamp(1.3rem, 1.05rem + 1vw, 1.9rem);
  margin-top: 2.25rem;
  margin-bottom: 0.7rem;
}
.prose h3:first-child {
  margin-top: 0;
}
.prose ul {
  margin: 0 0 1.1em;
  padding-left: 1.1rem;
  max-width: var(--measure);
}
.prose li {
  margin-bottom: 0.45rem;
  padding-left: 0.25rem;
}
.prose li::marker {
  color: var(--pink);
}

code,
.mono {
  font-family: "Slug", "Courier 10 Pitch", monospace;
  font-size: 0.86em;
  background: var(--paper-deep);
  padding: 0.08em 0.32em;
}
.band.inked code,
.band.inked .mono {
  background: rgba(244, 238, 225, 0.16);
}

/* closing / colophon */
.colophon {
  padding-block: clamp(2.25rem, 5vw, 3.75rem);
}
.colophon-inner {
  display: flex;
  gap: 1.5rem 3rem;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
}
.colophon .slug {
  line-height: 1.7;
}

/* ─── motion ───────────────────────────────────────────────────────────── */

@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;
  }
}
