/* ============================================================
   FORMA — Night School Wall
   Dark kraft wall · taped prints · pinned lesson cards
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --bg: #16130e;
  --bg-raise: #1d1912;
  --card: #251f15;
  --card-2: #2b2418;
  --ink: #efe7d6;
  --muted: #b3a88f;
  --faint: #908670;
  --accent: #e2a63d;
  --accent-soft: rgba(226, 166, 61, 0.14);
  --accent-ink: #221a06;
  --line: rgba(239, 231, 214, 0.16);
  --line-soft: rgba(239, 231, 214, 0.09);
  --tape: rgba(226, 166, 61, 0.55);

  --font-body: "Sora", "Avenir Next", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  --font-hand: "Caveat", "Segoe Script", cursive;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 3px;
}

/* ---------- reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  background: var(--bg);
}

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

/* wall grain — sits behind all content */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* skip-link target: ring would wrap a 3000px section */
#wall:focus {
  outline: none;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 60;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius);
  transition: top 160ms var(--ease);
}

.skip-link:focus {
  top: 12px;
}

/* ---------- utilities ---------- */
.wrap {
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 48px);
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hand {
  font-family: var(--font-hand);
  font-size: 27px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 24px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 16px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform 180ms var(--ease), background 180ms var(--ease);
}

.btn .arr {
  transition: transform 180ms var(--ease);
}

.btn:active {
  transform: scale(0.97);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding-block: 6px;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color 180ms var(--ease), color 180ms var(--ease);
}

.text-link:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- header ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(22, 19, 14, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}

.head-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  min-height: 72px;
  padding-block: 10px;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  padding-block: 8px;
}

.wordmark .mark {
  color: var(--accent);
  font-size: 20px;
  transform: translateY(-4px);
}

.head-nav {
  display: flex;
  gap: 26px;
  margin-left: 12px;
}

.head-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}

.head-nav a:focus-visible {
  color: var(--ink);
  border-color: var(--accent);
}

.clipboard {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin-left: auto;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg-raise);
  transition: border-color 180ms var(--ease), background 180ms var(--ease),
    transform 180ms var(--ease);
}

.clipboard svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.8;
}

.clip-count {
  min-width: 26px;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--line-soft);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: background 180ms var(--ease), color 180ms var(--ease);
}

.clipboard[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.clipboard[aria-pressed="true"] .clip-count {
  background: rgba(34, 26, 6, 0.18);
  color: var(--accent-ink);
}

.clipboard.wobble {
  animation: wobble 480ms var(--ease);
}

@keyframes wobble {
  0% { transform: rotate(0); }
  25% { transform: rotate(-2.5deg) scale(1.03); }
  55% { transform: rotate(2deg); }
  80% { transform: rotate(-1deg); }
  100% { transform: rotate(0); }
}

/* ---------- hero ---------- */
.hero {
  padding-block: clamp(64px, 9vh, 110px) 84px;
  overflow-x: clip;
}

.hero-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: clamp(32px, 4vw, 64px);
  align-items: center;
}

.kicker {
  color: var(--accent);
  margin-bottom: 26px;
}

.display {
  font-size: clamp(52px, 8vw, 118px);
  letter-spacing: -0.035em;
  line-height: 0.98;
}

.u-hold {
  position: relative;
}

.scribble {
  position: absolute;
  left: -1%;
  bottom: -0.14em;
  width: 102%;
  height: 0.22em;
  overflow: visible;
}

.scribble path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 560;
  stroke-dashoffset: 560;
  animation: draw 700ms var(--ease) 350ms forwards;
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

.hero-lede {
  max-width: 46ch;
  margin-top: 30px;
  font-size: 18px;
  color: var(--muted);
}

.hero-cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 28px;
  margin-top: 36px;
}

.hero-hand {
  margin-top: 26px;
  transform: rotate(-2deg);
}

.hero-photo {
  position: relative;
  margin-top: 4px;
}

