/* SoilTwin website. Values come from css/tokens.css (the brand identity); nothing here names a colour directly
   except the reversed logo colourway, which belongs to the fixed humus ground and must not follow the theme.
   Layout idea: the twin line. Paper, Geologica and photographs above it; loess, IBM Plex Mono and raster cells below. */
:root { --wrap: 1120px; --gutter: clamp(16px, 4vw, 48px); }
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-sans); font-size: 16px; line-height: 26px; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: var(--space-4); top: -100px; background: var(--paper); padding: var(--space-2) var(--space-4); z-index: 10; }
.skip:focus { top: var(--space-4); }

/* type */
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1 { font: 300 clamp(44px, 7.4vw, 72px)/0.98 var(--font-display); letter-spacing: -.02em; text-wrap: balance; }
h2 { font: 300 clamp(32px, 4.6vw, 48px)/1.08 var(--font-display); letter-spacing: -.015em; text-wrap: balance; max-width: 20ch; }
h3 { font: 500 22px/28px var(--font-display); letter-spacing: -.005em; }
.lead { font-size: 20px; line-height: 30px; font-weight: 300; max-width: 60ch; }
.narrow { max-width: 56ch; }
.muted { color: var(--ink-muted); }
.label { font: 500 12px/16px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.data { font: 400 14px/20px var(--font-mono); font-variant-numeric: tabular-nums; }

/* logo inks */
.lg { --lg-leaf: var(--sprout); --lg-stem: var(--loam); --lg-ink: var(--logo-ink); --lg-net: var(--signal); height: auto; }
.lg-leaf { fill: var(--lg-leaf); } .lg-stem { fill: var(--lg-stem); } .lg-ink { fill: var(--lg-ink); }
.lg-net-f { fill: var(--lg-net); } .lg-net-s { stroke: var(--lg-net); fill: none; stroke-linecap: round; }
.lg--reversed { --lg-leaf: #8fa24c; --lg-stem: #b8823f; --lg-ink: #f1ecdc; --lg-net: #cea03b; }

/* twin line and raster */
.twinline { width: 100%; height: 14px; fill: var(--logo-ink); }
.raster { width: 100%; height: auto; shape-rendering: crispEdges; }
.nd1, .bg1 { fill: var(--ndvi-1); background: var(--ndvi-1); } .nd2, .bg2 { fill: var(--ndvi-2); background: var(--ndvi-2); }
.nd3, .bg3 { fill: var(--ndvi-3); background: var(--ndvi-3); } .nd4, .bg4 { fill: var(--ndvi-4); background: var(--ndvi-4); }
.nd5, .bg5 { fill: var(--ndvi-5); background: var(--ndvi-5); }
.below { background: var(--loess); }

/* header */
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-8); padding-block: var(--space-6); }
.brand { display: block; flex: none; }
.brand .lg { width: 176px; }
.site-header nav { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); }
.site-header nav a { font-size: 14px; line-height: 21px; font-weight: 500; text-decoration: none; padding-block: var(--space-1); border-bottom: 1px solid transparent; }
.site-header nav a:hover { border-bottom-color: var(--line-strong); }

/* buttons and tags */
.btn { display: inline-block; font: 500 14px/20px var(--font-sans); text-decoration: none; padding: var(--space-3) var(--space-6); border-radius: var(--radius-md); border: 1px solid var(--line-strong); color: var(--ink); }
.btn:hover { background: var(--loess); }
.btn--primary { background: var(--action); border-color: var(--action); color: var(--on-action); }
.btn--primary:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.tag { display: inline-flex; align-items: center; gap: var(--space-2); font: 500 12px/16px var(--font-mono); letter-spacing: .06em; text-transform: uppercase; padding: var(--space-1) var(--space-2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--paper); white-space: nowrap; }
.tag svg { width: 10px; height: 10px; flex: none; }
.tag--low svg { fill: var(--sprout-text); }

