/* Ecosystem Explorer.
 *
 * The page is image-first: a water type IS its creatures, so every card leads with
 * the organisms that mark it out rather than with a colour or a score. Sections run
 * micro -> bottom -> plants -> fish, so the reader travels from a diatom to a pike.
 *
 * No status colours anywhere. Green/amber/red mean STATE elsewhere on this site, and
 * a water type is not a state -- a peat pool is not "worse" than a river. */

.eco2 {
    overflow-x: hidden;   /* the 100vw stage must not create a horizontal scrollbar */
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px 64px;
}

/* ---- Hero ---- */
.eco2-hero {
    padding: 40px 0 32px;
    border-bottom: 1px solid var(--border);
}

.eco2-hero h1 {
    font-size: clamp(1.75rem, 4.2vw, 2.75rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-bright);
    max-width: 18ch;
}

.eco2-lead {
    margin-top: 16px;
    max-width: 62ch;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
}

.eco2-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    margin-top: 28px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.eco2-stats > div {
    background: var(--bg-card);
    padding: 14px 16px;
}

.eco2-stats dt {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.eco2-stats dd {
    margin-top: 4px;
    font-size: 1.5rem;
    font-weight: 650;
    color: var(--text-bright);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* ---- Sections ---- */
.eco2-block { padding: 40px 0 8px; }

.eco2-block h2 {
    font-size: clamp(1.25rem, 2.4vw, 1.625rem);
    color: var(--text-bright);
    letter-spacing: -0.01em;
}

.eco2-intro,
.eco2-note {
    margin-top: 10px;
    max-width: 68ch;
    color: var(--text-muted);
    line-height: 1.6;
}

.eco2-note {
    margin-top: 20px;
    font-size: 0.8125rem;
    color: var(--text-faint);
}

/* ---- The four lenses ---- */
.eco2-lenses {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    margin-top: 22px;
    list-style: none;
    counter-reset: none;
}

.eco2-lens {
    position: relative;
    padding: 18px 16px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.eco2-lens-n {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-faint);
}

.eco2-lens h3 {
    font-size: 0.9375rem;
    color: var(--text-bright);
}

.eco2-lens-how {
    margin-top: 6px;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.eco2-lens-count {
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--text-faint);
    font-variant-numeric: tabular-nums;
}

/* ---- Type cards ---- */
.eco2-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 14px;
    margin-top: 22px;
}

.eco2-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition), transform var(--transition);
}

.eco2-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

/* The organisms ARE the illustration: a strip of the taxa that mark this type out.
 * Fixed aspect ratio so the row cannot shift as images decode. */








.eco2-why {
    margin-top: 5px;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text);
}

.eco2-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* Confidence is a WORD, never a percentage -- the number would imply a precision
 * the bootstrap does not support. */
.eco2-conf {
    padding: 2px 8px;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    color: var(--text-faint);
    white-space: nowrap;
}





/* ---- Method ---- */
.eco2-method { border-top: 1px solid var(--border); margin-top: 24px; }

.eco2-method-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px 28px;
    margin-top: 20px;
}

.eco2-method-grid h3 {
    font-size: 0.875rem;
    color: var(--text-bright);
}

.eco2-method-grid p {
    margin-top: 6px;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .eco2-hero { padding-top: 24px; }
    .eco2-stats dd { font-size: 1.25rem; }
    .eco2-grid { grid-template-columns: 1fr; }
}

/* The readable name leads; the Latin follows as a quiet second line, so precision
 * is ADDED rather than substituted. "Microcoleaceae" alone was the complaint that
 * started this page's rebuild. */
.eco2-taxa li {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-style: normal;
}



/* Reveal on scroll. Content is server-rendered and visible without JS; this only
 * softens its arrival, and is skipped entirely under prefers-reduced-motion. */
.eco2-reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 420ms ease, transform 420ms ease;
}

.eco2-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .eco2-reveal { opacity: 1; transform: none; transition: none; }
}

/* "x3" where one readable name covers several families -- the grouping is stated,
 * not hidden, because a repeated chip reads as a bug. */
.eco2-x { color: var(--text-faint); font-variant-numeric: tabular-nums; }

/* =========================================================================
 * THE NATIONAL FIELD
 * A canvas of soft radial glows, not tiles. The point is that neighbouring
 * measurements MERGE: a water type is a region, and the data has no hard edges
 * to draw. Dark map = nobody looked there, which is the honest empty state.
 * ====================================================================== */










/* Reserve the height before the map loads so nothing jumps (CLS). */






.eco2-fieldcanvas { position: absolute; pointer-events: none; }









/* =========================================================================
 * TYPE CARDS — the scene IS the card
 * ====================================================================== */
.eco2-grid { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }

