:root {
  --bg: #f7f5ef;
  --surface: #ffffff;
  --surface-muted: #eee9dc;
  --text: #1d2327;
  --muted: #617078;
  --line: #ded8ca;
  --gold: #b68a2b;
  --green: #177b63;
  --red: #9b2f36;
  --ink: #11171a;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
  line-height: 1.5;
}

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

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 16px 32px;
  border-bottom: 1px solid rgba(29, 35, 39, 0.12);
  background: rgba(247, 245, 239, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: grid;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.1;
  text-transform: uppercase;
}

.brand strong {
  color: var(--ink);
  font-size: 18px;
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.topbar nav a {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
}

.topbar nav a:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.language-switch {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.54);
}

.topbar nav .language-switch a {
  padding: 8px 10px;
  border: 0;
  border-radius: 0;
}

.topbar nav .language-switch a.is-active {
  background: var(--ink);
  color: white;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 48px;
  min-height: calc(100vh - 140px);
  padding: 72px 32px 48px;
  align-items: center;
}

.hero__content,
.section,
.library-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero h1 {
  max-width: 880px;
  margin-bottom: 24px;
  color: var(--ink);
  font-size: 64px;
  line-height: 1.02;
  letter-spacing: 0;
}

.hero__lead {
  max-width: 760px;
  color: #3b484f;
  font-size: 20px;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 700;
}

.button--primary {
  background: var(--ink);
  color: white;
}

.button--secondary {
  border: 1px solid var(--line);
  background: white;
}

.hero__panel {
  display: grid;
  gap: 18px;
  width: min(460px, 100%);
  justify-self: end;
}

.comparison-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 72px 32px 32px;
  align-items: start;
}

.comparison-hero h1 {
  max-width: 900px;
  margin-bottom: 22px;
  color: var(--ink);
  font-size: 54px;
  line-height: 1.04;
}

.comparison-hero p {
  max-width: 820px;
  color: #3b484f;
  font-size: 18px;
}

.comparison-hero aside,
.quote-panel {
  padding: 24px;
  border: 1px solid #d4b05e;
  border-radius: 8px;
  background: #11171a;
  color: white;
}

.comparison-hero aside strong {
  display: block;
  margin-bottom: 10px;
  color: #f4cb5e;
  font-size: 18px;
}

.comparison-hero aside p,
.quote-panel p {
  margin-bottom: 0;
  color: #efe6c8;
}

.jackpot-meter {
  display: grid;
  gap: 8px;
  padding: 28px;
  border: 1px solid #d4b05e;
  border-radius: 8px;
  background: #11171a;
  color: white;
}

.jackpot-meter span,
.jackpot-meter small {
  color: #d9cda8;
}

