:root {
  --bg: #f6f1e8;
  --paper: rgba(255, 252, 247, 0.86);
  --ink: #181613;
  --muted: #645d54;
  --line: rgba(24, 22, 19, 0.12);
  --accent: #c84d2f;
  --accent-soft: #f2c3a8;
  --card: rgba(255, 248, 240, 0.88);
  --shadow: 0 24px 60px rgba(75, 51, 28, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(200, 77, 47, 0.15), transparent 34%),
    radial-gradient(circle at top right, rgba(74, 95, 78, 0.14), transparent 28%),
    linear-gradient(180deg, #f8f4ec 0%, #f1eadf 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(24, 22, 19, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 22, 19, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 80%);
  pointer-events: none;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.hero,
.section,
.footer {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero {
  padding: 28px;
}

.hero__eyebrow,
.section__label,
.hero__kicker,
.metric__label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
}

.hero__eyebrow,
.section__label,
.metric__label {
  color: var(--muted);
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 20px;
  align-items: stretch;
  margin-top: 18px;
}

.hero__copy h1,
.section__heading h2 {
  margin: 0;
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  line-height: 0.94;
}

.hero__copy h1 {
  font-size: clamp(3.4rem, 7vw, 6.6rem);
  max-width: 10ch;
}

.hero__kicker {
  color: var(--accent);
  margin-bottom: 16px;
}

.hero__lede,
.section__heading p,
.card p,
.source-card p,
.scenario-item,
.plan-card li,
.footer p {
  color: var(--muted);
  line-height: 1.6;
}

.hero__lede {
  max-width: 58ch;
  font-size: 1.05rem;
  margin: 18px 0 0;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button--solid {
  background: var(--ink);
  color: #fff9f2;
}

.button--ghost {
  border: 1px solid var(--line);
  color: var(--ink);
}

.hero__panel {
  display: grid;
  gap: 12px;
}

.metric,
.card,
.source-card,
.scenario-item,
.plan-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
}

.metric {
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 120px;
}

.metric__value {
  font-size: 1.6rem;
  margin-top: 10px;
}

.section {
  margin-top: 22px;
  padding: 26px;
}

.section--tint {
  background:
    linear-gradient(145deg, rgba(255, 246, 237, 0.95), rgba(250, 241, 231, 0.9));
}

.section__heading {
  max-width: 66ch;
  margin-bottom: 22px;
}

.section__heading h2 {
  font-size: clamp(2.2rem, 4vw, 3.7rem);
  margin-top: 8px;
}

.domain-grid,
.module-grid,
.chapter-grid,
.source-grid,
.plan-grid {
  display: grid;
  gap: 16px;
}

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

.domain-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

.source-grid,
.plan-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card,
.chapter-card,
.source-card,
.plan-card {
  padding: 18px;
}

.card__top,
.source-card__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(200, 77, 47, 0.1);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

.card h3,
.chapter-card h3,
.source-card h3,
.plan-card h3 {
  margin: 12px 0 8px;
  font-size: 1.12rem;
}

.chapter-card {
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 249, 242, 0.98), rgba(252, 244, 236, 0.95));
}

.chapter-card__top {
  display: flex;
  justify-content: flex-start;
}

.chapter-card__summary {
  font-size: 1.02rem;
  max-width: 72ch;
}

.chapter-sections {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.chapter-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.44);
}

.chapter-section h4 {
  margin: 0 0 12px;
  font-size: 1.06rem;
}

.chapter-section p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.75;
}

.section-block-label {
  margin: 10px 0 8px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.example-list {
  display: grid;
  gap: 12px;
  margin: 10px 0 14px;
}

.example-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(200, 77, 47, 0.06);
}

.example-card h5 {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.example-card p {
  margin: 0;
}

.snippet-list,
.trap-list {
  display: grid;
  gap: 12px;
  margin: 10px 0 14px;
}

.snippet-card,
.trap-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.snippet-card {
  background: rgba(24, 22, 19, 0.95);
  color: #f7f1e8;
}

.snippet-card h5,
.trap-card h5 {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.snippet-card pre {
  margin: 0;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.trap-card {
  background: rgba(96, 40, 18, 0.08);
}

.trap-card p {
  margin: 0;
}

.citation-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.citation {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(200, 77, 47, 0.08);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

.card ul,
.plan-card ol {
  padding-left: 18px;
  color: var(--ink);
}

.card li,
.plan-card li {
  margin: 8px 0;
}

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

.study-note {
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.52);
}

.study-note__label {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.study-note h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

.study-note p:last-child {
  margin-bottom: 0;
}

.section__heading--compact {
  margin-bottom: 14px;
}

.topic-index {
  margin-bottom: 20px;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.topic-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.5);
}

.topic-card__top {
  display: flex;
  justify-content: flex-start;
}

.topic-card h3 {
  margin: 10px 0 6px;
  font-size: 1rem;
}

.topic-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.topic-card p {
  margin: 0;
  color: var(--muted);
}

.topic-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.topic-jump,
.topic-source {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 700;
}

.topic-jump {
  background: var(--ink);
  color: #fff9f2;
}

.topic-source {
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
}

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

.chapter-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

.filter-chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.filter-chip:hover,
.filter-chip:focus-visible {
  transform: translateY(-1px);
}

.filter-chip.is-active {
  background: var(--ink);
  color: #fff9f2;
}

.source-card a,
.footer__links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.source-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 14px;
}

.source-topic-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  font-size: 0.88rem;
}

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

.scenario-item {
  padding: 18px;
  font-weight: 700;
}

.footer {
  margin-top: 22px;
  padding: 22px 26px;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

[data-animate] {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 500ms ease forwards;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .hero__grid,
  .domain-grid,
  .module-grid,
  .chapter-grid,
  .topic-grid,
  .source-grid,
  .scenario-list,
  .plan-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .hero,
  .section,
  .footer {
    border-radius: 22px;
    padding: 20px;
  }

  .hero__grid,
  .domain-grid,
  .module-grid,
  .chapter-grid,
  .topic-grid,
  .source-grid,
  .scenario-list,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .hero__copy h1 {
    font-size: clamp(2.8rem, 16vw, 4.4rem);
  }
}