.eco2-scene {
    position: relative;
    aspect-ratio: 16 / 10;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-elevated);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Left-to-right plus bottom-up scrim: the same treatment the lake pages use, so
 * overlaid text stays legible whatever the photo does underneath. */
.eco2-scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, rgba(8,12,18,0.92) 0%, rgba(8,12,18,0.55) 42%, rgba(8,12,18,0.08) 100%),
        linear-gradient(to right, rgba(8,12,18,0.55) 0%, rgba(8,12,18,0) 60%);
}

.eco2-scene-txt { position: relative; padding: 0 16px 8px; }

.eco2-scene-txt h3 {
    font-size: 1.25rem;
    line-height: 1.15;
    color: #fff;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 12px rgba(0,0,0,0.5);
}

.eco2-why {
    margin-top: 5px;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: rgba(255,255,255,0.86);
    text-shadow: 0 1px 10px rgba(0,0,0,0.5);
}

.eco2-scene .eco2-meta {
    position: relative;
    margin: 0;
    padding: 0 16px 14px;
    color: rgba(255,255,255,0.7);
}

.eco2-scene .eco2-conf {
    border-color: rgba(255,255,255,0.28);
    color: rgba(255,255,255,0.8);
}

/* ---- The organisms, at a size you can actually see ---- */
.eco2-org {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    margin: 0;
    padding: 0;
    list-style: none;
    background: var(--border);
}

.eco2-org li {
    position: relative;
    background: var(--bg-card);
    padding-bottom: 8px;
}

.eco2-org-img {
    display: block;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-elevated);
    transition: transform 260ms ease;
}

.eco2-card:hover .eco2-org-img { transform: scale(1.05); }

.eco2-org li { overflow: hidden; }

.eco2-org-name {
    display: block;
    padding: 7px 8px 0;
    font-size: 0.6875rem;
    line-height: 1.25;
    color: var(--text);
}

.eco2-org-lat {
    display: block;
    padding: 1px 8px 0;
    font-size: 0.5625rem;
    font-style: italic;
    color: var(--text-faint);
}

@media (max-width: 640px) {
    #eco2-map { height: 58vh; }
    .eco2-scene-txt h3 { font-size: 1.0625rem; }
}

/* A literal strip of that water's own colour and clarity across the top of the card
 * -- tea-brown peat, soup-green lake, glass-clear sand pit. Not an accent border in
 * the decorative sense: it is a photograph of the water the card is about. */
.eco2-swatch {
    display: block;
    height: 6px;
    background-size: cover;
    background-position: center;
    filter: saturate(1.15);
}

/* =========================================================================
 * THE STAGE — the map IS the hero
 * The page's argument is the variation, and the map shows it; a text hero would
 * delay that by a whole screen to say what a short headline over the map says
 * better. Editorial comes after, once the reader has a question.
 * ====================================================================== */

/* Full bleed without a 100vw breakout: 100vw includes the scrollbar, and the
 * overflow guard that fixes THAT then clips the breakout. Escaping the padded
 * container by its own padding is cleaner and cannot fight itself. */
.eco-stage {
    position: relative;
    margin: -20px -24px 0;
    background: #0b0e13;
    isolation: isolate;
}

.eco-map {
    position: relative;
    height: calc(100vh - 48px);
    min-height: 480px;
    overflow: hidden;
    background: #0b0e13;
}

/* The substrate is one image of every water body in the country, with land rendered
 * transparent — so this background IS the land, and the image's alpha channel is the
 * water mask the field layer clips into. JS sets left/top/width/height from the
 * contain-fit it computed, because the same numbers have to place the measurements. */
.eco-substrate {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    user-select: none;
}

.eco-field {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* Horizontal vignette: quiets the North Sea and Germany without touching the top
 * and bottom of the country. */
.eco-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 450;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(11,14,19,.55), transparent 26%,
                transparent 74%, rgba(11,14,19,.55));
}

/* ---- Headline, over the emptiest water ---- */
.eco-title {
    position: absolute;
    top: 40px;
    left: 40px;
    z-index: 500;
    max-width: 420px;
    pointer-events: none;
    transition: opacity .5s ease;
}

/* A corner scrim that bleeds off the frame, rather than a box drawn around text. */
.eco-title::before {
    content: "";
    position: absolute;
    inset: -40px -140px -130px -48px;
    z-index: -1;
    background: radial-gradient(120% 120% at 0 0, rgba(11,14,19,.94),
                rgba(11,14,19,.55) 52%, transparent 78%);
}

.eco-title .kicker {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,.55);
}

.eco-title h1 {
    margin: 12px 0 10px;
    font-size: clamp(1.75rem, 3.2vw, 2.5rem);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: #fff;
}

.eco-title p {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: rgba(255,255,255,.72);
    max-width: 42ch;
}

