:root {
  --ink: #181713;
  --muted: #666256;
  --paper: #fbf7ee;
  --panel: #fffdf7;
  --line: #ded4bf;
  --gold: #c4862a;
  --green: #2f6b56;
  --red: #b64d3b;
  --shadow: 0 18px 60px rgba(28, 24, 17, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 54px);
  background: rgba(251, 247, 238, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  aspect-ratio: 1;
  place-items: center;
  color: #fffdf8;
  background: var(--ink);
  border: 3px solid var(--gold);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.topnav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.topnav a {
  text-decoration: none;
}

.hero {
  min-height: calc(100vh - 70px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(290px, 0.9fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  padding: clamp(54px, 8vw, 108px) clamp(18px, 6vw, 88px) 42px;
  background:
    linear-gradient(90deg, rgba(24, 23, 19, 0.88), rgba(24, 23, 19, 0.42)),
    repeating-linear-gradient(110deg, #2d2a22 0 2px, #201f1a 2px 16px);
  color: #fffdf7;
}

.hero-copy {
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 780px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 7.4rem;
  line-height: 0.88;
  letter-spacing: 0;
}

.subtitle {
  max-width: 620px;
  margin: 26px 0 0;
  color: rgba(255, 253, 247, 0.84);
  font-size: 1.3rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  color: var(--ink);
  background: #fffdf7;
  border: 2px solid #fffdf7;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--gold);
  border-color: var(--gold);
}

.signal-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-self: end;
  max-width: 520px;
}

.signal-board span {
  min-height: 94px;
  display: flex;
  align-items: end;
  padding: 16px;
  background: rgba(255, 253, 247, 0.1);
  border: 1px solid rgba(255, 253, 247, 0.24);
  border-radius: var(--radius);
  color: rgba(255, 253, 247, 0.86);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
}

.dashboard,
.notes,
.reader-shell {
  width: min(1440px, calc(100% - 36px));
  margin-inline: auto;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 28px 0;
}

.dashboard article,
.note-grid article,
.tool-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dashboard article {
  padding: 20px;
}

.metric {
  display: block;
  color: var(--green);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.1rem;
  font-weight: 800;
}

.dashboard p,
.note-grid p,
.reader-tools p {
  margin: 6px 0 0;
  color: var(--muted);
}

.reader-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 24px 0 64px;
}

.reader-tools {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 14px;
}

.tool-block {
  padding: 18px;
}

.tool-block h2,
.notes h2,
.note-grid h3 {
  margin: 0;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
}

input[type="search"] {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
}

.chapter-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 410px;
  overflow: auto;
}

.chapter-list button {
  width: 100%;
  padding: 11px 12px;
  color: var(--ink);
  background: #f6efe1;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.chapter-list button:hover,
.chapter-list button.is-active {
  border-color: var(--green);
  background: #e7f0e8;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  background: #ece1cf;
  border-radius: 999px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
}

.manuscript {
  min-height: 80vh;
  padding: clamp(24px, 5vw, 64px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.manuscript h1,
.manuscript h2 {
  scroll-margin-top: 96px;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

.manuscript h1 {
  margin: 64px 0 20px;
  font-size: 3.6rem;
  line-height: 0.98;
}

.manuscript h1:first-child {
  margin-top: 0;
}

.manuscript h2 {
  margin: 42px 0 18px;
  color: var(--green);
  font-size: 2rem;
}

.manuscript p {
  max-width: 760px;
  margin: 0 0 1.05em;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.22rem;
  line-height: 1.78;
}

.manuscript hr {
  margin: 34px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.highlight {
  background: rgba(196, 134, 42, 0.25);
  border-radius: 4px;
}

.loading {
  color: var(--muted);
}

.notes {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 28px;
  padding: 64px 0 76px;
  border-top: 1px solid var(--line);
}

.notes h2 {
  max-width: 440px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.4rem;
  line-height: 1;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.note-grid article {
  padding: 20px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 6vw, 88px);
  color: #fffdf7;
  background: var(--ink);
}

@media (max-width: 980px) {
  .hero,
  .reader-shell,
  .notes {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .reader-tools {
    position: static;
  }

  .dashboard,
  .note-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 5rem;
  }

  .notes h2 {
    font-size: 2.8rem;
  }
}

@media (max-width: 680px) {
  .topbar,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    width: 100%;
    justify-content: flex-start;
    gap: 14px 22px;
  }

  .signal-board {
    grid-template-columns: 1fr;
  }

  .signal-board span {
    min-height: 68px;
  }

  .manuscript {
    padding: 22px 18px;
  }

  .hero h1 {
    font-size: 3.35rem;
    line-height: 0.95;
  }

  .subtitle {
    font-size: 1.08rem;
  }

  .manuscript h1 {
    font-size: 2.15rem;
  }

  .manuscript h2 {
    font-size: 1.45rem;
  }

  .manuscript p {
    font-size: 1.08rem;
  }

  .notes h2 {
    font-size: 2.25rem;
  }
}
