/* Spark Gears Initiative — shared styles */

:root {
  --paper: #f4f0e6;
  --paper-2: #ebe5d5;
  --card: #fffdf7;
  --ink: #17150f;
  --ink-2: #26231b;
  --ink-soft: #3a362c;
  --muted: #5f594b;
  --yellow: #ffc233;
  --yellow-2: #f2ad00;
  --yellow-soft: #ffe39a;
  --green: #1f9d55;
  --line: rgba(23, 21, 15, 0.14);
  --line-strong: rgba(23, 21, 15, 0.9);
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 10px;
  color-scheme: light;
}

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

html { scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* tape strips on photo frames can poke past the gutter on phones */
main { overflow-x: clip; }

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

a { color: inherit; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}

h1 { font-size: clamp(3.4rem, 9vw, 7.6rem); }
h2 { font-size: clamp(2.5rem, 6vw, 4.8rem); }
h3 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); line-height: 0.98; }

p { margin: 0; }

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

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--yellow);
  border-radius: 6px;
}
.skip:focus { top: 12px; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}
.on-ink :focus-visible { outline-color: var(--yellow); }

/* ---------- Labels & text bits ---------- */

.label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 800 1rem/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.label::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--yellow);
  box-shadow: 0 0 0 2px var(--ink);
}

.on-ink .label::before { box-shadow: 0 0 0 2px var(--yellow); background: transparent; }

.lede {
  max-width: 58ch;
  font-size: clamp(1.08rem, 1.6vw, 1.25rem);
  color: var(--ink-soft);
}

.hl {
  background: linear-gradient(transparent 58%, var(--yellow) 58%, var(--yellow) 92%, transparent 92%);
  padding: 0 0.06em;
}

.on-ink .hl { background: none; color: var(--yellow); }

.chip {
  display: inline-block;
  padding: 5px 10px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  background: var(--card);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 22px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  font: 700 1rem/1 var(--body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.btn svg { width: 18px; height: 18px; transition: transform 180ms ease; }
.btn:hover svg { transform: translateX(4px); }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--yellow); color: var(--ink); }
.btn-primary:hover { background: var(--ink); color: var(--yellow); }

.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

.on-ink .btn { border-color: var(--yellow); }
.on-ink .btn-ghost { color: var(--paper); border-color: rgba(244, 240, 230, 0.5); }
.on-ink .btn-ghost:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.on-ink .btn-primary:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }

.on-yellow .btn-primary { background: var(--ink); color: var(--yellow); }
.on-yellow .btn-primary:hover { background: var(--card); color: var(--ink); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--yellow-2);
  padding-bottom: 2px;
}
.text-link:hover { border-bottom-color: var(--ink); }
.text-link svg { width: 16px; height: 16px; transition: transform 180ms ease; }
.text-link:hover svg { transform: translateX(4px); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font: 900 1.45rem/0.9 var(--display);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  transition: transform 500ms cubic-bezier(.3, 1.4, .5, 1);
}

.brand:hover img { transform: rotate(120deg); }
.brand small {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  position: relative;
  padding: 10px 12px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
}

.nav-links a:not(.btn):hover { background: var(--paper-2); }

.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 3px;
  background: var(--yellow-2);
  border-radius: 2px;
}

.nav-links .btn { min-height: 42px; margin-left: 8px; padding: 0 16px; }

.menu-btn {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--yellow);
  font: 800 1rem/1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
}