/* An intro, not chrome: it steps aside the moment you touch the map. The h1 stays
 * in the DOM for crawlers and screen readers. */
.eco-map.touched ~ .eco-title { opacity: 0; }

/* ---- The plate: the selected or hovered type, big ---- */
.eco-plate {
    position: absolute;
    top: 28px;
    right: 28px;
    z-index: 500;
    width: 428px;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(11,14,19,.82);
    border: 1px solid rgba(255,255,255,.09);
    box-shadow: 0 24px 60px rgba(0,0,0,.55);
    backdrop-filter: blur(14px);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .3s ease, transform .3s ease;
    pointer-events: none;
}

.eco-plate.on { opacity: 1; transform: none; }

.eco-plate-img {
    display: block;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
}

.eco-plate-body { padding: 12px 16px 16px; }

.eco-plate-kicker {
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    color: var(--type, #fff);
}

.eco-plate-body h3 {
    margin-top: 4px;
    font-size: 1.125rem;
    color: #fff;
    letter-spacing: -0.01em;
}

.eco-plate-why {
    margin-top: 5px;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: rgba(255,255,255,.7);
}







/* ---- The tape ---- */
.eco-tape {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 24px;
    z-index: 500;
    padding: 10px 16px 14px;
    border-radius: 16px;
    background: rgba(11,14,19,.74);
    backdrop-filter: blur(14px) saturate(1.2);
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 24px 60px rgba(0,0,0,.5);
}

.eco-cards {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.eco-cards::-webkit-scrollbar { display: none; }

/* TWO PHOTOGRAPHS, ONE DISSOLVE.
 *
 * A card shows the WATER. Picking it dissolves that away to show the PLACE. The two
 * images are stacked -- scene underneath, swatch as a veil over it -- because a
 * background-image cannot cross-fade to another background-image, and fading one
 * layer over an opaque one never passes through a dark midpoint the way fading two
 * against the card would.
 *
 * The ground is the water's mean colour (`--water`, the same figure the gallery
 * uses), so the instant before either photograph decodes is still that water's
 * colour rather than a dark box. It used to be `var(--swatch, <dark gradient>)`
 * with nothing anywhere setting `--swatch` -- so every card in the tape was the
 * fallback, and the tape was ten dark rectangles. */
.eco-card {
    position: relative;
    flex: 0 0 268px;
    height: 116px;
    padding: 0;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    scroll-snap-align: start;
    background: var(--water, #16202c);
    font-family: inherit;
    text-align: left;
    outline: 2px solid transparent;
    outline-offset: 2px;
    transition: filter .25s ease, outline-color .2s ease;
}

.eco-card .scene,
.eco-card .swatch {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: filter .3s ease;
}

/* The water, covering the place until this card is the chosen one.
 *
 * Slow on purpose -- it is the same dissolve the gallery heroes use, shortened
 * because this one answers a tap and has to start moving at once, where the
 * gallery's answers a scroll and can afford to wait. */
.eco-card .swatch {
    opacity: 1;
    transition: opacity 1.1s ease-in-out, filter .3s ease;
}

.eco-card[aria-pressed="true"] .swatch { opacity: 0; }

/* The scrim exists to make the name readable, and that is ALL it may cover. A flat
 * top-to-bottom wash at .25-.82 was a lid on the whole photograph: it put a dark
 * film over water the card is there to show. This keeps the top two fifths clear
 * and does its work in the band the text actually occupies. */
.eco-card-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
                rgba(11,14,19,0) 0%,
                rgba(11,14,19,.04) 40%,
                rgba(11,14,19,.5) 68%,
                rgba(11,14,19,.86) 100%);
}

.eco-card .specimen {
    position: absolute;
    top: 11px;
    left: 11px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--type, #fff);
    background: #0b0e13;
}

.eco-card .count {
    position: absolute;
    top: 14px;
    right: 12px;
    font: 500 0.625rem/1 var(--font-mono);
    /* Above the scrim's reach, so it carries its own contrast. */
    color: rgba(255,255,255,.78);
    text-shadow: 0 1px 4px rgba(0,0,0,.8);
}

.eco-card .name {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 28px;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
}

.eco-card .why {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 11px;
    font-size: 0.6875rem;
    color: rgba(255,255,255,.62);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Selection is the card's own material: the water dissolves to the place behind it,
 * the card rises, and the type's map colour draws itself along the bottom edge. The
 * scrim takes no part -- it is a legibility device, and making it a state signal is
 * what had it swinging between .64 and .9 and hiding the photograph either way. */

.eco-card-stripes { position: absolute; inset: 0; display: flex; transition: filter .3s ease; }
.eco-card-stripes i { flex: 1; }

/* NB: this used to read `@media (max-width: 1279px) { .eco-plate { display: none } }`
 * and it never worked -- a later `.eco-plate { display: flex }` rule has equal
 * specificity and a media query adds none, so the plain rule won and the panel stayed
 * on at every size. On a phone it was 428px wide on a 390px viewport, anchored to
 * `right`, so it hung off the left edge at x=-92 and covered the map.
 *
 * Hiding it was the wrong cure anyway: tapping a water would then do nothing a reader
 * could see. It becomes a sheet instead -- see the phone block at the end of this
 * file, which is where every rule that must beat the desktop layout now lives. */

@media (max-width: 860px) {
    .eco-stage { margin: -12px -16px 0; }
    .eco-title { top: 24px; left: 20px; max-width: 76vw; }
    .eco-title h1 { font-size: 1.5rem; }
    .eco-tape { left: 12px; right: 12px; bottom: 12px; padding: 8px 12px 12px; }
    .eco-card { flex-basis: 218px; height: 104px; }
}

/* ---- The creatures, at a size that earns them ----
 * These were 22px circles with a label, which is a legend, not a showing. They are
 * the reason the page exists: most people have never seen a caddis larva or a
 * desmid, and the whole promise is that variation. So they get a grid of real
 * tiles with the name laid over the image, and the plate is sized around them
 * rather than the other way round. */
.eco-plate-life {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    background: rgba(255,255,255,.07);
}

.eco-life {
    position: relative;
    margin: 0;
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center;
    background-color: #0b0e13;
    overflow: hidden;
}

/* Bottom-up scrim only: the top two-thirds of every specimen stays untouched, so
 * the animal is never dimmed for the sake of its own caption. */
.eco-life::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 62%;
    background: linear-gradient(to top, rgba(8,11,16,.93), rgba(8,11,16,.55) 45%, transparent);
}

.eco-life figcaption {
    position: absolute;
    left: 9px;
    right: 9px;
    bottom: 7px;
    z-index: 1;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    text-shadow: 0 1px 8px rgba(0,0,0,.6);
}

.eco-life figcaption em {
    display: block;
    margin-top: 1px;
    font-size: 0.625rem;
    font-weight: 400;
    font-style: italic;
    color: rgba(255,255,255,.62);
}

/* A single odd one out spans the row rather than leaving a hole. */
.eco-life:last-child:nth-child(odd) { grid-column: 1 / -1; aspect-ratio: 16 / 7; }

/* On a short viewport the plate must not run under the tape: the scene shrinks
 * first, because the creatures are the point. */
@media (max-height: 860px) {
    .eco-plate-img { aspect-ratio: 21 / 9; }
    .eco-life { aspect-ratio: 3 / 2; }
}

@media (max-height: 760px) {
    .eco-plate-img { display: none; }
}

/* ---- Fit the plate between the top of the stage and the tape ----
 * The creature grid was running under the tape and losing four of six animals.
 * The plate now measures itself against the tape's footprint (--eco-tape-h, set by
 * JS) and the scene gives up height first, because the creatures are the point of
 * the panel. Whatever still does not fit is simply not shown -- the full set lives
 * in the sections below, and a half-cropped animal is worse than four whole ones. */
.eco-plate {
    max-height: calc(100% - 28px - var(--eco-tape-h, 200px) - 28px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.eco-plate-img {
    flex: none;
    /* A wide banner, not a 16:9 still: the scene is the mood, the creatures are the
     * subject, and every pixel the scene gives up is a row of animals that fits. */
    aspect-ratio: 3 / 1;
}

.eco-plate-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 11px 14px 0;
}

.eco-plate-life {
    flex: 1;
    min-height: 0;
    margin: 12px -14px 0;
    align-content: start;
    overflow: hidden;
}

/* Four whole creatures beat six cropped ones. */
.eco-life:nth-child(n+5) { display: none; }
.eco-life:last-child:nth-child(odd) { grid-column: auto; aspect-ratio: 4 / 3; }

/* ---- Keep the tape clear of the cookie banner ---- */
.eco-tape { bottom: calc(24px + var(--eco-cookie-h, 0px)); }

/* ---- The headline should break in two, not three ---- */
.eco-title { max-width: 560px; }
.eco-title h1 { max-width: none; }

@media (max-height: 820px) {
    .eco-plate-img { aspect-ratio: 3 / 1; }
    .eco-plate-why { display: none; }
}

@media (max-height: 700px) {
    .eco-plate-img { display: none; }
    .eco-life:nth-child(n+3) { display: none; }
}

/* Two rows of creatures must always fit WHOLE -- a half-cropped animal with its name
 * sliced off is the one thing this panel must never do. So the tile aspect is chosen
 * to fit the height the plate actually has (scene + text + two rows), rather than
 * letting flex distribute, which needs a definite parent height that max-height
 * alone does not provide (tried; the tiles collapsed to zero). */
.eco-life { aspect-ratio: 16 / 9; }
.eco-plate-life { flex: none; }

/* Below this the plate cannot hold two whole rows, so it shows one -- two complete
 * creatures beat four sliced ones.
 *
 * 1010px, not 880: measured, the plate overflows by 112px at a 900-tall viewport and
 * by 12px at 1000, so at 880 the rule stopped applying exactly where it was still
 * needed and the bottom row's captions were sliced on the commonest laptop sizes.
 * It clears at 1080. */
@media (max-height: 1010px) {
    .eco-life:nth-child(n+3) { display: none; }
}

/* =========================================================================
 * THE DIVE — the scene at full size, every creature named
 * The plate is a glance. This is for the reader who wants to look, and it is
 * where the generated scenes finally get to be photographs rather than banners.
 * ====================================================================== */

/* The one control on the plate. It no longer opens a modal -- it scrolls to this
 * water's own section further down the page -- but it keeps the class name because
 * the styling is unchanged and renaming it would touch three files for nothing. */
.eco-dive-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 9px;
    border-radius: 8px;
    border: 1px solid var(--type, #fff);
    background: transparent;
    color: var(--type, #fff);
    font: 600 0.8125rem/1 inherit;
    cursor: pointer;
    pointer-events: auto;
    transition: background .2s ease, color .2s ease;
}

.eco-dive-btn:hover { background: var(--type, #fff); color: #0b0e13; }
/* The plate is pointer-events:none so the map stays draggable behind it; the one
 * control inside it has to opt back in. */
.eco-plate { pointer-events: none; }
.eco-plate .eco-dive-btn { pointer-events: auto; }

/* =========================================================================
 * THE GALLERY — each water at full size, where the scenes get real room
 * ====================================================================== */
.eco-gallery { padding-top: 48px; }

.eco-char {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 0 32px;
    align-items: start;
    padding: 32px 0;
    border-top: 1px solid var(--border);
}

.eco-char:first-of-type { border-top: none; }

.eco-char-img {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg);
    background-size: cover;
    background-position: center;
    background-color: var(--bg-elevated);
}

/* THE VEIL. Each hero opens as the water itself -- the swatch photograph, filling the
 * frame -- and fades to the scene as the section reaches the viewport. You see what
 * the water looks like before you see what lives in it.
 *
 * This replaces a thin strip that painted the same photograph at `background-size:
 * cover` in an 8px-tall box, which cropped a band out of the middle of a 1024px image
 * and read as a squashed second picture pasted under the hero.
 *
 * DEFAULT IS LIFTED, NOT VEILED. Opacity 0 here and JS adds `.veiled`, so a reader
 * whose JavaScript never runs gets the scene rather than a permanent sheet of water
 * over it. The failure mode of a decoration must never be a hidden page. */
.eco-char-swatch {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    background-size: cover;
    background-position: center;
    opacity: 0;
    /* A short hold, then a slow dissolve: long enough to register as the water, not
     * so long that it feels like a loading state. `ease-in-out` rather than `ease`
     * keeps the water up through the first beat instead of dropping away immediately,
     * which is what makes it read as a dissolve and not as a fade-in of the scene. */
    transition: opacity 1.9s ease-in-out 0.3s;
    pointer-events: none;
}

.eco-char.veiled .eco-char-swatch {
    opacity: 1;
    transition: none;              /* arrive veiled; only the lift is animated */
}

@media (prefers-reduced-motion: reduce) {
    /* No veil at all under reduced motion -- the JS skips it, and this makes sure a
     * stale class cannot leave the scene covered. */
    .eco-char.veiled .eco-char-swatch { opacity: 0; }
}

.eco-char-lead {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.eco-char-txt h3 {
    margin: 8px 0 10px;
    font-size: clamp(1.25rem, 2.2vw, 1.625rem);
    line-height: 1.12;
    letter-spacing: -0.015em;
    color: var(--text-bright);
}

.eco-char-txt p + p { margin-top: 10px; }

.eco-char-txt p:not(.eco-char-lead) {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text);
    max-width: 56ch;
}

/* What was MEASURED in this character, as against the prose above it, which is
 * written. Two different kinds of claim, so they do not share a paragraph. */
.eco-char-kinds {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding: 0;
    list-style: none;
}

.eco-char-kinds li {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 7px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.eco-char-kinds b { font-size: 0.8125rem; color: var(--text-bright); }

.eco-char-kinds span {
    font-size: 0.6875rem;
    color: var(--text-faint);
    font-variant-numeric: tabular-nums;
}

.eco-char-life {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
}

.eco-char-life li { min-width: 0; }

.eco-char-life span {
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-lg);
    background-size: cover;
    background-position: center;
    background-color: var(--bg-elevated);
}

.eco-char-life b {
    display: block;
    margin-top: 8px;
    font-size: 0.8125rem;
    color: var(--text-bright);
}

.eco-char-life i {
    display: block;
    font-size: 0.6875rem;
    font-style: italic;
    color: var(--text-faint);
}

@media (max-width: 820px) {
    .eco-char { grid-template-columns: 1fr; gap: 18px; }
    .eco-char-life { grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); }
}

/* ---- Paging through the lens from inside the dive ----
 * The arrows sit OUTSIDE the panel, against the backdrop, so they never compete
 * with the photograph and never move as the panel's height changes between types.
 * Each one names the water it leads to: an unlabelled chevron makes you click to
 * find out, which on a set of three or four is the whole journey. */

/* The chevron is drawn rather than shipped as an icon file: it is two borders. */

/* The label is the point, but it must not push the button wide on a narrow screen. */

/* A short lift on each step, so paging reads as movement rather than as the panel
 * blinking into different content. *

}

 */
/* ---- Tape selection, rebuilt ----
 * The first version said "selected" with an outline ring and said "not selected"
 * by draining the colour out with a saturate() filter. Both are borrowed gestures:
 * a ring is focus furniture bolted on top of the card rather than part of it, and
 * greyscale throws away the one thing that ties a card to its region on the map --
 * its colour. A tape of grey cards also stops being a legend.
 *
 * So selection is now made of the card's own material: the scrim lifts so the water
 * comes forward, the card rises, and the type's map colour draws itself along the
 * bottom edge. Unselected cards keep their hue and simply sit further back under a
 * heavier scrim -- dimmer, never drained. */

.eco-card {
    outline: none;
    outline-offset: 0;
    transition: transform .26s cubic-bezier(.2,.7,.3,1),
                box-shadow .26s ease,
                filter .2s ease;
}

/* The type's colour, drawn on rather than framed around: it wipes in from the left
 * and is the same hue the region wears on the map, so the tape reads as the legend
 * it actually is. */
.eco-card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--type, rgba(255,255,255,.5));
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .34s cubic-bezier(.2,.7,.3,1);
}

.eco-card[aria-pressed="true"]::after { transform: scaleX(1); }

.eco-card[aria-pressed="true"] {
    transform: translateY(-5px);
    box-shadow: 0 14px 30px rgba(0,0,0,.55);
}

.eco-card:hover { transform: translateY(-2px); }
.eco-card[aria-pressed="true"]:hover { transform: translateY(-5px); }

/* Unselected while something else is: further back, same colour. Nothing on this
 * tape is ever greyed -- greyscale throws away the one thing that ties a card to its
 * region on the map.
 *
 * The dimming is on the PHOTOGRAPHS, not on a scrim over them. Reaching for the
 * scrim meant the recede state was a near-opaque dark wash (.55 to .9), so the
 * moment a reader picked any water the other nine stopped showing their water at
 * all -- which is the whole content of the card. */
.eco-cards.has-selection .eco-card[aria-pressed="false"] .scene,
.eco-cards.has-selection .eco-card[aria-pressed="false"] .swatch,
.eco-cards.has-selection .eco-card[aria-pressed="false"] .eco-card-stripes {
    filter: brightness(.66);
}

.eco-cards.has-selection .eco-card[aria-pressed="false"] .name { color: rgba(255,255,255,.74); }
.eco-cards.has-selection .eco-card[aria-pressed="false"] .why { color: rgba(255,255,255,.4); }

/* The specimen ring was a second coloured outline competing with the first. It is
 * now a neutral hairline whose only job is to separate the animal from the water
 * behind it. */
.eco-card .specimen {
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: 0 2px 10px rgba(0,0,0,.45);
}

.eco-card[aria-pressed="true"] .specimen { border-color: rgba(255,255,255,.42); }

/* Keyboard users still need to see where they are; that is what a ring is FOR. */
.eco-card:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .eco-card,
    .eco-card .swatch,
    .eco-card::after { transition: none; }
    .eco-card[aria-pressed="true"],
    .eco-card:hover { transform: none; }
}


