:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5f6b78;
  --line: #d9e0e7;
  --panel: #ffffff;
  --soft: #f3f7fa;
  --mint: #dff5eb;
  --green: #147a55;
  --blue: #2357a6;
  --gold: #9a6b16;
  --rose: #b73b52;
  --shadow: 0 18px 55px rgba(22, 32, 42, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #eef6f2 0%, #f7f8fb 520px, #ffffff 100%);
  color: var(--ink);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.site-header,
.site-footer,
main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
}

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

.top-nav a,
.site-footer a {
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
}

.top-nav a:hover,
.site-footer a:hover,
.text-link:hover {
  color: var(--blue);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr);
  gap: 24px;
  align-items: stretch;
  padding: 42px 0 26px;
}

.hero-copy {
  padding: clamp(28px, 4vw, 54px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.82)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='520' viewBox='0 0 900 520'%3E%3Crect width='900' height='520' fill='%23f8fbfd'/%3E%3Cg stroke='%23bdd4ce' stroke-width='1' opacity='.9'%3E%3Cpath d='M0 90h900M0 180h900M0 270h900M0 360h900M0 450h900M110 0v520M220 0v520M330 0v520M440 0v520M550 0v520M660 0v520M770 0v520'/%3E%3C/g%3E%3Cg fill='none' stroke='%23147a55' stroke-width='4' opacity='.24'%3E%3Cpath d='M135 332c96-128 172-172 270-128s130 126 235 42 163-92 220-46'/%3E%3Ccircle cx='405' cy='204' r='12' fill='%23147a55'/%3E%3Ccircle cx='642' cy='246' r='12' fill='%23147a55'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero-copy::after {
  content: "";
  position: absolute;
  inset: auto 28px 28px auto;
  width: 150px;
  height: 78px;
  border: 1px solid rgba(20, 122, 85, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(20, 122, 85, 0.16) 0 38%, transparent 38% 100%),
    repeating-linear-gradient(0deg, transparent 0 13px, rgba(23, 32, 42, 0.09) 13px 14px);
  opacity: 0.72;
  pointer-events: none;
}

.hero-panel,
.mini-panel,
.results-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
}

.hero-panel {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
}

.research-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255,255,255,.96), rgba(238,248,243,.96)),
    radial-gradient(circle at 85% 20%, rgba(35,87,166,.16), transparent 32%);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.research-card:hover {
  transform: translateY(-4px);
  border-color: #91d1b6;
  box-shadow: 0 22px 48px rgba(23, 32, 42, 0.16);
}

.panel-cover-link {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.research-card .text-link {
  position: relative;
  z-index: 3;
  margin-top: 18px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.metric-strip span {
  border: 1px solid rgba(20, 122, 85, 0.18);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  font-size: .82rem;
}

.metric-strip strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
}

.eyebrow,
.panel-label {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(2.7rem, 8vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.25;
}

.hero-text {
  max-width: 720px;
  color: #344453;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  line-height: 1.65;
}

.lookup-form {
  margin-top: 28px;
  position: relative;
  z-index: 1;
  max-width: 900px;
  padding: 18px;
  border: 1px solid rgba(20, 122, 85, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
}

.lookup-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 750;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  gap: 10px;
}

input {
  min-height: 48px;
  width: 100%;
  border: 1px solid #aebbc8;
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #ffffff;
}

input:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(35, 87, 166, 0.28);
  outline-offset: 2px;
}

button {
  min-height: 48px;
  min-width: 84px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 780;
  white-space: nowrap;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.primary-button {
  background: var(--green);
  color: #ffffff;
}

.secondary-button {
  border-color: #b6c5d2;
  background: #ffffff;
  color: var(--ink);
}

.ghost-button {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

.form-note {
  min-height: 24px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.form-note.error {
  color: var(--rose);
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(260px, 340px);
  gap: 24px;
  align-items: start;
  margin: 22px 0 42px;
}

.results-shell,
.mini-panel,
.content-band,
.guide,
.faq {
  padding: clamp(20px, 3vw, 30px);
}

.results-shell {
  box-shadow: 0 16px 42px rgba(23, 32, 42, 0.08);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 20px;
}

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

.status-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--soft);
}

.status-box.loading {
  border-color: #83aee7;
  background: #eef5ff;
}

.status-box.success {
  border-color: #9fd8bf;
  background: #f0fbf5;
}

.status-box.partial {
  border-color: #dfc47d;
  background: #fff9e8;
}

.status-box.error {
  border-color: #ebb0bb;
  background: #fff1f4;
}

.status-box p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.result-item {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.result-item span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.result-item strong {
  display: block;
  line-height: 1.45;
}

.raw-data {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101820;
  color: #e8eef5;
}

.raw-data summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
}

pre {
  max-height: 360px;
  margin: 0;
  overflow: auto;
  padding: 0 16px 16px;
  white-space: pre-wrap;
  word-break: break-word;
}

.result-explainer {
  margin-top: 16px;
  padding: 16px;
  border-left: 4px solid var(--green);
  background: #f6faf8;
  color: #334250;
}

.side-column {
  display: grid;
  gap: 16px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  width: 100%;
  min-height: 40px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--ink);
}

.text-link {
  color: var(--green);
  font-weight: 800;
  text-decoration: none;
}

.content-band,
.guide,
.faq {
  margin: 26px 0;
  border-top: 1px solid var(--line);
}

#datasets {
  border: 1px solid #9ed6bf;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(230, 248, 239, 0.98), rgba(236, 244, 255, 0.96)),
    linear-gradient(90deg, rgba(20, 122, 85, 0.08), rgba(35, 87, 166, 0.08));
  box-shadow: 0 22px 58px rgba(23, 32, 42, 0.11);
}

