:root {
  --ink: #0b1728;
  --paper: #f5f1e8;
  --muted: #758093;
  --line: rgba(11, 23, 40, 0.14);
  --coral: #ff6b5e;
  --aqua: #55d8cf;
  --yellow: #ffd166;
  --violet: #a88cff;
  color-scheme: light;
  font-family: "Yu Gothic UI", "Yu Gothic", "Hiragino Sans", system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.noscript { padding: 1rem; background: #fff3cd; color: #5f4900; }

/* Entry */
.home-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 32rem);
  grid-template-rows: auto 1fr;
  padding: clamp(1.25rem, 3vw, 3rem);
  background:
    radial-gradient(circle at 86% 14%, rgba(85, 216, 207, .35), transparent 24rem),
    linear-gradient(135deg, #f8f4eb 0%, #eee8dc 100%);
}
.home-nav {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  font-size: .82rem;
  letter-spacing: .08em;
}
.brand-mark { font-weight: 800; }
.hero { align-self: center; max-width: 70rem; padding: 5vh 5vw 5vh 0; }
.hero-kicker, .slide-eyebrow, .chapter-kicker {
  margin: 0 0 1rem;
  color: #df4d43;
  font-weight: 800;
  font-size: .78rem;
  letter-spacing: .16em;
}
.hero h1 {
  margin: 0;
  max-width: 13ch;
  font-size: clamp(3rem, 7vw, 7.8rem);
  line-height: .99;
  letter-spacing: -.055em;
}
.hero-subtitle {
  max-width: 44rem;
  margin: 2rem 0;
  color: #465163;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  line-height: 1.7;
}
.mode-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.action {
  min-width: 13rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--ink);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}
.action:hover, .action:focus-visible { transform: translate(-3px, -3px); box-shadow: 5px 5px 0 var(--ink); }
.action-primary { color: white; background: var(--ink); }
.action small { font-size: .62rem; letter-spacing: .12em; opacity: .65; }
.hero-note {
  align-self: end;
  margin: 2rem 0;
  padding: clamp(1.5rem, 3vw, 3rem);
  background: var(--yellow);
  transform: rotate(1.5deg);
  box-shadow: 12px 14px 0 rgba(11, 23, 40, .12);
}
.hero-note span { display: block; margin-bottom: 1rem; font-size: .75rem; font-weight: 800; letter-spacing: .14em; }
.hero-note strong { font-size: clamp(1.2rem, 2.2vw, 2rem); line-height: 1.5; }

/* Live */
body[data-mode="live"] { overflow: hidden; background: var(--ink); }
.live-shell {
  --accent: var(--coral);
  width: 100vw;
  height: 100vh;
  min-height: 35rem;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(1.25rem, 3vw, 3rem);
  overflow: hidden;
  color: #f8f4eb;
  background:
    linear-gradient(115deg, rgba(255,255,255,.04), transparent 45%),
    var(--ink);
}
.accent-coral { --accent: var(--coral); }
.accent-aqua { --accent: var(--aqua); }
.accent-yellow { --accent: var(--yellow); }
.accent-violet { --accent: var(--violet); }
.live-shell::before {
  content: "";
  position: absolute;
  width: 36vw;
  aspect-ratio: 1;
  top: -20vw;
  right: -9vw;
  border: 8vw solid var(--accent);
  border-radius: 50%;
  opacity: .9;
}
.live-header, .live-footer { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; }
.live-header { font-size: clamp(.72rem, 1vw, 1rem); letter-spacing: .12em; }
.live-brand { text-decoration: none; font-weight: 800; }
.slide-stage { position: relative; z-index: 1; align-self: center; max-width: 90vw; }
.slide-eyebrow { color: var(--accent); font-size: clamp(.75rem, 1.2vw, 1.15rem); }
.slide-stage h1 { margin: 0; font-size: clamp(3.4rem, 8.2vw, 9.5rem); line-height: .98; letter-spacing: -.055em; }
.slide-stage h1 span { display: block; }
.slide-stage h1 span:nth-child(2) { color: var(--accent); }
.watermark {
  position: absolute;
  right: -2vw;
  bottom: -18vh;
  z-index: -1;
  font-size: 38vw;
  line-height: 1;
  font-weight: 900;
  color: rgba(255,255,255,.035);
}
.live-footer { gap: 2rem; }
.progress { flex: 1; height: 3px; background: rgba(255,255,255,.18); }
.progress span { display: block; height: 100%; background: var(--accent); transition: width .2s ease; }
.live-controls { display: flex; gap: .45rem; }
.live-controls button {
  width: 2.6rem; height: 2.6rem; border: 1px solid rgba(255,255,255,.25); border-radius: 50%;
  color: white; background: rgba(255,255,255,.06); cursor: pointer;
}
.live-controls button:hover, .live-controls button:focus-visible { border-color: var(--accent); background: var(--accent); color: var(--ink); }

