:root {
  --kiln: #f7f7f2;
  --cobalt: #1746b0;
  --paprika: #d8432e;
  --maize: #f2b632;
  --beet: #8b2457;
  --soil: #35234f;
  --leaf: #347a52;
  --lilac: #7357a6;
  --ink: #24183a;
  --rule: rgba(36, 24, 58, 0.22);
  --page: min(1180px, calc(100vw - 48px));
  --display: "Anybody", "Arial Narrow", sans-serif;
  --body: "Atkinson Next", Arial, sans-serif;
  --mono: "IBM Plex Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--kiln);
}

body {
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background: var(--kiln);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--cobalt);
}

button,
select {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
  box-shadow: 0 0 0 7px var(--kiln);
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--kiln);
  background: var(--soil);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: var(--page);
  margin: 0 auto;
  padding: 24px 0 18px;
  border-bottom: 2px solid var(--ink);
}

.wordmark,
.language-nav {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.wordmark {
  font-weight: 700;
  text-decoration: none;
}

.language-nav {
  display: flex;
  gap: 18px;
}

.language-nav [aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.hero {
  position: relative;
  display: grid;
  align-content: center;
  width: var(--page);
  min-height: min(860px, calc(100svh - 70px));
  margin: 0 auto;
  padding: 90px 0 120px;
}

.hero::before {
  position: absolute;
  z-index: -1;
  inset: 32px -24px 56px 45%;
  content: "";
  opacity: 0.42;
  background: repeating-linear-gradient(0deg, transparent 0 31px, rgba(23, 70, 176, 0.18) 31px 33px);
  clip-path: polygon(24% 0, 100% 0, 100% 100%, 0 100%);
}

.hero-copy {
  max-width: 1020px;
}

.kicker,
.section-label,
.plate-period {
  margin: 0 0 26px;
  color: var(--cobalt);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1,
h2 {
  margin: 0;
  font-family: var(--display);
  font-variation-settings: "wdth" 108;
  font-weight: 760;
  letter-spacing: -0.045em;
  line-height: 0.94;
}

h1 {
  max-width: 900px;
  color: var(--soil);
  font-size: clamp(5.3rem, 11vw, 10.6rem);
}

h2 {
  font-size: clamp(3.1rem, 6vw, 6.4rem);
}

h3 {
  margin: 0 0 16px;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.headline {
  max-width: 880px;
  margin: 48px 0 0;
  font-size: clamp(1.55rem, 3.3vw, 2.8rem);
  line-height: 1.12;
}

.headline strong {
  display: inline;
  color: var(--paprika);
  font-family: var(--display);
  font-variation-settings: "wdth" 112;
  font-size: 1.23em;
  font-weight: 800;
}

.intro {
  max-width: 690px;
  margin: 32px 0 0;
  font-size: 1.22rem;
}

.hero-cue {
  position: absolute;
  right: 0;
  bottom: 42px;
  display: flex;
  gap: 22px;
  align-items: center;
  color: var(--cobalt);
  font-family: var(--mono);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.hero-cue span {
  font-size: 1.4rem;
}

.instrument {
  color: var(--kiln);
  background: var(--cobalt);
  border-top: 8px solid var(--maize);
}

.instrument-head,
.instrument-reading {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.95fr);
  gap: 70px;
  width: var(--page);
  margin: 0 auto;
}

.instrument-head {
  align-items: end;
  padding: 70px 0 38px;
}

.instrument .section-label {
  color: var(--maize);
}

.instrument h2 {
  max-width: 780px;
}

.controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 12px;
  align-items: end;
}

.controls label {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.controls select,
.plate-toggle {
  min-height: 54px;
  border: 2px solid var(--kiln);
  border-radius: 0;
}

.controls select {
  width: 100%;
  padding: 10px 42px 10px 14px;
  color: var(--ink);
  background: var(--kiln);
}

.controls select:disabled,
.plate-toggle:disabled {
  opacity: 0.72;
}

.plate-toggle {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 10px 16px;
  color: var(--kiln);
  background: transparent;
  cursor: pointer;
}

.plate-toggle:hover:not(:disabled) {
  color: var(--ink);
  background: var(--maize);
}

.plate-stage {
  position: relative;
  overflow: hidden;
  background: var(--kiln);
}

#plate-visual {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.plate-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.soil {
  fill: var(--soil);
}

.soil-line {
  fill: none;
  stroke: var(--maize);
  stroke-width: 8;
}

.plate-top,
.roots {
  transition: transform 700ms cubic-bezier(0.2, 0.75, 0.25, 1), opacity 420ms ease;
}

.plate-top {
  transform-box: fill-box;
  transform-origin: center;
}

.plate-rim {
  fill: var(--kiln);
  stroke: var(--cobalt);
  stroke-width: 15;
}

.plate-segment {
  stroke: var(--kiln);
  stroke-width: 3;
}

.plate-well {
  fill: var(--kiln);
  stroke: var(--cobalt);
  stroke-width: 6;
}

.root-line {
  fill: none;
  stroke-linecap: round;
  stroke-width: 5;
}

.root-label circle {
  fill: var(--kiln);
}

.root-label text {
  fill: var(--kiln);
  font-family: var(--mono);
  font-size: 19px;
  letter-spacing: 0.02em;
}

.roots-dense .root-label text {
  font-size: 17px;
}

.plate-stage.is-lowered .plate-top {
  transform: translateY(155px);
}

.plate-stage.is-lowered .roots {
  opacity: 0.08;
}

.plate-period {
  position: absolute;
  top: 30px;
  left: max(24px, calc((100% - 1120px) / 2));
  max-width: 270px;
  color: var(--cobalt);
}

.mobile-region-key {
  display: none;
}

.plate-scope {
  max-width: 780px;
  margin: 18px auto 0;
  padding: 0 24px;
  color: #d9e3ff;
  font-family: var(--mono);
  font-size: 0.7rem;
}

.tone-0 { fill: var(--paprika); background: var(--paprika); }
.tone-1 { fill: var(--maize); background: var(--maize); }
.tone-2 { fill: var(--beet); background: var(--beet); }
.tone-3 { fill: var(--leaf); background: var(--leaf); }
.tone-4 { fill: var(--cobalt); background: var(--cobalt); }
.tone-5 { fill: var(--lilac); background: var(--lilac); }
.tone-6 { fill: #a99dbc; background: #a99dbc; }
.tone-stroke-0 { stroke: var(--paprika); }
.tone-stroke-1 { stroke: var(--maize); }
.tone-stroke-2 { stroke: #d86b9f; }
.tone-stroke-3 { stroke: #6dbf83; }
.tone-stroke-4 { stroke: #6f94ef; }
.tone-stroke-5 { stroke: #a98bd5; }

.instrument-reading {
  padding: 54px 0 86px;
}

.result-block {
  padding-top: 8px;
  border-top: 2px solid var(--maize);
}

.result-range {
  margin: 18px 0 0;
  font-family: var(--display);
  font-variation-settings: "wdth" 102;
  font-size: clamp(2.3rem, 4.3vw, 4.5rem);
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1.03;
}

.result-comparison {
  max-width: 650px;
  margin: 24px 0 0;
  color: #d9e3ff;
}

.crop-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(247, 247, 242, 0.5);
}

.crop-row {
  display: grid;
  grid-template-columns: 10px minmax(120px, 0.8fr) minmax(150px, 1.2fr);
  gap: 10px 14px;
  align-items: baseline;
  padding: 13px 0;
  border-bottom: 1px solid rgba(247, 247, 242, 0.28);
}

.crop-mark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.crop-name {
  font-weight: 700;
}

.crop-share,
.crop-origins {
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.45;
}

.crop-origins {
  grid-column: 2 / -1;
  color: #d9e3ff;
}

.crop-row-other {
  opacity: 0.8;
}

.ruled-section {
  width: var(--page);
  margin: 0 auto;
  padding: 92px 0 108px;
  border-top: 2px solid var(--ink);
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.95fr);
  gap: 80px;
  align-items: start;
}

.section-grid h2 {
  max-width: 680px;
  color: var(--soil);
}

.prose {
  max-width: 660px;
}

.prose p,
.global-intro {
  margin: 0;
  font-size: 1.26rem;
}

.prose p + p {
  margin-top: 28px;
}

.global {
  position: relative;
  overflow: clip;
}

.global::after {
  position: absolute;
  z-index: -1;
  right: -4vw;
  bottom: 60px;
  width: 30vw;
  height: 30vw;
  max-width: 390px;
  max-height: 390px;
  content: "";
  border: 28px solid rgba(216, 67, 46, 0.09);
  border-radius: 50%;
}

.global-intro {
  max-width: 640px;
  margin-top: 30px;
}

.metrics {
  margin: 0;
  border-top: 2px solid var(--ink);
}

.metric-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 22px;
  padding: 14px 0 12px;
  border-bottom: 1px solid var(--rule);
}

.metric-row dt {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric-row dd {
  margin: 0;
  color: var(--paprika);
  font-family: var(--display);
  font-size: clamp(2.4rem, 4.8vw, 4.8rem);
  font-weight: 760;
  line-height: 0.9;
}

.combined {
  margin: 18px 0 0;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.implication {
  max-width: 980px;
  margin: 95px 0 0;
  color: var(--cobalt);
  font-family: var(--display);
  font-size: clamp(2.4rem, 5.3vw, 5.6rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.country-data {
  margin-top: 74px;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

.country-data summary {
  padding: 22px 46px 22px 0;
  color: var(--cobalt);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.table-wrap {
  max-height: 560px;
  overflow: auto;
  border-top: 1px solid var(--rule);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

caption {
  padding: 18px 0;
  text-align: left;
  font-size: 0.9rem;
}

th,
td {
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}

thead th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: var(--kiln);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tbody th {
  font-weight: 500;
}

td {
  font-family: var(--mono);
  font-size: 0.8rem;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 60px;
  padding: 62px max(24px, calc((100vw - 1180px) / 2));
  color: var(--kiln);
  background: var(--soil);
}

.site-footer h2 {
  font-size: 2.4rem;
  color: var(--kiln);
}

.site-footer ul {
  margin: 24px 0 0;
  padding-left: 20px;
}

.site-footer li + li {
  margin-top: 8px;
}

.footer-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.68rem;
  text-align: right;
  text-transform: uppercase;
}

.back-to-top.is-enhanced {
  position: fixed;
  z-index: 20;
  right: 16px;
  bottom: 16px;
  display: flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--ink);
  background: var(--maize);
  border: 2px solid var(--ink);
  opacity: 0;
  pointer-events: none;
  text-indent: -999px;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.back-to-top.is-enhanced::after {
  content: "↑";
  font-family: var(--mono);
  font-size: 1.15rem;
  text-indent: 0;
}

.back-to-top.is-enhanced.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 820px) {
  :root {
    --page: calc(100vw - 32px);
  }

  body {
    font-size: 1.04rem;
  }

  .site-header {
    padding-top: 18px;
  }

  .wordmark {
    max-width: 90px;
    line-height: 1.25;
  }

  .hero {
    min-height: auto;
    padding: 76px 0 110px;
  }

  .hero::before {
    inset: 32px -16px 30px 22%;
  }

  h1 {
    font-size: clamp(3.7rem, 17vw, 5rem);
    font-variation-settings: "wdth" 82;
    letter-spacing: -0.055em;
  }

  h2 {
    font-size: clamp(2.75rem, 13vw, 5rem);
    font-variation-settings: "wdth" 90;
  }

  .headline {
    margin-top: 38px;
  }

  .hero-cue {
    bottom: 30px;
  }

  .instrument-head,
  .instrument-reading,
  .section-grid,
  .site-footer {
    grid-template-columns: minmax(0, 1fr);
  }

  .instrument-head > *,
  .instrument-reading > *,
  .section-grid > *,
  .site-footer > *,
  .controls,
  .controls select,
  .plate-toggle {
    min-width: 0;
    max-width: 100%;
  }

  .instrument-head,
  .instrument-reading,
  .section-grid {
    gap: 38px;
  }

  .instrument-head {
    padding-top: 54px;
  }

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

  .controls label {
    grid-column: auto;
  }

  .plate-toggle {
    justify-content: space-between;
  }

  .plate-period {
    top: 15px;
    left: 16px;
    max-width: 185px;
    font-size: 0.68rem;
  }

  .root-label text {
    font-family: var(--body);
    font-size: 20px;
    font-weight: 600;
  }

  .roots-dense .root-label text {
    font-size: 13px;
  }

  .root-line {
    stroke-width: 5;
  }

  .instrument-reading {
    padding-top: 42px;
  }

  .result-range {
    font-size: clamp(2.1rem, 10vw, 3.4rem);
  }

  .crop-row {
    grid-template-columns: 10px minmax(100px, 0.85fr) minmax(130px, 1.15fr);
  }

  .ruled-section {
    padding: 70px 0 82px;
  }

  .section-grid h2 {
    font-size: clamp(2.75rem, 13vw, 5rem);
    font-variation-settings: "wdth" 90;
  }

  .implication {
    margin-top: 70px;
  }

  .site-footer {
    gap: 44px;
  }

  .footer-end {
    gap: 24px;
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 430px) {
  .root-label text {
    display: none;
  }

  .mobile-region-key {
    display: block;
    padding: 20px 16px 26px;
    color: var(--kiln);
    background: var(--soil);
  }

  .mobile-region-key p {
    margin: 0 0 12px;
    color: var(--maize);
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .mobile-region-key ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .mobile-region-key li {
    position: relative;
    padding-left: 13px;
    font-size: 0.82rem;
    line-height: 1.25;
  }

  .mobile-region-key li::before {
    position: absolute;
    top: 0.5em;
    left: 0;
    width: 6px;
    height: 6px;
    content: "";
    background: var(--maize);
    border-radius: 50%;
  }
}

@media (max-width: 820px) {
  html[lang="en"] h1 {
    font-size: clamp(3.55rem, 16vw, 4.7rem);
  }
}

@media (max-width: 430px) {
  .language-nav {
    gap: 10px;
    font-size: 0.64rem;
  }

  .headline {
    font-size: 1.42rem;
  }

  .intro,
  .prose p,
  .global-intro {
    font-size: 1.08rem;
  }

  .plate-stage {
    min-height: 305px;
  }

  .plate-svg {
    min-width: 0;
  }

  .crop-row {
    grid-template-columns: 10px 1fr;
  }

  .crop-share,
  .crop-origins {
    grid-column: 2;
  }

  .metric-row dd {
    font-size: 2.55rem;
  }

  .table-wrap {
    width: 100%;
    max-width: 100%;
  }

  table {
    table-layout: fixed;
  }

  th,
  td {
    min-width: 0;
    padding-right: 7px;
    overflow-wrap: anywhere;
  }

  th:first-child {
    width: 42%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .hero-cue,
  .controls,
  .country-data,
  .site-footer {
    display: none;
  }

  .hero {
    min-height: auto;
  }
}