.hero-photo img {
  width: 100%;
  aspect-ratio: 4 / 4.6;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.tape {
  position: absolute;
  width: 96px;
  height: 30px;
  background: var(--tape);
  opacity: 0.85;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.tape-a {
  top: -13px;
  left: 8%;
  transform: rotate(-7deg);
}

.tape-b {
  bottom: 34px;
  right: -26px;
  width: 110px;
  transform: rotate(5deg);
}

.hero-photo figcaption {
  margin-top: 14px;
  text-align: right;
}

/* rotating term stamp — the wall's dated seal */
.term-stamp {
  position: absolute;
  top: -44px;
  left: -40px;
  width: clamp(92px, 9vw, 128px);
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.4));
  animation: spin 26s linear infinite;
}

.stamp-ring-text {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 1.6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* hero entrance */
.rise {
  animation: rise 620ms var(--ease) both;
}

.rise-2 { animation-delay: 120ms; }
.rise-3 { animation-delay: 220ms; }
.rise-4 { animation-delay: 320ms; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-photo.rise {
  animation-name: rise-tilt;
}

@keyframes rise-tilt {
  from {
    opacity: 0;
    transform: translateY(26px) rotate(1.5deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }
}

/* ---------- term index ledger ---------- */
.term {
  padding-block: 24px 96px;
}

.term-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.term-head .mono {
  color: var(--faint);
}

.term-list {
  list-style: none;
}

.trow {
  display: grid;
  grid-template-columns: 64px 1fr auto 40px;
  align-items: center;
  gap: clamp(12px, 3vw, 40px);
  width: 100%;
  min-height: 84px;
  padding-block: 18px;
  padding-inline: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  transition: background 180ms var(--ease), padding-left 180ms var(--ease);
}

.trow-no {
  color: var(--faint);
  font-size: 13px;
}

.trow-name {
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.trow-meta {
  color: var(--muted);
}

.trow-arrow {
  justify-self: end;
  font-size: 22px;
  color: var(--faint);
  transition: transform 180ms var(--ease), color 180ms var(--ease);
}

.trow:focus-visible {
  background: var(--line-soft);
  padding-left: 22px;
}

.trow:focus-visible .trow-arrow {
  color: var(--accent);
  transform: translateX(6px);
}

.trow:active {
  transform: scale(0.995);
}

/* ---------- the wall ---------- */
.wall {
  padding-block: 24px 130px;
}

.wall-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 32px;
  margin-bottom: 40px;
}

.wall-head h2 {
  font-size: clamp(40px, 5vw, 64px);
}

.wall-head .wall-note {
  max-width: 40ch;
  color: var(--muted);
  font-size: 16px;
}

/* toolbar */
.toolbar {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 14px 18px;
  align-items: end;
  padding: 22px;
  margin-bottom: 54px;
  background: var(--bg-raise);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-label {
  color: var(--muted);
}

.field input,
.field select {
  min-height: 48px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.field input::placeholder {
  color: var(--faint);
}

.field input:focus-visible,
.field select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.select-wrap {
  position: relative;
}

.select-wrap select {
  width: 100%;
  appearance: none;
  padding-right: 42px;
  cursor: pointer;
}

.select-wrap::after {
  content: "▾";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  pointer-events: none;
  font-size: 15px;
}

.saved-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  font-weight: 600;
  font-size: 15px;
  transition: background 180ms var(--ease), border-color 180ms var(--ease),
    color 180ms var(--ease);
}

.saved-toggle .tick {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--muted);
  border-radius: 2px;
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  line-height: 1;
  color: transparent;
  transition: background 180ms var(--ease), border-color 180ms var(--ease),
    color 180ms var(--ease);
}

.saved-toggle[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.saved-toggle[aria-pressed="true"] .tick {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: var(--accent);
}

.wall-count {
  grid-column: 1 / -1;
  color: var(--faint);
}

/* card grid */
.wall-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 56px 40px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
  transition: transform 220ms var(--ease), box-shadow 220ms var(--ease),
    border-color 220ms var(--ease);
  animation: settle 560ms var(--ease) both;
}

.card:nth-child(1) { grid-column: span 7; --tilt: -0.7deg; animation-delay: 40ms; }
.card:nth-child(2) { grid-column: span 5; --tilt: 0.8deg; --ty: 26px; animation-delay: 110ms; }
.card:nth-child(3) { grid-column: span 5; --tilt: 0.7deg; animation-delay: 180ms; }
.card:nth-child(4) { grid-column: span 7; --tilt: -0.8deg; --ty: 26px; animation-delay: 250ms; }
.card:nth-child(5) { grid-column: span 6; --tilt: 0.6deg; animation-delay: 320ms; }
.card:nth-child(6) { grid-column: span 6; --tilt: -0.7deg; --ty: 26px; animation-delay: 390ms; }

.card {
  transform: translateY(var(--ty, 0px)) rotate(var(--tilt, 0deg));
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(calc(var(--ty, 0px) + 34px)) rotate(var(--tilt, 0deg));
  }
  to {
    opacity: 1;
    transform: translateY(var(--ty, 0px)) rotate(var(--tilt, 0deg));
  }
}

.pin {
  position: absolute;
  top: -9px;
  left: 50%;
  width: 18px;
  height: 18px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f4c56e, var(--accent) 55%, #8a5f14);
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.45);
  z-index: 2;
}

.card-photo {
  overflow: hidden;
  border-radius: 3px 3px 0 0;
  border-bottom: 1px solid var(--line-soft);
}

.card-photo img {
  width: 100%;
  aspect-ratio: 16 / 9.4;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 320ms var(--ease), filter 320ms var(--ease);
  filter: saturate(0.88);
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 12px;
  padding: 24px 26px 26px;
}

.card-meta {
  color: var(--accent);
  font-size: 11.5px;
}

.card-title {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card:nth-child(1) .card-title {
  font-size: 34px;
}

.card-desc {
  color: var(--muted);
  font-size: 15.5px;
  max-width: 52ch;
}

.card-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.card-price {
  color: var(--ink);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.card-price span {
  display: block;
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-top: 3px;
}

.card-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding-block: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  transition: color 180ms var(--ease), transform 180ms var(--ease);
}

.card-open .arr {
  transition: transform 180ms var(--ease);
  color: var(--accent);
}

.card-open:focus-visible {
  color: var(--accent);
}

.card-open:focus-visible .arr {
  transform: translateX(5px);
}

.card-open:active {
  transform: scale(0.97);
}

/* saved stamp on card */
.stamp {
  position: absolute;
  top: 16px;
  right: 14px;
  padding: 5px 10px;
  border: 1.5px solid var(--accent);
  border-radius: 2px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: rotate(6deg);
  background: rgba(22, 19, 14, 0.75);
}

.stamp[hidden] {
  display: none;
}

/* hover states for cards */
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(calc(var(--ty, 0px) - 6px)) rotate(0deg);
    box-shadow: 0 26px 54px rgba(0, 0, 0, 0.45);
    border-color: var(--line);
  }

  .card:hover .card-photo img {
    transform: scale(1.045);
    filter: saturate(1);
  }
}