.menu-btn .bars {
  position: relative;
  width: 16px;
  height: 2px;
  background: currentColor;
  transition: background 160ms;
}
.menu-btn .bars::before,
.menu-btn .bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: currentColor;
  transition: transform 200ms ease;
}
.menu-btn .bars::before { top: -5px; }
.menu-btn .bars::after { top: 5px; }
.menu-btn[aria-expanded="true"] .bars { background: transparent; }
.menu-btn[aria-expanded="true"] .bars::before { transform: translateY(5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .bars::after { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 20px;
    background: var(--yellow);
    border-bottom: 2px solid var(--ink);
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    padding: 14px 0;
    font: 900 2.2rem/1 var(--display);
    text-transform: uppercase;
    border-bottom: 1.5px solid rgba(23, 21, 15, 0.2);
    border-radius: 0;
  }
  .nav-links a:not(.btn):hover { background: none; }
  .nav-links a[aria-current="page"]::after { display: none; }
  .nav-links a[aria-current="page"]::before { content: "→ "; }

  .nav-links .btn {
    margin: 18px 0 0;
    min-height: 54px;
    font: 700 1.05rem/1 var(--body);
    text-transform: none;
    background: var(--ink);
    color: var(--yellow);
    border-bottom: 2px solid var(--ink);
    border-radius: 8px;
  }
}

/* ---------- Hero (home) ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid var(--ink);
  isolation: isolate;
}

.board {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

/* power rails along the top and bottom of the breadboard */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 10px;
  z-index: -1;
  background:
    linear-gradient(var(--yellow-2), var(--yellow-2)) 0 2px / 100% 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 0 8px / 100% 2px no-repeat;
  opacity: 0.55;
}
.hero::before { top: 10px; }
.hero::after { bottom: 10px; transform: scaleY(-1); }

.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding-block: clamp(44px, 8vw, 96px) clamp(52px, 8vw, 104px);
}

.hero-copy { display: grid; gap: 22px; justify-items: start; }

/* hero without a photo: copy spans the board */
.hero-grid.solo { grid-template-columns: 1fr; }
.hero-grid.solo h1 { max-width: 15ch; }
@media (max-width: 520px) {
  .hero-grid.solo h1 { font-size: clamp(2.6rem, 12.5vw, 3.4rem); }
  .hero-grid.solo h1 .row { display: inline; }
}

.hero h1 .row { display: block; }

.hero .lede {
  padding: 2px 0;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
}

.hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--muted);
}
.hint i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow-2);
  box-shadow: 0 0 0 3px rgba(242, 173, 0, 0.25);
}

/* ---------- Taped photo frame ---------- */

.taped {
  position: relative;
  margin: 0;
  padding: 10px 10px 14px;
  background: var(--card);
  border: 1.5px solid var(--line);
  box-shadow: 0 22px 40px -26px rgba(23, 21, 15, 0.55);
  transform: rotate(var(--tilt, 1.4deg));
  transition: transform 260ms ease;
}

.taped:hover { transform: rotate(0deg); }

.taped::before,
.taped::after {
  content: "";
  position: absolute;
  width: 96px;
  height: 26px;
  background: rgba(255, 194, 51, 0.82);
  border-left: 2px dashed rgba(23, 21, 15, 0.12);
  border-right: 2px dashed rgba(23, 21, 15, 0.12);
}
.taped::before { top: -12px; left: -24px; transform: rotate(-32deg); }
.taped::after { bottom: -10px; right: -26px; transform: rotate(-30deg); }

.taped img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.taped figcaption {
  margin-top: 10px;
  font-size: 0.86rem;
  color: var(--muted);
}

/* ---------- Stats ---------- */

.stats {
  background: var(--ink);
  color: var(--paper);
}

.stats ul {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-block: 0;
  padding: 0;
  list-style: none;
}

.stats li {
  padding: 26px 22px;
  border-left: 1.5px solid rgba(244, 240, 230, 0.16);
}
.stats li:first-child { border-left: 0; padding-left: 0; }

.stats strong {
  display: block;
  font: 900 clamp(2.8rem, 5vw, 4.2rem)/0.9 var(--display);
  color: var(--yellow);
}

