/* ============================================================
   BayStreet Prep — faded-print study hub
   Palette: desaturated 70s photo (mustard / avocado / ochre / sienna)
   Type: Fraunces + JetBrains Mono, hand-marked-up annotations
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --bg:        #efe6d0;
  --bg-2:      #e7dcc2;
  --surface:   #f6efdd;
  --ink:       #3a2f1a;
  --ink-soft:  #5c4f33;
  --ink-faint: #6b5e3f;
  --a:         #8a6408;   /* deep mustard (text-safe on paper) */
  --a-bright:  #b8860b;   /* mustard for fills and bars only */
  --b:         #4f7a2e;   /* leaf green */
  --c:         #c2410c;   /* burnt orange */
  --d:         #1d5c8f;   /* ink blue */
  --e:         #8a2f6b;   /* plum */
  --rule:      #cbbd9c;
  --rule-soft: #dbcfb2;
  --accent:    rgba(184, 134, 11, 0.20);
  --shadow:    0 1px 0 rgba(58, 47, 26, 0.10), 0 10px 30px -18px rgba(58, 47, 26, 0.45);
  --grain-op:  0.055;
  --maxw:      1120px;
  --pad:       clamp(1.15rem, 4vw, 3rem);
  --serif:     "Fraunces", Georgia, "Times New Roman", serif;
  --mono:      "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

html[data-theme="dark"] {
  --bg:        #1c1a14;
  --bg-2:      #232019;
  --surface:   #262218;
  --ink:       #f0e7d2;
  --ink-soft:  #cdc0a0;
  --ink-faint: #b8ab89;
  --a:         #e0b13c;
  --a-bright:  #e0b13c;
  --b:         #8fb055;
  --c:         #f07a3c;
  --d:         #6aa9d8;
  --e:         #d17ab4;
  --rule:      #4a4234;
  --rule-soft: #383226;
  --accent:    rgba(224, 177, 60, 0.16);
  --shadow:    0 1px 0 rgba(0, 0, 0, 0.4), 0 12px 34px -20px rgba(0, 0, 0, 0.9);
  --grain-op:  0.075;
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 0, "WONK" 0;
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.62;
  overflow-x: hidden;
  position: relative;
}

/* diagonal colour band cutting under the content */
body::before {
  content: "";
  position: fixed;
  inset: -20% -10%;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(
      15deg,
      transparent 36%,
      color-mix(in srgb, var(--d) 9%, transparent) 36%,
      color-mix(in srgb, var(--d) 9%, transparent) 44%,
      transparent 44%
    ),
    linear-gradient(
      15deg,
      transparent 46%,
      var(--accent) 46%,
      var(--accent) 62%,
      transparent 62%
    ),
    linear-gradient(
      15deg,
      transparent 66%,
      color-mix(in srgb, var(--e) 8%, transparent) 66%,
      color-mix(in srgb, var(--e) 8%, transparent) 74%,
      transparent 74%
    );
}

/* subtle print grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--grain-op);
  mix-blend-mode: multiply;
  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.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(/%23n)'/%3E%3C/svg%3E");
}
html[data-theme="dark"] body::after { mix-blend-mode: screen; }

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

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
  position: relative;
  z-index: 2;
}

main { position: relative; z-index: 2; }

/* ---------- type ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-size: clamp(2.35rem, 1.4rem + 4.6vw, 4.6rem);
  font-weight: 700;
  font-variation-settings: "SOFT" 30, "WONK" 1;
  margin-block: 0.5rem 0.9rem;
  max-width: 16ch;
}

h2 {
  font-size: clamp(1.7rem, 1.2rem + 2.1vw, 2.7rem);
  margin-block: 0.35rem 0.7rem;
  max-width: 22ch;
}

h3 { font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem); }
h4 { font-size: 1.02rem; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--c); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--a); }

strong { font-weight: 650; }
em { font-style: italic; }

::selection { background: var(--a); color: var(--bg); }

/* ---------- folio strip ---------- */
.folio {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.6rem;
  margin: 0 0 1.6rem;
}
.folio-sep { color: var(--a); }

