:root {
  --bg: #f5f1ea;
  --surface: #fffaf2;
  --surface-strong: #ffffff;
  --ink: #171513;
  --muted: #6d655d;
  --line: #ded5c8;
  --green: #1e6f5c;
  --green-dark: #12483c;
  --coral: #d96c4a;
  --gold: #b8842c;
  --blue: #315f8f;
  --shadow: 0 18px 60px rgba(55, 45, 35, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(30, 111, 92, 0.08), transparent 36%),
    linear-gradient(315deg, rgba(217, 108, 74, 0.08), transparent 42%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 250, 242, 0.78);
  backdrop-filter: blur(18px);
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  font-weight: 800;
}

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

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.quick-links {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.quick-links a {
  display: flex;
  min-height: 38px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
}

.quick-links a:hover {
  background: var(--surface-strong);
}

.nav-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  border-color: var(--line);
  background: var(--surface-strong);
  color: var(--ink);
}

.nav-index {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: #ece3d5;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
}

.nav-title {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-subtitle {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-panel {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.side-panel h2 {
  margin: 8px 0;
  font-size: 18px;
}

.side-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.page {
  padding: 32px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 24px;
  align-items: stretch;
  min-height: 560px;
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.92), rgba(255, 255, 255, 0.84)),
    url("data:image/svg+xml,%3Csvg width='760' height='520' viewBox='0 0 760 520' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%231e6f5c' stroke-opacity='.18'%3E%3Cpath d='M42 402 C135 310 156 358 240 267 C324 176 396 214 463 123 C530 32 614 72 718 34' stroke-width='3'/%3E%3Cpath d='M62 454 C154 382 201 409 278 326 C355 243 430 267 514 184 C598 101 636 136 724 86' stroke-width='2'/%3E%3Cpath d='M96 84 L202 142 L308 104 L418 172 L538 122 L668 196'/%3E%3Cpath d='M126 238 L232 205 L338 282 L454 247 L562 318 L688 274'/%3E%3C/g%3E%3Cg fill='%23d96c4a' fill-opacity='.5'%3E%3Ccircle cx='202' cy='142' r='7'/%3E%3Ccircle cx='418' cy='172' r='7'/%3E%3Ccircle cx='562' cy='318' r='7'/%3E%3C/g%3E%3Cg fill='%231e6f5c' fill-opacity='.58'%3E%3Ccircle cx='240' cy='267' r='6'/%3E%3Ccircle cx='463' cy='123' r='6'/%3E%3Ccircle cx='668' cy='196' r='6'/%3E%3C/g%3E%3C/svg%3E");
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 780px;
}

.eyebrow {
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin: 12px 0 18px;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.55;
}

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

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  background: var(--green);
  color: #fff;
}

.secondary-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.hero-card {
  align-self: end;
  padding: 22px;
  border: 1px solid rgba(23, 21, 19, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 34px rgba(55, 45, 35, 0.1);
}

.formula-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.formula-stack span,
.launch-list span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7efe4;
  font-size: 13px;
  font-weight: 750;
}

.formula-result {
  display: block;
  color: var(--green-dark);
  font-size: 30px;
}

.overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.overview article,
.territory-card,
.script-card,
.notes-card,
.launch-copy,
.launch-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.overview article {
  padding: 20px;
}

.metric {
  display: block;
  margin-bottom: 8px;
  color: var(--coral);
  font-size: 34px;
  font-weight: 850;
}

.overview p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.route-map,
.stock-section,
.reveal-section,
.reader-section,
.launch-plan {
  margin-top: 44px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.section-heading h2,
.reader-header h2 {
  margin: 6px 0 0;
  font-size: 34px;
  line-height: 1.1;
}

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

.territory-card {
  display: flex;
  flex-direction: column;
  min-height: 188px;
  padding: 18px;
  cursor: pointer;
}

.territory-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(55, 45, 35, 0.1);
}

.territory-card.active {
  border-color: rgba(30, 111, 92, 0.5);
  box-shadow: inset 0 0 0 1px rgba(30, 111, 92, 0.25), 0 14px 36px rgba(30, 111, 92, 0.13);
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 18px;
}

.card-index {
  color: var(--green);
  font-weight: 850;
}

.card-fragment {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.territory-card h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.territory-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

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

.stock-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.stock-card h3 {
  margin: 6px 0 12px;
  font-size: 20px;
}

.stock-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.query-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.query-list span {
  padding: 7px 9px;
  border-radius: 8px;
  background: #eef4ef;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 750;
}

.reveal-timeline {
  display: grid;
  gap: 12px;
}

.reveal-intro {
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid rgba(30, 111, 92, 0.24);
  border-radius: 8px;
  background: #eef4ef;
  color: var(--green-dark);
  font-size: 17px;
  font-weight: 750;
  line-height: 1.5;
}

.reveal-step {
  display: grid;
  grid-template-columns: 56px minmax(0, 0.9fr) minmax(220px, 0.55fr);
  gap: 16px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.reveal-number {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--green-dark);
  color: #fff;
  font-weight: 850;
}

.reveal-step h3 {
  margin: 2px 0 8px;
  font-size: 21px;
}

.reveal-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.reveal-cta {
  justify-self: end;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff4eb;
  color: var(--coral);
  font-size: 13px;
  font-weight: 850;
}

.reader-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.reader-controls {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 28px;
  cursor: pointer;
}

.reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.script-card {
  padding: 28px;
}

.script-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  color: var(--muted);
  font-weight: 750;
}

.script-meta strong {
  color: var(--green-dark);
}

.question {
  margin: 0 0 24px;
  padding: 18px;
  border-left: 4px solid var(--coral);
  border-radius: 8px;
  background: #fff4eb;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 780;
}

.script-text {
  max-width: 820px;
}

.script-text p {
  margin: 0 0 18px;
  font-size: 20px;
  line-height: 1.68;
}

.script-text p.key-line {
  margin: 30px 0;
  color: var(--green-dark);
  font-size: 28px;
  font-weight: 850;
  line-height: 1.22;
}

.notes-card {
  position: sticky;
  top: 24px;
  padding: 20px;
}

.note-block + .note-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.note-block p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-line;
}

.button-preview {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff !important;
  font-weight: 800;
}

.launch-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
}

.launch-copy {
  padding: 24px;
}

.launch-copy p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.launch-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: center;
  padding: 24px;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .side-panel {
    display: none;
  }

  .hero,
  .reader-layout,
  .reveal-step,
  .launch-layout {
    grid-template-columns: 1fr;
  }

  .reveal-cta {
    justify-self: start;
  }

  .territory-grid,
  .stock-grid,
  .overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notes-card {
    position: static;
  }
}

@media (max-width: 640px) {
  .page,
  .sidebar {
    padding: 16px;
  }

  .hero {
    min-height: auto;
    padding: 24px;
  }

  .hero h1 {
    font-size: 42px;
  }

  .hero p,
  .script-text p {
    font-size: 18px;
  }

  .nav-list,
  .territory-grid,
  .stock-grid,
  .overview {
    grid-template-columns: 1fr;
  }

  .reader-header {
    align-items: start;
    flex-direction: column;
  }

  .question {
    font-size: 19px;
  }
}
