/* ============================================================
   Laurence Richard Starn — personal site stylesheet
   Plain CSS, no build tools. Edit with any text editor.
   Sections:
     1. Fonts            2. Colors & variables     3. Base
     4. Layout           5. Header & navigation    6. Hero
     7. README card      8. Chapter index          9. Marquee
    10. Page headings    11. Portfolio lists       12. Learning module
    13. Picture Project  14. Footer               15. Motion & reveal
    16. Small screens
   ============================================================ */

/* ---------- 1. Fonts ---------- */
/* The font files live in the fonts/ folder next to this file. */
@font-face {
  font-family: 'Lora';
  src: url('../fonts/lora-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('../fonts/lora-latin-wght-italic.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('../fonts/instrument-sans-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- 2. Colors & variables ---------- */
:root {
  --paper: #F9F8F5;          /* warm vellum page background   */
  --panel: #FFFFFF;          /* white cards                   */
  --subtle: #F0EDE6;         /* soft band behind marquee etc. */
  --ink: #181716;            /* near-black text               */
  --muted: #5C5852;          /* secondary text                */
  --faint: #B5B0A8;          /* tertiary text                 */
  --border: #E3DFD5;         /* hairline borders              */
  --accent: #A63D24;         /* terracotta                    */
  --accent-soft: #FBEBE7;    /* terracotta wash               */
  --amber: #F59E0B;          /* highlight on dark surfaces    */
  --green: #15803D;
  --green-bright: #4ADE80;
  --red: #B91C1C;
  --red-bright: #F87171;
  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --sans: 'Instrument Sans', 'Segoe UI', Arial, sans-serif;
  --mono: 'JetBrains Mono', 'Courier New', monospace;
}

/* ---------- 3. Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--paper); }

h1, h2, h3, .serif { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; }
.mono { font-family: var(--mono); }
.overline {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}
.overline--accent { color: var(--accent); }

/* ---------- 4. Layout ---------- */
.container { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.section { padding-top: 64px; padding-bottom: 64px; }
.section--tight { padding-top: 40px; padding-bottom: 40px; }
main { padding-top: 64px; } /* clears the fixed header */

/* ---------- 5. Header & navigation ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(249, 248, 245, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .bar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark { font-family: var(--mono); font-size: 14px; letter-spacing: -0.02em; }
.wordmark span { color: var(--accent); }
.main-nav { display: flex; align-items: center; gap: 32px; }
.main-nav a.navlink {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  transition: color 0.25s;
}
.main-nav a.navlink:hover { color: var(--ink); }
.main-nav a.navlink.current { color: var(--accent); }
.main-nav a.navlink .num { color: var(--faint); margin-right: 6px; }
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ink);
  padding: 9px 16px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-outline--fill { background: var(--ink); color: var(--paper); }
.btn-outline--fill:hover { background: transparent; color: var(--ink); }
.menu-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.menu-toggle svg { display: block; }
.mobile-nav {
  display: none;
  border-top: 1px solid var(--border);
  padding: 16px 24px 24px;
  background: var(--paper);
}
.mobile-nav a { display: block; font-family: var(--serif); font-size: 24px; padding: 10px 0; }
.mobile-nav a.accent { color: var(--accent); }
.mobile-nav.open { display: block; }

/* ---------- 6. Hero ---------- */
.hero h1 {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.06;
  margin-top: 32px;
}
.hero h1 em, .page-head h1 em { color: var(--accent); }
.hero-sub {
  max-width: 560px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 18px;
}
/* masked line-by-line reveal */
.mask { display: block; overflow: hidden; }
.mask > span { display: block; transform: translateY(112%); animation: rise 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.mask > span.d1 { animation-delay: 0.10s; }
.mask > span.d2 { animation-delay: 0.22s; }
.mask > span.d3 { animation-delay: 0.34s; }
.mask > span.d4 { animation-delay: 0.50s; }
.mask > span.d5 { animation-delay: 0.58s; }
@keyframes rise { to { transform: translateY(0); } }

/* ---------- 7. README card ---------- */
.readme-wrap { position: relative; }
.readme-card {
  position: relative;
  background: var(--ink);
  color: var(--faint);
  border: 1px solid var(--ink);
  box-shadow: 10px 10px 0 0 var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  padding: 28px;
}
.readme-dots { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.readme-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(181, 176, 168, 0.4); }
.readme-dots i:first-child { background: var(--accent); }
.readme-dots .label { margin-left: auto; font-size: 10px; text-transform: uppercase; letter-spacing: 0.2em; color: rgba(181, 176, 168, 0.6); }
.readme-card .fence { color: rgba(249, 248, 245, 0.5); }
.readme-card .bright { color: var(--paper); }
.readme-card .amber { color: var(--amber); }
.readme-card ul { list-style: none; }
.readme-card ul a:hover { color: var(--amber); }
.cursor {
  display: inline-block;
  width: 8px; height: 16px;
  background: var(--amber);
  vertical-align: -2px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ---------- 8. Chapter index ---------- */
.chapters { list-style: none; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.chapters li { border-bottom: 1px solid var(--border); }
.chapters li:last-child { border-bottom: 0; }
.chapters a { display: flex; align-items: baseline; gap: 28px; padding: 20px 0; }
.chapters .num { font-family: var(--mono); font-size: 14px; color: var(--accent); }
.chapters .label { font-family: var(--serif); font-size: clamp(24px, 3vw, 30px); transition: color 0.25s; }
.chapters a:hover .label { color: var(--accent); }
.chapters .side { margin-left: auto; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--faint); }
.chapters .blurb { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); }
.chapters .arrow { font-size: 20px; color: var(--faint); transition: transform 0.25s, color 0.25s; }
.chapters a:hover .arrow { transform: translateX(4px); color: var(--accent); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; margin-top: 80px; align-items: start; }

/* ---------- 9. Marquee ---------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--subtle);
  color: var(--muted);
  padding: 14px 0;
}
.marquee--dark { background: var(--ink); color: var(--faint); border-color: rgba(249, 248, 245, 0.15); }
.marquee-track { display: flex; width: max-content; white-space: nowrap; animation: marquee 32s linear infinite; }
.marquee-track .word { font-family: var(--serif); font-style: italic; font-size: 20px; padding: 0 24px; }
.marquee-track .star { color: var(--accent); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- 10. Page headings ---------- */
.page-head h1 { font-size: clamp(40px, 5vw, 60px); line-height: 1.06; margin-top: 32px; }
.page-head .lead { max-width: 560px; margin-top: 24px; color: var(--muted); font-size: 18px; }
.split { display: grid; grid-template-columns: 1fr 1.4fr; gap: 80px; }
.split h2 { font-size: clamp(28px, 3.5vw, 38px); line-height: 1.25; margin-top: 24px; }
.split .body { align-self: end; color: var(--muted); font-size: 18px; }
.split .body .btn-outline { margin-top: 32px; }

/* ---------- 11. Portfolio lists ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 24px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 20px;
}
.section-head .num { font-family: var(--mono); font-size: 14px; color: var(--accent); }
.section-head h2 { font-size: clamp(24px, 3vw, 38px); }
.section-head .note { margin-left: auto; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--faint); }
.doc { display: flex; align-items: flex-start; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--border); }
.doc .num { font-family: var(--mono); font-size: 12px; color: var(--accent); padding-top: 5px; }
.doc .title { font-family: var(--serif); font-size: 20px; line-height: 1.3; transition: color 0.25s; }
a.doc:hover .title { color: var(--accent); }
.doc .meta { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); }
.doc .ext { margin-left: auto; color: var(--faint); transition: color 0.25s, transform 0.25s; padding-top: 4px; }
a.doc:hover .ext { color: var(--accent); transform: translate(3px, -3px); }
.pill-row { display: flex; gap: 12px; margin: 10px 0 0 40px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.pill-row.flush { border-bottom: 0; padding-bottom: 0; }
.pill {
  border: 1px solid var(--border);
  padding: 6px 14px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}
.pill:hover { border-color: var(--ink); color: var(--ink); }
.pill--after { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.pill--after:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
/* pairs a doc row with its pill row into one visual item */
.doc--makeover { border-bottom: 0; padding-bottom: 0; }

/* ---------- 12. Learning module ---------- */
.module { border: 1px solid var(--ink); background: var(--panel); }
.module-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}
.module-bar .count { color: var(--faint); letter-spacing: 0.05em; text-transform: none; }
.module-steps { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.module-steps button {
  flex: 1 1 0;
  min-width: 110px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  padding: 12px 8px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.25s, color 0.25s;
}
.module-steps button:last-child { border-right: 0; }
.module-steps button:hover { background: var(--subtle); }
.module-steps button.current { background: var(--accent-soft); color: var(--accent); }
.module-steps .dot {
  width: 20px; height: 20px;
  border: 1px solid var(--faint);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}
.module-steps button.current .dot { border-color: var(--accent); }
.module-steps button.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.module-body { display: grid; grid-template-columns: 1fr 1fr; }
.module-text { padding: 40px; border-right: 1px solid var(--border); }
.module-text img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; border: 1px solid var(--border); filter: grayscale(15%); }
.module-text h3 { font-style: italic; font-size: clamp(22px, 2.5vw, 30px); margin-top: 24px; }
.module-text p { margin-top: 16px; color: var(--muted); }
.module-text ol { margin-top: 24px; font-family: var(--mono); font-size: 14px; list-style: none; }
.module-text ol li { padding: 4px 0; }
.module-text ol .n { color: var(--accent); margin-right: 8px; }
.module-activity { padding: 40px; }
.module-activity.dark { background: var(--ink); color: var(--paper); }
.module-activity.dark p.lead-in { color: var(--faint); font-size: 14px; }
.module-activity.dark .lead-in b { color: var(--paper); font-weight: 600; }
.module-activity .btn-outline { margin-top: 32px; }
.module-activity.dark .btn-outline { border-color: var(--paper); color: var(--paper); }
.module-activity.dark .btn-outline:hover { background: var(--paper); color: var(--ink); }
.module-activity h4 { font-family: var(--serif); font-size: clamp(20px, 2.2vw, 26px); line-height: 1.3; }
.module-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.module-activity.dark .module-nav { border-top-color: rgba(249, 248, 245, 0.1); }
.module-nav button {
  background: none;
  border: 0;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.25s;
}
.module-nav button:hover { color: var(--ink); }
.module-activity.dark .module-nav button { color: var(--faint); }
.module-activity.dark .module-nav button:hover { color: var(--paper); }
.module-nav button:disabled { color: rgba(181, 176, 168, 0.4); cursor: not-allowed; }
.module-nav button.next:not(:disabled) { color: var(--accent); }
.module-activity.dark .module-nav button.next:not(:disabled) { color: var(--amber); }
.module-complete {
  border-top: 1px solid var(--ink);
  background: var(--accent-soft);
  color: var(--accent);
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  padding: 16px;
}

/* Find activity */
.cat-row, .thing-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.cat-btn {
  border: 1px solid rgba(249, 248, 245, 0.25);
  background: transparent;
  color: var(--paper);
  padding: 7px 14px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.cat-btn:hover { border-color: var(--paper); }
.cat-btn.open { border-color: var(--amber); background: var(--amber); color: var(--ink); }
.thing-btn {
  border: 0;
  background: rgba(249, 248, 245, 0.1);
  color: var(--paper);
  padding: 7px 14px;
  font-size: 14px;
  font-family: var(--sans);
  cursor: pointer;
  transition: background 0.2s;
}
.thing-btn:hover { background: rgba(249, 248, 245, 0.2); }
.thing-btn.got { background: rgba(21, 128, 61, 0.2); color: var(--green-bright); text-decoration: line-through; cursor: default; }
.find-status { margin-top: 24px; border-top: 1px solid rgba(249, 248, 245, 0.1); padding-top: 16px; }
.find-status .row { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--faint); }
.meter { height: 4px; background: rgba(249, 248, 245, 0.1); margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--amber); width: 0; transition: width 0.5s; }
.find-list { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; font-family: var(--mono); font-size: 12px; color: rgba(249, 248, 245, 0.8); list-style: none; }
.find-list .n { color: var(--accent); }
.ok-note { margin-top: 16px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--green-bright); }

/* Group activity */
.pool-label { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--faint); }
.pool { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; min-height: 44px; border: 1px dashed rgba(249, 248, 245, 0.2); padding: 12px; }
.pool .empty-note { font-size: 14px; color: var(--faint); }
.chip {
  border: 0;
  background: rgba(249, 248, 245, 0.1);
  color: var(--paper);
  padding: 7px 14px;
  font-size: 14px;
  font-family: var(--sans);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.chip:hover { background: rgba(249, 248, 245, 0.2); }
.chip.selected { background: var(--amber); color: var(--ink); }
.bins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.bin {
  min-height: 110px;
  border: 1px solid rgba(249, 248, 245, 0.2);
  background: transparent;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  color: var(--paper);
  font-family: var(--sans);
  transition: border-color 0.2s, background 0.2s;
  vertical-align: top;
}
.bin.armed { border-color: var(--amber); background: rgba(245, 158, 11, 0.06); }
.bin.ok { border-color: var(--green-bright); }
.bin.bad { border-color: var(--red-bright); }
.bin .bin-head { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--faint); }
.bin .verdict.ok { color: var(--green-bright); }
.bin .verdict.bad { color: var(--red-bright); }
.bin .placed { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.placed-chip {
  border: 0;
  background: var(--paper);
  color: var(--ink);
  padding: 5px 10px;
  font-size: 12px;
  font-family: var(--sans);
  cursor: pointer;
}
.group-actions { display: flex; align-items: center; gap: 16px; margin-top: 20px; flex-wrap: wrap; }
.check-btn {
  border: 1px solid rgba(249, 248, 245, 0.15);
  background: transparent;
  color: rgba(181, 176, 168, 0.5);
  padding: 11px 20px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  cursor: not-allowed;
  transition: all 0.2s;
}
.check-btn.ready { border-color: var(--amber); background: var(--amber); color: var(--ink); cursor: pointer; }
.check-btn.ready:hover { background: transparent; color: var(--amber); }
.bad-note { font-size: 14px; color: var(--red-bright); }

/* Identify + Conclude activities (light panels) */
.option-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.option-card { border: 1px solid var(--border); background: var(--panel); padding: 20px; transition: border-color 0.25s, background 0.25s; }
.option-card.solved { border-color: var(--green); background: rgba(21, 128, 61, 0.05); }
.option-card .g-label { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--accent); }
.option-card ul { list-style: none; margin-top: 12px; font-size: 14px; color: var(--muted); }
.option-card ul li { padding: 1px 0; }
.opt-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: transparent;
  padding: 9px 12px;
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.opt-btn:hover { border-color: var(--ink); }
.opt-btn.right { border-color: var(--green); background: var(--green); color: #fff; }
.opt-btn.wrong { border-color: var(--red); color: var(--red); text-decoration: line-through; }
.progress-note { margin-top: 20px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted); }
.progress-note.done { color: var(--green); }
.conclude-list { margin-top: 24px; }
.conclude-opt {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 20px;
  margin-top: 12px;
  cursor: pointer;
  font-family: var(--sans);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.conclude-opt:hover { border-color: var(--ink); }
.conclude-opt .text { font-family: var(--serif); font-size: 18px; display: block; }
.conclude-opt .verdict-text { display: block; margin-top: 8px; font-size: 14px; }
.conclude-opt.right { border-color: var(--green); background: var(--green); color: #fff; }
.conclude-opt.right .verdict-text { color: rgba(255, 255, 255, 0.85); }
.conclude-opt.wrong { border-color: var(--red); background: rgba(185, 28, 28, 0.05); color: var(--red); }
.summary-card { margin-top: 24px; border: 1px solid var(--ink); background: var(--panel); padding: 24px; }
.summary-card h4 { margin-top: 10px; }
.summary-card p { margin-top: 10px; font-size: 14px; color: var(--muted); }

/* toast */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 6px 6px 0 0 var(--accent);
  padding: 16px 20px;
  font-size: 14px;
  max-width: 320px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.35s, transform 0.35s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast .check { color: var(--green-bright); margin-right: 6px; }

/* ---------- 13. Picture Project ---------- */
.essay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.essay-card {
  display: block;
  border: 1px solid var(--ink);
  background: var(--panel);
  transition: box-shadow 0.3s;
}
.essay-card:hover { box-shadow: 8px 8px 0 0 var(--accent); }
.essay-card .frame { overflow: hidden; border-bottom: 1px solid var(--ink); }
.essay-card img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
  filter: grayscale(100%);
  transition: transform 0.7s, filter 0.7s;
}
.essay-card:hover img { transform: scale(1.03); filter: grayscale(0%); }
.essay-card .body { padding: 28px; }
.essay-card h2 { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.25; margin-top: 16px; }
.essay-card h2 .ext { color: var(--faint); transition: color 0.25s, transform 0.25s; font-family: var(--sans); }
.essay-card:hover h2 .ext { color: var(--accent); transform: translate(3px, -3px); }
.essay-card .meta { margin-top: 10px; font-size: 14px; color: var(--muted); }
.note-card { border: 1px solid var(--border); background: var(--panel); padding: 40px; display: grid; grid-template-columns: 1fr 1.4fr; gap: 56px; }
.note-card blockquote { font-family: var(--serif); font-size: clamp(22px, 2.4vw, 30px); line-height: 1.3; border: 0; }
.note-card .body p { margin-top: 20px; color: var(--muted); }
.note-card .body p:first-child { margin-top: 0; }

/* ---------- 14. Footer ---------- */
.site-footer { background: var(--ink); color: var(--paper); }
.site-footer .inner { padding: 80px 0; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.site-footer .tagline { font-family: var(--serif); font-size: clamp(26px, 3vw, 38px); line-height: 1.25; margin-top: 24px; }
.site-footer .tagline em { color: var(--amber); }
.footer-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 32px; align-self: end; }
.footer-nav a { font-family: var(--mono); font-size: 14px; color: var(--faint); transition: color 0.25s; }
.footer-nav a:hover { color: var(--paper); }
.footer-nav .num { color: var(--accent); margin-right: 10px; }
.footer-base {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid rgba(249, 248, 245, 0.1);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
}

/* ---------- 15. Motion & reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.in { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .mask > span { animation: none; transform: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee-track { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- 16. Small screens ---------- */
@media (max-width: 900px) {
  .main-nav { display: none; }
  .menu-toggle { display: block; }
  .hero-grid { grid-template-columns: 1fr; gap: 48px; margin-top: 56px; }
  .split { grid-template-columns: 1fr; gap: 32px; }
  .module-body { grid-template-columns: 1fr; }
  .module-text { border-right: 0; border-bottom: 1px solid var(--border); padding: 28px; }
  .module-activity { padding: 28px; }
  .option-grid { grid-template-columns: 1fr; }
  .bins { grid-template-columns: 1fr; }
  .essay-grid { grid-template-columns: 1fr; }
  .note-card { grid-template-columns: 1fr; gap: 28px; padding: 28px; }
  .footer-grid { grid-template-columns: 1fr; }
  .section-head .note { display: none; }
  .chapters .side { display: none; }
}

/* ============================================================
   17. Learning module frames (the Flash rebuild)
   ============================================================ */
.frame-kicker {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 18px;
}
.frame-body { min-height: 200px; }
.soft-note { font-size: 14px; color: var(--muted); margin-top: 12px; }
.question-banner {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--ink);
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  margin-bottom: 18px;
}

/* typing grids (Find) */
.food-subject {
  display: inline-block;
  font-family: var(--mono);
  font-size: 14px;
  border: 1px solid var(--ink);
  padding: 3px 18px;
  margin-bottom: 18px;
  color: var(--ink);
}
.food-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.food-grid-cats { align-items: start; }
.food-col { display: grid; gap: 8px; }
.food-head {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  border: 1px solid var(--ink);
  text-align: center;
  padding: 3px 6px;
}
.food-cell {
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 13px;
  color: var(--ink);
  padding: 6px 8px;
  text-align: center;
}
.text-input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--panel);
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  padding: 6px 8px;
  outline: none;
  transition: border-color 0.2s;
}
.text-input:focus { border-color: var(--accent); }
.conclusion-input { resize: vertical; font-size: 15px; padding: 12px; }

