/* ============================================================
   Living with Fire — shared stylesheet
   Typography follows the apriltiltoniser.com playbook
   (Playfair Display / Lora / Josefin Sans).
   Palette shifts from cream-and-sage toward sillar, ash, and ember.
   ============================================================ */

:root {
  /* Base — carried over */
  --cream: #faf6f1;
  --warm-white: #fffcf8;
  --sage: #8b9e7e;
  --sage-light: #c2ceac;
  --sage-dark: #5a6e4e;
  --brown: #6b5442;
  --brown-light: #a08670;
  --brown-dark: #3e2e22;
  --charcoal: #2c2825;
  --text: #3a3530;
  --text-light: #7a7067;
  --text-on-dark-muted: #938e88;

  /* Volcanic additions */
  --sillar: #f3ece3;      /* the white-pink building stone of Arequipa */
  --sillar-pink: #ecdfd6;
  --ash: #8a8078;
  --ash-light: #d8d1c9;
  --basalt: #221f1d;
  --basalt-soft: #34302c;
  --ember: #b4553a;
  --ember-light: #d9805f;
  --ember-soft: #e0a48f;
  --snow: #ffffff;

  --serif: "Playfair Display", Georgia, serif;
  --body: "Lora", Georgia, serif;
  --sans: "Josefin Sans", -apple-system, sans-serif;

  --wrap: 1080px;
  --wrap-narrow: 720px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  font-size: 17px;
  color: var(--text);
  background: var(--cream);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* Grain overlay — same trick as the personal site */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ---------- Type ---------- */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.2; }
em { font-style: italic; }
a { color: var(--ember); text-decoration-color: var(--ember-soft); text-underline-offset: 3px; }
a:hover { color: var(--brown-dark); }

.section-label {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--ash);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ash-light);
}

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  color: var(--charcoal);
  margin-bottom: 18px;
}
.lede {
  font-size: 19px;
  color: var(--text-light);
  max-width: 62ch;
}

/* ---------- Layout ---------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
.wrap-narrow { max-width: var(--wrap-narrow); margin: 0 auto; padding: 0 32px; }
section { padding: 88px 0; }
.band-sillar { background: var(--sillar); }
.band-dark { background: var(--basalt); color: var(--sillar); }
.band-dark .section-title { color: var(--sillar); }
.band-dark .lede { color: var(--text-on-dark-muted); }
.band-dark .section-label { color: var(--ember-soft); }
.band-dark .section-label::after { background: #4a4440; }

/* ---------- Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 32px;
  background: rgba(250, 246, 241, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ash-light);
}
.nav-logo {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--charcoal);
  text-decoration: none;
  white-space: nowrap;
}
.nav-logo em { color: var(--ember); }
.nav-links { display: flex; gap: 26px; flex-wrap: wrap; }
.nav-link {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-light);
  text-decoration: none;
}
.nav-link:hover { color: var(--ember); }
.nav-link.workroom {
  border: 1px solid var(--ash-light);
  padding: 5px 12px;
  border-radius: 2px;
  color: var(--ash);
}
.nav-link.workroom:hover { border-color: var(--ember); color: var(--ember); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 110px 0 0;
  background: linear-gradient(180deg, var(--cream) 0%, var(--sillar-pink) 100%);
  overflow: hidden;
  text-align: center;
}
.hero-eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 26px;
}
.hero-title {
  font-size: clamp(44px, 8vw, 84px);
  color: var(--charcoal);
  line-height: 1.02;
  letter-spacing: -0.5px;
}
.hero-title em { color: var(--ember); }
.hero-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 2.4vw, 25px);
  color: var(--brown);
  margin-top: 20px;
  max-width: 30ch;
  margin-inline: auto;
  line-height: 1.4;
}
.hero-meta {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--ash);
  margin-top: 30px;
}
.hero-meta span { color: var(--ash-light); margin: 0 10px; }
.hero-range { display: block; margin-top: 60px; line-height: 0; }
.hero-range svg { width: 100%; height: auto; display: block; }

/* ---------- Stat strip ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--basalt);
  color: var(--sillar);
}
.stat {
  padding: 34px 24px;
  text-align: center;
  border-right: 1px solid #3b3733;
}
.stat:last-child { border-right: none; }
.stat-num {
  font-family: var(--serif);
  font-size: clamp(24px, 3.2vw, 34px);
  color: var(--snow);
  line-height: 1.1;
}
.stat-num em { color: var(--ember-soft); font-style: normal; }
.stat-label {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-on-dark-muted);
  margin-top: 10px;
}

/* ---------- Pull quote / thesis ---------- */
.thesis-block { text-align: center; }
.pull-quote {
  font-family: var(--serif);
  font-size: clamp(22px, 3.1vw, 33px);
  line-height: 1.42;
  color: var(--charcoal);
  font-weight: 400;
  max-width: 24ch;
  margin: 0 auto;
}
.band-dark .pull-quote { color: var(--sillar); }
.pull-quote em { color: var(--ember); font-style: italic; }
.band-dark .pull-quote em { color: var(--ember-soft); }
.quote-rule { width: 46px; height: 2px; background: var(--ember); margin: 30px auto; }
.thesis-full {
  max-width: 66ch;
  margin: 0 auto;
  color: var(--text-light);
  font-size: 17px;
}
.band-dark .thesis-full { color: var(--text-on-dark-muted); }