/* ---------- hand-drawn scribble mark ---------- */
mark.scribble {
  background: none;
  color: inherit;
  position: relative;
  padding: 0 0.06em;
  white-space: nowrap;
}
mark.scribble::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: -0.14em;
  height: 0.42em;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M3 13 C 40 4, 78 17, 116 9 S 176 3, 197 11' fill='none' stroke='%23c04e1a' stroke-width='4' stroke-linecap='round'/%3E%3Cpath d='M6 17 C 46 10, 84 20, 122 13 S 178 8, 195 15' fill='none' stroke='%23a67c00' stroke-width='2.4' stroke-linecap='round' opacity='.75'/%3E%3C/svg%3E");
}
html[data-theme="dark"] mark.scribble::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M3 13 C 40 4, 78 17, 116 9 S 176 3, 197 11' fill='none' stroke='%23e2703a' stroke-width='4' stroke-linecap='round'/%3E%3Cpath d='M6 17 C 46 10, 84 20, 122 13 S 178 8, 195 15' fill='none' stroke='%23d9a72e' stroke-width='2.4' stroke-linecap='round' opacity='.75'/%3E%3C/svg%3E");
}

/* ---------- focus ---------- */
:focus-visible {
  outline: 3px solid var(--c);
  outline-offset: 3px;
  border-radius: 2px;
}
html[data-theme="dark"] :focus-visible { outline-color: var(--a); }

/* ---------- masthead ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px) saturate(1.1);
  border-bottom: 1px solid var(--rule);
}
.masthead-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 62px;
  flex-wrap: wrap;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: -0.01em;
  margin-right: auto;
}
.wordmark-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 3px;
  transform: rotate(-2.5deg);
}
.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.6rem, 1.6vw, 1.4rem);
  flex-wrap: wrap;
}
.nav a {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 0.55rem 0.15rem;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--a); }
.nav-cta {
  color: var(--ink) !important;
  border: 1px solid var(--ink) !important;
  border-radius: 999px;
  padding: 0.5rem 0.95rem !important;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
}
.nav-cta:hover { background: var(--ink); color: var(--bg) !important; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.4rem 0.8rem;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--ink); color: var(--ink); }
.tt-icon {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--a);
  box-shadow: inset -4px -3px 0 0 var(--bg);
}
html[data-theme="dark"] .tt-icon {
  background: var(--a);
  box-shadow: 0 0 0 2px var(--a), 0 0 10px 2px color-mix(in srgb, var(--a) 60%, transparent);
}

/* ---------- sections ---------- */
section { padding-block: clamp(2.6rem, 6vw, 5rem); }
section + section { border-top: 1px solid var(--rule-soft); }

.section-intro {
  max-width: 62ch;
  color: var(--ink-soft);
  margin-bottom: 2rem;
}

/* ---------- hero ---------- */
.hero { padding-top: clamp(2rem, 5vw, 3.6rem); }

.byline {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 2.2rem;
}
.byline-sep { color: var(--a); }

.hero-cols {
  display: grid;
  gap: clamp(1.6rem, 4vw, 3rem);
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .hero-cols { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
}

.hero-lede p { max-width: 62ch; }
.hero-lede p + p { margin-top: 1rem; }

.dropcap::first-letter {
  float: left;
  font-size: 3.9em;
  line-height: 0.78;
  font-weight: 700;
  padding: 0.06em 0.1em 0 0;
  color: var(--c);
  font-variation-settings: "SOFT" 40, "WONK" 1;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: clamp(1.2rem, 3vw, 1.8rem);
  box-shadow: var(--shadow);
  align-self: start;
  position: relative;
}
.hero-card::before {
  content: "";
  position: absolute;
  inset: 6px -6px -6px 6px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  z-index: -1;
}
.card-title {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  margin-bottom: 0.9rem;
}
.tick-list { list-style: none; margin: 0 0 1.4rem; padding: 0; }
.tick-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.55rem;
  font-size: 0.98rem;
}
.tick-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.72em;
  height: 0.72em;
  background: var(--b);
  border-radius: 2px 60% 2px 60%;
  transform: rotate(-8deg);
}
.card-note {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--ink-faint);
  margin-top: 0.85rem;
  line-height: 1.5;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.7rem 1.5rem;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}