#datasets .section-heading {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(20, 122, 85, 0.18);
}

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

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

.data-card,
.article-card,
.guide article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
}

.data-card:nth-child(1) {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(225, 246, 235, 0.96)),
    linear-gradient(135deg, #ffffff, #dff5eb);
}

.data-card:nth-child(2) {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(232, 240, 255, 0.98)),
    linear-gradient(135deg, #ffffff, #e4edff);
}

.data-card:nth-child(3) {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(255, 242, 219, 0.98)),
    linear-gradient(135deg, #ffffff, #fff0cf);
}

.interactive-card {
  position: relative;
  display: flex;
  min-height: 244px;
  flex-direction: column;
  justify-content: space-between;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.interactive-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(20, 122, 85, 0.1), transparent 42%),
    linear-gradient(315deg, rgba(35, 87, 166, 0.11), transparent 40%);
  opacity: 0;
  transition: opacity .18s ease;
  pointer-events: none;
}

.interactive-card:hover {
  transform: translateY(-6px);
  border-color: #82c8ad;
  box-shadow: 0 26px 54px rgba(23, 32, 42, 0.18);
}

.interactive-card:hover::before {
  opacity: 1;
}

.interactive-card h3,
.interactive-card p,
.interactive-card .tag-row,
.interactive-card .card-footer,
.interactive-card .card-kicker {
  position: relative;
  z-index: 1;
}

.card-kicker {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: #edf7f2;
  color: var(--green);
  padding: 5px 9px;
  font-size: .75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.card-footer {
  color: var(--blue);
  font-weight: 850;
}

.data-card p,
.article-card p,
.guide article p,
.mini-panel p,
.hero-panel p,
.faq p {
  color: var(--muted);
  line-height: 1.6;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.tag {
  border-radius: 999px;
  background: var(--mint);
  color: #0b6241;
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 800;
}

.blog-section {
  background: linear-gradient(180deg, #ffffff, #f6faf8);
}

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

.blog-card {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
}

.blog-card p {
  color: var(--muted);
  line-height: 1.55;
}

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

.faq details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.faq summary {
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 800;
}

.faq details p {
  margin: 0;
  padding: 0 18px 18px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 0 46px;
  border-top: 1px solid var(--line);
}

.site-footer p {
  max-width: 520px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .hero,
  .workspace,
  .card-grid,
  .guide-grid,
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .site-header,
  .site-footer,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  .site-header,
  .site-footer,
  main {
    width: min(100% - 24px, 1180px);
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }

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

  h1 {
    font-size: clamp(2.45rem, 18vw, 4rem);
  }
}