.card:focus-within {
  transform: translateY(calc(var(--ty, 0px) - 6px)) rotate(0deg);
  border-color: var(--line);
}

/* empty state */
.empty {
  padding: 72px 32px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  text-align: center;
}

.empty h3 {
  font-size: 26px;
  margin-bottom: 10px;
}

.empty p {
  color: var(--muted);
  max-width: 46ch;
  margin: 0 auto 26px;
}

.empty-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.ghost-btn {
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  transition: border-color 180ms var(--ease), background 180ms var(--ease),
    transform 180ms var(--ease);
}

.ghost-btn:focus-visible {
  border-color: var(--accent);
}

.ghost-btn:active {
  transform: scale(0.97);
}

[hidden] {
  display: none !important;
}

/* ---------- lesson card dialog ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 40px);
}

.scrim {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 5, 0.72);
  backdrop-filter: blur(3px);
}

.lesson-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 5fr) 7fr;
  width: min(1020px, 100%);
  max-height: min(88vh, 820px);
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  animation: card-in 220ms var(--ease);
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lc-photo {
  position: relative;
  min-height: 260px;
}

.lc-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lc-photo .tape {
  width: 84px;
  height: 26px;
}

.lc-photo .tape-a {
  top: -10px;
  left: 10%;
}

.lc-photo .tape-b {
  bottom: 26px;
  right: -20px;
}

.lc-body {
  padding: clamp(26px, 3.4vw, 44px);
  overflow-y: auto;
}

.lc-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--accent);
  margin-bottom: 18px;
}

.lc-title {
  font-size: clamp(34px, 3.6vw, 46px);
  letter-spacing: -0.03em;
}

.lc-lede {
  margin-top: 16px;
  font-size: 17px;
  color: var(--ink);
  max-width: 58ch;
}

.lc-instructor {
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
}

.lc-specs {
  margin-top: 26px;
  border-top: 1px solid var(--line);
}

.lc-specs > div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}

.lc-specs dt {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding-top: 3px;
}

.lc-specs dd {
  font-size: 15.5px;
}

.lc-incl {
  margin-top: 22px;
  list-style: none;
  display: grid;
  gap: 8px;
}

.lc-incl li {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 15px;
}

.lc-incl li::before {
  content: "✳";
  color: var(--accent);
  flex: none;
}

.lc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
}

.save-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 12px 22px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 15.5px;
  transition: transform 180ms var(--ease), background 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

.save-btn .pin-ico {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.save-btn[aria-pressed="true"] {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.save-btn:hover {
  transform: translateY(-2px);
}

.save-btn:active {
  transform: scale(0.97);
}

.close-btn {
  min-height: 50px;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  transition: border-color 180ms var(--ease), color 180ms var(--ease),
    transform 180ms var(--ease);
}

.close-btn:focus-visible {
  border-color: var(--accent);
}

.close-btn:active {
  transform: scale(0.97);
}

body.locked {
  overflow: hidden;
}

/* ---------- notes band (full-bleed ochre breath) ---------- */
.notes {
  background: var(--accent);
  color: var(--accent-ink);
  padding-block: clamp(88px, 10vw, 132px);
}