.stats span { display: block; margin-top: 8px; font-size: 0.95rem; color: #cfc8b6; }

@media (max-width: 760px) {
  .stats ul { grid-template-columns: repeat(2, 1fr); }
  .stats li { padding: 20px 16px; }
  .stats li:nth-child(odd) { border-left: 0; padding-left: 0; }
  .stats li:nth-child(n + 3) { border-top: 1.5px solid rgba(244, 240, 230, 0.16); }
}

/* ---------- Sections ---------- */

.section { padding-block: clamp(56px, 9vw, 112px); }
.section.tight { padding-block: clamp(44px, 6vw, 72px); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 18px 40px;
  margin-bottom: clamp(28px, 4vw, 44px);
}

.section-head > div:not(.rail-controls) { display: grid; gap: 14px; max-width: 760px; }
.section-head .lede { max-width: 46ch; }

.on-ink {
  background: var(--ink);
  color: var(--paper);
}
.on-ink .lede { color: #d4cdbb; }

.on-yellow {
  background: var(--yellow);
  color: var(--ink);
}
.on-yellow .lede { color: var(--ink-2); }
.on-yellow .label::before { background: var(--ink); box-shadow: none; }

.rule-top { border-top: 2px solid var(--ink); }

/* ---------- Steps ---------- */

.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 26px 24px 28px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  counter-increment: step;
}

.steps li::before {
  content: "0" counter(step);
  display: block;
  margin-bottom: 18px;
  font: 900 3.6rem/0.8 var(--display);
  color: transparent;
  -webkit-text-stroke: 2px var(--ink);
}

.steps li:hover::before { color: var(--yellow); }

/* wire connecting step cards: spans the 18px gap, centered on the step number */
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 47px;
  right: -20px;
  width: 18px;
  height: 2px;
  background: var(--ink);
}

.steps h3 { margin-bottom: 10px; }
.steps p { color: var(--muted); }

.steps.vertical { grid-template-columns: 1fr; gap: 14px; color: var(--ink); }
.steps.vertical li { display: grid; grid-template-columns: 52px 1fr; column-gap: 18px; padding: 20px; }
.steps.vertical li::before { grid-row: span 2; margin: 0; font-size: 3rem; text-align: center; }
.steps.vertical li:not(:last-child)::after { top: auto; bottom: -16px; left: 45px; right: auto; width: 2px; height: 14px; }
.on-ink .steps li:not(:last-child)::after { background: var(--yellow); }

@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr; gap: 14px; }
  .steps li { display: grid; grid-template-columns: 52px 1fr; column-gap: 18px; padding: 20px; }
  .steps li::before { grid-row: span 2; margin: 0; font-size: 3rem; text-align: center; }
  .steps li:not(:last-child)::after { top: auto; bottom: -16px; left: 45px; right: auto; width: 2px; height: 14px; }
}

/* ---------- Program rail (home) ---------- */

.rail-controls { display: flex; gap: 8px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 160ms, color 160ms, opacity 160ms;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover:not(:disabled) { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.icon-btn:disabled { opacity: 0.3; cursor: default; }

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 32%);
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 4px;
  overscroll-behavior-x: contain;
}
.rail::-webkit-scrollbar { display: none; }

.rail-card {
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  background: var(--ink-2);
  border: 1.5px solid rgba(244, 240, 230, 0.14);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: border-color 180ms;
}

.rail-card:hover { border-color: var(--yellow); }

.rail-card .media { overflow: hidden; aspect-ratio: 4 / 3; }
.rail-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}
.rail-card:hover img { transform: scale(1.05); }