.btn:hover {
  background: var(--c);
  border-color: var(--c);
  color: #fff;
  transform: translateY(-1px);
}
html[data-theme="dark"] .btn:hover { color: #1c1a14; }

/* ---------- drag band ---------- */
.band-section { overflow: hidden; }
.band-wrap { position: relative; }

.band {
  overflow: hidden;
  cursor: grab;
  padding-block: 0.5rem 1.2rem;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
}
.band.is-dragging { cursor: grabbing; }
.band:focus-visible { outline: 3px solid var(--c); outline-offset: 4px; }

.band-track {
  display: flex;
  gap: 1.1rem;
  list-style: none;
  margin: 0;
  padding-inline: var(--pad);
  width: max-content;
  will-change: transform;
  transition: transform 420ms cubic-bezier(.2,.7,.1,1);
}
.band.is-dragging .band-track { transition: none; }

.band-card {
  width: min(78vw, 320px);
  flex: 0 0 auto;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.35rem 1.3rem 1.2rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.band-card:nth-child(5n+1) { border-top: 4px solid var(--a); }
.band-card:nth-child(5n+2) { border-top: 4px solid var(--b); }
.band-card:nth-child(5n+3) { border-top: 4px solid var(--c); }
.band-card:nth-child(5n+4) { border-top: 4px solid var(--d); }
.band-card:nth-child(5n)   { border-top: 4px solid var(--e); }

.band-card:nth-child(5n+1) .band-code { color: var(--a); }
.band-card:nth-child(5n+2) .band-code { color: var(--b); }
.band-card:nth-child(5n+3) .band-code { color: var(--c); }
.band-card:nth-child(5n+4) .band-code { color: var(--d); }
.band-card:nth-child(5n)   .band-code { color: var(--e); }

.band-code {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--c);
  margin: 0 0 0.5rem;
  line-height: 1;
}
.band-card h3 { margin-bottom: 0.6rem; }
.band-body { font-size: 0.95rem; color: var(--ink-soft); margin-bottom: 1rem; }
.band-tag {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-top: 1px solid var(--rule-soft);
  padding-top: 0.7rem;
}

.band-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-inline: var(--pad);
  max-width: var(--maxw);
  margin-inline: auto;
  margin-top: 0.4rem;
}
.band-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--ink);
  font-size: 1.05rem;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.band-btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.band-hint {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0 0.4rem;
}

/* ---------- how it works ---------- */
.how-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .how-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .how-grid { grid-template-columns: repeat(4, 1fr); } }

.how-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.3rem 1.2rem;
  box-shadow: var(--shadow);
}
.how-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--a);
  margin: 0 0 0.7rem;
}
.how-card:nth-child(1) { border-top: 4px solid var(--a); }
.how-card:nth-child(2) { border-top: 4px solid var(--b); }
.how-card:nth-child(3) { border-top: 4px solid var(--c); }
.how-card:nth-child(4) { border-top: 4px solid var(--d); }
.how-card:nth-child(1) .how-num { color: var(--a); }
.how-card:nth-child(2) .how-num { color: var(--b); }
.how-card:nth-child(3) .how-num { color: var(--c); }
.how-card:nth-child(4) .how-num { color: var(--d); }
.how-card h3 { margin-bottom: 0.55rem; }
.how-card p { font-size: 0.94rem; color: var(--ink-soft); }