/* =========================================================================
 * THE FOUR METHODS, DEMOTED
 * They used to be tabs across the top of the tape, which made the page ask
 * "which way of looking?" before it had said what there was to look at — and
 * since a method is not a kind of water, the same water then appeared four
 * times under four names. They are now a line each inside the water they
 * describe: what the microscope, the kick-net, the rake and the fyke each
 * found here, and in what share of the places they looked.
 * ====================================================================== *

/* The four methods, as a line each inside the water they describe.
 *
 * These rules were written as `.eco-plate-lenses li, .eco-dive-lenses li { ... }`, and
 * removing the modal's styles took the whole selector list with them -- the plate's
 * rows silently fell back to list-item. A shared selector list is only as safe as the
 * least-wanted selector in it; now that the modal is gone these name the plate alone. */
.eco-plate-lenses {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 1px;
}

.eco-plate-lenses li {
    display: grid;
    grid-template-columns: 5.5rem 1fr auto;
    align-items: baseline;
    gap: 8px;
    padding: 5px 0;
    border-top: 1px solid rgba(255,255,255,.07);
}

.eco-plate-lenses li:first-child { border-top: none; }

.eco-plate-lenses b {
    min-width: 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255,255,255,.9);
}

/* A method that barely reached this water is shown, not hidden — the page's rule is
 * that "nobody looked" and "nothing lives there" are different statements — but it is
 * set back so it cannot be mistaken for a finding. */
