:root {
  --ink: #102033;
  --muted: #5e6f82;
  --line: #d8e7ef;
  --paper: #ffffff;
  --soft: #f3fbfc;
  --mint: #93d7c6;
  --coral: #f36f67;
  --gold: #f2bd5c;
  --blue: #4d8ed8;
  --shadow: 0 18px 48px rgba(35, 70, 100, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(16, 32, 51, 0.035) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(rgba(16, 32, 51, 0.035) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(180deg, #effbf8 0%, #fff8ea 54%, #f7fbff 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 14px max(24px, 5vw);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand,
.footer-brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 2px solid #202020;
  border-radius: 8px;
  background: #f4d35e;
  color: #202020;
  font-size: 0.82rem;
  line-height: 1;
  letter-spacing: 0;
}

.brand-mark-small {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  font-size: 0.72rem;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  font-size: 0.96rem;
  font-weight: 800;
}

.top-nav a,
.site-footer a {
  text-decoration: none;
}

.top-nav a:hover,
.site-footer a:hover {
  color: #cb514c;
}

.language-menu {
  position: relative;
  justify-self: end;
}

.language-menu summary {
  min-width: 124px;
  padding: 10px 12px;
  list-style: none;
  cursor: pointer;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.language-menu summary::-webkit-details-marker {
  display: none;
}

.language-menu div {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  min-width: 170px;
  padding: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.language-menu a {
  padding: 9px 10px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 800;
}

.language-menu a:hover {
  background: var(--soft);
}

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

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  gap: 32px;
  align-items: center;
  min-height: calc(100vh - 78px);
  padding: 54px 0 42px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #b94c47;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(2.4rem, 6vw, 4.9rem);
  line-height: 1.02;
}

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

h3 {
  font-size: 1.18rem;
}

p,
li {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.72;
}

.lede {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 700;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 28px 0 18px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  color: #fff;
  background: var(--coral);
}

.button.secondary {
  background: var(--paper);
  border-color: var(--line);
}

.source-note {
  font-size: 0.92rem;
}

.hero-card,
.tool-panel,
.chart-grid article,
.narrative article,
.source-panel,
.faq details,
.legal-panel,
.table-wrap {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 18px;
}

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

.mini-grid span {
  min-height: 74px;
  padding: 12px;
  background: linear-gradient(135deg, #fff, #f3fbfc);
  border: 1px solid var(--line);
  border-left: 6px solid var(--mint);
  border-radius: 8px;
  font-weight: 900;
}

.tool-section,
.content-section,
.legal-page {
  padding: 56px 0;
}

.section-heading {
  max-width: 820px;
  margin: 0 auto 24px;
  text-align: center;
}

.tool-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
  gap: 24px;
  padding: 24px;
}

.controls {
  display: grid;
  gap: 18px;
}

label span,
label small {
  display: flex;
  justify-content: space-between;
}

label span {
  margin-bottom: 5px;
  font-weight: 900;
}

label small {
  color: var(--muted);
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--coral);
}

.result-card {
  min-height: 100%;
  padding: 22px;
  background: linear-gradient(145deg, #fff8ea, #effbf8);
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.chart-grid article {
  padding: 18px;
}

.chart-grid h3 {
  margin-bottom: 8px;
}

.chart-grid p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.narrative {
  display: grid;
  gap: 18px;
}

.narrative article {
  padding: 22px;
}

.table-wrap {
  overflow-x: auto;
  padding: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

caption {
  padding: 12px;
  font-weight: 900;
  text-align: left;
}

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

th {
  color: var(--ink);
  background: #effbf8;
}

.source-panel {
  padding: 24px;
}

.source-panel ul {
  display: grid;
  gap: 10px;
  padding-left: 20px;
}

.faq {
  display: grid;
  gap: 14px;
}

.faq details {
  padding: 18px 20px;
}

.faq summary {
  font-weight: 900;
  cursor: pointer;
}

.legal-page {
  min-height: 68vh;
}

.legal-panel {
  max-width: 900px;
  margin: 0 auto;
  padding: 26px;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  margin-top: 40px;
  padding: 28px max(24px, 5vw);
  background: #fff;
  border-top: 1px solid var(--line);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-end;
  font-weight: 800;
}

.site-footer p {
  margin-bottom: 8px;
}

@media (max-width: 900px) {
  .site-header,
  .hero,
  .tool-panel,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .top-nav {
    justify-content: flex-start;
  }

  .language-menu {
    justify-self: start;
  }

  .language-menu div {
    right: auto;
    left: 0;
    max-width: calc(100vw - 24px);
  }

  .hero {
    min-height: auto;
  }

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

@media (max-width: 520px) {
  main {
    width: min(100% - 22px, 1180px);
  }

  .site-header {
    gap: 12px;
    padding: 10px 12px;
  }

  .top-nav {
    display: none;
  }

  .hero {
    padding-top: 32px;
  }

  .hero-actions .button,
  .controls .button {
    width: 100%;
  }

  .mini-grid,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .tool-panel,
  .legal-panel {
    padding: 16px;
  }

  th,
  td {
    padding: 10px;
  }
}