/* hero */
.hero-above { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-8); align-items: end; padding-block: var(--space-12) 0; }
.hero-copy { padding-bottom: var(--space-12); }
.hero-copy { display: grid; gap: var(--space-6); justify-items: start; min-width: 0; }
.hero-top { position: relative; overflow: hidden; }
.hero-art { width: 100%; height: auto; align-self: end; shape-rendering: crispEdges; }
.px-sprout { fill: var(--sprout); } .px-soil { fill: var(--soil); } .px-signal { fill: var(--signal); } .px-tint { fill: var(--ndvi-1); } .px-ground { fill: var(--paper); }
.hero .twinline { margin-bottom: -1px; }
.hero-below { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-12); align-items: center; padding-block: var(--space-12) var(--space-16); }
.stats { display: grid; gap: var(--space-6); margin-top: var(--space-6); }
.stats div { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: var(--space-6); align-items: baseline; padding-top: var(--space-4); border-top: 1px solid var(--line); }
.stats dd { grid-column: 1; grid-row: 1; font: 400 32px/36px var(--font-mono); letter-spacing: -.01em; white-space: nowrap; }
.stats dt { grid-column: 2; grid-row: 1; }
.hero-raster { display: grid; gap: var(--space-3); min-width: 0; }

/* sections */
.section { padding-block: var(--space-16); display: grid; gap: var(--space-6); }
.section > .label { margin-bottom: calc(var(--space-3) * -1); }
.split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-12); align-items: start; }
.split > div { display: grid; gap: var(--space-6); min-width: 0; }
.split > div > .label { margin-bottom: calc(var(--space-3) * -1); }
.band { padding-block: var(--space-16); }
.split--card { align-items: center; }

.inputs li { display: grid; grid-template-columns: 13ch minmax(0, 1fr); gap: var(--space-4); align-items: baseline; padding-block: var(--space-3); border-top: 1px solid var(--line); }
.inputs li:last-child { border-bottom: 1px solid var(--line); }

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-8); margin-top: var(--space-6); counter-reset: none; }
.steps li { display: grid; gap: var(--space-2); align-content: start; padding-top: var(--space-4); border-top: 1px solid var(--line-strong); }
.steps .num { font: 400 14px/20px var(--font-mono); color: var(--signal-text); }

.params { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6) var(--space-8); }
.params div { display: grid; gap: var(--space-1); padding-top: var(--space-4); border-top: 1px solid var(--line-strong); }
.params dt { font: 500 22px/28px var(--font-display); }

/* field card */
.card { border: 1px solid var(--line); background: var(--paper); min-width: 0; }
.card-top { padding: var(--space-6); display: grid; gap: var(--space-2); }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-2) var(--space-4); }
.card h3 { font-size: 28px; line-height: 34px; }
.card .twinline { height: 12px; }
.card-bottom { background: var(--loess); border-top: 1px solid var(--line); padding: var(--space-6); display: grid; gap: var(--space-4); }
.card-read { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 168px); gap: var(--space-6); align-items: end; }
.big { font: 400 32px/36px var(--font-mono); letter-spacing: -.01em; margin-top: var(--space-1); }
.delta { color: var(--sprout-text); margin-top: var(--space-1); }
.rows { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2) var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.rows dt { color: var(--ink-muted); } .rows dd { text-align: right; }
.rec { font-size: 14px; line-height: 21px; }

/* guidance */
.guidance { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--space-8); margin-top: var(--space-6); }
.guidance > div { display: grid; gap: var(--space-3); align-content: start; padding-top: var(--space-4); border-top: 1px solid var(--line-strong); min-width: 0; }
.plain li { padding-block: var(--space-2); border-bottom: 1px solid var(--line); }
.ramp { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: var(--space-3); color: var(--ink-muted); font-size: 12px; line-height: 16px; }
.ramp li { display: grid; gap: var(--space-1); }
.ramp i { height: var(--space-6); border-block: 1px solid var(--line-strong); margin-bottom: var(--space-1); }
.ramp li:first-child i { border-left: 1px solid var(--line-strong); } .ramp li:last-child i { border-right: 1px solid var(--line-strong); }
.ramp b { font-weight: 500; color: var(--ink); }

