/* =============================================================
   module.css — The Made Self · Module pages
   Shared by all module and content pages.
   Requires shared.css to be loaded first.
   ============================================================= */

:root {
  --pad:         clamp(32px, 6vw, 120px);
  --content-max: 1200px;
  --prose-max:   680px;
}

/* ── Body override for module pages ─────────────────────────── */
body {
  line-height: 1.85;
  padding-top: 100px;
}

/* ── Nav (module variant) ────────────────────────────────────── */
nav {
  padding-left: 0;
  padding-right: 0;
  max-width: none;
}

.nav-inner {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-back {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--ease);
}
.nav-back:hover { color: var(--accent); }
.nav-back::before { content: '← '; }

/* ── Page wrapper ────────────────────────────────────────────── */
.page {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--pad) 160px;
}

.prose {
  max-width: var(--prose-max);
}

/* ── Book hero ───────────────────────────────────────────────── */
.book-hero {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 100px;
  border-bottom: 1px solid var(--border);
}

.module-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  margin-top: 60px;
}

.module-context {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 32px;
}

.book-title {
  font-family: var(--serif);
  font-size: clamp(64px, 9vw, 130px);
  font-weight: 300;
  line-height: 1.0;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 20px;
}

.book-author {
  font-family: var(--sans);
  font-size: clamp(13px, 1.2vw, 15px);
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 48px;
}

.book-intro {
  font-family: var(--sans);
  font-size: clamp(16px, 1.5vw, 19px);
  font-weight: 400;
  line-height: 1.9;
  color: var(--text);
}
.book-intro + .book-intro { margin-top: 1.5em; }
.book-intro em { color: var(--accent); font-style: italic; }
.book-intro a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.book-intro a:hover { color: var(--text); }

/* ── Module intro (tripart form explainer) ───────────────────── */
.module-intro {
  padding: 52px 0 60px;
  border-bottom: 1px solid var(--border);
}

.module-intro-lead {
  font-family: var(--sans);
  font-size: clamp(14px, 1.3vw, 16px);
  line-height: 1.9;
  color: var(--muted);
  margin-bottom: 40px;
}

/* ── Form parts (3-column descriptor grid) ───────────────────── */
.form-parts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.form-part {
  padding: 28px 32px 28px 28px;
  border-left: 1px solid var(--border);
}
.form-part:first-child {
  border-left: none;
  padding-left: 0;
}

.form-part-label {
  display: block;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.form-part-desc {
  font-family: var(--sans);
  font-size: clamp(13px, 1.2vw, 14px);
  line-height: 1.85;
  color: var(--muted);
  margin: 0;
}

@media (max-width: 600px) {
  .form-parts { grid-template-columns: 1fr; }
  .form-part {
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 24px 0;
  }
  .form-part:first-child { border-top: none; padding-top: 0; }
}

/* ── Table of contents ───────────────────────────────────────── */
.toc {
  padding: 64px 0 72px;
  border-bottom: 1px solid var(--border);
}

.toc-header {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 32px;
  cursor: pointer;
  user-select: none;
}

.toc-chevron {
  font-size: 20px;
  color: var(--accent);
  display: inline-block;
  transition: transform 0.3s ease;
  opacity: 0.7;
  line-height: 1;
}
.toc.collapsed .toc-chevron { transform: rotate(-90deg); }

.toc-items {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 1200px;
  opacity: 1;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}
.toc.collapsed .toc-items { max-height: 0; opacity: 0; }

.toc-link {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: border-color 0.3s ease, opacity 0.3s ease;
  opacity: 0.62;
}
.toc-link:last-child { border-bottom: none; }
.toc-link:hover { opacity: 1; border-color: rgba(201,169,110,0.28); }
.toc-link.is-active { opacity: 1; }
.toc-link.is-active .toc-name { color: var(--accent); }

.toc-num {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--accent);
  min-width: 22px;
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity 0.3s;
}
.toc-link:hover .toc-num,
.toc-link.is-active .toc-num { opacity: 1; }

.toc-name {
  font-family: var(--sans);
  font-size: clamp(14px, 1.35vw, 16px);
  font-weight: 400;
  color: var(--text);
  transition: color 0.3s ease;
}

.toc-arrow {
  margin-left: auto;
  font-size: 11px;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  flex-shrink: 0;
}
.toc-link:hover .toc-arrow,
.toc-link.is-active .toc-arrow { opacity: 0.6; transform: translateX(0); }

/* ── Content bands ───────────────────────────────────────────── */
.band {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 90px 0;
  border-bottom: 1px solid var(--border);
}

/* Scroll offset for fixed nav on anchor-linked bands */
.band[id] { scroll-margin-top: 110px; }

.band-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.band-content {
  font-family: var(--sans);
  font-size: clamp(15px, 1.4vw, 17px);
  font-weight: 400;
  line-height: 1.9;
  color: var(--text);
}
.band-content p + p                       { margin-top: 1.5em; }
.band-content p + .form-parts             { margin-top: 1.5em; }
.band-content .form-parts + p             { margin-top: 1.5em; }
.band-content .form-parts + .form-parts   { margin-top: 1.5em; }
.band-content em     { font-style: italic; color: var(--accent); }

/* ── Koan blocks ─────────────────────────────────────────────── */
.koan[id] { scroll-margin-top: 110px; }

.koan {
  padding: 64px 0 60px;
  border-bottom: 1px solid var(--border);
}