/* Reader */
body[data-mode="read"] { background: #f8f5ee; }
.reader-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .9rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid var(--line);
  background: rgba(248, 245, 238, .92);
  backdrop-filter: blur(12px);
}
.reader-brand { font-weight: 900; text-decoration: none; }
.reader-header nav { display: flex; gap: 1rem; font-size: .82rem; }
.reader-shell { width: min(72rem, calc(100% - 2rem)); margin: 0 auto; }
.reader-hero { padding: clamp(4rem, 12vw, 10rem) 0 clamp(3rem, 8vw, 7rem); border-bottom: 1px solid var(--line); }
.reader-hero > p:first-child { font-size: .8rem; letter-spacing: .12em; font-weight: 800; color: #df4d43; }
.reader-hero h1 { margin: 1rem 0; max-width: 13ch; font-size: clamp(2.7rem, 8vw, 6.5rem); line-height: 1; letter-spacing: -.05em; }
.reader-hero > p:last-child { max-width: 45rem; color: #515c6d; font-size: clamp(1rem, 2vw, 1.35rem); line-height: 1.8; }
.reader-toc { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 2rem 0 5rem; background: var(--line); border: 1px solid var(--line); }
.reader-toc a { display: flex; gap: 1rem; padding: 1rem; background: #f8f5ee; text-decoration: none; }
.reader-toc a:hover { background: white; }
.reader-toc span { color: #df4d43; font-size: .75rem; font-weight: 900; }
.reader-chapter { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: clamp(1rem, 4vw, 4rem); padding: 5rem 0; border-top: 1px solid var(--line); scroll-margin-top: 4rem; }
.chapter-number { color: #df4d43; font-size: 1rem; font-weight: 900; }
.chapter-copy { max-width: 48rem; }
.chapter-copy h2 { margin: 0 0 1.4rem; font-size: clamp(2rem, 5vw, 4.3rem); line-height: 1.08; letter-spacing: -.035em; }
.chapter-summary { font-size: clamp(1rem, 1.8vw, 1.25rem); line-height: 1.95; color: #3e495a; }
.chapter-copy ul { margin: 2rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.chapter-copy li { padding: 1rem .25rem; border-bottom: 1px solid var(--line); line-height: 1.7; }
.chapter-copy li::before { content: "→"; margin-right: .8rem; color: #df4d43; font-weight: 900; }
.fact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin-top: 2rem; background: var(--line); border: 1px solid var(--line); }
.fact-grid div { display: flex; flex-direction: column; gap: .25rem; padding: 1.4rem; background: white; }
.fact-grid strong { font-size: clamp(1.5rem, 4vw, 2.8rem); }
.fact-grid span { color: var(--muted); font-size: .8rem; }
.reader-footer { padding: 3rem 1rem; text-align: center; color: var(--muted); font-size: .75rem; border-top: 1px solid var(--line); }

.schedule-band {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  margin: 2rem 0;
  border: 1px solid var(--line);
  background: var(--line);
}
.schedule-band div { min-height: 7rem; display: flex; flex-direction: column; justify-content: space-between; padding: 1rem; background: white; }
.schedule-band time { color: #df4d43; font-size: .75rem; font-weight: 900; }
.schedule-band span { font-size: .82rem; line-height: 1.5; }
.flow-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-top: 2rem; }
.flow-strip div { position: relative; min-height: 8rem; padding: 1.25rem; border: 1px solid var(--line); background: white; }
.flow-strip div:not(:last-child)::after { content: "→"; position: absolute; right: -.75rem; top: 45%; z-index: 2; color: #df4d43; font-weight: 900; }
.flow-strip span { display: block; margin-bottom: 1.6rem; color: #df4d43; font-size: .68rem; font-weight: 900; }
.flow-strip strong { line-height: 1.6; }
.mapping-grid, .ladder-grid, .stage-grid { margin-top: 2rem; border-top: 1px solid var(--line); }
.mapping-row { display: grid; grid-template-columns: minmax(9rem, .8fr) minmax(0, 1.7fr); gap: 1.5rem; padding: 1.15rem .25rem; border-bottom: 1px solid var(--line); }
.mapping-row strong { color: #df4d43; }
.mapping-row span { line-height: 1.7; }
.ladder-grid .mapping-row strong::before { content: "→ "; }
.question-list { margin: 2rem 0 0; padding: 0; list-style: none; counter-reset: question; }
.question-list li { counter-increment: question; padding: 1.25rem 0; border-bottom: 1px solid var(--line); font-size: clamp(1.1rem, 2vw, 1.45rem); line-height: 1.6; }
.question-list li::before { content: "Q" counter(question); display: inline-block; width: 3rem; color: #df4d43; font-size: .72rem; font-weight: 900; vertical-align: .25rem; }
.purpose-cloud { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 2rem; }
.purpose-cloud span { padding: .8rem 1rem; border-radius: 999px; background: var(--ink); color: white; font-size: .9rem; }
.proposal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 2rem; }
.proposal-grid article { min-height: 15rem; padding: 1.5rem; border: 1px solid var(--line); background: white; }
.proposal-grid article > span { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--yellow); font-weight: 900; }
.proposal-grid h3 { margin: 2rem 0 .75rem; font-size: 1.4rem; }
.proposal-grid p { margin: 0; color: #4d5869; line-height: 1.8; }
.voices-link { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 2rem; padding: 1.25rem 1.4rem; border: 1px solid var(--ink); background: var(--ink); color: white; text-decoration: none; }
.voices-link span { font-size: 1.05rem; font-weight: 900; }
.voices-link small { color: var(--yellow); font-weight: 800; }
.voices-link:hover, .voices-link:focus-visible { outline: 4px solid var(--aqua); outline-offset: 2px; }
.chapter-callout { margin-top: 2.5rem; padding: 1.5rem; border-left: .35rem solid var(--coral); background: #fff0eb; font-weight: 700; line-height: 1.8; }
.paper-workshop { margin: 2rem 0 0; padding: 0; list-style: none; counter-reset: paper-question; }
.paper-workshop li { counter-increment: paper-question; padding: 1.25rem 0; border-top: 1px solid var(--line); font-size: clamp(1.05rem, 2vw, 1.35rem); line-height: 1.6; }
.paper-workshop li::before { content: counter(paper-question, decimal-leading-zero); display: inline-block; width: 3rem; color: #df4d43; font-size: .72rem; font-weight: 900; vertical-align: .15rem; }
.feedback-panel { margin-top: 3rem; padding: clamp(1.4rem, 4vw, 2.5rem); border: 1px solid var(--line); background: white; }
.feedback-kicker { margin: 0 0 .5rem !important; color: #df4d43 !important; font-size: .72rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.feedback-panel h3 { margin: 0; font-size: clamp(1.5rem, 4vw, 2.4rem); line-height: 1.3; }
.feedback-panel > p:not(.feedback-kicker) { color: #596476; line-height: 1.7; }
.feedback-form { display: grid; gap: 1.25rem; margin-top: 1.5rem; }
.feedback-form label { position: relative; display: grid; gap: .55rem; }
.feedback-form label > strong { line-height: 1.5; }
.feedback-form textarea { width: 100%; padding: 1rem 1rem 1.5rem; resize: vertical; border: 1px solid var(--line); border-radius: .35rem; background: #fbfcfe; color: var(--ink); font: inherit; line-height: 1.7; }
.feedback-form textarea:focus { outline: 3px solid rgba(85, 216, 207, .45); border-color: #198c85; }
.feedback-form small { position: absolute; right: .7rem; bottom: .45rem; color: #718096; font-size: .72rem; }
.feedback-trap { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.feedback-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.feedback-actions button { padding: .9rem 1.2rem; border: 1px solid var(--ink); background: var(--ink); color: white; font: inherit; font-weight: 800; cursor: pointer; }
.feedback-actions button:disabled { cursor: wait; opacity: .55; }
.feedback-actions span { color: #198c85; font-size: .88rem; font-weight: 800; }
.step-line { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 2rem; background: var(--line); border: 1px solid var(--line); }
.step-line div { min-height: 8rem; display: flex; flex-direction: column; justify-content: space-between; padding: 1rem; background: white; }
.step-line span { color: #df4d43; font-size: .7rem; font-weight: 900; }
.step-line strong { font-size: 1.15rem; }
.sources-section { padding: 6rem 0; border-top: 1px solid var(--line); scroll-margin-top: 4rem; }
.sources-section > h2 { margin: 0; font-size: clamp(2.5rem, 6vw, 5rem); letter-spacing: -.045em; }
.sources-section > p { max-width: 48rem; color: #4d5869; line-height: 1.8; }
.sources-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 2rem; }
.source-card { display: flex; flex-direction: column; min-height: 13rem; padding: 1.4rem; border: 1px solid var(--line); background: white; text-decoration: none; }
.source-card:hover, .source-card:focus-visible { outline: 3px solid var(--aqua); }
.source-card > span { color: #df4d43; font-size: .68rem; font-weight: 900; letter-spacing: .1em; }
.source-card strong { margin: 1.4rem 0 .6rem; font-size: 1.12rem; line-height: 1.5; }
.source-card p { margin: 0; color: #596476; font-size: .88rem; line-height: 1.7; }

/* Presenter */
body[data-mode="presenter"] { background: #111827; color: white; }
.presenter-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; padding: 1.5rem; }
.presenter-shell header { display: flex; justify-content: space-between; padding-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,.18); }
.presenter-shell header a { color: white; text-decoration: none; font-weight: 900; }
.presenter-grid { display: grid; grid-template-columns: 1.5fr 1fr; grid-template-rows: 1fr auto; gap: 1rem; padding: 1rem 0; }
.presenter-current, .presenter-next, .presenter-grid aside { padding: 1.5rem; border-radius: .5rem; background: #1d293b; }
.presenter-current h1 { font-size: clamp(2rem, 5vw, 5rem); line-height: 1.08; }
.presenter-next h2 { color: #b7c2d4; font-size: clamp(1.3rem, 3vw, 2.5rem); line-height: 1.3; }
.presenter-grid aside { grid-column: 1 / -1; }
.presenter-grid small { color: var(--aqua); font-weight: 900; letter-spacing: .1em; }
.presenter-grid aside p { line-height: 1.7; }
.presenter-grid aside a { color: var(--aqua); }
.presenter-shell footer { display: flex; justify-content: flex-end; gap: .7rem; }
.presenter-shell button { padding: .8rem 1.2rem; border: 1px solid #60708a; background: #1d293b; color: white; cursor: pointer; }

@media (max-width: 760px) {
  .home-shell { grid-template-columns: 1fr; }
  .hero { padding-right: 0; }
  .hero-note { align-self: auto; }
  .mode-actions, .action { width: 100%; }
  .live-shell { min-height: 0; }
  .slide-stage h1 { font-size: clamp(2.7rem, 12vw, 5.5rem); }
  .reader-header nav a:first-child { display: none; }
  .reader-toc { grid-template-columns: 1fr; }
  .reader-chapter { grid-template-columns: 1fr; gap: .5rem; padding: 3.5rem 0; }
  .fact-grid { grid-template-columns: 1fr 1fr; }
  .schedule-band { grid-template-columns: repeat(2, 1fr); }
  .flow-strip, .proposal-grid, .sources-grid { grid-template-columns: 1fr; }
  .mapping-row { grid-template-columns: 1fr; gap: .35rem; }
  .step-line { grid-template-columns: repeat(2, 1fr); }
  .presenter-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
  @page { size: A4 portrait; margin: 12mm 14mm; }
  html, body { min-height: 0; background: white !important; font-size: 9pt; }
  .reader-header, .reader-toc, .feedback-actions { display: none !important; }
  .reader-shell { width: 100%; margin: 0; }
  .reader-hero { padding: 10mm 0 8mm; }
  .reader-hero h1 { max-width: 15ch; font-size: 38pt; }
  .reader-hero > p:last-child { font-size: 10.5pt; line-height: 1.55; }
  .schedule-band { grid-template-columns: repeat(6, 1fr) !important; margin: 5mm 0 0; }
  .schedule-band div { min-height: 24mm; padding: 3mm; }
  .schedule-band span { font-size: 7pt; }
  .reader-chapter { display: block !important; padding: 8mm 0 0; border-top: 1px solid var(--line); break-before: page; }
  .chapter-number { margin-bottom: 2mm; }
  .chapter-copy { max-width: none; }
  .chapter-kicker { margin-bottom: 2mm; font-size: 7pt; }
  .chapter-copy h2 { margin-bottom: 4mm; font-size: 25pt; }
  .chapter-summary { margin: 0 0 4mm; font-size: 9.5pt; line-height: 1.65; }
  .reader-list { margin-top: 4mm !important; }
  .chapter-copy li { padding: 2.8mm 1mm; line-height: 1.45; }
  .fact-grid { grid-template-columns: repeat(4, 1fr) !important; margin-top: 4mm; }
  .fact-grid div { padding: 4mm; }
  .fact-grid strong { font-size: 19pt; }
  .flow-strip { grid-template-columns: repeat(3, 1fr) !important; gap: 2mm; margin-top: 4mm; }
  .flow-strip div { min-height: 25mm; padding: 3mm; }
  .flow-strip span { margin-bottom: 4mm; }
  .mapping-grid, .ladder-grid, .stage-grid { margin-top: 4mm; }
  .mapping-row { grid-template-columns: 1fr 2fr !important; gap: 4mm; padding: 3mm 1mm; }
  .question-list { margin-top: 3mm; }
  .question-list li { padding: 3mm 0; font-size: 10.5pt; }
  .purpose-cloud { margin-top: 4mm; gap: 2mm; }
  .purpose-cloud span { padding: 2.5mm 3mm; font-size: 8pt; }
  .proposal-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 3mm; margin-top: 4mm; }
  .proposal-grid article { min-height: 48mm; padding: 4mm; break-inside: avoid; }
  .proposal-grid h3 { margin: 5mm 0 2mm; font-size: 12pt; }
  .proposal-grid p { font-size: 8pt; line-height: 1.55; }
  .chapter-callout { margin-top: 5mm; padding: 4mm; font-size: 9pt; line-height: 1.55; break-inside: avoid; }
  .paper-workshop { margin-top: 3mm; }
  .paper-workshop li { padding: 3mm 0; font-size: 9pt; }
  .feedback-panel { margin-top: 5mm; padding: 4mm; break-inside: avoid; }
  .feedback-form textarea { height: 16mm; padding: 2.5mm; }
  .step-line { grid-template-columns: repeat(4, 1fr) !important; margin-top: 4mm; }
  .step-line div { min-height: 25mm; padding: 3mm; }
  .sources-section { padding: 8mm 0 0; break-before: page; }
  .sources-section > h2 { font-size: 28pt; }
  .sources-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 3mm; margin-top: 4mm; }
  .source-card { min-height: 36mm; padding: 4mm; break-inside: avoid; }
  .source-card strong { margin: 3mm 0 1.5mm; font-size: 9.5pt; }
  .source-card p { font-size: 7.5pt; line-height: 1.5; }
  .reader-footer { padding: 6mm 0 0; }
}