/* photos and partners */
.photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-6); }
.photo { border: 1px solid var(--line); min-width: 0; display: flex; flex-direction: column; }
.photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.photo--wide { grid-column: 1 / -1; }
.photo--wide img { aspect-ratio: 21 / 9; object-position: 50% 42%; }
.photos + .photos { margin-top: var(--space-4); }
.photo .twinline { height: 12px; background: var(--loess); margin-top: -6px; position: relative; }
.photo figcaption { background: var(--loess); padding: var(--space-3) var(--space-6) var(--space-6); display: grid; gap: var(--space-1); flex: 1; margin-top: -1px; }
.partner-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-8); }
.partner-list li { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); align-content: start; min-width: 0; }
.partner-list h3 { font-size: 28px; line-height: 34px; }
.partner-list li > p:last-child { color: var(--ink-muted); font-size: 14px; line-height: 21px; max-width: 44ch; }
/* partner logos keep their own colours, each on the fixed ground it was drawn for */
.plate { display: grid; place-items: center; height: 168px; min-width: 0; padding: var(--space-6); border: 1px solid var(--line); margin-bottom: var(--space-3); }
.plate--dark { background: var(--humus); }
.plate--light { background: #ffffff; }
.plate img { width: auto; height: auto; max-width: min(100%, 280px); max-height: 100px; min-width: 0; }
.plate--dark img { max-width: min(100%, 260px); }
.cloud { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-8); margin-top: var(--space-8); padding-top: var(--space-4); border-top: 1px solid var(--line-strong); }
.cloud ul { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-8); }
.cloud li { display: flex; align-items: center; gap: var(--space-2); font-weight: 500; }
.cloud img { height: 32px; width: auto; }
.supervision { display: grid; gap: var(--space-2); margin-top: var(--space-8); padding: var(--space-6); background: var(--loess); max-width: 720px; }

/* footer: the darkest horizon */
.site-footer { background: var(--humus); color: var(--on-humus); padding-bottom: var(--space-8); margin-top: var(--space-8); }
.twinline--footer { fill: var(--humus); background: var(--paper); margin-bottom: -1px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: var(--space-12); align-items: end; padding-block: var(--space-12); }
.footer-grid .lg:not(.mesh) { width: 220px; margin-bottom: var(--space-6); }
.foot-line { font: 300 20px/30px var(--font-sans); }
.foot-line[lang="uk"] { opacity: .8; }
.site-footer .label { color: inherit; opacity: .8; }

/* soil horizons: the page descends through a chornozem profile. Horizon colours are fixed (soil is soil in
   either theme); each band re-points the text tokens so everything inside stays legible on its ground. */
