:root {
  --ink: #102b2d;
  --muted: #5a6d6f;
  --paper: #f6f4ed;
  --surface: #fffdf8;
  --line: #d8ddd7;
  --teal: #006d69;
  --teal-dark: #004b49;
  --aqua: #a9e0d5;
  --lime: #d8e56d;
  --orange: #e4672e;
  --purple: #7259a6;
  --shadow: 0 16px 45px rgb(16 43 45 / 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
a { color: var(--teal-dark); text-underline-offset: 0.18em; }
a:hover { color: var(--orange); }
button, input, select { font: inherit; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 10; background: white; padding: .75rem 1rem; }
.skip-link:focus { top: 1rem; }

.site-header {
  min-height: 76px;
  padding: 0 clamp(1rem, 4vw, 4.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid rgb(16 43 45 / .14);
  background: rgb(246 244 237 / .92);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: .75rem; font-weight: 750; text-decoration: none; color: var(--ink); }
.brand-mark { padding: .45rem .58rem; background: var(--ink); color: white; font: 900 1rem/1 Georgia, serif; letter-spacing: -.04em; }
.site-header nav { display: flex; gap: 1.4rem; font-size: .92rem; }
.site-header nav a { text-decoration: none; font-weight: 650; color: var(--ink); }

main { min-height: 75vh; }
.hero {
  padding: clamp(4rem, 9vw, 8rem) clamp(1rem, 8vw, 9rem) clamp(4rem, 7vw, 6rem);
  background:
    radial-gradient(circle at 82% 35%, rgb(216 229 109 / .55), transparent 18rem),
    linear-gradient(135deg, #083a3b 0%, #006d69 58%, #3b9088 100%);
  color: white;
}
.hero h1, .detail-hero h1, .prose h1 {
  max-width: 900px;
  margin: .4rem 0 1.2rem;
  font: 600 clamp(2.7rem, 7vw, 6.8rem)/.96 Georgia, "Times New Roman", serif;
  letter-spacing: -.055em;
}
.hero-copy { max-width: 760px; font-size: clamp(1.08rem, 2vw, 1.35rem); line-height: 1.55; }
.eyebrow { margin: 0 0 .55rem; font-size: .73rem; line-height: 1.2; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.snapshot-note {
  max-width: 850px;
  margin-top: 2rem;
  padding: 1rem 1.2rem;
  border: 1px solid rgb(255 255 255 / .28);
  background: rgb(255 255 255 / .09);
  line-height: 1.55;
}

.explorer-shell, .content-width { width: min(1440px, calc(100% - 2rem)); margin: 0 auto; }
.explorer-shell { padding: clamp(3rem, 6vw, 6rem) 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; }
.section-heading h2, .panel h2, .evidence-section h2, .method-note h2 {
  margin: .2rem 0 0;
  font: 600 clamp(1.7rem, 3vw, 2.8rem)/1.08 Georgia, serif;
  letter-spacing: -.025em;
}
.section-heading > p { color: var(--muted); }
.filters {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(150px, 1fr)) auto;
  gap: .8rem;
  align-items: end;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.filters label { display: grid; gap: .38rem; font-size: .77rem; font-weight: 750; }
.filters input, .filters select {
  width: 100%;
  min-height: 46px;
  padding: .65rem .75rem;
  border: 1px solid #aeb9b5;
  border-radius: 0;
  background: white;
  color: var(--ink);
}
button, .button-link {
  min-height: 46px;
  padding: .72rem 1rem;
  border: 1px solid var(--teal-dark);
  background: var(--teal-dark);
  color: white;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button-link:hover { background: var(--orange); border-color: var(--orange); color: white; }
.button-secondary { background: transparent; color: var(--teal-dark); }
.results-line { display: flex; justify-content: space-between; align-items: center; margin: 1.8rem 0 1rem; }
.topic-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.topic-card { min-width: 0; padding: 1.25rem; border: 1px solid var(--line); background: var(--surface); transition: transform .18s, box-shadow .18s; }
.topic-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-topline { display: flex; align-items: start; justify-content: space-between; gap: .6rem; min-height: 2.1rem; }
.topic-card h2 { min-height: 2.7em; margin: .2rem 0 .85rem; font: 600 1.35rem/1.22 Georgia, serif; }
.topic-card h2 a { color: var(--ink); text-decoration-thickness: 1px; }
.direction { display: inline-flex; padding: .28rem .48rem; border-radius: 999px; white-space: nowrap; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; background: #e8ece9; }
.direction--rising { background: #d5efe5; color: #075b40; }
.direction--falling { background: #f7dfd3; color: #913512; }
.trend-chart { display: block; width: 100%; height: 86px; overflow: visible; }
.chart-area { fill: rgb(0 109 105 / .09); }
.chart-line { fill: none; stroke: var(--teal); stroke-width: 3; vector-effect: non-scaling-stroke; }
.card-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin: .8rem 0 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.card-metrics div { min-width: 0; }
.card-metrics dt { color: var(--muted); font-size: .68rem; }
.card-metrics dd { margin: .2rem 0 0; font-weight: 780; font-size: .9rem; }
.compare-check { display: flex; gap: .5rem; align-items: center; color: var(--muted); font-size: .78rem; }
.compare-check input { accent-color: var(--teal); width: 1rem; height: 1rem; }

.content-width { padding: 2.5rem 0 5rem; }
.breadcrumb { display: flex; gap: .55rem; align-items: center; margin-bottom: 3rem; color: var(--muted); font-size: .86rem; }
.detail-hero { display: flex; align-items: end; justify-content: space-between; gap: 2rem; padding: 1rem 0 3rem; }
.detail-hero h1 { font-size: clamp(3rem, 6vw, 6.2rem); }
.detail-hero p:not(.eyebrow) { color: var(--muted); font-size: 1.15rem; }
.detail-hero > .direction { margin-bottom: 1rem; font-size: .8rem; }
.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); background: var(--surface); }
.metric-strip div { display: grid; gap: .45rem; padding: 1.3rem; border-right: 1px solid var(--line); }
.metric-strip div:last-child { border-right: 0; }
.metric-strip span { color: var(--muted); font-size: .8rem; }
.metric-strip strong { font: 600 1.7rem Georgia, serif; }
.panel { padding: clamp(1.3rem, 3vw, 2.2rem); border: 1px solid var(--line); background: var(--surface); }
.chart-panel { margin: 1rem 0; }
.trend-chart--large { height: 300px; }
.chart-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: .76rem; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.rank-list, .related-list { margin: 1.4rem 0 0; padding: 0; list-style: none; }
.rank-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .72rem 0; border-top: 1px solid var(--line); }
.related-list li { display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; padding: .72rem 0; border-top: 1px solid var(--line); }
.related-list li > a:first-child { font-weight: 750; }
.related-list span { color: var(--muted); font-size: .78rem; }
.compare-link { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: .78rem; }
.evidence-section { padding: 4rem 0 2rem; }
.evidence-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.evidence-card { padding: 1.25rem; border-top: 4px solid var(--aqua); background: var(--surface); }
.evidence-card h3 { margin: .5rem 0 1rem; font: 600 1.2rem/1.3 Georgia, serif; }
.evidence-card p:last-child { color: var(--muted); font-size: .77rem; overflow-wrap: anywhere; }
.method-note { margin-top: 2rem; padding: 1.5rem; border-left: 5px solid var(--lime); background: #f0f0d8; }
.method-note h2 { font-size: 1.35rem; }
.method-note p { max-width: 950px; line-height: 1.6; }

.comparison-panel { margin-top: 1rem; }
.comparison-legend { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--line); }
.comparison-legend div { display: flex; align-items: center; gap: .45rem; }
.legend-dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--teal); }
.legend-dot--orange { background: var(--orange); }
.legend-dot--green { background: #4d8c43; }
.legend-dot--purple { background: var(--purple); }
.comparison-row { display: grid; grid-template-columns: minmax(230px, .8fr) 2fr; gap: 2rem; align-items: center; padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.comparison-row h2 { font-size: 1.45rem; }
.comparison-row p { color: var(--muted); }
.comparison-row--orange .chart-line { stroke: var(--orange); }
.comparison-row--green .chart-line { stroke: #4d8c43; }
.comparison-row--purple .chart-line { stroke: var(--purple); }

.prose { max-width: 880px; font-size: 1.08rem; line-height: 1.72; }
.prose h1 { font-size: clamp(2.8rem, 6vw, 5rem); }
.prose h2 { margin-top: 2.5rem; font: 600 2rem Georgia, serif; }
.empty-state { padding: 4rem 1rem; text-align: center; border: 1px dashed #9caaa5; background: var(--surface); }
.empty-state.standalone { width: min(760px, calc(100% - 2rem)); margin: 5rem auto; }
.empty-state .button-link { display: inline-flex; align-items: center; margin-top: 1rem; }
footer { padding: 2rem clamp(1rem, 4vw, 4.5rem); border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; }

@media (max-width: 1100px) {
  .topic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .filters button { width: max-content; }
}
@media (max-width: 760px) {
  .site-header { align-items: flex-start; padding-top: 1rem; padding-bottom: 1rem; }
  .site-header nav { flex-direction: column; gap: .45rem; }
  .topic-grid, .evidence-grid, .detail-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .filters button { width: 100%; }
  .section-heading, .detail-hero, .results-line { align-items: flex-start; flex-direction: column; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric-strip div:nth-child(2) { border-right: 0; }
  .comparison-row { grid-template-columns: 1fr; gap: .5rem; }
  .hero h1 { font-size: clamp(2.8rem, 15vw, 4.8rem); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