.jackpot-meter strong {
  color: #f4cb5e;
  font-size: 54px;
  line-height: 1;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.hero__stats div {
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.hero__stats strong {
  display: block;
  margin-bottom: 8px;
  color: var(--red);
  font-size: 28px;
}

.hero__stats span {
  color: var(--muted);
  font-size: 13px;
}

.section {
  padding: 48px 32px;
}

.section__heading {
  max-width: 760px;
  margin-bottom: 24px;
}

.section__note {
  padding: 14px 16px;
  border-left: 4px solid var(--gold);
  background: var(--surface-muted);
  color: #3b484f;
}

.section h2 {
  font-size: 38px;
  line-height: 1.12;
}

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

.value-grid article,
.document-card,
.doc-group,
.library-intro,
.document-view {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.value-grid article {
  min-height: 260px;
  padding: 22px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.video-grid article {
  display: grid;
  gap: 16px;
  min-height: 260px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.video-grid h3 {
  margin-bottom: 0;
  font-size: 26px;
}

.video-grid p {
  color: var(--muted);
}

.video-grid__tag {
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.video-grid__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-self: end;
}

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

.comparison-summary article {
  min-height: 220px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.comparison-summary span {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.comparison-summary strong {
  display: block;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.15;
}

.comparison-summary p {
  color: var(--muted);
}

.comparison-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.comparison-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.comparison-table--wide {
  min-width: 1120px;
}

.comparison-table--score {
  min-width: 1240px;
}

.comparison-table th,
.comparison-table td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.comparison-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 13px;
  text-transform: uppercase;
}

.comparison-table tr:last-child td {
  border-bottom: 0;
}

.comparison-table td:first-child {
  color: var(--ink);
  font-weight: 800;
}

.comparison-table--score th:not(:first-child),
.comparison-table--score td:not(:first-child) {
  width: 124px;
  text-align: center;
}

.comparison-table--score td:first-child {
  width: 340px;
}

.score-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.score-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  font-weight: 900;
  line-height: 1;
}

.score--best {
  background: #0f6b57;
  color: white;
}

.score--good {
  background: #dff1ea;
  color: #0f6b57;
}

.score--mixed {
  background: #fbf4df;
  color: #8a6417;
}

.score--weak {
  background: #f4e2e2;
  color: #8a2830;
}

.score--unknown {
  background: var(--surface-muted);
  color: #6c7478;
}

.value-grid__tag {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.value-grid h3 {
  font-size: 24px;
  line-height: 1.15;
}

.value-grid p,
.section--split p,
.document-card p {
  color: var(--muted);
}

.section--split {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 42px;
  align-items: start;
}

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

.timeline a {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border-left: 4px solid var(--green);
  border-radius: 6px;
  background: var(--surface);
}

.timeline strong {
  color: var(--green);
  font-size: 20px;
}

.timeline span {
  color: #39464c;
}

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

.doc-group {
  padding: 18px;
}

.doc-group h3 {
  margin-bottom: 14px;
}

.doc-list {
  display: grid;
  gap: 10px;
}

.doc-link {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfaf6;
}

.doc-link:hover,
.document-card:hover,
.timeline a:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.doc-link span {
  color: var(--muted);
  font-size: 13px;
}

.library-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 32px;
}

.library-nav {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 108px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.library-nav__home {
  display: block;
  margin-bottom: 18px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
}

.library-nav section {
  margin-top: 18px;
}

.library-nav h2 {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.library-nav section a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: #45545b;
  font-size: 14px;
}

.library-nav section a:hover,
.library-nav section a.is-active {
  background: var(--surface-muted);
  color: var(--ink);
}

.library-content {
  min-width: 0;
  max-width: 980px;
}

.library-intro {
  margin-bottom: 18px;
  padding: 28px;
}

.library-intro h1,
.document-view header h1 {
  font-size: 44px;
  line-height: 1.1;
}

.library-intro p,
.document-view header p {
  max-width: 820px;
  color: var(--muted);
}

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

.document-card {
  min-height: 210px;
  padding: 22px;
}

.document-card span,
.document-view header span {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.document-card h2 {
  font-size: 24px;
  line-height: 1.15;
}

.document-view {
  overflow: hidden;
}

.document-view header {
  padding: 34px 42px;
  border-bottom: 1px solid var(--line);
  background: #fbfaf6;
}

.markdown-body {
  padding: 36px 42px 54px;
  color: #233038;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  color: var(--ink);
  line-height: 1.16;
}

.markdown-body h1 {
  font-size: 38px;
}

.markdown-body h2 {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 28px;
}

.markdown-body h3 {
  margin-top: 28px;
  font-size: 22px;
}

.markdown-body p,
.markdown-body li {
  font-size: 16px;
}

.markdown-body a {
  color: #0f6b57;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(15, 107, 87, 0.38);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.markdown-body a:hover {
  color: var(--ink);
  text-decoration-color: var(--gold);
}

.markdown-body blockquote {
  margin: 20px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--gold);
  background: #fbf4df;
}

.markdown-body table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.markdown-body th,
.markdown-body td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  vertical-align: top;
}

.markdown-body th {
  background: var(--surface-muted);
}

.markdown-body code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--surface-muted);
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 980px) {
  .hero,
  .comparison-hero,
  .section--split,
  .library-shell {
    grid-template-columns: 1fr;
  }

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

  .hero__panel {
    justify-self: stretch;
  }

  .value-grid,
  .video-grid,
  .comparison-summary,
  .doc-groups,
  .document-board {
    grid-template-columns: repeat(2, 1fr);
  }

  .library-nav {
    position: static;
    max-height: none;
  }
}

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

  .hero,
  .comparison-hero,
  .section,
  .library-shell {
    padding-right: 18px;
    padding-left: 18px;
  }

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

  .hero__stats,
  .value-grid,
  .video-grid,
  .comparison-summary,
  .doc-groups,
  .document-board {
    grid-template-columns: 1fr;
  }

  .timeline a {
    grid-template-columns: 1fr;
  }

  .document-view header,
  .markdown-body {
    padding-right: 22px;
    padding-left: 22px;
  }
}