.eco-plate-lenses li.sparse b,
.eco-char-kinds li.sparse b { font-style: italic; opacity: .6; font-weight: 400; }
.eco-plate-lenses li.sparse .eco-lens-share { color: rgba(255,255,255,.35); }

.eco-lens-name {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.42);
} */
/* A share is a proportion of a sample, so it is set in the same tabular figures
 * the rest of the site uses for measured quantities rather than as body text. */
.eco-lens-share {
    font: 600 0.75rem/1 var(--font-mono);
    font-variant-numeric: tabular-nums;
    color: var(--type, #fff);
}

/* The character's own prose, in the dive. The plate shows only the one-line lead;
 * this is where the writing gets room. */

/* In the gallery the same three facts sit in the existing chip, so the method
 * gets a kicker above the name rather than a row of its own. */
.eco-char-kind-lens {
    font-size: 0.5625rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-faint);
}

@media (max-width: 520px) {
    .eco-plate-lenses li { grid-template-columns: 4.5rem 1fr auto; gap: 6px; }
}

/* =========================================================================
 * THE TAPE MUST SHOW EVERY WATER
 * With nine waters plus "all", fixed 268px cards ran to 2,680px inside a
 * ~1,550px stage — and `scrollbar-width: none` removed the one hint that
 * anything lay beyond the edge. Two of the nine were simply invisible, which
 * is how brackish water and the sea came to look like they were missing.
 *
 * The cards now SHARE the width instead of claiming a fixed slice, so on a
 * desktop all of them are on screen at once. The min-width keeps them from
 * collapsing on a phone, where the row scrolls — and there it gets a visible
 * edge fade, because a hidden scrollbar with no fade is an invisible control.
 * ====================================================================== */