/* ---------- Prose ---------- */
.prose p { margin-bottom: 20px; max-width: 68ch; }
.prose p:last-child { margin-bottom: 0; }
.prose .first-line::first-letter {
  font-family: var(--serif);
  font-size: 58px;
  float: left;
  line-height: 0.82;
  padding: 6px 10px 0 0;
  color: var(--ember);
}

/* ---------- Two-column split ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

/* ---------- Diagram ---------- */
.figure { margin-top: 44px; }
.figure svg { width: 100%; height: auto; display: block; }
.figure-caption {
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: 0.4px;
  color: var(--ash);
  margin-top: 16px;
  max-width: 70ch;
  line-height: 1.6;
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  margin-top: 44px;
}
.card {
  background: var(--warm-white);
  border: 1px solid var(--ash-light);
  border-top: 3px solid var(--ember);
  padding: 26px 24px;
}
.band-dark .card {
  background: var(--basalt-soft);
  border-color: #46403b;
  border-top-color: var(--ember);
}
.card h3 {
  font-size: 20px;
  color: var(--charcoal);
  margin-bottom: 8px;
}
.band-dark .card h3 { color: var(--sillar); }
.card p { font-size: 15.5px; color: var(--text-light); line-height: 1.65; }
.band-dark .card p { color: var(--text-on-dark-muted); }
.card-kicker {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 10px;
}

/* ---------- Volcano cards ---------- */
.volcano-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 24px;
  margin-top: 48px;
}
.volcano {
  background: var(--warm-white);
  border: 1px solid var(--ash-light);
  display: flex;
  flex-direction: column;
}
.volcano-art { background: var(--sillar-pink); line-height: 0; }
.volcano-art svg { width: 100%; height: auto; display: block; }
.volcano-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.volcano-role {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 9px;
}
.volcano h3 { font-size: 23px; color: var(--charcoal); }
.volcano-type {
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: 0.6px;
  color: var(--ash);
  margin: 4px 0 16px;
}
.volcano p { font-size: 15px; color: var(--text-light); line-height: 1.62; flex: 1; }
.volcano-facts {
  list-style: none;
  margin-top: 18px;
  border-top: 1px solid var(--ash-light);
  padding-top: 14px;
}
.volcano-facts li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: 0.4px;
  padding: 4px 0;
  color: var(--text);
}
.volcano-facts span { color: var(--ash); }

/* ---------- Timeline ---------- */
.timeline { margin-top: 52px; position: relative; padding-left: 30px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--ash-light), var(--ember-soft), var(--ash-light));
}
.tl-item { position: relative; padding-bottom: 34px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--ash);
}
.tl-item.eruption::before { background: var(--ember); border-color: var(--ember); }
.tl-item.outside::before { background: var(--ash-light); border-color: var(--ash-light); }
.tl-year {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  color: var(--ember);
}
.tl-item.outside .tl-year { color: var(--ash); }
.tl-head { font-family: var(--serif); font-size: 20px; color: var(--charcoal); margin: 3px 0 6px; }
.tl-item p { font-size: 15.5px; color: var(--text-light); max-width: 64ch; line-height: 1.65; }
.tl-window-note {
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--ash);
  border: 1px dashed var(--ash-light);
  padding: 9px 14px;
  display: inline-block;
  margin-bottom: 8px;
}

