:root {
  --bg: #f7f7f2;
  --paper: #ffffff;
  --ink: #151b18;
  --muted: #647067;
  --line: #dde3dc;
  --green: #136d43;
  --blue: #244e78;
  --gold: #b78320;
  --soft: #eef3ee;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: 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;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 54px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: #14231a;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
}

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

.brand small,
.main-nav a,
.site-footer p,
.site-footer a {
  color: var(--muted);
}

.main-nav,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.main-nav a,
.site-footer a {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
}

.hero,
.section,
.article-layout,
.legal-page {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
  align-items: stretch;
  padding: 52px 0 32px;
}

.hero-copy,
.hero-panel,
.article-card,
.study-card,
.note-box,
.risk-box,
.toc,
.article-main,
.legal-page {
  background: var(--paper);
  border: 1px solid var(--line);
}

.hero-copy {
  padding: clamp(26px, 5vw, 54px);
}

.hero-panel {
  padding: 28px;
  display: grid;
  align-content: center;
  gap: 12px;
  background: #14231a;
  color: #fff;
}

.hero-panel span,
.hero-panel p {
  color: rgba(255, 255, 255, 0.72);
}

.hero-panel strong {
  font-size: 2.1rem;
  line-height: 1.05;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  max-width: 880px;
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  line-height: 1.02;
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.12;
}

h3 {
  font-size: 1.12rem;
  line-height: 1.25;
}

p,
li {
  color: #39443d;
  line-height: 1.72;
}

.lead {
  max-width: 760px;
  color: #3c4941;
  font-size: 1.08rem;
}

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

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  text-decoration: none;
  font-weight: 800;
}

.button.primary {
  background: #14231a;
  color: #fff;
}

.button.secondary {
  background: var(--soft);
  color: var(--ink);
}

.section {
  padding: 30px 0;
}

.section-head {
  margin-bottom: 16px;
}

.article-grid,
.study-grid,
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.article-card,
.study-card,
.note-box {
  padding: 20px;
}

.article-card span,
.related-card span {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.article-card a {
  text-decoration: none;
}

.article-card small {
  color: var(--muted);
  line-height: 1.45;
}

.compact-grid .article-card {
  box-shadow: none;
}

.compact-grid .article-card h3 {
  font-size: 1rem;
}

.band {
  width: 100%;
  max-width: none;
  padding: 42px max(18px, calc((100vw - 1180px) / 2));
  background: #e9eee8;
}

.study-card ul,
.clean-list {
  margin: 12px 0 0;
  padding-left: 20px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.article-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  width: min(1180px, calc(100% - 36px));
  padding: 28px 0;
}

.toc {
  position: sticky;
  top: 14px;
  align-self: start;
  padding: 16px;
}

.toc strong,
.toc a {
  display: block;
}

.toc a {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
  text-decoration: none;
}

.toc a:hover {
  color: var(--blue);
}

.article-main {
  padding: clamp(22px, 5vw, 54px);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 0.86rem;
}

.breadcrumbs a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 800;
}

.article-hero {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.article-hero h1 {
  font-size: clamp(2rem, 4vw, 3.35rem);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.article-meta span {
  padding: 7px 10px;
  background: var(--soft);
  color: #344039;
  font-size: 0.82rem;
  font-weight: 800;
}

.featured-figure {
  margin: 24px 0;
}

.featured-figure img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--soft);
}

.featured-figure figcaption {
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.86rem;
}

.risk-box,
.writer-note,
.guide-use-box {
  margin: 24px 0;
  padding: 16px 18px;
  border-left: 5px solid var(--gold);
}

.writer-note {
  background: #f8faf7;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
}

.guide-use-box {
  background: #fbfcfa;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
}

.risk-box p,
.writer-note p,
.guide-use-box p {
  margin-bottom: 0;
}

.takeaway-box {
  margin: 24px 0;
  padding: 22px;
  background: #f8faf7;
  border: 1px solid var(--line);
}

.takeaway-box h2 {
  margin-bottom: 12px;
  font-size: 1.25rem;
}

.takeaway-box ul {
  margin: 0;
  padding-left: 20px;
}

.context-box {
  margin: 24px 0;
  padding: 20px;
  background: #eef3ee;
  border: 1px solid var(--line);
}

.context-box h2 {
  font-size: 1.25rem;
}

.context-box p {
  margin-bottom: 0;
}

.context-box a,
.article-section p a {
  color: var(--blue);
  font-weight: 800;
}

.article-section {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.article-section:first-of-type {
  border-top: 0;
}

.article-table-wrap {
  overflow-x: auto;
  margin: 16px 0;
}

.article-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  background: #fbfcfa;
}

.article-table th,
.article-table td {
  padding: 12px 14px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}

.article-table th {
  background: #eef3ee;
  color: #223229;
  font-size: 0.84rem;
  text-transform: uppercase;
}

.section-note {
  margin-top: 14px;
  padding: 14px 16px;
  background: #fff8e8;
  border-left: 4px solid var(--gold);
  color: #443a24;
}

.faq-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.faq-item h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.faq-item p {
  margin-bottom: 0;
}

.related-card {
  display: block;
  min-height: 120px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fbfcfa;
  text-decoration: none;
}

.context-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.context-link-grid a {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fbfcfa;
  text-decoration: none;
}

.context-link-grid span,
.context-link-grid strong,
.context-link-grid small {
  display: block;
}

.context-link-grid span {
  margin-bottom: 7px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.context-link-grid small {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.legal-page {
  margin-top: 34px;
  margin-bottom: 34px;
  padding: clamp(24px, 5vw, 54px);
}

.tool-hero,
.calculator-layout {
  width: min(980px, calc(100% - 36px));
  margin: 0 auto;
}

.tool-hero {
  padding: 44px 0 18px;
}

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

.calculator-panel,
.calculator-result {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 22px;
}

.calculator-panel {
  display: grid;
  gap: 14px;
}

.calculator-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.calculator-panel input {
  height: 44px;
  border: 1px solid var(--line);
  padding: 0 12px;
  font: inherit;
}

.calculator-result span,
.calculator-result strong {
  display: block;
}

.calculator-result span {
  color: var(--muted);
  font-weight: 800;
}

.calculator-result strong {
  margin: 8px 0;
  font-size: 2rem;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.glossary-grid article {
  padding: 16px;
  background: #fbfcfa;
  border: 1px solid var(--line);
}

.glossary-grid h2 {
  font-size: 1.1rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.site-footer p {
  margin: 6px 0 0;
}

@media (max-width: 920px) {
  .site-header,
  .site-footer,
  .hero,
  .two-col,
  .article-layout {
    display: block;
  }

  .main-nav,
  .site-footer nav {
    margin-top: 16px;
  }

  .hero-panel,
  .note-box,
  .toc {
    margin-top: 18px;
  }

  .toc {
    position: static;
    margin-bottom: 16px;
  }

  .article-grid,
  .study-grid,
  .related-grid,
  .context-link-grid,
  .calculator-layout,
  .glossary-grid {
    grid-template-columns: 1fr;
  }
}