.eco-cards {
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.22) transparent;
}

.eco-card { flex: 1 1 0; min-width: 132px; max-width: 300px; }

/* Below this the card is a photograph with a name on it; the one-line
 * description would wrap to four lines and shove the name out of the frame.
 * It is not lost — the plate prints it the moment the water is selected. */
/* With nine waters plus "all" the cards are ~145px wide even on a large desktop, and
 * the one-line description wraps to four lines and pushes the name out of the frame.
 * It is not lost: the plate prints it the moment a water is selected. */
.eco-card .why { display: none; }

@media (max-width: 900px) {
    .eco-card { flex: 0 0 190px; min-width: 190px; height: 104px; }
    .eco-card .why { display: none; }
    /* The row scrolls here, so say so: a fade at the trailing edge is the
     * cheapest honest affordance, and unlike an arrow it cannot fall out of
     * step with the scroll position.
     *
     * NB: do NOT add `position: relative` to anchor this. The tape is already
     * `position: absolute`, which is just as good a containing block -- and
     * relative drops it out of the overlay and back into normal flow, where it
     * stacks BELOW the map instead of over it. That made the stage 896px tall
     * against a 760px map, pushed the tape 13px under the fold on every phone,
     * and left the map covering the cards so they could not be tapped at all. */
    .eco-tape::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 40px;
        pointer-events: none;
        border-radius: 0 16px 16px 0;
        background: linear-gradient(90deg, transparent, rgba(11,14,19,.92));
    }
}