.koan-header {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 40px;
}

.koan-num {
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--accent);
  flex-shrink: 0;
}

.koan-title {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}

.koan-rule {
  flex: 1;
  height: 1px;
  background: var(--border);
  position: relative;
  top: -3px;
}

.koan-statement {
  font-family: var(--sans);
  font-size: clamp(17px, 1.7vw, 21px);
  font-weight: 400;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 56px;
}

.koan-record,
.koan-commentary {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0 32px;
}

.koan-record {
  padding-bottom: 32px;
  margin-bottom: 32px;
  border-bottom: 1px dashed var(--border);
}

.koan-record-label,
.koan-commentary-label {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.6;
  padding-top: 4px;
  line-height: 1.5;
}

.koan-record-body,
.koan-commentary-body {
  font-family: var(--sans);
  font-size: clamp(13px, 1.2vw, 14px);
  line-height: 1.9;
  color: var(--muted);
}

.koan-record-body cite {
  display: block;
  margin-top: 12px;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent2);
  opacity: 0.75;
}

@media (max-width: 600px) {
  .koan-record,
  .koan-commentary    { grid-template-columns: 1fr; gap: 8px 0; }
  .koan-record-label,
  .koan-commentary-label { padding-top: 0; margin-bottom: 6px; }
  .koan-record        { padding-bottom: 24px; margin-bottom: 24px; }
}

/* ── Pull quote ──────────────────────────────────────────────── */
.pull-quote {
  padding: 90px 0;
  border-bottom: 1px solid var(--border);
}

.pull-quote-text {
  font-family: var(--sans);
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 20px;
}
.pull-quote-text em { color: var(--accent); }

.pull-quote-attr {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Reflection questions ────────────────────────────────────── */
.questions {
  padding: 90px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.questions-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 40px;
}

.questions-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.question {
  font-family: var(--sans);
  font-size: clamp(15px, 1.4vw, 17px);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.question:last-child { border-bottom: none; }

/* ── TLDR numbered steps ─────────────────────────────────────── */
.tldr-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  counter-reset: step;
}
.tldr-steps li {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--sans);
  font-size: clamp(15px, 1.4vw, 17px);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
  counter-increment: step;
}
.tldr-steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--accent);
  min-width: 22px;
  flex-shrink: 0;
  opacity: 0.6;
}

.tldr-repeat {
  font-family: var(--sans);
  font-size: clamp(13px, 1.15vw, 14px);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.75;
  margin: 28px 0 32px;
}

.tldr-note {
  font-family: var(--sans);
  font-size: clamp(13px, 1.2vw, 15px);
  line-height: 1.9;
  color: var(--muted);
  border-left: 1px solid var(--border);
  padding-left: 20px;
  margin: 14px 0 18px 42px;
}

/* ── Posture sub-list (floor seating options) ────────────────── */
.posture-sub {
  padding-left: 28px;
  border-left: 1px solid var(--border);
  margin: 6px 0 10px;
}
.posture-sub p + p { margin-top: 0.85em; }

/* ── Scroll reveal ───────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Next navigation ─────────────────────────────────────────── */
.next-book {
  padding: 90px 0 0;
  display: flex;
  justify-content: flex-end;
}

.next-link {
  text-align: right;
  text-decoration: none;
  transition: opacity 0.3s;
}
.next-link:hover { opacity: 0.7; }

.next-link-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.next-link-title {
  font-family: var(--sans);
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 400;
  color: var(--text);
}
.next-link-title::after { content: ' →'; color: var(--accent); }

/* ── Era timeline ────────────────────────────────────────────── */
.era-timeline {
  padding-top: 48px;
  padding-bottom: 0;
}

.era-timeline-context {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.era-timeline-module {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.era-timeline-date {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.era-timeline-bar {
  position: relative;
  height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: visible;
  margin-bottom: 8px;
}

.era-timeline-fill {
  position: absolute; left: 0; top: 0; height: 100%;
  background: linear-gradient(to right, var(--accent2), var(--accent));
  border-radius: 2px;
}

.era-timeline-era-dot {
  position: absolute; top: 50%;
  transform: translate(-50%, -50%);
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--muted);
  opacity: 0.25;
}
.era-timeline-era-dot.live    { background: var(--accent); opacity: 0.5; }
.era-timeline-era-dot.current { opacity: 0; }

.era-timeline-dot {
  position: absolute; top: 50%;
  transform: translate(-50%, -50%);
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent);
}

.era-timeline-label {
  position: absolute;
  top: 12px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--accent);
  white-space: nowrap;
  transform: translateX(-50%);
}

.era-timeline-ends {
  display: flex;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: 10px;
  color: var(--muted);
  opacity: 0.6;
  margin-top: 28px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}

/* ── Vertical border lines ───────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  top: 0; bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(var(--content-max), 100%);
  border-left:  1px solid var(--border);
  border-right: 1px solid var(--border);
  pointer-events: none;
  z-index: 85;
}

/* ── Footer ──────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px var(--pad);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.footer-quote {
  font-family: var(--sans);
  font-size: clamp(14px, 1.3vw, 16px);
  font-weight: 400;
  color: var(--muted);
}

.footer-updated {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.4;
}

.gs-section-title {
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 300;
  color: var(--text);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --pad: 24px; }
  .book-title { font-size: clamp(52px, 14vw, 80px); }
}