.notes .mono {
  color: rgba(34, 26, 6, 0.72);
}

.notes-grid {
  display: grid;
  grid-template-columns: 6fr 5fr;
  gap: clamp(36px, 5vw, 80px);
  align-items: start;
}

.notes h2 {
  font-size: clamp(38px, 4.6vw, 58px);
  letter-spacing: -0.03em;
  margin-top: 18px;
}

.notes-lede {
  margin-top: 18px;
  max-width: 52ch;
  font-size: 17.5px;
}

.notes-facts {
  margin-top: 34px;
  border-top: 1.5px solid rgba(34, 26, 6, 0.4);
}

.notes-facts > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1.5px solid rgba(34, 26, 6, 0.4);
}

.notes-facts dt {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding-top: 4px;
}

.notes-facts dd {
  font-size: 16px;
  font-weight: 500;
}

.notes-photo {
  position: relative;
  transform: rotate(1.6deg);
  margin-bottom: 30px;
}

.notes-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 2px;
  filter: saturate(0.92);
  box-shadow: 0 20px 44px rgba(34, 26, 6, 0.35);
}

.notes-photo .tape {
  background: rgba(22, 19, 14, 0.5);
}

.notes-photo figcaption {
  margin-top: 12px;
  font-family: var(--font-hand);
  font-size: 25px;
  color: var(--accent-ink);
  text-align: right;
}

.notes-list {
  list-style: none;
  display: grid;
  gap: 12px;
}

.notes-list li {
  display: flex;
  gap: 12px;
  font-size: 16px;
  font-weight: 500;
}

