:root {
  --bg: #f7f3ea;
  --ink: #1f1b16;
  --muted: #6f675d;
  --line: #d8cdbf;
  --panel: rgba(255, 251, 245, 0.88);
  --panel-strong: #fffdfa;
  --accent: #8d4d2f;
  --accent-soft: #f2e2d6;
  --shadow: 0 18px 48px rgba(59, 33, 10, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(186, 120, 74, 0.12), transparent 30%),
    linear-gradient(180deg, #fbf7f1 0%, var(--bg) 100%);
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.site-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 18px 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  margin-bottom: 18px;
}

.hero-copy {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.eyebrow,
.section-kicker,
.chart-label,
.metric-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-size: 0.78rem;
}

h1 {
  margin: 12px 0;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
}

h2 {
  margin: 6px 0 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.lede,
.section-note,
.prose p,
.timeline-card p,
.glossary-card p,
.discovery-card p {
  color: var(--muted);
  line-height: 1.6;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  align-items: center;
}

.pill,
.language-toggle button,
.prompt-actions button,
.prompt-row button,
.prompt-card-actions button,
.site-nav a {
  border-radius: 999px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(141, 77, 47, 0.14);
}

.stamp {
  color: var(--muted);
  font-size: 0.92rem;
}

.language-toggle {
  display: inline-flex;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px;
  box-shadow: var(--shadow);
}

.language-toggle button,
.prompt-actions button,
.prompt-row button,
.prompt-card-actions button {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  padding: 10px 14px;
}

.language-toggle button.active {
  background: var(--accent);
  color: #fff7f0;
  border-color: var(--accent);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.site-nav a {
  text-decoration: none;
  background: rgba(255, 251, 245, 0.7);
  border: 1px solid var(--line);
  padding: 9px 14px;
}

.stack {
  display: grid;
  gap: 18px;
}

.panel,
.subpanel,
.discovery-card,
.timeline-card,
.chart-card,
.glossary-card,
.metric,
.essentials-card,
.run-item {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.panel {
  border-radius: 28px;
  padding: 24px;
}

.subpanel,
.discovery-card,
.timeline-card,
.chart-card,
.glossary-card,
.metric,
.essentials-card,
.run-item {
  border-radius: 22px;
  padding: 18px;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.section-head.secondary {
  grid-template-columns: 1fr;
  margin-top: 24px;
}

.metrics,
.discovery-grid,
.timeline-grid,
.chart-grid,
.glossary-grid,
.essentials-grid,
.run-history {
  display: grid;
  gap: 14px;
}

.metrics {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 18px;
}

.metric-value {
  margin-top: 10px;
  font-size: 2rem;
  line-height: 1;
}

.two-col {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
}

.story-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(216, 205, 191, 0.8);
}

.secondary-block {
  margin-top: 16px;
}

.essentials-grid {
  grid-template-columns: 1fr;
}

.essentials-card p,
.run-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.run-history {
  gap: 12px;
}

.run-item {
  padding: 0;
  overflow: hidden;
}

.run-item-important {
  border-color: rgba(141, 77, 47, 0.4);
  background: linear-gradient(180deg, rgba(242, 226, 214, 0.65), var(--panel) 42%);
}

.run-summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  cursor: pointer;
  list-style: none;
  padding: 18px;
}

.run-summary::-webkit-details-marker {
  display: none;
}

.run-summary-main {
  min-width: 0;
}

.run-summary-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.run-takeaway {
  margin-top: 10px;
}

.run-toggle-text {
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
}

.run-close-label {
  display: none;
}

.run-item[open] .run-open-label {
  display: none;
}

.run-item[open] .run-close-label {
  display: inline;
}

.importance-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff7f0;
  font-weight: 700;
  line-height: 1;
}

.run-details {
  padding: 0 18px 18px;
  border-top: 1px solid rgba(216, 205, 191, 0.8);
}

.detail-block {
  padding-top: 16px;
}

.detail-block + .detail-block {
  margin-top: 2px;
}

.detail-label {
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-size: 0.76rem;
}

.mini-list,
.question-list {
  margin: 0;
  padding-left: 18px;
}

.mini-list li,
.question-list li {
  margin: 8px 0;
  color: var(--muted);
}

.mini-list strong {
  display: block;
  color: var(--ink);
}

.discovery-grid,
.glossary-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.timeline-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.92rem;
}

.chart-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.chart-card {
  color: var(--accent);
}

.chart-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.chart-value {
  margin-top: 8px;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ink);
}

.chart-svg {
  width: 100%;
  height: 120px;
  margin-top: 12px;
  display: block;
}

.prompt-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.prompt-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.prompt-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.prompt-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.prompt-status {
  min-height: 1.3em;
  margin-top: 14px;
  color: var(--muted);
}

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

@media (max-width: 860px) {
  .hero,
  .section-head,
  .two-col {
    grid-template-columns: 1fr;
  }

  .prompt-card-actions button {
    flex: 1 1 100%;
  }
}