/* ---------- Comparison ---------- */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 46px;
  border: 1px solid #46403b;
}
.compare-col { padding: 34px 30px; }
.compare-col:first-child { border-right: 1px solid #46403b; }
.compare-name { font-family: var(--serif); font-size: 27px; color: var(--sillar); }
.compare-tag {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--ember-soft);
  margin: 8px 0 20px;
}
.compare-col ul { list-style: none; }
.compare-col li {
  font-size: 15.5px;
  color: var(--text-on-dark-muted);
  padding: 10px 0 10px 18px;
  position: relative;
  border-bottom: 1px solid #3b3733;
  line-height: 1.6;
}
.compare-col li:last-child { border-bottom: none; }
.compare-col li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 19px;
  width: 6px;
  height: 1px;
  background: var(--ember);
}
.compare-note {
  margin-top: 34px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--sillar);
  text-align: center;
  max-width: 62ch;
  margin-inline: auto;
  line-height: 1.5;
}

/* ---------- Research questions ---------- */
.q-central {
  background: var(--warm-white);
  border-left: 3px solid var(--ember);
  padding: 30px 34px;
  margin-top: 40px;
}
.q-central .card-kicker { margin-bottom: 12px; }
.q-central p { font-family: var(--serif); font-size: 21px; line-height: 1.45; color: var(--charcoal); }
.q-list { margin-top: 26px; display: grid; gap: 16px; }
.q-item {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 22px;
  background: var(--warm-white);
  border: 1px solid var(--ash-light);
  padding: 22px 26px;
  align-items: start;
}
.q-num {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--ember);
  padding-top: 4px;
}
.q-item h4 { font-size: 17px; color: var(--charcoal); margin-bottom: 5px; }
.q-item p { font-size: 15.5px; color: var(--text-light); line-height: 1.62; }

/* ---------- Footnote ---------- */
.footnote {
  border-top: 1px solid var(--ash-light);
  margin-top: 54px;
  padding-top: 22px;
  font-size: 14.5px;
  color: var(--text-light);
  max-width: 74ch;
}
.footnote strong { font-family: var(--sans); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--ash); display: block; margin-bottom: 8px; font-weight: 400; }

/* ---------- Source list ---------- */
.sources { list-style: none; margin-top: 34px; display: grid; gap: 2px; }
.sources li {
  padding: 14px 0;
  border-bottom: 1px solid var(--ash-light);
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 22px;
  align-items: baseline;
}
.sources .src-name { font-family: var(--sans); font-size: 12px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--ember); }
.sources .src-what { font-size: 15.5px; color: var(--text-light); line-height: 1.6; }
.sources a { word-break: break-word; font-size: 14px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--basalt);
  color: var(--text-on-dark-muted);
  padding: 56px 0 44px;
  text-align: center;
}
.site-footer .f-title { font-family: var(--serif); font-size: 21px; color: var(--sillar); }
.site-footer .f-meta { font-family: var(--sans); font-size: 11.5px; letter-spacing: 2.4px; text-transform: uppercase; margin-top: 14px; }
.site-footer a { color: var(--ember-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: 40px; }
  .compare { grid-template-columns: 1fr; }
  .compare-col:first-child { border-right: none; border-bottom: 1px solid #46403b; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid #3b3733; }
  .sources li { grid-template-columns: 1fr; gap: 6px; }
  .q-item { grid-template-columns: 1fr; gap: 10px; }
  section { padding: 64px 0; }
  .wrap, .wrap-narrow { padding: 0 22px; }
  .site-nav { padding: 14px 20px; }
  .nav-links { gap: 16px; }
}
@media (max-width: 560px) {
  .nav-links .nav-link:not(.workroom) { display: none; }
}

/* ============================================================
   WORKROOM — private working view
   ============================================================ */

.work-body { background: #f6f3ef; }

.work-head {
  background: var(--basalt);
  color: var(--sillar);
  padding: 46px 0 40px;
}
.work-head .eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--ember-soft);
}
.work-head h1 { font-size: clamp(30px, 4.4vw, 44px); color: var(--sillar); margin-top: 12px; }
.work-head .sub { color: var(--text-on-dark-muted); margin-top: 10px; font-size: 16px; }