.rail-card .body { display: grid; gap: 10px; padding: 18px 18px 22px; }
.rail-card time { font: 800 1rem/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--yellow); }
.rail-card p { color: #cfc8b6; font-size: 0.97rem; }

.rail-progress {
  height: 3px;
  margin-top: 22px;
  background: rgba(244, 240, 230, 0.14);
  border-radius: 2px;
  overflow: hidden;
}
.rail-progress span {
  display: block;
  height: 100%;
  width: 30%;
  background: var(--yellow);
  transform-origin: left;
}

@media (max-width: 860px) {
  .rail-controls { display: none; }
  .rail { grid-auto-columns: 82%; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
}

/* ---------- Tape marquee ---------- */

.tape {
  overflow: hidden;
  background: var(--yellow);
  border-block: 2px solid var(--ink);
}

.tape-track {
  display: flex;
  width: max-content;
  animation: tape 38s linear infinite;
}

.tape:hover .tape-track { animation-play-state: paused; }

.tape-track span {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  padding: 14px 11px;
  font: 900 clamp(1.4rem, 2.4vw, 1.9rem)/1 var(--display);
  text-transform: uppercase;
  white-space: nowrap;
}

.tape-track svg { width: 22px; height: 22px; flex: none; }

@keyframes tape { to { transform: translateX(-50%); } }

/* ---------- Split feature ---------- */

.split {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}

.split .copy { display: grid; gap: 20px; justify-items: start; }
.split.flip .copy { order: 2; }

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split.flip .copy { order: 0; }
}

/* ---------- CTA band ---------- */

.cta {
  display: grid;
  grid-template-columns: 1.2fr auto;
  gap: 28px;
  align-items: end;
}
.cta .copy { display: grid; gap: 16px; }

@media (max-width: 760px) {
  .cta { grid-template-columns: 1fr; }
}

/* ---------- Page header (inner pages) ---------- */

.page-head {
  position: relative;
  padding-block: clamp(44px, 7vw, 88px) clamp(36px, 5vw, 56px);
  border-bottom: 2px solid var(--ink);
  background:
    radial-gradient(circle, rgba(23, 21, 15, 0.13) 1.6px, transparent 2px) 0 0 / 22px 22px,
    var(--paper);
}

.page-head .wrap { display: grid; gap: 20px; justify-items: start; }
.page-head h1 { font-size: clamp(3.2rem, 8vw, 6.6rem); max-width: 12ch; }
/* longer titles: wider measure so they stay at three lines */
.page-head h1.wide { font-size: clamp(2.05rem, 7vw, 5.6rem); max-width: 22ch; }
.page-head .lede { background: var(--paper); }

/* ---------- Programs logbook ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  font: 600 0.95rem/1 var(--body);
  color: var(--ink);
  cursor: pointer;
  transition: background 150ms;
}
.filter b {
  min-width: 22px;
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--paper-2);
  font-size: 0.78rem;
  text-align: center;
}
.filter:hover { background: var(--yellow-soft); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--yellow); }
.filter[aria-pressed="true"] b { background: var(--yellow); color: var(--ink); }

.log { display: grid; }

.entry {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  padding-block: clamp(36px, 5vw, 60px);
  border-top: 2px solid var(--ink);
}
.entry:first-child { border-top: 0; padding-top: 8px; }
.entry:nth-child(even of :not([hidden])) .gallery { order: 2; }

.entry .copy { display: grid; gap: 16px; align-content: start; }

.stamp {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 10px;
  padding: 8px 12px 7px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 6px;
  font: 900 1.15rem/1 var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transform: rotate(-2deg);
}
.stamp small { font-weight: 700; opacity: 0.7; letter-spacing: 0.08em; }

.entry h2 { font-size: clamp(2.3rem, 4.6vw, 3.8rem); }
.entry .copy > p { color: var(--ink-soft); }

.gallery { display: grid; gap: 10px; }

.gallery-main {
  position: relative;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink);
  cursor: zoom-in;
  aspect-ratio: 3 / 2;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 200ms ease, transform 400ms ease;
}
.gallery-main:hover img { transform: scale(1.03); }

.gallery-main .count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.8rem;
  font-weight: 600;
}

.thumbs {
  display: flex;
  gap: 8px;
}

.thumb {
  flex: 0 1 96px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: none;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 150ms, border-color 150ms;
}
.thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.thumb:hover { opacity: 1; }
.thumb[aria-current="true"] { opacity: 1; border-color: var(--ink); }

@media (max-width: 860px) {
  .entry { grid-template-columns: 1fr; gap: 20px; }
  .entry:nth-child(even of :not([hidden])) .gallery { order: 0; }
  .entry .copy { order: -1; }
}

/* ---------- Lightbox ---------- */

.lightbox {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(14, 13, 9, 0.94);
  color: var(--paper);
}
.lightbox::backdrop { background: transparent; }

.lightbox[open] {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.lb-top,
.lb-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px var(--gutter);
}

.lb-top p { font: 800 1.2rem/1.1 var(--display); letter-spacing: 0.04em; text-transform: uppercase; }
.lb-bottom { justify-content: center; }
.lb-bottom span { min-width: 64px; text-align: center; font-weight: 600; }

.lb-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 0 var(--gutter);
}
.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

/* ---------- About ---------- */

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.principle {
  display: grid;
  align-content: start;
  gap: 12px;
  margin: 0;
}

.principle .taped { margin-bottom: 14px; }
.principle:nth-child(2) .taped { --tilt: -1.6deg; }
.principle:nth-child(3) .taped { --tilt: 0.8deg; }
.principle p { color: var(--muted); }