/* ---------- sample lesson ---------- */
.lesson {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.lesson-head {
  padding: clamp(1.2rem, 3vw, 1.9rem);
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(
    100deg,
    color-mix(in srgb, var(--a) 16%, var(--surface)) 0%,
    color-mix(in srgb, var(--b) 12%, var(--surface)) 48%,
    color-mix(in srgb, var(--d) 12%, var(--surface)) 100%
  );
}
.lesson-kicker {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.5rem;
}
.lesson-head h3 { max-width: 30ch; }

.lesson-body {
  display: grid;
  gap: 0;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) { .lesson-body { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .lesson-body { grid-template-columns: repeat(4, 1fr); } }

.lesson-col {
  padding: clamp(1.1rem, 2.6vw, 1.6rem);
  border-top: 1px solid var(--rule-soft);
}
@media (min-width: 760px) {
  .lesson-col { border-left: 1px solid var(--rule-soft); }
  .lesson-col:nth-child(odd) { border-left: 0; }
}
@media (min-width: 1080px) {
  .lesson-col { border-left: 1px solid var(--rule-soft); }
  .lesson-col:nth-child(1) { border-left: 0; }
}
.lesson-sub {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c);
  margin: 0 0 0.7rem;
  font-weight: 600;
}
.lesson-col:nth-child(1) .lesson-sub { color: var(--a); }
.lesson-col:nth-child(2) .lesson-sub { color: var(--b); }
.lesson-col:nth-child(3) .lesson-sub { color: var(--c); }
.lesson-col:nth-child(4) .lesson-sub { color: var(--d); }
.lesson-col:nth-child(1) { border-top-color: color-mix(in srgb, var(--a) 45%, var(--rule-soft)); }
.lesson-col:nth-child(2) { border-top-color: color-mix(in srgb, var(--b) 45%, var(--rule-soft)); }
.lesson-col:nth-child(3) { border-top-color: color-mix(in srgb, var(--c) 45%, var(--rule-soft)); }
.lesson-col:nth-child(4) { border-top-color: color-mix(in srgb, var(--d) 45%, var(--rule-soft)); }
.lesson-col p { font-size: 0.93rem; color: var(--ink-soft); }

.mini-viz {
  border: 1px dashed var(--rule);
  border-radius: 3px;
  padding: 0.85rem;
  background: color-mix(in srgb, var(--b) 8%, transparent);
}
.viz-row {
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.viz-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--ink);
  letter-spacing: 0.04em;
}
.viz-bar { height: 12px; border-radius: 2px; display: block; }
.viz-bar-a { background: var(--b); width: 88%; }
.viz-bar-b { background: var(--c); width: 34%; }
.viz-bar-a { background: linear-gradient(90deg, var(--b), color-mix(in srgb, var(--b) 55%, var(--a-bright))); }
.viz-bar-b { background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 55%, var(--e))); }
.viz-note {
  grid-column: 2;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-top: -0.35rem;
}
.viz-caption {
  font-size: 0.82rem !important;
  color: var(--ink-soft);
  margin: 0.6rem 0 0;
  border-top: 1px solid var(--rule-soft);
  padding-top: 0.6rem;
}

.formula {
  font-family: var(--mono);
  font-size: 0.86rem;
  background: color-mix(in srgb, var(--a) 18%, transparent);
  border-left: 3px solid var(--a);
  padding: 0.6rem 0.75rem;
  border-radius: 2px;
  color: var(--ink);
  margin-bottom: 0.8rem;
}
.formula em { font-style: normal; color: var(--c); font-weight: 600; }

.pq-q { font-size: 0.93rem; color: var(--ink); font-weight: 600; margin-bottom: 0.6rem; }
.pq-opts {
  list-style: none;
  margin: 0 0 0.8rem;
  padding: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.pq-opts li {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--rule-soft);
  font-family: var(--mono);
  font-size: 0.76rem;
}
.pq-a {
  font-size: 0.88rem;
  color: var(--ink-soft);
  border-left: 3px solid var(--b);
  padding-left: 0.7rem;
}
.pq-opts li:nth-child(1) { border-left: 2px solid color-mix(in srgb, var(--a) 55%, transparent); padding-left: 0.6rem; }
.pq-opts li:nth-child(2) { border-left: 2px solid color-mix(in srgb, var(--b) 55%, transparent); padding-left: 0.6rem; }
.pq-opts li:nth-child(3) { border-left: 2px solid color-mix(in srgb, var(--c) 55%, transparent); padding-left: 0.6rem; }
.pq-opts li:nth-child(4) { border-left: 2px solid color-mix(in srgb, var(--d) 55%, transparent); padding-left: 0.6rem; }
.pq-a strong { color: var(--ink); }