/* Overall progress */
.overall { margin-top: 30px; }
.overall-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 26px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--text-on-dark-muted);
  margin-bottom: 10px;
}
.overall-row strong { color: var(--snow); font-weight: 400; font-size: 13px; }
.bar { height: 10px; background: #3b3733; border-radius: 2px; overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; }
.bar .drafted { background: var(--sage); }
.bar .raw { background: var(--ember); }
.bar-key {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-on-dark-muted);
}
.bar-key span { display: flex; align-items: center; gap: 8px; }
.bar-key b { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* Next-task callout */
.next-up {
  background: var(--warm-white);
  border: 1px solid var(--ember-soft);
  border-left: 4px solid var(--ember);
  padding: 30px 34px;
  margin: -34px auto 0;
  position: relative;
  max-width: var(--wrap);
  box-shadow: 0 8px 24px rgba(44, 40, 37, 0.09);
}
.next-up .card-kicker { margin-bottom: 10px; }
.next-up h2 { font-size: 26px; color: var(--charcoal); }
.next-up p { margin-top: 12px; color: var(--text-light); max-width: 72ch; font-size: 16px; }

/* Work sections */
.work-sec { padding: 54px 0; }
.work-sec h2 {
  font-size: 27px;
  color: var(--charcoal);
  margin-bottom: 6px;
}
.work-sec .hint { color: var(--text-light); font-size: 15.5px; max-width: 74ch; margin-bottom: 26px; }

/* Status badges */
.badge {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 2px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge.done      { background: #e6ecdf; color: var(--sage-dark); border-color: #cfdcc2; }
.badge.raw       { background: #f7e6de; color: #8f3f26; border-color: #edcbbc; }
.badge.open      { background: var(--ember); color: #fff; }
.badge.blocked   { background: #e9e5e0; color: var(--ash); border-color: #d8d1c9; }
.badge.last      { background: #e7e9ee; color: #545d6f; border-color: #d3d7e0; }

/* Section board */
.board { border: 1px solid var(--ash-light); background: var(--warm-white); }
.board-row {
  display: grid;
  grid-template-columns: 54px 1fr 132px 120px;
  gap: 20px;
  align-items: center;
  padding: 17px 22px;
  border-bottom: 1px solid #eae4dc;
}
.board-row:last-child { border-bottom: none; }
.board-row.head {
  background: var(--sillar);
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ash);
  padding: 12px 22px;
}
.board-num { font-family: var(--serif); font-size: 19px; color: var(--ember); }
.board-name { font-family: var(--serif); font-size: 18px; color: var(--charcoal); }
.board-name small {
  display: block;
  font-family: var(--body);
  font-size: 14px;
  color: var(--text-light);
  margin-top: 3px;
  line-height: 1.55;
}
.board-words { font-family: var(--sans); font-size: 13px; letter-spacing: 1px; color: var(--text); }
.board-words em { font-style: normal; color: var(--ash); font-size: 11px; display: block; letter-spacing: 1.6px; text-transform: uppercase; }
.board-row.sub { background: #fbf8f4; }
.board-row.sub .board-name { font-size: 16px; padding-left: 16px; border-left: 2px solid var(--ember-soft); }

/* Paragraph map */
.pmap { display: grid; gap: 12px; }
.pslot {
  display: grid;
  grid-template-columns: 58px 1fr 118px;
  gap: 20px;
  align-items: start;
  background: var(--warm-white);
  border: 1px solid var(--ash-light);
  padding: 18px 22px;
}
.pslot.is-open { border-color: var(--ember); border-width: 2px; background: #fff9f6; }
.pslot-id { font-family: var(--serif); font-size: 21px; color: var(--ember); }
.pslot-id small { display: block; font-family: var(--sans); font-size: 10px; letter-spacing: 1.6px; color: var(--ash); margin-top: 2px; }
.pslot h4 { font-size: 17px; color: var(--charcoal); margin-bottom: 5px; }
.pslot p { font-size: 15px; color: var(--text-light); line-height: 1.6; }
.pslot-right { text-align: right; }

/* Task list */
.tasks { display: grid; gap: 12px; }
.task {
  background: var(--warm-white);
  border: 1px solid var(--ash-light);
  border-left: 3px solid var(--ash-light);
  padding: 18px 22px;
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 20px;
  align-items: start;
}
.task.is-open { border-left-color: var(--ember); }
.task.is-blocked { border-left-color: var(--ash); }
.task.is-last { border-left-color: #8b93a6; }
.task h4 { font-size: 17px; color: var(--charcoal); margin-bottom: 5px; }
.task p { font-size: 15px; color: var(--text-light); line-height: 1.6; }
.task .right { text-align: right; }

/* Verify / correction callout */
.verify {
  background: #fff7f3;
  border: 1px solid var(--ember-soft);
  padding: 26px 30px;
}
.verify h3 { font-size: 20px; color: var(--charcoal); margin-bottom: 10px; }
.verify p { font-size: 15.5px; color: var(--text-light); max-width: 76ch; margin-bottom: 12px; }
.verify p:last-child { margin-bottom: 0; }
.verify .flag {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  background: var(--ember);
  padding: 4px 10px;
  display: inline-block;
  margin-bottom: 14px;
}

/* Decisions list */
.decisions { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.decision {
  background: var(--warm-white);
  border: 1px solid var(--ash-light);
  border-top: 3px solid var(--sage);
  padding: 20px 22px;
}
.decision .card-kicker { color: var(--sage-dark); }
.decision p { font-size: 15px; color: var(--text-light); line-height: 1.6; }

/* Source shelf */
.shelf { display: grid; gap: 10px; }
.shelf-item {
  background: var(--warm-white);
  border: 1px solid var(--ash-light);
  padding: 15px 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
}
.shelf-item .s-name { font-family: var(--serif); font-size: 16.5px; color: var(--charcoal); }
.shelf-item .s-use { font-size: 14.5px; color: var(--text-light); margin-top: 3px; line-height: 1.55; }
.shelf-item a { font-size: 13.5px; }

@media (max-width: 860px) {
  .board-row { grid-template-columns: 40px 1fr; }
  .board-row .board-words, .board-row .board-status { grid-column: 2; }
  .board-row.head { display: none; }
  .pslot, .task, .shelf-item { grid-template-columns: 1fr; }
  .pslot-right, .task .right { text-align: left; }
  .next-up { margin-top: 0; }
}

/* ============================================================
   READ VIEW — the thesis as continuous prose, no scaffolding
   ============================================================ */

.read-body {
  background: #e6e0d8;
  font-size: 18px;
}

.read-toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 13px 26px;
  background: rgba(34, 31, 29, 0.96);
  backdrop-filter: blur(10px);
  color: var(--text-on-dark-muted);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}
.read-toolbar a { color: var(--ember-soft); text-decoration: none; }
.read-toolbar a:hover { color: #fff; }
.read-toolbar .rt-group { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.read-toolbar .rt-count { color: var(--snow); }
.rt-btn {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--sillar);
  background: transparent;
  border: 1px solid #55504b;
  padding: 5px 13px;
  border-radius: 2px;
  cursor: pointer;
}
.rt-btn:hover { border-color: var(--ember); color: var(--ember-soft); }

/* The page itself */
.page {
  max-width: 46em;
  margin: 44px auto 90px;
  background: #fffdfa;
  padding: 84px 78px 96px;
  box-shadow: 0 3px 28px rgba(44, 40, 37, 0.14);
  color: #2f2b27;
  line-height: 1.9;
}

.title-block {
  text-align: center;
  padding-bottom: 56px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--ash-light);
}
.title-block h1 {
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1.18;
  color: var(--charcoal);
}
.title-block .tb-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--brown);
  margin-top: 14px;
  line-height: 1.4;
}
.title-block .tb-meta {
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ash);
  margin-top: 30px;
  line-height: 2;
}

.page h2 {
  font-family: var(--serif);
  font-size: 26px;
  color: var(--charcoal);
  margin: 62px 0 22px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ash-light);
}
.page h2:first-of-type { margin-top: 0; }
.page h2 .h-num {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--ember);
  display: block;
  margin-bottom: 7px;
  text-transform: uppercase;
}
.page h3 {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--brown-dark);
  margin: 36px 0 14px;
}
.page p {
  margin: 0;
  text-indent: 1.6em;
  hyphens: auto;
}
.page h2 + p,
.page h3 + p,
.page .gap + p,
.page .title-block + p { text-indent: 0; }

/* Placeholder for a slot that isn't written yet */
.gap {
  border: 1px dashed var(--ember-soft);
  background: #fffaf7;
  padding: 15px 20px;
  margin: 20px 0;
  text-indent: 0;
}
.gap .gap-head {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 6px;
}
.gap .gap-job {
  font-family: var(--body);
  font-style: italic;
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.6;
}
.hide-gaps .gap { display: none; }

/* Footnotes at the foot of a section */
.fn-block {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--ash-light);
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.7;
}
.fn-block p { text-indent: 0; }
.fn-block .fn-label {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ash);
  display: block;
  margin-bottom: 6px;
}

@media (max-width: 760px) {
  .read-body { font-size: 17px; }
  .page { padding: 44px 26px 56px; margin: 20px auto 50px; }
  .title-block h1 { font-size: 28px; }
  .read-toolbar { padding: 11px 18px; gap: 12px; }
}

@media print {
  .read-toolbar { display: none; }
  .read-body { background: #fff; }
  .page { box-shadow: none; margin: 0; max-width: none; padding: 0; }
  .gap { display: none; }
}

/* ============================================================
   VOLCANO PLUME — three wisps rising from the summit crater
   ============================================================ */

.plume-wisp {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  opacity: 0;
  animation: plume-rise 9s linear infinite;
}
.plume-wisp.w2 { animation-duration: 10.5s; animation-delay: 3s; }
.plume-wisp.w3 { animation-duration: 8s;    animation-delay: 6s; }

@keyframes plume-rise {
  0%   { opacity: 0;    transform: translate(0, 6px) scale(0.45); }
  14%  { opacity: 0.58; }
  55%  { opacity: 0.30; }
  100% { opacity: 0;    transform: translate(13px, -30px) scale(1.6); }
}

@media (prefers-reduced-motion: reduce) {
  .plume-wisp { animation: none; transform: none; opacity: 0; }
  .plume-wisp.w1 { opacity: 0.5; }
}

/* ============================================================
   SUBDUCTION DIAGRAM — plate convergence, melt ascent, melt zone
   ============================================================ */

/* Magma rising along the conduit, following its exact curve. */
.melt-bubble {
  offset-path: path("M515 268 C 522 210, 536 140, 553 76");
  offset-rotate: 0deg;
  opacity: 0;
  animation: melt-rise 7s linear infinite;
}
.melt-bubble.b2 { animation-duration: 8.5s; animation-delay: 2.4s; }
.melt-bubble.b3 { animation-duration: 6.4s; animation-delay: 4.6s; }

@keyframes melt-rise {
  0%   { offset-distance: 0%;   opacity: 0; }
  12%  { opacity: 0.85; }
  78%  { opacity: 0.55; }
  100% { offset-distance: 100%; opacity: 0; }
}

/* The oceanic plate driving east under the continent. */
.conv-arrow {
  opacity: 0;
  animation: conv-slide 5.5s ease-in-out infinite;
}
.conv-arrow.a2 { animation-delay: 2.75s; }

@keyframes conv-slide {
  0%   { opacity: 0;    transform: translateX(-26px); }
  22%  { opacity: 0.85; }
  70%  { opacity: 0.5; }
  100% { opacity: 0;    transform: translateX(46px); }
}

/* Melt zone breathing, so the diagram never reads as fully static. */
.melt-zone {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: melt-pulse 7s ease-in-out infinite;
}

@keyframes melt-pulse {
  0%, 100% { transform: scale(0.94); opacity: 0.85; }
  50%      { transform: scale(1.09); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .melt-bubble { animation: none; opacity: 0; }
  .conv-arrow  { animation: none; opacity: 0; transform: none; }
  .conv-arrow.a1 { opacity: 0.85; }
  .melt-zone   { animation: none; transform: none; }
}

/* Raw material shown in the read view: visibly not-yet-yours. */
.p-raw {
  border-left: 3px dotted var(--ember-soft);
  padding-left: 14px;
  color: #6b5f55;
}
.p-raw::before {
  content: "raw — source language";
  display: block;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 4px;
}
@media print {
  .p-raw { display: none; }  /* borrowed language never prints */
}

/* Working drafts in the read view: real sentences, placeholder cites, not final. */
.p-working {
  border-left: 3px solid var(--sage-light);
  padding-left: 14px;
}
.p-working::before {
  content: "working draft";
  display: block;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--sage-dark);
  margin-bottom: 4px;
}
@media print {
  .p-working { border-left: none; padding-left: 0; }
  .p-working::before { display: none; }  /* drafts print clean; raw still never prints */
}