/* sorting activities (light theme) */
.pool-label-light {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-top: 4px;
}
.pool-light {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 60px;
  border: 1px dashed var(--border);
  padding: 12px;
}
.pool-light .empty-note { font-size: 14px; color: var(--faint); }
.bins-three { grid-template-columns: repeat(3, 1fr); }
.bins-six { grid-template-columns: repeat(3, 1fr); }
.bins { display: grid; gap: 10px; margin-top: 14px; }
.bin-light {
  min-height: 90px;
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.bin-light.armed { border-color: var(--accent); background: var(--accent-soft); }
.bin-light .bin-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}
.bin-light .placed { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip-light {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--ink);
  padding: 6px 12px;
  font-size: 13px;
  font-family: var(--sans);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.chip-light:hover { border-color: var(--ink); }
.chip-light.selected { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.placed .chip-light { background: var(--subtle); }

/* shapes */
.shape { display: inline-block; width: 30px; height: 30px; cursor: pointer; transition: outline-color 0.15s; outline: 2px solid transparent; outline-offset: 3px; }
.shape.selected { outline-color: var(--accent); }
.shape-circle { border-radius: 50%; }
.shape-oval { width: 42px; border-radius: 50%; }
.shape-diamond { transform: rotate(45deg) scale(0.85); }
.shape-triangle { width: 0; height: 0; border-left: 17px solid transparent; border-right: 17px solid transparent; background: transparent !important; }
.c-red { background: #C0272D; }
.c-blue { background: #2B2EA6; }
.c-green { background: #22A02E; }
.c-yellow { background: #E3C700; }
.shape-triangle.c-red { border-bottom: 30px solid #C0272D; }
.shape-triangle.c-blue { border-bottom: 30px solid #2B2EA6; }
.shape-triangle.c-green { border-bottom: 30px solid #22A02E; }
.shape-triangle.c-yellow { border-bottom: 30px solid #E3C700; }

/* solution clusters */
.cluster-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cluster-grid--items { grid-template-columns: 1fr; gap: 14px; }
.cluster { border: 1px solid var(--border); background: var(--panel); padding: 14px; }
.cluster-title { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); margin-bottom: 10px; }
.cluster-items { display: flex; flex-wrap: wrap; gap: 8px; }
.cluster-items--text .food-cell { text-align: left; }
.cluster .text-input { margin-top: 10px; }
.cluster .cluster-title:last-child { margin-bottom: 0; margin-top: 10px; }

/* playing cards on felt */
.felt { background: #1E5B33; padding: 20px; border: 1px solid var(--ink); }
.cards-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cards-group { margin-bottom: 16px; }
.cards-group:last-child { margin-bottom: 0; }
.cards-label {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 8px;
}
.cards-label--solution { color: #FFD766; margin-top: 8px; margin-bottom: 0; }
.cards-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pcard {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 56px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: var(--sans);
  font-weight: 600;
  line-height: 1.05;
}
.pcard .rank { font-size: 13px; }
.pcard .suit { font-size: 15px; }
.pcard.red { color: #C0272D; }
.pcard.black { color: #181716; }
.hand-input { margin-top: 8px; }
.your-answer { font-family: var(--mono); font-size: 12px; color: rgba(255, 255, 255, 0.7); margin-top: 6px; }
.conclusion-answer { border: 1px solid var(--ink); padding: 16px; margin-top: 16px; background: var(--accent-soft); }
.conclusion-answer .cluster-title { font-size: 14px; margin-bottom: 4px; }
.frame-body .your-answer { color: var(--muted); }

/* old dark-panel styles are no longer used by the module */
.module-activity.dark { background: var(--panel); color: var(--ink); }

/* ============================================================
   18. Tell Me About It
   ============================================================ */
.tmai-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.tmai-tab {
  border: 1px solid var(--ink);
  background: transparent;
  padding: 10px 22px;
  font-family: var(--mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}
.tmai-tab span { color: var(--accent); margin-left: 6px; }
.tmai-tab:hover { background: var(--subtle); }
.tmai-tab.active { background: var(--ink); color: var(--paper); }
.tmai-intro-p { max-width: 640px; color: var(--muted); margin-top: 18px; }
.q-list {
  margin-top: 28px;
  columns: 2;
  column-gap: 48px;
  list-style: none;
  counter-reset: q;
}
.q-list li {
  counter-increment: q;
  break-inside: avoid;
  padding: 12px 0 12px 44px;
  position: relative;
  border-bottom: 1px solid var(--border);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.4;
}
.q-list li::before {
  content: counter(q, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}
@media (max-width: 900px) {
  .q-list { columns: 1; }
}

/* draw a question card */
.tmai-draw { margin-bottom: 40px; }
.draw-card {
  margin-top: 20px;
  max-width: 480px;
  background: var(--panel);
  border: 1px solid var(--ink);
  box-shadow: 8px 8px 0 0 var(--accent);
  padding: 28px;
}
.draw-card.deal { animation: deal 0.45s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes deal {
  from { opacity: 0; transform: translateY(14px) rotate(-1.5deg); }
  to { opacity: 1; transform: none; }
}
.draw-card-q { font-family: var(--serif); font-size: 22px; line-height: 1.35; }
.draw-card-meta {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
}
@media (prefers-reduced-motion: reduce) {
  .draw-card.deal { animation: none; }
}

/* ============================================================
   19. Print — clean paper output for every page
   ============================================================ */
@media print {
  .site-header, .mobile-nav, .marquee, .tmai-tabs, .tmai-draw,
  .module-steps, .module-activity, .module-bar .count, .toast,
  .menu-toggle, .cursor, .footer-nav { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  main { padding-top: 0; }
  .mask > span { animation: none !important; transform: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .hero-grid, .split, .module-body, .footer-grid, .note-card,
  .essay-grid { display: block; }
  .readme-card, .module, .cluster, .essay-card, .note-card, .summary-card {
    box-shadow: none !important;
    border: 1px solid #999;
  }
  .readme-card { background: #fff; color: #000; }
  .readme-card .bright, .readme-card .amber, .readme-card .fence { color: #000; }
  .felt { background: #fff; border: 1px solid #999; }
  .felt .cards-label, .felt .your-answer { color: #000; }
  .pcard { border: 1px solid #000; }
  .site-footer { background: #fff; color: #000; }
  .site-footer .tagline em { color: #000; }
  .site-footer .overline { color: #555; }
  a { color: #000; text-decoration: none; }
  a.doc .ext, .chapters .arrow { display: none; }
  .doc, .q-list li, .cluster, .essay-card { break-inside: avoid; }
  .tmai-level[hidden] { display: block !important; }
  .tmai-level + .tmai-level { page-break-before: always; }
  .section { padding-top: 24px; padding-bottom: 24px; }
  .site-footer .inner { padding: 24px 0; }
  .footer-base { border-top-color: #999; color: #555; }
}

/* ============================================================
   20. Signposts, print cover, favorites
   ============================================================ */
/* signpost pages (404.html and the signposts/ folder) */
.signpost { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.signpost-box { max-width: 560px; border: 1px solid var(--ink); box-shadow: 10px 10px 0 0 var(--accent); background: var(--panel); padding: 48px; }
.signpost-box h1 { font-size: clamp(28px, 4vw, 40px); margin-top: 20px; }
.signpost-box p { margin-top: 16px; color: var(--muted); }
.signpost-box .btn-outline { margin-top: 28px; }
.signpost-box .signpost-links { margin-top: 20px; font-family: var(--mono); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.signpost-box .signpost-links a { color: var(--accent); text-decoration: underline; }

/* print-only cover page (Tell Me About It booklet) */
.print-cover { display: none; }

/* favorite questions: tap to star; stars last while the page is open */
.q-list li { cursor: pointer; padding-right: 32px; }
.q-list li::after {
  content: '☆';
  position: absolute;
  right: 4px;
  top: 12px;
  font-size: 14px;
  color: var(--faint);
  transition: color 0.2s, transform 0.2s;
}
.q-list li:hover::after { color: var(--accent); }
.q-list li.starred { background: #FDF6E7; }
.q-list li.starred::after { content: '★'; color: var(--amber); transform: scale(1.15); }

/* drag and drop (desktop; touch keeps click-select) */
.sortable-item[draggable="true"] { cursor: grab; }
.sortable-item.dragging { opacity: 0.45; }
.bin-light.droptarget { border-color: var(--accent); background: var(--accent-soft); }
.pool-light.droptarget { border-color: var(--accent); border-style: solid; }

/* mix-again button on sorting activities */
.pool-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.mix-btn {
  border: 0;
  background: none;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.2s;
}
.mix-btn:hover { color: var(--ink); }

/* print-only closing page (Tell Me About It booklet) */
.print-back { display: none; }

@media print {
  .print-cover {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 88vh;
    page-break-after: always;
  }
  .print-back {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 88vh;
    page-break-before: always;
  }
  .print-back .pc-over { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.25em; color: #555; }
  .print-back h2 { font-size: 40px; margin: 28px 0; }
  .pb-steps { list-style: none; margin: 0 0 28px; font-family: var(--serif); font-size: 18px; }
  .pb-steps li { padding: 4px 0; }
  .pb-steps span { font-family: var(--mono); font-size: 13px; margin-right: 10px; }
  .pb-close { font-family: var(--serif); font-style: italic; font-size: 16px; color: #333; max-width: 440px; margin-bottom: 32px; }
  .print-cover .pc-over { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.25em; color: #555; }
  .print-cover h1 { font-size: 64px; margin: 28px 0; }
  .print-cover h1 em { font-style: italic; }
  .print-cover .pc-sub { font-family: var(--serif); font-size: 18px; color: #333; max-width: 420px; }
  .print-cover .pc-rule { width: 64px; border-top: 2px solid #000; margin: 32px 0; }
  .print-cover .pc-meta { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.2em; color: #555; }
  /* starred questions keep their star in print */
  .q-list li.starred { background: #fff; }
  .q-list li.starred::after { color: #000; }

/* ============================================================
   21. Colophon page
   ============================================================ */
.article { max-width: 680px; margin: 0 auto; }
.article-title { font-size: clamp(38px, 5vw, 56px); line-height: 1.08; margin-top: 32px; }
.article-title em { color: var(--accent); }
.article-lead { font-family: var(--serif); font-size: 20px; line-height: 1.5; color: var(--ink); margin-top: 28px; }
.article h2 { font-size: 26px; margin-top: 56px; }
.article h2 .v-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 3px 10px;
  margin-right: 14px;
  vertical-align: 6px;
}
.article p { margin-top: 18px; color: var(--muted); font-size: 17px; line-height: 1.7; }
.colophon-close { margin-top: 72px; }
.colophon-link { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.colophon-link:hover { color: var(--amber); }

/* ============================================================
   22. Stopwatch (Find) and keepsake certificate (Conclude)
   ============================================================ */
.find-timer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
}
.find-clock {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 3px 12px;
  min-width: 64px;
  text-align: center;
}
.find-timer-label { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.find-timer-label.done { color: var(--green); }

.certificate {
  margin-top: 28px;
  border: 2px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: 5px;
  background: var(--panel);
  padding: 36px 28px;
  text-align: center;
}
.cert-over {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
}
.cert-conclusion { font-family: var(--serif); font-style: italic; font-size: 24px; line-height: 1.35; margin-top: 18px; }
.cert-steps { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; color: var(--muted); margin-top: 22px; }
.cert-date { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 8px; }

/* when the certificate button is used, print only the certificate */
@media print {
  body.print-certificate * { visibility: hidden; }
  /* the activity panel is display:none in print, which would hide the
     certificate outright — re-show the ancestors in certificate mode */
  body.print-certificate .module-activity,
  body.print-certificate .module-body,
  body.print-certificate .module { display: block !important; }
  body.print-certificate .certificate,
  body.print-certificate .certificate * { visibility: visible; }
  body.print-certificate .certificate {
    position: fixed;
    inset: 0;
    margin: 0;
    border: none;
    outline: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}
}