
:root {
  --ink: #17242e;
  --muted: #647078;
  --paper: #f7f4ec;
  --surface: #fffdf8;
  --line: #ded9cc;
  --navy: #183b4c;
  --teal: #197b77;
  --gold: #d99f39;
  --pale-teal: #e8f2ef;
  --shadow: 0 18px 60px rgba(28, 44, 50, 0.09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.75;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(217, 159, 57, 0.55);
  outline-offset: 3px;
}
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.hero { padding-bottom: 82px; }
.topbar { min-height: 88px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: white; font-weight: 800; }
.brand-copy { font-weight: 800; letter-spacing: -0.02em; }
.part-pill, .status-pill { margin-inline-start: auto; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; color: var(--muted); font-size: 0.78rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.65fr); gap: 70px; align-items: end; padding-top: 88px; }
.kicker { margin: 0 0 14px; color: var(--teal); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.09em; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.28; letter-spacing: -0.035em; }
.hero h1 { max-width: 760px; margin-bottom: 26px; font-size: clamp(2.55rem, 5.8vw, 5.25rem); font-weight: 900; }
.hero-lead { max-width: 760px; margin-bottom: 34px; color: var(--muted); font-size: 1.12rem; line-height: 1.95; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; padding: 10px 20px; font-weight: 800; }
.button.primary { background: var(--navy); color: white; }
.button.quiet { border: 1px solid var(--line); background: rgba(255,255,255,0.45); }
.method-card { border-top: 5px solid var(--gold); background: var(--navy); color: white; padding: 34px; box-shadow: var(--shadow); }
.method-number { margin: 0; font-size: 3.1rem; font-weight: 900; line-height: 1; }
.method-label { margin: 10px 0 22px; color: #c7d5d8; }
.method-rule { height: 1px; background: rgba(255,255,255,0.18); margin-bottom: 22px; }
.method-stat { margin-bottom: 8px; font-weight: 700; }
.method-note { margin: 0; color: #c7d5d8; font-size: 0.86rem; }
.section { padding-block: 76px; border-top: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: end; margin-bottom: 34px; }
.section-heading h2, .study-sequence h2 { margin-bottom: 0; font-size: clamp(1.8rem, 3.2vw, 3.2rem); }
.section-heading > p { margin-bottom: 4px; color: var(--muted); }
.segment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.segment-card { position: relative; display: flex; flex-direction: column; min-height: 320px; padding: 30px; border: 1px solid var(--line); background: var(--surface); transition: transform 180ms ease, box-shadow 180ms ease; }
.segment-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-topline, .card-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.segment-index { color: var(--gold); font-size: 2rem; font-weight: 900; line-height: 1; }
.status-pill { margin: 0; }
.status-pill.done { border-color: #9fc5b7; background: var(--pale-teal); color: #17635d; }
.card-time { margin: 26px 0 8px; color: var(--muted); font-size: 0.76rem; }
.segment-card h3 { margin-bottom: 14px; font-size: 1.5rem; }
.segment-card > p:not(.card-time) { color: var(--muted); font-size: 0.9rem; line-height: 1.8; }
.card-footer { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.82rem; }
.card-footer span { color: var(--muted); }
.card-footer a { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; color: var(--teal); font-weight: 800; }
.study-sequence { margin-block: 30px 90px; padding: 48px; background: var(--pale-teal); display: grid; grid-template-columns: 0.7fr 1.3fr; gap: 50px; }
.study-sequence ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; counter-reset: step; }
.study-sequence li { display: grid; grid-template-columns: 44px 1fr; column-gap: 12px; align-items: center; counter-increment: step; }
.study-sequence li::before { content: counter(step, decimal-leading-zero); grid-row: span 2; color: var(--teal); font-weight: 900; }
.study-sequence strong, .study-sequence span { display: block; }
.study-sequence span { color: var(--muted); font-size: 0.82rem; }

.study-header { padding-block: 34px 54px; border-bottom: 1px solid var(--line); }
.study-nav { min-height: 52px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 42px; color: var(--muted); font-size: 0.85rem; }
.study-nav a { min-height: 44px; display: inline-flex; align-items: center; font-weight: 800; color: var(--navy); }
.study-header h1 { max-width: 820px; margin-bottom: 18px; font-size: clamp(2.2rem, 5vw, 4.5rem); }
.study-header > p:last-child { max-width: 830px; margin-bottom: 0; color: var(--muted); font-size: 1.02rem; }
.study-layout { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 46px; align-items: start; padding-block: 44px 90px; }
.study-sidebar { position: sticky; top: 22px; display: grid; gap: 16px; }
.audio-card, .outline-card, .questions-card { border: 1px solid var(--line); background: var(--surface); padding: 24px; }
.audio-title { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.audio-title > span { color: var(--gold); font-size: 1.3rem; }
.audio-title strong, .audio-title small { display: block; }
.audio-title small { color: var(--muted); }
audio { width: 100%; height: 44px; }
.audio-card > p { margin: 14px 0 0; color: var(--muted); font-size: 0.78rem; }
.mini-title { margin-bottom: 14px; font-weight: 900; }
.outline-card ul { margin: 0; padding: 0 20px 0 0; }
.outline-card li { margin-bottom: 10px; color: var(--muted); font-size: 0.82rem; }
.outline-card li::marker { color: var(--gold); }
.complete-button { min-height: 50px; width: 100%; border: 1px solid var(--navy); background: transparent; color: var(--navy); cursor: pointer; font-weight: 800; }
.complete-button.is-complete { background: var(--navy); color: white; }
.reader-column { min-width: 0; }
.reader-toolbar { min-height: 56px; display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 14px; }
.mode-tabs, .font-controls { display: flex; align-items: center; gap: 5px; }
.mode-tabs button, .font-controls button, .speed-controls button { min-width: 44px; min-height: 44px; border: 1px solid var(--line); background: transparent; cursor: pointer; color: var(--ink); }
.mode-tabs button { padding-inline: 16px; }
.mode-tabs button.active { background: var(--navy); border-color: var(--navy); color: white; }
.font-controls span { min-width: 54px; text-align: center; color: var(--muted); font-size: 0.78rem; }
.book-text { --font-scale: 1; padding: clamp(26px, 5vw, 58px); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.source-label { display: flex; justify-content: space-between; margin-bottom: 36px; padding-bottom: 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.76rem; }
.book-text p { margin-bottom: 1.55em; font-family: Georgia, "Times New Roman", Tahoma, serif; font-size: calc(1.08rem * var(--font-scale)); line-height: 2.1; text-align: justify; }
.book-text p:first-of-type::first-letter { color: var(--teal); font-size: 2.8em; font-weight: 900; line-height: 0.85; }
.speed-reader { min-height: 560px; padding: clamp(24px, 4vw, 44px); border: 1px solid var(--line); background: var(--navy); color: white; box-shadow: var(--shadow); }
.speed-settings { display: grid; grid-template-columns: 1.4fr 0.8fr auto; gap: 22px; align-items: end; }
.speed-settings label { color: #d9e4e5; font-size: 0.78rem; }
.speed-settings strong { color: white; }
.speed-settings input { width: 100%; margin-top: 10px; accent-color: var(--gold); }
.speed-settings select { min-height: 44px; width: 100%; margin-top: 7px; border: 1px solid rgba(255,255,255,0.25); background: #214b5c; color: white; padding-inline: 10px; }
.reading-estimate { color: #c4d3d5; font-size: 0.75rem; }
.flash-stage { min-height: 270px; display: grid; place-items: center; text-align: center; padding: 30px 10px; }
.flash-stage span { max-width: 680px; font-size: clamp(2rem, 5.5vw, 4.6rem); font-weight: 900; line-height: 1.45; }
.speed-progress { height: 7px; background: rgba(255,255,255,0.16); overflow: hidden; }
.speed-progress span { display: block; height: 100%; background: var(--gold); transition: width 120ms linear; }
.speed-meta { display: flex; justify-content: space-between; margin-top: 8px; color: #c4d3d5; font-size: 0.7rem; direction: ltr; }
.speed-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; }
.speed-controls button { border-color: rgba(255,255,255,0.25); color: white; padding-inline: 16px; }
.speed-controls .play-button { min-width: 160px; background: var(--gold); border-color: var(--gold); color: #17242e; font-weight: 900; }
.keyboard-hint { margin: 14px 0 0; text-align: center; color: #b9c9cb; font-size: 0.7rem; }
.recall-section { margin-top: 54px; }
.recall-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 20px; }
.recall-heading h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.5rem); }
.save-status { opacity: 0; color: var(--teal); font-size: 0.78rem; transition: opacity 180ms ease; }
.save-status.visible { opacity: 1; }
.notes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.notes-grid label { color: var(--navy); font-size: 0.82rem; font-weight: 800; }
.notes-grid textarea { display: block; width: 100%; min-height: 150px; margin-top: 7px; resize: vertical; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 16px; font-weight: 400; line-height: 1.7; }
.notes-grid textarea:focus { border-color: var(--teal); }
.questions-card { margin-top: 18px; border-right: 5px solid var(--gold); }
.questions-card ol { margin: 0; padding-right: 24px; }
.questions-card li { margin-bottom: 10px; }
.pager { display: flex; justify-content: space-between; gap: 18px; margin-top: 30px; }
.pager a { min-height: 48px; display: inline-flex; align-items: center; padding: 8px 16px; border: 1px solid var(--line); background: var(--surface); font-weight: 800; }
.pager .next-link { background: var(--navy); border-color: var(--navy); color: white; }

@media (max-width: 900px) {
  .hero-grid, .section-heading, .study-sequence, .study-layout { grid-template-columns: 1fr; }
  .hero-grid { gap: 40px; padding-top: 60px; }
  .method-card { max-width: 440px; }
  .study-sidebar { position: static; grid-template-columns: 1fr 1fr; }
  .complete-button { grid-column: 1 / -1; }
}

@media (max-width: 650px) {
  body { font-size: 17px; }
  .shell { width: min(100% - 24px, 1180px); }
  .topbar { min-height: 72px; }
  .brand-copy { font-size: 0.88rem; }
  .part-pill { display: none; }
  .hero { padding-bottom: 52px; }
  .hero-grid { padding-top: 42px; }
  .hero h1 { font-size: 2.6rem; }
  .segment-grid, .study-sequence ol, .notes-grid, .study-sidebar { grid-template-columns: 1fr; }
  .section { padding-block: 54px; }
  .segment-card { min-height: 0; padding: 24px; }
  .study-sequence { padding: 28px 22px; }
  .study-header { padding-block: 22px 38px; }
  .study-nav { margin-bottom: 28px; }
  .study-layout { gap: 30px; padding-block: 28px 60px; }
  .reader-toolbar { align-items: stretch; flex-direction: column; }
  .mode-tabs button { flex: 1; }
  .font-controls { justify-content: flex-end; }
  .book-text { padding: 25px 20px; }
  .book-text p { text-align: right; line-height: 2; }
  .speed-settings { grid-template-columns: 1fr; }
  .flash-stage { min-height: 235px; }
  .recall-heading { align-items: start; flex-direction: column; }
  .pager a { font-size: 0.78rem; }
}

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