/* A method that barely reached this water is shown, not hidden — the page's rule is
 * that "nobody looked" and "nothing lives there" are different statements — but it is
 * set back so it cannot be mistaken for a finding. */

/* The lens rows now carry a phrase ("haften en kokerjuffers tussen de planten")
 * rather than a two-word type name, so they wrap to two lines and pushed the creature
 * tiles out of the plate — which is the one thing this panel must not lose, since the
 * creatures are why the page exists. Tighter rows and a shallower scene buy them back. */
.eco-plate-img { aspect-ratio: 21 / 9; }

.eco-plate-lenses li { padding: 3px 0; }

.eco-plate-lenses b {
    font-size: 0.75rem;
    line-height: 1.3;
}

.eco-plate-lenses .eco-lens-name { line-height: 1.3; }


/* =========================================================================
 * THE PHONE
 * Last in the file ON PURPOSE. The desktop plate is defined in several passes
 * further up, and the last definition wins at equal specificity — so anything
 * that must override it has to come after all of them, not merely inside a
 * media query.
 * ====================================================================== */
@media (max-width: 900px) {
    /* A BAR, not a sheet.
     *
     * The phone version used to be the desktop panel re-flowed: scene hidden, lead
     * hidden, four lens rows, four creatures, capped at 47vh. Measured on a 390x844
     * iPhone that came to 322px tall and covered 247 of the country's 422 rendered
     * pixels — 59% of the map, to show a cramped copy of what the section below
     * already renders properly. The same reasoning that removed the modal applies
     * here: this is a glance, "Duik erin" is the way to the detail, and the detail
     * is served by one DOM rather than two.
     *
     * So the panel collapses to thumbnail + name + lead + place count, and docks in
     * space the map was never using — that screen had 99px of slack above the
     * country and 79px below it. `--eco-bar-h` is the reserve sizeStage() keeps
     * clear for it, declared here so the height has ONE definition; the country is
     * fitted above it whether or not a water is picked, so picking one never moves
     * the map. */
    .eco-stage { --eco-bar-h: 108px; }

    .eco-plate {
        top: auto;
        left: 10px;
        right: 10px;
        width: auto;
        bottom: calc(var(--eco-tape-h, 200px) + 6px);
        max-height: none;
        border-radius: 12px;

        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        transform: translateY(10px);
    }

    .eco-plate.on { transform: none; }

    /* The scene comes BACK on the phone, as a thumbnail. Three height-based rules
     * further up hide it (760px, 700px) or squash it to a 3:1 banner — all written
     * for the tall panel, all wrong for a 56px square, and all beaten only because
     * this block is last in the file. */
    .eco-plate-img {
        display: block;
        flex: none;
        width: 56px;
        height: 56px;
        aspect-ratio: auto;
        border-radius: 9px;
    }

    .eco-plate-body {
        flex: 1;
        min-width: 0;
        /* Clear of the chevron. */
        padding: 0 20px 0 0;
    }

    /* Name first, then what kind of water it is, then how much was measured. The
     * source order is kicker-then-name because that is the reading order in a panel
     * with a photograph above it; in a bar the name has to lead. */
    .eco-plate-body h3 { order: 1; margin-top: 0; font-size: 1rem; line-height: 1.25; }

    /* The lead is back — it is the one sentence that says what this water IS, and in
     * a bar there is room for it because the lens rows are gone. One line: it is a
     * label here, not prose, and the full paragraph is in the section below. */
    .eco-plate-why {
        order: 2;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-top: 2px;
        font-size: 0.75rem;
        line-height: 1.35;
        /* TWO lines, and always the height of two.
         *
         * One line clipped the two longest leads mid-word -- "Het meest voorkomende
         * water van Ne..." and "Zout, altijd in beweging, en twee k..." -- which
         * spends the sentence and delivers none of it. Holding the height fixed
         * whether the lead needs one line or two keeps every bar the same size: it
         * is docked to the bottom, so a shorter lead would otherwise make it grow
         * upward and the whole bar would jump as the reader taps along the tape. */
        min-height: 2.7em;
    }

    .eco-plate-kicker { order: 3; margin-top: 3px; }

    /* Coverage figures and creature tiles do not fit in a bar and do not need to:
     * they are rendered full size, from the server, in #char-<slug> — which is
     * exactly where the bar goes when tapped. */
    .eco-plate-lenses,
    .eco-plate-life { display: none; }

    /* The whole bar is the control. The button keeps its label for assistive tech
     * and gives up its box: a bordered button inside a bar this short reads as a
     * second thing to hit, and the bar has nothing else to hit. */
    .eco-dive-btn {
        position: absolute;
        inset: 0;
        width: auto;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 12px;
        background: transparent;
        font-size: 0;
    }

    .eco-dive-btn:hover,
    .eco-dive-btn:focus-visible { background: rgba(255,255,255,.05); color: transparent; }
    .eco-dive-btn:active { background: rgba(255,255,255,.09); color: transparent; }

    /* Points down, because that is where it goes. */
    .eco-dive-btn::after {
        content: "";
        position: absolute;
        top: 50%;
        right: 15px;
        width: 8px;
        height: 8px;
        margin-top: -6px;
        border-right: 2px solid var(--type, #fff);
        border-bottom: 2px solid var(--type, #fff);
        transform: rotate(45deg);
    }

    /* The headline must not sit under the bar. It is an invitation, and once a
     * water is picked the invitation has been accepted. */
    .eco-map.touched ~ .eco-title { opacity: 0; pointer-events: none; }
}