/* ---------- who ---------- */
.who-cols {
  display: grid;
  gap: 1.6rem;
  grid-template-columns: 1fr;
}
@media (min-width: 820px) { .who-cols { grid-template-columns: repeat(3, 1fr); gap: 2rem; } }
.who-col h3 {
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--a);
  margin-bottom: 0.8rem;
}
.who-col:nth-child(2) h3 { border-bottom-color: var(--b); }
.who-col:nth-child(3) h3 { border-bottom-color: var(--c); }
.who-col:nth-child(1) { border-left: 3px solid var(--a); padding-left: 1rem; }
.who-col:nth-child(2) { border-left: 3px solid var(--b); padding-left: 1rem; }
.who-col:nth-child(3) { border-left: 3px solid var(--c); padding-left: 1rem; }
.who-col p { font-size: 0.96rem; color: var(--ink-soft); }

/* ---------- faq ---------- */
.faq-list { max-width: 74ch; }
.faq-item {
  border-bottom: 1px solid var(--rule);
  padding: 0.35rem 0;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 0.85rem 2rem 0.85rem 0;
  position: relative;
  font-weight: 600;
  font-size: 1.03rem;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0.2rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--c);
  transition: transform 200ms ease;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item summary:hover { color: var(--c); }
.faq-item p {
  padding: 0 2rem 1rem 0;
  color: var(--ink-soft);
  font-size: 0.96rem;
}

/* ---------- start / contact ---------- */
.start-cols {
  display: grid;
  gap: clamp(1.6rem, 4vw, 3rem);
  grid-template-columns: 1fr;
}
@media (min-width: 860px) {
  .start-cols { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
}

.contact-form {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: clamp(1.2rem, 3vw, 1.9rem);
  box-shadow: var(--shadow);
}
.field { margin-bottom: 1.05rem; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.4rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 0.8rem;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.5;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--c);
  outline: 3px solid color-mix(in srgb, var(--c) 35%, transparent);
  outline-offset: 1px;
}
.form-status {
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--b);
}
.form-status.is-error { color: var(--c); }

.start-aside h3 {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  margin-bottom: 0.9rem;
}
.contact-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.contact-list li {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.95rem;
}
.cl-label {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  min-width: 5.2rem;
}
.aside-note {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--ink-faint);
  line-height: 1.5;
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--bg-2);
  padding-block: clamp(2rem, 4vw, 3rem) 4.5rem;
  position: relative;
  z-index: 2;
}
.footer-inner {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .footer-inner { grid-template-columns: 1.4fr 1fr; align-items: start; }
  .footer-legal { grid-column: 1 / -1; }
}
.footer-wordmark {
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0 0 0.3rem;
}
.footer-line { font-size: 0.92rem; color: var(--ink-soft); margin: 0; }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
}
.footer-nav a {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 0.5rem 0;
}
.footer-nav a:hover { color: var(--c); }
.footer-legal {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--ink-faint);
  line-height: 1.6;
  max-width: 70ch;
  border-top: 1px solid var(--rule-soft);
  padding-top: 1rem;
  margin: 0;
}

/* attribution — required on free tier, kept readable */
.attribution {
  position: static;
  grid-column: 1 / -1;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  opacity: 1;
}
.attribution a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.attribution a:hover { color: var(--c); }

/* ---------- notes index ---------- */
.notes-index { padding-block: clamp(2rem, 5vw, 3.6rem) clamp(2.6rem, 6vw, 5rem); }

.page-title {
  font-size: clamp(2.1rem, 1.3rem + 3.6vw, 3.8rem);
  max-width: 18ch;
  margin-block: 0.4rem 0.8rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 2rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip-count {
  font-size: 0.62rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--a-bright) 30%, transparent);
  color: var(--ink);
}
.chip.is-active .chip-count { background: color-mix(in srgb, var(--bg) 30%, transparent); color: var(--bg); }

.note-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 700px) { .note-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .note-grid { grid-template-columns: repeat(3, 1fr); } }

.note-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.3rem 1.25rem 1.15rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  border-top: 4px solid var(--a);
}
.note-card:nth-child(5n+1) { border-top-color: var(--a); }
.note-card:nth-child(5n+2) { border-top-color: var(--b); }
.note-card:nth-child(5n+3) { border-top-color: var(--c); }
.note-card:nth-child(5n+4) { border-top-color: var(--d); }
.note-card:nth-child(5n)   { border-top-color: var(--e); }