@media (max-width: 860px) {
  .principles { grid-template-columns: 1fr; gap: 40px; }
}

.goals {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: goal;
}

.goals li {
  display: grid;
  grid-template-columns: 90px 1fr 1.4fr;
  gap: 24px;
  align-items: baseline;
  padding-block: 26px;
  border-top: 1.5px solid rgba(23, 21, 15, 0.3);
  counter-increment: goal;
}
.goals li:last-child { border-bottom: 1.5px solid rgba(23, 21, 15, 0.3); }
.goals li::before {
  content: "0" counter(goal);
  font: 900 3rem/0.8 var(--display);
}

@media (max-width: 760px) {
  .goals li { grid-template-columns: 56px 1fr; gap: 6px 16px; }
  .goals li::before { grid-row: span 2; font-size: 2.4rem; }
}

.mentors {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.mentor {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 22px;
  align-items: start;
  padding: 22px;
  border: 1.5px solid rgba(244, 240, 230, 0.18);
  border-radius: var(--radius);
  background: var(--ink-2);
}

.mentor img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
}

.mentor .copy { display: grid; gap: 12px; }
.mentor p { color: #cfc8b6; font-size: 0.98rem; }
.mentor .tagline { color: var(--paper); font-weight: 600; }

@media (max-width: 960px) {
  .mentors { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .mentor { grid-template-columns: 1fr; }
  .mentor img { width: 120px; }
}

/* ---------- Get involved ---------- */

.subnav {
  position: sticky;
  top: 70px;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1.5px solid var(--line);
}

.subnav .wrap {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-block: 10px;
  scrollbar-width: none;
}
.subnav .wrap::-webkit-scrollbar { display: none; }

.subnav a {
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--line);
}
.subnav a:hover { border-color: var(--ink); }
.subnav a.active { background: var(--ink); color: var(--yellow); border-color: var(--ink); }

.exchange {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
}

.exchange > div { padding: clamp(22px, 3vw, 34px); }
.exchange > div + div { background: var(--yellow); border-left: 2px solid var(--ink); }
.exchange > div:first-child { background: var(--card); }
.exchange h3 { margin-bottom: 18px; }

.checks {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checks li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: start;
  font-weight: 500;
}

.checks li::before {
  content: "";
  width: 22px;
  height: 22px;
  margin-top: 3px;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4 9.4l3.2 3.1L14 5.6' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
}

@media (max-width: 760px) {
  .exchange { grid-template-columns: 1fr; }
  .exchange > div + div { border-left: 0; border-top: 2px solid var(--ink); }
}

/* program picker (tabs) */
.picker {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 18px;
}

.picker-tabs { display: grid; gap: 10px; align-content: start; }

.picker-tab {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 150ms, transform 150ms;
}
.picker-tab span { font: 800 0.95rem/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.picker-tab strong { font: 900 1.7rem/1 var(--display); text-transform: uppercase; }
.picker-tab:hover { background: var(--yellow-soft); }
.picker-tab[aria-selected="true"] { background: var(--ink); color: var(--paper); transform: translateX(6px); }
.picker-tab[aria-selected="true"] span { color: var(--yellow); }

.picker-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}
.picker-panel[hidden] { display: none; }
.picker-panel img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 2px solid var(--ink); }
.picker-panel .body { display: grid; gap: 14px; align-content: start; padding: 22px 24px 26px; }
.picker-panel p { color: var(--ink-soft); }

@media (max-width: 860px) {
  .picker { grid-template-columns: 1fr; }
  .picker-tabs { grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); overflow-x: auto; scrollbar-width: none; }
  .picker-tab[aria-selected="true"] { transform: none; }
  .picker-tab strong { font-size: 1.4rem; }
}