:root { --hz-o: #2b1e15; --hz-a: #624732; --hz-b: #7a5326; --hz-c: #f1ecdc; }
.hz { background: var(--hz-bg); color: var(--ink); }
.hz-o { --hz-bg: var(--hz-o); } .hz-a { --hz-bg: var(--hz-a); } .hz-b { --hz-bg: var(--hz-b); } .hz-c { --hz-bg: var(--hz-c); } .hz-r { --hz-bg: var(--paper); }
.hz-dark { --ink: #f1ecdc; --ink-muted: #e0d5bd; --line: rgb(241 236 220 / .28); --line-strong: rgb(241 236 220 / .6); --signal-text: #f0d48a; --sprout-text: #c5d58c; --logo-ink: #f1ecdc; --focus: #f1ecdc; }
.hz-light { --ink: #2b1e15; --ink-muted: #6b5a4a; --line: #d8cfb9; --line-strong: #8a7a66; --paper: #ffffff; --loess: #f1ecdc; --logo-ink: #624732; --sprout-text: #56642b; --signal-text: #7a5a10; --alert: #a3381f; --focus: #2b1e15; }
.twinline.hz-surface { fill: var(--hz-o); height: 16px; margin-bottom: -1px; }
.twinline.hz-edge { fill: var(--hz-bg); background: linear-gradient(var(--from) 52%, var(--hz-bg) 52%); height: 16px; }
.hz-tag { display: flex; align-items: baseline; gap: var(--space-4); padding-block: var(--space-6) 0; }
.hz-tag b { font: 400 32px/36px var(--font-mono); letter-spacing: 0; color: var(--ink); }
.hz-tag span:last-child { margin-left: auto; }
.hz .section, .hz .band { padding-top: var(--space-8); }
.hz-c .card-bottom { background: #f8f5ea; }

/* laptop widths: the hero art grows and runs off the right edge of the screen; wider screens keep it inside the content */
@media (min-width: 901px) and (max-width: 1440px) {
  .hero-art { width: auto; max-width: none; margin-right: calc(-1 * max(var(--gutter), (100vw - var(--wrap)) / 2 + var(--gutter))); }
}

@media (max-width: 900px) {
  .hero-above { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); padding-block: var(--space-8) var(--space-12); }
  .hero-copy { padding-bottom: 0; }
  .hero-art { width: 100%; }
  .hero-below, .split, .footer-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guidance { grid-template-columns: minmax(0, 1fr); }
  .section, .band { padding-block: var(--space-12); }
}
@media (max-width: 560px) {
  .steps, .partner-list, .params, .photos { grid-template-columns: minmax(0, 1fr); }
  .photo--wide img { aspect-ratio: 3 / 2; }
  .brand .lg { width: 152px; }
  .inputs li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .card-read { grid-template-columns: minmax(0, 1fr); }
  .lead { font-size: 18px; line-height: 28px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Language navigation stays visible even when the main links wrap. */
.site-header .language-switch { gap: var(--space-3); }
.language-switch a[aria-current="page"] { border-bottom-color: currentColor; }
.language-switch a:not([aria-current]) { color: var(--ink-muted); }
@media (max-width: 700px) {
  .site-header > nav:not(.language-switch) { order: 3; width: 100%; }
  .site-header { column-gap: var(--space-4); }
  .ramp { column-gap: 4px; overflow-wrap: anywhere; }
  .tag { white-space: normal; }
}

/* Compare observations without moving the field: only the map layers crossfade. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.season-intro { font-size: clamp(28px, 3vw, 36px); max-width: 17ch; }
.hero-below { align-items: center; padding-block: var(--space-8) var(--space-12); }
.field-season { gap: 0; border: 1px solid var(--line); background: rgb(0 0 0 / .08); padding: var(--space-6); }
.season-heading { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); }
.season-heading > span:first-child { font-size: 16px; font-weight: 500; }
.season-heading > span:last-child { color: var(--ink-muted); }
.season-controls { border: 0; padding: 0; margin: var(--space-4) 0 0; min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.season-controls[hidden] { display: none; }
.season-choice { position: relative; cursor: pointer; min-width: 0; }
.season-choice input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.season-choice span { display: block; padding: 12px 4px; text-align: center; font: 400 13px/20px var(--font-mono); color: var(--ink-muted); border-bottom: 1px solid var(--line); }
.season-choice input:checked + span { color: var(--ink); border-bottom: 2px solid var(--signal); padding-bottom: 11px; background: rgb(241 236 220 / .05); }
.season-choice input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.season-stage { padding-block: var(--space-8); margin-block: var(--space-4); background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 24px 24px; background-position: center; }
.season-layer { opacity: 0; }
.season-layer[data-active="true"] { opacity: 1; }
.field-season[data-motion="fade"] .season-layer { transition: opacity 240ms cubic-bezier(.23, 1, .32, 1); }
.season-readout { display: flex; justify-content: space-between; align-items: center; gap: var(--space-6); }
.season-value { font-size: 28px; line-height: 36px; margin-top: var(--space-1); }
.season-scale { width: 55%; max-width: 230px; min-width: 0; }
.season-swatches { display: grid; grid-template-columns: repeat(5, 1fr); height: 8px; }
.season-scale p { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; color: var(--ink-muted); font: 400 11px/16px var(--font-mono); }
.season-help { display: none; margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--line); color: var(--ink-muted); font-size: 13px; line-height: 20px; }
.is-interactive .season-help { display: block; }
@media (max-width: 560px) {
  .field-season { padding: var(--space-4); }
  .season-heading { gap: var(--space-2); }
  .season-stage { padding-block: var(--space-6); }
}
@media (prefers-reduced-motion: reduce) {
  .field-season[data-motion="fade"] .season-layer { transition: none; }
}
