:root {
  color-scheme: light;
  --paper: #f5f7fa;
  --surface: #ffffff;
  --ink: #101820;
  --muted: #586776;
  --line: #d9e0e8;
  --green: #0f6b5a;
  --green-dark: #08483d;
  --red: #93424a;
  --amber: #a16f1a;
  --blue: #123c69;
  --blue-dark: #071f3a;
  --blue-soft: #e7edf5;
  --shadow: 0 22px 70px rgba(8, 31, 58, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  letter-spacing: 0;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.topline {
  background: var(--blue-dark);
  color: #f7f4ee;
  font-size: 0.82rem;
  padding: 0.55rem 1rem;
  text-align: center;
}

.site-header {
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 1rem;
  grid-template-columns: auto 1fr auto;
  padding: 0.9rem clamp(1rem, 3vw, 2.5rem);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header > *,
.hero-copy,
.section-heading,
.feature-item,
.content-card,
.split-panel,
.form-copy,
.chart-panel,
.control-panel {
  min-width: 0;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-weight: 800;
  gap: 0.7rem;
  min-width: max-content;
}

.brand-mark {
  align-items: center;
  background: var(--blue);
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  font-size: 0.78rem;
  height: 2rem;
  justify-content: center;
  width: 2rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: center;
}

.nav-link {
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.94rem;
  padding: 0.55rem 0.7rem;
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--blue-soft);
  color: var(--ink);
}

.auth-row,
.hero-actions,
.footer-links {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 750;
  justify-content: center;
  min-height: 2.45rem;
  padding: 0.6rem 0.9rem;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-dark {
  background: var(--blue-dark);
  color: #fff;
}

.button-dark:hover {
  background: var(--blue);
}

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

.button-ghost:hover {
  background: var(--blue-soft);
}

.account-pill {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  max-width: 12rem;
  overflow: hidden;
  padding: 0.55rem 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero {
  align-items: center;
  background: linear-gradient(90deg, #f8fafc 0%, #eef3f8 64%, #e4ebf3 100%);
  display: grid;
  min-height: calc(100vh - 12rem);
  overflow: hidden;
  padding: clamp(3rem, 8vw, 6.5rem) clamp(1rem, 6vw, 6rem);
  position: relative;
}

.hero::after {
  background: linear-gradient(90deg, rgba(248, 250, 252, 0.98), rgba(248, 250, 252, 0.84) 48%, rgba(248, 250, 252, 0.16));
  content: "";
  inset: 0;
  position: absolute;
  z-index: 1;
}

.hero-copy {
  max-width: 45rem;
  position: relative;
  z-index: 3;
}

.hero h1,
.page-intro h1,
.tool-header h1,
.form-copy h1,
.narrow-section h1 {
  font-size: clamp(2.45rem, 4.35rem, 4.35rem);
  line-height: 1;
  margin: 0 0 1.1rem;
  max-width: 13ch;
  overflow-wrap: anywhere;
}

.hero .lead {
  max-width: 46rem;
}

.hero-visual {
  inset: 0;
  position: absolute;
  z-index: 0;
}

#hero-regime-canvas {
  height: 100%;
  margin-left: auto;
  min-height: 32rem;
  opacity: 0.82;
  width: min(70rem, 72vw);
}

.hero-metrics {
  bottom: 2rem;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(3, minmax(8.5rem, 1fr));
  position: absolute;
  right: clamp(1rem, 5vw, 5rem);
  width: min(34rem, calc(100vw - 2rem));
  z-index: 4;
}

.hero-metrics div,
.metric-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(8, 31, 58, 0.14);
  border-radius: 6px;
  padding: 0.9rem;
}

.hero-metrics span,
.metric-card span,
.content-card span,
.split-panel span,
.eyebrow {
  color: var(--green);
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  margin: 0 0 0.45rem;
  text-transform: uppercase;
}

.hero-metrics strong,
.metric-card strong {
  display: block;
  font-size: 1.05rem;
}

.lead {
  color: var(--muted);
  font-size: 1.13rem;
  margin: 0 0 1.6rem;
  overflow-wrap: anywhere;
}

.section-band,
.two-column-section,
.tool-shell,
.form-shell,
.admin-shell,
.narrow-section {
  margin: 0 auto;
  max-width: 1200px;
  padding: clamp(2.5rem, 7vw, 5.5rem) clamp(1rem, 3vw, 2rem);
}

.section-heading {
  align-items: end;
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.section-heading h2,
.newsletter-band h2,
.table-shell h2 {
  font-size: 2rem;
  line-height: 1.05;
  margin: 0;
  overflow-wrap: anywhere;
}

.feature-grid,
.card-grid,
.metric-grid {
  display: grid;
  gap: 1rem;
}

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

.feature-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--green);
  padding: 1rem;
}

.feature-item:nth-child(2) {
  border-top-color: var(--red);
}

.feature-item:nth-child(3) {
  border-top-color: var(--blue);
}

.feature-item:nth-child(4) {
  border-top-color: var(--amber);
}

.feature-item span {
  color: var(--muted);
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  margin-bottom: 0.8rem;
}

.feature-item h3,
.content-card h3,
.content-card h2,
.split-panel h3 {
  margin: 0 0 0.55rem;
}

.feature-item p,
.content-card p,
.split-panel p,
.newsletter-band p,
.form-copy p,
.article-body p {
  color: var(--muted);
  margin: 0 0 1rem;
  overflow-wrap: anywhere;
}

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

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

.content-card,
.split-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  min-height: 14rem;
  padding: 1.25rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.content-card:hover,
.split-panel:hover {
  border-color: rgba(18, 60, 105, 0.38);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.long-card {
  min-height: 16rem;
}

.two-column-section {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.15fr 0.85fr;
}

.accent-panel {
  background: var(--blue-dark);
  color: #fff;
}

.accent-panel p,
.accent-panel .meta-line {
  color: rgba(255, 255, 255, 0.74);
}

.accent-panel span {
  color: #a9c7eb;
}

.meta-line {
  color: var(--muted);
  font-size: 0.92rem;
}

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

.newsletter-band {
  align-items: center;
  background: var(--blue-dark);
  color: #fff;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr auto;
  margin: clamp(1rem, 3vw, 2rem) auto clamp(2.5rem, 6vw, 5rem);
  max-width: 1180px;
  padding: 2rem;
}

.newsletter-band p,
.newsletter-band .eyebrow {
  color: rgba(255, 255, 255, 0.76);
}

.institutional-band {
  align-items: end;
  background: var(--blue-dark);
  color: #fff;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 0.9fr 1.1fr;
  margin: 0;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 6vw, 6rem);
}

.institutional-band h2 {
  font-size: 2.6rem;
  line-height: 1.05;
  margin: 0;
  overflow-wrap: anywhere;
}

.institutional-band p {
  color: rgba(255, 255, 255, 0.76);
  margin: 0;
}

.institutional-band .eyebrow {
  color: #a9c7eb;
}

.trust-strip {
  border-top: 1px solid rgba(8, 31, 58, 0.14);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.7rem;
  padding-top: 1rem;
}

.trust-strip span {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(8, 31, 58, 0.12);
  border-radius: 999px;
  color: var(--blue-dark);
  font-size: 0.82rem;
  font-weight: 750;
  padding: 0.42rem 0.68rem;
}

.article-card,
.research-card {
  display: flex;
  flex-direction: column;
}

.article-card::before,
.research-card::before {
  background: linear-gradient(90deg, var(--blue), var(--green));
  content: "";
  display: block;
  height: 3px;
  margin: -1.25rem -1.25rem 1rem;
}

.card-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 1rem;
}

.card-footer small {
  color: var(--muted);
  font-weight: 700;
}

.card-footer strong {
  color: var(--blue);
  font-size: 0.9rem;
}

.panel-stat-row,
.tool-standard-row {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1.2rem;
}

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

.panel-stat-row div,
.tool-standard-row div {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 0.75rem;
}

.panel-stat-row strong,
.tool-standard-row strong {
  display: block;
}

.panel-stat-row small,
.tool-standard-row span {
  color: rgba(255, 255, 255, 0.68);
  display: block;
  font-size: 0.76rem;
  font-weight: 750;
  text-transform: uppercase;
}

.tool-standard-row {
  background: var(--blue-dark);
  color: #fff;
  margin-bottom: 1rem;
  padding: 1rem;
}

.panel-kicker,
.chart-title-row span {
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.chart-title-row {
  align-items: end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.chart-title-row h2 {
  font-size: 1.15rem;
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
}

.chart-title-row small {
  color: var(--muted);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.inline-form {
  display: flex;
  gap: 0.6rem;
  width: min(100%, 30rem);
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  outline: none;
  padding: 0.78rem 0.85rem;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(27, 107, 88, 0.12);
}

.page-intro h1,
.tool-header h1,
.form-copy h1,
.narrow-section h1 {
  font-size: 3rem;
  max-width: 18ch;
}

.article-shell {
  margin: 0 auto;
  max-width: 850px;
  padding: clamp(2.5rem, 7vw, 5.5rem) clamp(1rem, 3vw, 2rem);
}

.article-shell h1 {
  font-size: 3.2rem;
  line-height: 1;
  margin: 0 0 1rem;
}

.article-meta {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  margin: 1rem 0 2rem;
  padding-bottom: 1rem;
}

.article-body h2,
.article-body h3 {
  color: var(--ink);
  margin: 2rem 0 0.7rem;
}

.article-body p {
  font-size: 1.05rem;
}

.disclaimer-box,
.notice {
  background: #fff8e7;
  border: 1px solid #dec47a;
  border-radius: 8px;
  color: #5c4513;
  margin-top: 1.5rem;
  padding: 1rem;
}

.compact {
  margin-top: 0;
  max-width: 26rem;
}

.tool-header {
  align-items: end;
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.simulator-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 19rem 1fr;
}

.control-panel,
.chart-panel,
.stacked-form,
.table-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem;
}

.chart-panel {
  box-shadow: 0 16px 50px rgba(8, 31, 58, 0.08);
}

.control-panel {
  border-left: 3px solid var(--blue);
}

.control-panel,
.stacked-form {
  display: grid;
  gap: 1rem;
}

label {
  color: var(--ink);
  display: grid;
  font-size: 0.94rem;
  font-weight: 750;
  gap: 0.45rem;
}

.check-row {
  align-items: start;
  color: var(--muted);
  display: grid;
  font-weight: 600;
  gap: 0.65rem;
  grid-template-columns: 1rem 1fr;
  line-height: 1.4;
}

.check-row input {
  margin-top: 0.25rem;
  width: auto;
}

.chart-panel canvas,
.research-chart canvas {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: block;
  height: auto;
  max-width: 100%;
  width: 100%;
}

.research-chart {
  margin: 1.5rem 0;
}

input[type="range"] {
  accent-color: var(--blue);
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 1rem;
}

.sim-explanation {
  color: var(--muted);
  margin-bottom: 0;
}

.form-shell {
  align-items: start;
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(18rem, 0.75fr) minmax(20rem, 1fr);
}

.stacked-form textarea {
  resize: vertical;
}

.table-shell {
  margin-bottom: 1rem;
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.8rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

td span {
  color: var(--muted);
  font-size: 0.88rem;
}

.admin-inline-form {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(8rem, 0.8fr) minmax(10rem, 1fr) auto;
}

.admin-metrics {
  margin-bottom: 1rem;
}

.site-footer {
  background: var(--blue-dark);
  color: #f7f4ee;
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  padding: 2rem clamp(1rem, 3vw, 2.5rem);
}

.site-footer p {
  color: rgba(247, 244, 238, 0.72);
  margin: 0.35rem 0 0;
}

.footer-links a {
  color: rgba(247, 244, 238, 0.82);
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr;
  }

  .site-nav,
  .auth-row {
    justify-content: start;
  }

  .site-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .nav-link {
    min-width: 0;
    text-align: center;
  }

  .auth-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .auth-row .button,
  .auth-row .account-pill {
    width: 100%;
  }

  .hero {
    min-height: auto;
    padding-bottom: 2rem;
  }

  .hero::after {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(248, 250, 252, 0.82));
  }

  #hero-regime-canvas {
    width: 100%;
  }

  .hero-metrics {
    margin-top: 1.5rem;
    position: relative;
    right: auto;
    left: auto;
    width: 100%;
  }

  .feature-grid,
  .card-grid,
  .card-grid.two,
  .two-column-section,
  .simulator-grid,
  .form-shell,
  .newsletter-band,
  .institutional-band,
  .tool-standard-row {
    grid-template-columns: 1fr;
  }

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

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

  .institutional-band h2 {
    font-size: 2.2rem;
  }
}

@media (max-width: 620px) {
  .site-header,
  .hero,
  .institutional-band,
  .section-band,
  .two-column-section,
  .tool-shell,
  .form-shell,
  .admin-shell,
  .narrow-section,
  .article-shell,
  .newsletter-band,
  .site-footer {
    max-width: 100vw;
    width: 100%;
  }

  .topline {
    font-size: 0.78rem;
    line-height: 1.45;
    overflow-wrap: normal;
    padding-right: 1.5rem;
    text-align: left;
  }

  .site-header {
    padding: 0.85rem 1rem;
  }

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

  .nav-link {
    align-items: center;
    display: flex;
    font-size: 0.9rem;
    justify-content: center;
    min-height: 2.4rem;
    padding-inline: 0.35rem;
  }

  .hero h1,
  .page-intro h1,
  .tool-header h1,
  .form-copy h1,
  .narrow-section h1,
  .article-shell h1 {
    font-size: 2.05rem;
    line-height: 1.06;
  }

  .hero {
    padding-top: 3rem;
  }

  .hero-copy {
    max-width: 100%;
  }

  .hero .lead,
  .institutional-band p,
  .tool-header .lead,
  .form-copy .lead,
  .article-body p {
    max-width: 20.5rem;
    overflow-wrap: anywhere;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .chart-title-row {
    align-items: start;
    flex-direction: column;
  }

  .institutional-band h2 {
    font-size: 1.6rem;
    max-width: 16ch;
  }

  .section-heading h2,
  .newsletter-band h2,
  .table-shell h2 {
    font-size: 1.7rem;
  }

  .lead {
    font-size: 1rem;
  }

  .hero-metrics,
  .metric-grid,
  .admin-inline-form,
  .inline-form,
  .panel-stat-row {
    grid-template-columns: 1fr;
  }

  .inline-form {
    display: grid;
  }

  .button {
    width: 100%;
  }
}