.contact-card {
  display: grid;
  gap: 6px;
  padding: 22px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  text-decoration: none;
  transition: background 150ms;
}
.contact-card:hover { background: var(--yellow); }
.contact-card span { font: 800 0.95rem/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.contact-card strong { font-size: 1.12rem; overflow-wrap: anywhere; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 760px) {
  .contact-grid { grid-template-columns: 1fr; }
}

/* ---------- Card grid ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 12px;
}

.card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 22px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  transition: background 150ms;
}
a.card:hover { background: var(--yellow); }
.card > span { font: 800 0.95rem/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.card p { color: var(--muted); }
.card .btn { justify-self: start; margin-top: 6px; min-height: 44px; }

.section-foot { margin-top: clamp(24px, 3vw, 36px); }

/* ---------- Photo placeholder (owner to supply) ---------- */

.ph {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 16px;
  background: repeating-linear-gradient(-45deg, var(--paper-2) 0 12px, var(--card) 12px 24px);
  color: var(--ink);
  text-align: center;
}
.ph span {
  max-width: 30ch;
  padding: 7px 11px 6px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 6px;
  font: 800 0.95rem/1.15 var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rail-card .ph { height: 100%; background: repeating-linear-gradient(-45deg, var(--ink-2) 0 12px, #2f2b22 12px 24px); }
.rail-card .ph span { background: var(--ink); color: var(--yellow); border-color: var(--yellow); }

.gallery .ph { aspect-ratio: 3 / 2; border: 2px dashed var(--ink); border-radius: var(--radius); }
.picker-panel .ph { aspect-ratio: 16 / 9; border-bottom: 2px solid var(--ink); }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: #cfc8b6;
  padding-block: 56px 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 1fr;
  gap: 32px;
}

.site-footer .brand { color: var(--paper); }
.site-footer .brand small { color: #a49d8b; }
.site-footer h3 { font-size: 1.1rem; letter-spacing: 0.08em; color: var(--yellow); margin-bottom: 12px; }
.site-footer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.site-footer a { color: var(--paper); text-decoration-color: rgba(244, 240, 230, 0.3); text-underline-offset: 3px; }
.site-footer a:hover { color: var(--yellow); }
.site-footer .about { margin-top: 14px; max-width: 34ch; font-size: 0.95rem; }

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid rgba(244, 240, 230, 0.15);
  font-size: 0.88rem;
  color: #a49d8b;
}

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

/* ---------- Responsive: hero ---------- */

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; padding-block: 36px 52px; }
  .hero .taped { max-width: 560px; --tilt: 1deg; margin-inline: 8px; }
}

@media (max-width: 520px) {
  body { font-size: 1rem; }
  .actions .btn { flex: 1 1 100%; }
  .hero-copy { gap: 18px; }
  .taped::before, .taped::after { width: 70px; height: 20px; }
}

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

/* tape reads as paper on yellow sections */
.on-yellow .taped::before,
.on-yellow .taped::after { background: rgba(255, 253, 247, 0.8); }

/* leave room for the sticky sub-nav when jumping to a section */
html:has(.subnav) { scroll-padding-top: 136px; }

/* ---------- Downloads + PDF preview ---------- */

.card-grid.three { grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* five cards: one row on wide screens, then 3 + 2 and 2 + 2 + 1 with full-width rows */
.card-grid.five { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1100px) {
  .card-grid.five { grid-template-columns: repeat(6, 1fr); }
  .card-grid.five > * { grid-column: span 2; }
  .card-grid.five > :nth-child(n + 4) { grid-column: span 3; }
}
@media (max-width: 700px) {
  .card-grid.five { grid-template-columns: repeat(2, 1fr); }
  .card-grid.five > *, .card-grid.five > :nth-child(n + 4) { grid-column: auto; }
  .card-grid.five > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .card-grid.five { grid-template-columns: 1fr; }
}
.card-grid.downloads .card { grid-template-rows: auto auto 1fr auto; }
.card-grid.downloads .card .btn { align-self: end; }
.picker-panel .text-link { justify-self: start; }

@media (max-width: 960px) {
  .card-grid.three { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .card-grid.three { grid-template-columns: 1fr; }
}

.pdf-viewer {
  width: min(100% - 32px, 980px);
  max-width: none;
  height: min(100% - 32px, 1100px);
  max-height: none;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink);
  overflow: hidden;
}
.pdf-viewer::backdrop { background: rgba(14, 13, 9, 0.72); }
.pdf-viewer[open] { display: block; }

.pdf-panel { display: grid; grid-template-rows: auto 1fr; height: 100%; }
.pdf-body { position: relative; display: grid; grid-template-columns: 1fr; min-height: 0; }
.pdf-viewer.code-open .pdf-body { grid-template-columns: 1fr 320px; }

.pdf-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px 12px 20px;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}
.pdf-name { display: grid; gap: 4px; min-width: 0; }
.pdf-name p {
  font: 900 1.45rem/1 var(--display);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdf-meta { font-size: 0.85rem; color: var(--muted); }
.pdf-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pdf-actions .btn { min-height: 46px; }
.pdf-actions .btn:hover svg { transform: translateY(2px); }
.pdf-actions .icon-btn { width: 46px; height: 46px; border-color: var(--ink); color: var(--ink); }
.pdf-actions .icon-btn:hover { background: var(--ink); color: var(--paper); }

.pdf-pages {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 18px;
  padding: 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.pdf-pages:focus-visible { outline-offset: -4px; }
.pdf-pages canvas {
  display: block;
  width: 100%;
  max-width: 860px;
  height: auto;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(23, 21, 15, 0.2), 0 8px 24px rgba(23, 21, 15, 0.14);
}
.pdf-pages iframe { width: 100%; height: 100%; min-height: 70vh; border: 0; background: #fff; }
.pdf-status { padding: 40px 0; font-weight: 600; color: var(--muted); }

.pdf-code-toggle { gap: 8px; padding: 0 16px; }
.pdf-code-toggle[aria-expanded="true"] { background: var(--ink); color: var(--paper); }
.pdf-code-toggle:hover svg, .pdf-code-toggle svg { transform: none; }

.pdf-code {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  padding: 18px 16px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--paper);
  border-left: 2px solid var(--ink);
}
.pdf-code[hidden] { display: none; }
.pdf-code-head { display: grid; gap: 4px; }
.pdf-code-head p { font: 900 1.25rem/1 var(--display); text-transform: uppercase; }
.pdf-code-head span { font-size: 0.85rem; line-height: 1.4; color: var(--muted); }

.pdf-code-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.pdf-snippet {
  display: grid;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--card);
  overflow: hidden;
}
.pdf-snippet-top { display: grid; gap: 2px; padding: 10px 12px 8px; }
.pdf-snippet-top strong { font: 800 1.05rem/1.05 var(--display); text-transform: uppercase; letter-spacing: 0.02em; }
.pdf-snippet-top button {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  font: 600 0.8rem/1.4 var(--body);
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.pdf-snippet-top button:hover { color: var(--ink); }
.pdf-snippet pre {
  position: relative;
  max-height: 7.4em;
  margin: 0;
  padding: 8px 12px;
  overflow: hidden;
  background: var(--paper-2);
  border-block: 1.5px solid var(--line);
  font: 0.72rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
  color: var(--ink-soft);
}
.pdf-snippet pre::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2.4em;
  background: linear-gradient(transparent, var(--paper-2));
}
.pdf-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  background: var(--yellow);
  color: var(--ink);
  font: 700 0.95rem/1 var(--body);
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}
.pdf-copy svg { width: 16px; height: 16px; }
.pdf-copy:hover { background: var(--ink); color: var(--yellow); }
.pdf-copy.copied { background: var(--green); color: #fff; }
.pdf-copy:focus-visible { outline-offset: -4px; }

@media (max-width: 860px) {
  /* side panel becomes a sheet over the pages */
  .pdf-viewer.code-open .pdf-body { grid-template-columns: 1fr; }
  .pdf-code {
    position: absolute;
    inset: 0 0 0 auto;
    width: min(100%, 360px);
    z-index: 2;
    box-shadow: -12px 0 32px rgba(23, 21, 15, 0.22);
  }
}

@media (max-width: 600px) {
  .pdf-viewer { width: 100%; height: 100%; border: 0; border-radius: 0; }
  .pdf-bar { padding: 10px 10px 10px 16px; }
  .pdf-name p { font-size: 1.15rem; }
  .pdf-actions .btn { padding: 0 14px; }
  .pdf-code { width: 100%; border-left: 0; }
  .pdf-actions .btn-label { display: none; }
  .pdf-pages { padding: 12px; gap: 12px; }
}