.notes-list li::before {
  content: "✳";
  flex: none;
}

/* ---------- footer ---------- */
.site-foot {
  border-top: 1px solid var(--line-soft);
  padding-block: 56px 64px;
}

.foot-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px 32px;
}

.foot-left {
  display: grid;
  gap: 6px;
}

.foot-mark {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.foot-mark .mark {
  color: var(--accent);
}

.foot-meta {
  color: var(--faint);
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 160ms var(--ease), border-color 160ms var(--ease);
}

.foot-links a:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- pointer-hover states ---------- */
@media (hover: hover) and (pointer: fine) {
  .head-nav a:hover {
    color: var(--ink);
    border-color: var(--accent);
  }

  .text-link:hover {
    color: var(--accent);
    border-color: var(--accent);
  }

  .clipboard:hover {
    border-color: var(--muted);
    transform: translateY(-1px);
  }

  .btn:hover {
    transform: translateY(-2px);
    background: #edb957;
  }

  .btn:hover .arr {
    transform: translateY(2px);
  }

  .trow:hover {
    background: var(--line-soft);
    padding-left: 22px;
  }

  .trow:hover .trow-arrow {
    color: var(--accent);
    transform: translateX(6px);
  }

  .card-open:hover {
    color: var(--accent);
  }

  .card-open:hover .arr {
    transform: translateX(5px);
  }

  .field input:hover,
  .field select:hover {
    border-color: var(--muted);
  }

  .saved-toggle:hover {
    border-color: var(--muted);
  }

  .ghost-btn:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
  }

  .close-btn:hover {
    border-color: var(--ink);
  }

  .foot-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
  }
}

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
  }

  .display {
    font-size: clamp(46px, 7.4vw, 96px);
  }

  .wall-grid {
    gap: 44px 32px;
  }

  .card:nth-child(n) {
    grid-column: span 6;
  }

  .lesson-card {
    grid-template-columns: 1fr;
    max-height: 92vh;
  }

  .lc-photo {
    height: 250px;
    min-height: 0;
  }

  .lc-photo img {
    position: static;
    width: 100%;
    height: 100%;
  }
}

@media (max-width: 820px) {
  .head-bar {
    min-height: 0;
    row-gap: 2px;
  }

  .head-nav {
    order: 3;
    width: 100%;
    margin-left: -6px;
    gap: 22px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-photo {
    max-width: 460px;
    margin-top: 52px;
  }

  .term-stamp {
    left: auto;
    right: -14px;
    top: -36px;
    width: 94px;
  }

  .term-list .trow {
    grid-template-columns: 44px 1fr 28px;
  }

  .trow-meta {
    display: none;
  }

  .toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .toolbar .field:last-of-type {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .saved-toggle {
    justify-content: center;
  }

  .wall-count {
    grid-column: auto;
  }

  .card:nth-child(n) {
    grid-column: 1 / -1;
    --tilt: 0deg;
    --ty: 0px;
  }

  .wall-grid {
    gap: 40px;
  }

  .card-photo img {
    aspect-ratio: 16 / 10;
  }

  .notes-grid {
    grid-template-columns: 1fr;
  }

  .notes-photo {
    max-width: 480px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  .display {
    font-size: clamp(38px, 11.5vw, 56px);
  }

  .hero {
    padding-block: 48px 64px;
  }

  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }

  .card-body {
    padding: 20px 20px 22px;
  }

  .card-title {
    font-size: 24px;
  }

  .card-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .lc-actions .save-btn,
  .lc-actions .close-btn {
    flex: 1 1 auto;
  }

  .lc-specs > div {
    grid-template-columns: 96px 1fr;
    gap: 10px;
  }
}

/* ---------- reduced motion ---------- */
@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;
  }

  .card,
  .hero-photo,
  .notes-photo {
    transform: none !important;
  }

  .scribble path {
    stroke-dashoffset: 0;
    animation: none;
  }
}