.note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.7rem;
}
.note-meta-lg { font-size: 0.68rem; margin-bottom: 0.9rem; }
.note-exam {
  color: var(--bg);
  background: var(--c);
  padding: 0.18rem 0.5rem;
  border-radius: 2px;
  font-weight: 600;
}
.note-card:nth-child(5n+2) .note-exam { background: var(--b); }
.note-card:nth-child(5n+3) .note-exam { background: var(--a-bright); }
.note-card:nth-child(5n+4) .note-exam { background: var(--d); }
.note-card:nth-child(5n)   .note-exam { background: var(--e); }
.note-dot { color: var(--a); }
.note-examname {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: -0.35rem 0 0.7rem;
}

.note-title { font-size: 1.16rem; line-height: 1.22; margin: 0 0 0.6rem; }
.note-title a { color: var(--ink); text-decoration: none; }
.note-title a:hover { color: var(--c); text-decoration: underline; text-underline-offset: 0.18em; }
.note-summary { font-size: 0.94rem; color: var(--ink-soft); margin: 0 0 1rem; }
.note-more {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-top: 1px solid var(--rule-soft);
  padding-top: 0.75rem;
}
.note-more a { text-decoration: none; color: var(--c); }
.note-more a:hover { color: var(--a); }

.empty-note {
  border: 1px dashed var(--rule);
  border-radius: 4px;
  padding: 1.4rem;
  color: var(--ink-soft);
  max-width: 60ch;
}

/* ---------- single note ---------- */
.note-page { padding-block: clamp(2rem, 5vw, 3.6rem) clamp(2rem, 4vw, 3rem); }
.note-h1 {
  font-size: clamp(1.9rem, 1.2rem + 3vw, 3.2rem);
  max-width: 24ch;
  margin-block: 0.2rem 0.9rem;
}
.note-standfirst {
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.22rem);
  color: var(--ink-soft);
  max-width: 62ch;
  border-left: 3px solid var(--a);
  padding-left: 1rem;
  margin-bottom: 2rem;
}
.note-prose { max-width: 68ch; }
.note-prose p { margin: 0 0 1.15rem; }
.note-prose p:first-of-type::first-letter {
  float: left;
  font-size: 3.4em;
  line-height: 0.78;
  font-weight: 700;
  padding: 0.06em 0.1em 0 0;
  color: var(--c);
  font-variation-settings: "SOFT" 40, "WONK" 1;
}
.note-prose strong { color: var(--ink); }
.note-prose ul, .note-prose ol { padding-left: 1.3rem; margin: 0 0 1.15rem; }
.note-prose li { margin-bottom: 0.4rem; }
.note-prose h2, .note-prose h3 { margin: 1.8rem 0 0.7rem; }
.note-prose blockquote {
  margin: 1.4rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 3px solid var(--b);
  color: var(--ink-soft);
}
.note-back {
  margin-top: 2.4rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.note-back a { text-decoration: none; color: var(--c); }

.up-next { border-top: 1px solid var(--rule-soft); }

.latest-cta { margin-top: 2rem; }

/* ---------- placeholders ---------- */
.placeholder,
a[href="#"] {
  border-bottom: 1px dotted var(--c);
  text-decoration: none;
  color: var(--ink-soft);
}
a[href="#"]:hover { color: var(--c); }

/* ---------- motion: fade + rise on scroll enter ---------- */
@keyframes fadeRise {
  from { opacity: 0; translate: 0 14px; }
  to   { opacity: 1; translate: 0 0; }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero-cols,
    .band-wrap,
    .how-grid,
    .lesson,
    .who-cols,
    .faq-list,
    .start-cols,
    .note-grid,
    .note-prose {
      animation: fadeRise 420ms cubic-bezier(.2,.7,.1,1) both;
      animation-timeline: view();
      animation-range: entry 0% cover 26%;
    }
  }
}

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

/* ---------- narrow screens ---------- */
@media (max-width: 560px) {
  .masthead-inner { min-height: 56px; gap: 0.6rem; }
  .nav { order: 3; width: 100%; gap: 0.9rem; padding-bottom: 0.5rem; }
  .nav a { font-size: 0.68rem; }
  .theme-toggle { padding: 0.4rem 0.6rem; }
  .tt-label { display: none; }
  .band-card { width: 82vw; }
  .dropcap::first-letter { font-size: 3.2em; }
}
