/* IFML design refinement layer. Loads after site.css on every page.
   House rules: flat colour, no gradients/glows/hairlines, one frame,
   sentence-case labels, full-ink body text, two typefaces (Georgia + Segoe UI). */

:root {
    --ground: #f0f1ec;
    --ground-alt: #e4eae5;
    --ink: #16201b;
    --ink-soft: #3f4a44;
    --green: #173e31;
    --green-deep: #0f2b22;
    --gold: #8a6212;
    --frame: min(1320px, calc(100% - 48px));
    --section-gap: clamp(72px, 9vw, 150px);
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --text-muted: #55625b;
    --text-low: #3f4a44;
}

body {
    background: var(--ground);
    color: var(--ink);
    line-height: 1.6;
}

body::before,
.ring-band::before,
.footer::before,
.hero-wave,
.ring-band-wave-top,
.ring-band-wave-bottom,
.footer-wave,
.container::before,
.info-card::before,
.note-panel::before,
.stat-card::before,
.software-card::before,
.spec-box::before,
.citation-block::before,
.pub-card::before,
.sidebar::before,
.coverage-card::before,
.workflow-step::before {
    content: none;
    display: none;
    background: none;
}

/* ---------- type ---------- */
h1, h2, h3, h4 { color: var(--ink); letter-spacing: -0.015em; }
h1 { font-size: clamp(2.8rem, 6.2vw, 5.75rem); line-height: 1; letter-spacing: -0.03em; }
h2 { font-size: clamp(2rem, 3.6vw, 3.25rem); line-height: 1.05; letter-spacing: -0.02em; margin-top: 0; }
h3 { font-size: 1.4rem; }
p, ul, ol { color: var(--ink); font-size: 1.0625rem; line-height: 1.6; }
.muted, .page-intro, .gallery-intro { color: var(--ink-soft); }

/* Labels become plain sentence-case text, never tracked caps */
.eyebrow, .page-kicker, .stat-unit, .coverage-label, .footer-nav-group strong, .spec-unit {
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.9375rem;
    font-weight: 600;
}
.eyebrow { color: var(--gold); }
code, .mono, .zenodo-doi .mono { font-family: inherit; font-variant-numeric: tabular-nums; }
pre, pre code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- navigation: plain bar ---------- */
.nav-bar {
    padding: 12px max(24px, calc((100% - 1320px) / 2));
    background: var(--ground);
    border-bottom: 0;
    box-shadow: none;
}
.nav-bar.nav-scrolled { background: var(--ground); box-shadow: none; }
.nav-bar a { border-bottom: 0; font-weight: 600; letter-spacing: 0; box-shadow: none; position: relative; }
.nav-bar a::after {
    content: '';
    position: absolute;
    left: 0.7rem; right: 0.7rem; bottom: 6px;
    height: 3px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease);
}
.nav-bar a:hover, .nav-bar a:focus-visible { background: transparent; box-shadow: none; color: var(--green-deep); }
.nav-bar a:hover::after, .nav-bar a:focus-visible::after, .nav-bar a.active::after { transform: scaleX(1); }
.nav-bar a.active { background: transparent; box-shadow: none; border: 0; }
.nav-home::after, .nav-dropdown-menu a::after { display: none; }
.nav-home:hover, .nav-home:focus-visible { background: transparent; box-shadow: none; }
.nav-dropdown-menu { border: 0; background: var(--surface); box-shadow: 0 12px 32px rgba(15, 43, 34, 0.18); }
.nav-menu-btn { border: 0; background: var(--ground-alt); }

/* ---------- frame ---------- */
.container, .layout-wrapper, .page-shell, .featured { width: var(--frame); margin: var(--section-gap) auto; }
.container { padding: clamp(24px, 4vw, 56px); border: 0; border-radius: 0; background: var(--surface); }
main > .container:first-child, main > .page-shell:first-child { margin-top: 32px; }

/* ---------- surfaces: tone steps, no outlines ---------- */
.stat-card, .info-card, .software-card, .spec-box, .citation-block, .pub-card,
.note-panel, .sidebar, .coverage-card, .workflow-step, .about-sidecard {
    border: 0;
    border-radius: 0;
    background: var(--surface);
    box-shadow: none;
    padding: clamp(20px, 2.4vw, 32px);
}
.about-side-list div { border: 0; background: var(--ground-alt); border-radius: 0; }
.empty-state { border: 0; background: var(--ground-alt); }
.sheet-wrapper { border: 0; }
.text-banner-logo, .page-header {
    background: var(--green-deep);
    border-radius: 0;
    padding: clamp(28px, 4vw, 56px);
}
.page-header .page-kicker, .text-banner-logo span { color: #dbe8e1; }

/* ---------- controls ---------- */
.btn, .btn-explore, .btn-secondary, .btn-tertiary, .copy-btn, .preset-btn {
    border-radius: 0;
    font-weight: 600;
    min-height: 50px;
    padding: 0.8rem 1.4rem;
    transition: transform 0.25s var(--ease), background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.btn, .btn-explore, .copy-btn, .preset-btn.is-active { background: var(--green); color: #fff; }
.btn:hover, .btn-explore:hover, .copy-btn:hover { background: var(--green-deep); color: #fff; }
.btn-secondary, .btn-tertiary, .preset-btn { background: var(--ground-alt); color: var(--green-deep); border-color: transparent; }
.btn-secondary:hover, .btn-tertiary:hover, .preset-btn:hover { background: #d9e5de; color: var(--green-deep); }
.btn:active, .btn-explore:active, .btn-secondary:active { transform: translateY(0) scale(0.98); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.search-box input[type='search'], .search-input, .input-collection-search, .select {
    border: 0; border-radius: 0; background: var(--ground-alt);
}

/* ---------- hero ---------- */
.hero-wrap {
    min-height: 0;
    background: var(--green-deep);
    margin: 0 max(24px, calc((100% - 1320px) / 2));
    overflow: hidden;
}
.hero-wrap::after { content: none; }
.hero-panel {
    width: 100%;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
    min-height: clamp(520px, 78vh, 760px);
    color: #fff;
}
.hero-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(32px, 5vw, 80px); }
.hero-panel h1 { color: #fff; max-width: none; font-size: clamp(2.5rem, 4.6vw, 4.25rem); margin-bottom: 1.4rem; }
.hero-panel .subtitle { color: #e6efea; font-size: 1.25rem; line-height: 1.55; max-width: 40ch; margin-bottom: 2rem; }
.hero-actions { gap: 12px; }
.hero-wrap .btn-explore { background: #fff; color: var(--green-deep); }
.hero-wrap .btn-explore:hover { background: var(--ground-alt); color: var(--green-deep); }
.hero-wrap .btn-secondary { color: #fff; box-shadow: none; background: rgba(255, 255, 255, 0.14); }
.hero-wrap .btn-secondary:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.hero-photo {
    background: url('../img/main_background_optimized-1400w.jpg') center / cover no-repeat;
    min-height: 320px;
}

/* ---------- search band ---------- */
.search-strip { margin: 0 max(24px, calc((100% - 1320px) / 2)); }
.search-box {
    width: 100%;
    margin: 0;
    padding: 20px 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    gap: 16px;
}
.search-box label { font-weight: 600; white-space: nowrap; font-size: 1.0625rem; }
.search-box input[type='search'] { background: var(--surface); padding: 1rem 1.25rem; min-height: 54px; }

/* ---------- spec band ---------- */
.spec-band { width: var(--frame); margin: var(--section-gap) auto; }
.spec-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 0; background: var(--ground-alt); }
.spec-item { padding: clamp(24px, 3vw, 44px); border: 0; }
.spec-value { font-size: clamp(1.75rem, 2.9vw, 2.75rem); line-height: 1; letter-spacing: -0.02em; color: var(--green-deep); }
.spec-label { margin-top: 0.9rem; font-size: 1rem; color: var(--ink); }
.spec-note { margin: 16px 0 0; font-size: 0.9375rem; color: var(--ink-soft); }

/* ---------- why ---------- */
.why { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 112px); align-items: start; }
.why-head h2 { font-size: clamp(2rem, 3.2vw, 2.9rem); margin-bottom: 1.25rem; }
.why-head p { font-size: 1.25rem; max-width: 32ch; }
.why-list { display: grid; gap: clamp(28px, 4vw, 48px); }
.why-list h3 { font-size: clamp(1.6rem, 2.6vw, 2.25rem); margin-bottom: 0.5rem; }
.why-list p { margin: 0; max-width: 52ch; }

/* ---------- explore cards ---------- */
.section-header { align-items: end; margin-bottom: clamp(24px, 3vw, 48px); }
.masonry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2vw, 32px); }
.media-card, .zenodo-card { border: 0; border-radius: 0; background: var(--surface); box-shadow: none; transition: transform 0.35s var(--ease), background-color 0.25s; }
.media-card:hover, .media-card:focus-visible, .zenodo-card:hover, .zenodo-card:focus-within { box-shadow: none; transform: translateY(-4px); background: #fff; }
.media-card { overflow: hidden; }
.media-card img { aspect-ratio: 16 / 9; transition: transform 0.8s var(--ease); }
.media-card:hover img { transform: scale(1.04); }
.data-overlay { padding: clamp(20px, 2.4vw, 32px); }
.data-overlay h4 { font-size: 1.75rem; line-height: 1.1; }
.link-meta { color: var(--green-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; text-decoration-color: var(--gold); }
.center-cta { margin-top: clamp(24px, 3vw, 48px); }

/* ---------- about band: one flat field of colour ---------- */
.about-band {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: clamp(32px, 6vw, 112px);
    align-items: start;
    background: var(--green-deep);
    padding: clamp(32px, 6vw, 96px);
    border: 0;
}
.about-band h2 { color: #fff; grid-column: 1; grid-row: 1 / span 5; position: sticky; top: 110px; }
.about-band > p { grid-column: 2; color: #eaf2ed; max-width: 62ch; }
.about-band .cta-row { grid-column: 2; margin-top: 0.75rem; }
.about-band .btn { background: #fff; color: var(--green-deep); }
.about-band .btn:hover { background: var(--ground-alt); }
.about-band .btn-secondary { color: #fff; box-shadow: none; background: rgba(255, 255, 255, 0.14); }
.about-band .btn-secondary:hover { background: rgba(255, 255, 255, 0.12); }

/* ---------- records ---------- */
.zenodo-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: clamp(16px, 2vw, 28px); }
.zenodo-body { padding: 20px; }
#zenodo-latest { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.zenodo-actions .btn-small, .zenodo-actions .btn-secondary, .zenodo-actions .btn-tertiary { min-height: 42px; padding: 0.55rem 1rem; font-size: 0.9375rem; }
.zenodo-title { font-size: 1.1875rem; line-height: 1.2; }
.zenodo-meta-line, .zenodo-doi { color: var(--ink-soft); font-size: 0.9375rem; overflow-wrap: anywhere; }
.zenodo-doi .mono { font-variant-numeric: tabular-nums; }

/* ---------- footer ---------- */
.footer {
    margin-top: var(--section-gap);
    padding: clamp(48px, 6vw, 96px) max(24px, calc((100% - 1320px) / 2)) 48px;
    text-align: left;
    background: var(--green-deep);
    border: 0;
    color: #dbe8e1;
}
.footer p, .footer .muted { color: #dbe8e1; font-size: 1rem; max-width: 60ch; }
.footer a { color: #fff; text-decoration-color: rgba(255, 255, 255, 0.5); text-underline-offset: 3px; }
.footer a:hover { color: #fff; text-decoration-color: var(--gold); }
.footer-nav { max-width: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin: 2.5rem 0; }
.footer-nav-group strong { color: #fff; font-size: 1.0625rem; }
.footer-nav a { color: #dbe8e1; font-size: 1rem; text-decoration: none; }
.footer-nav a:hover { color: #fff; text-decoration: underline; }

#back-to-top { box-shadow: none; background: var(--green); }

/* ---------- motion: transform + opacity only, content visible without script ---------- */
@media (prefers-reduced-motion: no-preference) {
    .js-motion .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: var(--d, 0ms); }
    .js-motion .reveal.in { opacity: 1; transform: none; }
    .hero-copy > * { animation: rise 0.9s var(--ease) both; }
    .hero-copy > :nth-child(2) { animation-delay: 80ms; }
    .hero-copy > :nth-child(3) { animation-delay: 160ms; }
    .hero-photo { animation: settle 1.6s var(--ease) both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes settle { from { transform: scale(1.08); } to { transform: none; } }

/* ---------- tablet / phone ---------- */
@media (max-width: 900px) {
    .hero-panel { grid-template-columns: 1fr; min-height: 0; }
    .hero-photo { min-height: 260px; order: -1; }
    .spec-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .why, .about-band { grid-template-columns: 1fr; }
    .about-band h2 { position: static; grid-row: auto; margin-bottom: 1rem; }
    .about-band > p, .about-band .cta-row { grid-column: 1; }
    .masonry-grid { grid-template-columns: 1fr; }
    #zenodo-latest { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-nav { grid-template-columns: 1fr; }
    .search-box { flex-wrap: wrap; }
    .search-box label { width: 100%; }
    .search-box input[type='search'] { flex: 1 1 100%; }
}
@media (max-width: 600px) {
    :root { --frame: calc(100% - 32px); }
    .nav-bar { padding: 10px 16px; }
    .hero-wrap, .search-strip { margin-left: 16px; margin-right: 16px; }
    .hero-copy { padding: 28px 20px 32px; }
    .hero-panel .subtitle { font-size: 1.125rem; }
    .spec-item { padding: 20px 16px; }
    .zenodo-grid, #zenodo-latest { grid-template-columns: 1fr; gap: 16px; }
    .zenodo-title { font-size: 1.0625rem; }
}

/* sticky phone bar: flat, one tone */
.sticky-mobile-cta { border: 0; box-shadow: none; background: var(--ground-alt); }

/* ---------- interior pages ---------- */
:root { --surface-lift: #ffffff; --border-card: transparent; }
.page-header p, .page-header .page-intro, .page-header .gallery-intro, .text-banner-logo p { color: #e6efea; }
.page-header h1, .text-banner-logo h1 { margin-bottom: 1rem; }
.container > .page-header:first-child {
    margin: calc(-1 * clamp(24px, 4vw, 56px)) calc(-1 * clamp(24px, 4vw, 56px)) clamp(24px, 3vw, 40px);
}
.workflow-band, .best-practice, .methods li, li.method-step { background: var(--ground-alt); background-image: none; }
.eyebrow, .page-kicker { display: block; margin-bottom: 0.5rem; }
.eyebrow, .page-kicker { display: none; }
.breadcrumb { width: var(--frame); margin: 8px auto 0; padding: 0; }

/* ================= interior pages: shared hygiene ================= */
:root { --accent: #7a560c; --body-face: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif; }

/* one body face, sentence case, never tracked caps (headings and code keep their own) */
body *:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6):not(pre):not(pre *):not(code):not(svg *) {
    font-family: var(--body-face) !important;
    text-transform: none !important;
}
.sw-stack, .tag, .chip, .mono, [class*="badge"], [class*="pill"], [class*="label"] { letter-spacing: 0 !important; }
.status-pill, .component-badge, .software-card .status, .wip-badge, .collection-card-number, .collection-card-desc,
.feature .num, .product-eyebrow { font-size: 0.875rem !important; letter-spacing: 0 !important; }
.feature .num { background: none; color: var(--green); }
td, th { font-size: 0.9375rem; }

/* page width: one centred reading column, text fills it */
main > .container { width: min(1100px, var(--frame)); }
.layout-wrapper > .container { width: 100%; margin: 0; }
.container > p, .container > ul, .container > ol, .note-panel > p, .spec-box > p, .citation-block pre,
.pub-card p, .software-card p, .info-card p, .stat-label, .media-card-body p, .data-overlay p, .zenodo-desc,
.product-head .lead, .intro-stack { max-width: none; }
.breadcrumb { width: min(1100px, var(--frame)); padding: 0; margin: 8px auto 0; }
body:has(.layout-wrapper) .breadcrumb { width: var(--frame); }
.container > .product-head:first-child, .container > .page-header:first-child {
    margin: calc(-1 * clamp(24px, 4vw, 56px)) calc(-1 * clamp(24px, 4vw, 56px)) clamp(24px, 3vw, 40px);
}

/* product pages: headline dominates, flat dark field instead of a ruled header */
.product-head { background: var(--green-deep); color: #fff; border: 0; padding: clamp(32px, 5vw, 72px); margin-bottom: 0; }
.product-head h1 { color: #fff; font-size: clamp(1.65rem, 5.2vw, 4.75rem); line-height: 1.02; letter-spacing: -0.025em; }
.product-head .product-sub, .product-head .lead, .product-head p { color: #e6efea; }
.product-head .product-eyebrow { color: #e6efea; border: 0; padding: 0; }
.product-head .btn-secondary { background: rgba(255, 255, 255, 0.14); color: #fff; }
.product-head .btn { background: #fff; color: var(--green-deep); }

/* alerts as flat fills */
.beta-alert, .rights-alert, .best-practice, .contact-box { border: 0; background: var(--ground-alt); border-radius: 0; background-image: none; }
.beta-alert p, .rights-alert p { color: var(--ink); }
.beta-alert .product-eyebrow { color: var(--gold); }

/* no hairlines, no outlined boxes */
.tech-line, .reference-item, .cite-pre, .feature, .dart-section, .plate-card, .sw-head, .sw-actions,
.software-card li, .spec-box li, main li, .collection-card-link, .status-pill, .component-badge, .wip-badge { border-color: transparent !important; border-top: 0 !important; border-bottom: 0 !important; }
.cite-pre, .reference-item, .plate-card, .feature, .dart-section { background: var(--surface); }
.container .cite-pre, .container .reference-item { background: var(--ground-alt); }
main li { background-image: none !important; }

/* pill filters keep a fill, lose the outline */
.collection-filters button, .filter-btn, .preset-btn, .zenodo-controls select { border: 0; }

/* body text in full ink */
main li, main td, main .feature p, .feature li, .beta-alert p { color: var(--ink); }
.feature strong, main strong { color: var(--green-deep); }

/* phone: headings stay on two lines, margins match */
@media (max-width: 600px) {
    h1 { font-size: clamp(1.65rem, 7.2vw, 2.5rem); }
    h2 { font-size: clamp(1.5rem, 6.4vw, 2rem); }
    h3 { font-size: 1.1875rem; }
    .container { padding: 20px 16px; }
    .container > .page-header:first-child, .container > .product-head:first-child { margin: -20px -16px 24px; padding: 28px 16px; }
    .software-card, .info-card, .feature, .spec-box, .pub-card, .citation-block { padding: 18px 16px; }
}

/* phone sticky bar covers headings; the hero buttons and nav already carry the action */
.sticky-mobile-cta { display: none !important; }
body.has-sticky-mobile-cta { padding-bottom: 0 !important; }
body.has-sticky-mobile-cta #back-to-top { bottom: 24px !important; }

/* 404 */
.error-container { text-align: left; width: var(--frame); max-width: 900px; margin: var(--section-gap) auto; }
.error-container .error-code { font-family: Georgia, serif !important; font-size: clamp(5rem, 16vw, 12rem); line-height: 0.9; color: var(--green-deep); }

/* ===== interior layout: one 1100px column on the ground; nav, crumb and footer share its edges ===== */
main > .container { background: transparent; padding: 0; }
main > .container > .page-header:first-child, main > .container > .product-head:first-child { margin: 0 0 clamp(32px, 4vw, 56px); }
body:has(main > .container) .nav-bar,
body:has(main > .container) .footer { padding-left: max(24px, calc((100% - 1100px) / 2)); padding-right: max(24px, calc((100% - 1100px) / 2)); }
body:has(main > .container) .breadcrumb { width: min(1100px, var(--frame)); }
main > .container > * + * { margin-top: 0; }
main > .container h2, main > .container h3 { margin-top: 5.5rem; }
main > .container .section-header { margin-top: 5.5rem; }
main > .container .section-header h2 { margin-top: 0; }
main > .container .feature h3, main > .container .info-card h3, main > .container .software-card h2,
main > .container .dart-section h2, main > .container .ramsey-section h2 { margin-top: 0; }
main > .container .page-header h1, main > .container .product-head h1 { margin-top: 0; }
.note-panel > h2, .note-panel > h3 { margin-top: 0; }

/* product pages: beat the inline per-page rules */
html body .product-head h1 { color: #fff; font-size: clamp(1.65rem, 5.4vw, 4.75rem); letter-spacing: -0.025em; }
html body .dart-section, html body .ramsey-section, html body .dl-card, html body .install-box, html body .pipe-node,
html body .plate-card, html body .chart-card, html body .software-card, html body .feature { border: 0; border-radius: 0; }
html body .dart-section h2, html body .ramsey-section h2 { border: 0; padding-bottom: 0; color: var(--green-deep); }
html body .software-card { border-top: 0; }
html body table.chips, html body .ba { border: 0; border-radius: 0; }
html body table.chips td, html body .method-refs li { border-bottom: 0; }
html body .ba .handle, html body .ba .grip { box-shadow: none; }
html body .dart-section strong.term, html body .ramsey-section strong.term { color: var(--green-deep); }
html body .dart-section ul.tight li, html body .ramsey-section ul.tight li, html body .method-refs li, html body .bar-row .sp,
html body .bar-row .n, html body .software-card .desc, html body .software-card .details, html body .sysreq, html body .offline-line,
html body .ba-caption, html body .pipe-node .sub, html body .install-box .file, html body .dl-card .file { color: var(--ink); }
html body .pipe-node .sub { font-size: 0.875rem; }
html body .dl-card .file, html body .install-box .file, html body .tech-chip { font-size: 0.875rem; }
html body .tech-chip { background: var(--ground-alt); }
html body .status-pill.alpha, html body .status-pill.beta, html body .status-pill.active { color: var(--green-deep); background: var(--ground-alt); }
html body .feature .num { display: none; }

/* gallery on phones: title before the filters */
@media (max-width: 900px) { .layout-wrapper > .sidebar { order: 2; position: static; } .layout-wrapper > .container { order: 1; } }

/* 404: drop the duplicated numeral, centre nothing */
.error-container .icon { display: none; }
.error-container .cta-row { justify-content: flex-start !important; }

/* collection stat cards: figure first, status label after it */
.stat-card { display: flex; flex-direction: column; }
.stat-card .stat-count { order: -1; }
.best-practice, .note-panel { max-width: none; }
main > .container .masonry-grid { width: 100%; }
@media (max-width: 600px) {
    html body .software-card h2, html body .dart-section h2, html body .ramsey-section h2 { font-size: 1.1875rem; line-height: 1.2; }
}
.collection-stats, .stats-bar { margin-top: 5.5rem; }
@media (max-width: 900px) { .stats-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
main > .container > .stats-bar { margin-top: 5.5rem !important; }
@media (min-width: 601px) { main > .container > .stats-bar { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 600px) { .stats-bar > :last-child:nth-child(odd) { grid-column: 1 / -1; } }
main > .container > .masonry-grid { grid-template-columns: 1fr; }
main > .container > .masonry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
main > .container .pub-card h3, main > .container .note-panel h3 { margin-top: 0; }
.pub-card, .pub-card:hover { text-decoration: none; }
.pub-card h3, .pub-card p { text-decoration: none; }
.pub-card:hover h3 { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; text-decoration-thickness: 2px; }
@media (max-width: 900px) { .collection-grid { grid-template-columns: 1fr; } main > .container > .masonry-grid { grid-template-columns: 1fr; } }
.collection-card > * { display: block; }
.collection-card .component-chips, .collection-card [class*="components"] { display: flex; }
@media (max-width: 900px) { .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .collection-grid { grid-template-columns: 1fr; } }
@media (min-width: 1101px) {
    body:has(main > .container) .nav-bar, body:has(main > .container) .footer {
        padding-left: max(24px, calc((100% - 1100px) / 2 + 56px)); padding-right: max(24px, calc((100% - 1100px) / 2 + 56px));
    }
    body:has(main > .container) .breadcrumb { padding-left: 56px; }
}
.collection-card > .status-pill { display: inline-block; width: fit-content; }
@media (max-width: 900px) { .page-header, .product-head { padding: 28px 24px; } }
.page-header p, .page-intro, .subtitle:not(.hero-panel .subtitle) { max-width: none; text-wrap: wrap; }
@media (max-width: 900px) { .footer p, .footer .muted { max-width: none; } }

/* round two */
.wip-badge { background: #efe0b4; color: #3f3010; font-size: 0.8125rem !important; padding: 2px 10px; }
.muted, .page-intro, .gallery-intro, .muted-small { color: #2f3a34; }
main > .container h2, main > .container h3 { margin-top: 0; }
main > .container > h2, main > .container > h3, main > .container > .section-header,
main > .container > div > .section-header:first-child { margin-top: 5.5rem; }
main > .container > .page-header + h2, main > .container > .page-header + h3 { margin-top: 0; }
.best-practice h3, .spec-box h3, .citation-block h3, .beta-alert h3, .note-panel h3 { margin-bottom: 0.75rem; }

.scan-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 24px); margin-top: 3rem; }
.scan-strip figure { margin: 0; background: var(--surface); }
.scan-strip img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.scan-strip figcaption { padding: 12px 14px 16px; font-size: 0.9375rem; color: var(--ink); }
@media (max-width: 700px) { .scan-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.scan-strip { margin-bottom: 3rem; }
.coverage-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { .coverage-grid { grid-template-columns: 1fr; } }

/* gallery */
body:has(.layout-wrapper) .breadcrumb { padding-left: 0; }
.layout-wrapper { margin-top: 32px; }
.zenodo-actions { gap: 8px; }
.zenodo-actions .btn-small, .zenodo-actions .btn-secondary, .zenodo-actions .btn-tertiary { min-height: 38px; padding: 0.4rem 0.8rem; font-size: 0.875rem; }

/* mobile menu: the Collection submenu sits inline in the list */
@media (max-width: 960px) {
    .nav-dropdown-menu { display: flex; position: static; min-width: 0; padding: 0 0 0 16px; background: transparent; box-shadow: none; }
    .nav-links-wrap { background: var(--surface); border: 0; box-shadow: none; }
}

/* ===== homepage spec sheet: the scan beside the numbers that describe it ===== */
.spec-sheet { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 5vw, 80px); align-items: center; }
.spec-figure { margin: 0; background: var(--surface); }
.spec-figure img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.spec-figure figcaption { padding: 12px 16px 16px; font-size: 0.9375rem; color: var(--ink); }
.spec-body h2 { margin: 0 0 1.5rem; }
.spec-list { margin: 0; }
.spec-list > div { display: grid; grid-template-columns: minmax(7rem, 9rem) 1fr; gap: 16px; padding: 16px 20px; align-items: baseline; }
.spec-list > div:nth-child(odd) { background: var(--ground-alt); }
.spec-list dt { font-size: 1rem; font-weight: 600; color: var(--ink-soft); }
.spec-list dd { margin: 0; font-family: Georgia, 'Times New Roman', serif !important; font-size: clamp(1.2rem, 1.9vw, 1.6rem); line-height: 1.2; color: var(--green-deep); }
.spec-sheet .spec-note { grid-column: 1 / -1; margin: 0; }
@media (max-width: 900px) { .spec-sheet { grid-template-columns: 1fr; } .spec-list > div { grid-template-columns: 1fr; gap: 2px; } }

/* ===== collection status key: the four stages in order, each with its meaning ===== */
.status-key { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2vw, 32px); counter-reset: none; }
.status-key li { margin: 0; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.status-key .status-pill { font-size: 0.9375rem !important; padding: 0.35rem 0.9rem; border-radius: 0; font-weight: 600; }
.status-key li > span:last-child { font-size: 1rem; color: var(--ink); }
@media (max-width: 800px) { .status-key { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .spec-sheet .spec-figure { order: 2; } .spec-sheet .spec-note { order: 3; } }
.collection-filters button, .filter-btn, .collection-filters .chip { border-radius: 0; }
@media (max-width: 900px) { .spec-sheet { margin-bottom: calc(var(--section-gap) + 3rem); } }

/* ===== collection: stage bar instead of five stat boxes ===== */
html body .collection-stats, html body main > .container > .stats-bar.collection-stats { display: block; }
.stage-total { margin: 0 0 14px; font-size: 1.25rem; color: var(--ink); }
.stage-total strong { font-family: Georgia, serif !important; font-size: 2.25rem; color: var(--green-deep); margin-right: 0.25rem; }
.stage-bar { display: flex; gap: 3px; height: 28px; }
.stage-seg { flex-basis: 0; min-width: 6px; }
.stage-legend { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 32px; }
.stage-legend li { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 1rem; color: var(--ink); }
.stage-swatch { width: 14px; height: 14px; flex: none; }
.stage-not-scanned { background: #c5cec8; }
.stage-scanned { background: #6b97cf; }
.stage-processed { background: #d9a43c; }
.stage-published { background: #2f6b4f; }
.zenodo-thumb, .zenodo-thumb img { background: var(--ground-alt); }
main > .container > .stats-bar { margin-top: 3rem !important; }
main > .container > .stats-bar { margin-top: 4.75rem !important; }

/* spacing between a card grid and whatever follows it, and under section headings */
html body main > .container > .feature-grid,
html body main > .container .plate-grid,
html body main > .container .download-grid,
html body main > .container .pipeline,
html body main > .container .output-grid,
html body main > .container .method-cols,
html body main > .container .coverage-grid,
html body main > .container .workflow-band,
html body main > .container .impact-grid { margin-bottom: clamp(48px, 6vw, 88px); margin-top: 1.25rem; }
html body main > .container > h2 + .feature-grid, html body main > .container > h2 + * { margin-top: 1.5rem; }
html body main > .container .dart-section,
html body main > .container .ramsey-section,
html body main > .container .beta-alert,
html body main > .container .rights-alert,
html body main > .container .spec-box,
html body main > .container .best-practice,
html body main > .container .note-panel { margin-top: 0; margin-bottom: clamp(32px, 4vw, 56px); }
html body main > .container > :last-child { margin-bottom: 0; }

/* ===== audit round: grids, plates, tables, gallery filters ===== */
html body main > .container .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html body main > .container .feature-grid:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html body main > .container .feature-grid:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 800px) { html body main > .container .feature-grid, html body main > .container .feature-grid:has(> :nth-child(4):last-child) { grid-template-columns: 1fr; gap: 16px; } }

html body .plate-card img { height: auto; aspect-ratio: 4 / 5; object-fit: contain; background: var(--surface); }
@media (max-width: 900px) { html body .plate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { html body .plate-grid { grid-template-columns: 1fr; } }

html body table.chips { display: block; overflow-x: auto; max-width: 100%; }
@media (max-width: 700px) { html body .pipe-arrow { display: none; } }

.page-header > :last-child, .product-head > :last-child, .product-head-actions { margin-bottom: 0; }
html body .product-head + .beta-alert, html body .product-head + .rights-alert { margin-top: 2.5rem; }

#back-to-top { width: 40px; height: 40px; right: 16px; bottom: 16px; font-size: 1rem; opacity: 0.92; }

/* gallery filters */
.collection-filters, .zenodo-controls { margin-top: 1.25rem; }
.collection-filters .filter-chip, .collection-filters button, .zenodo-controls button { font-size: 0.9375rem; padding: 0.4rem 0.9rem; }
.collection-filters + p, .collection-filters + .muted { margin-top: 1rem; }
.zenodo-controls { gap: 12px 24px; align-items: flex-end; }
@media (max-width: 900px) { .layout-wrapper { grid-template-columns: 1fr; } .layout-wrapper > .sidebar { position: static; } }
.zenodo-actions > * { flex: 1 1 auto; text-align: center; justify-content: center; }
.filter-chip, .collection-filters .filter-chip { font-size: 0.9375rem; padding: 0.45rem 1rem; }
.filter-chip .count { color: var(--ink-soft); }
.status-key .status-pill.status-not-scanned, .status-pill.status-not-scanned { background: #dde3df; color: var(--ink); }
.collection-toolbar { margin-top: 2.5rem; gap: 12px; }
.collection-toolbar label { display: block; margin-bottom: 8px; }
.component-badge { color: var(--ink-soft); }

/* ===== audit round 2 ===== */
@media (max-width: 700px) { .section-header { flex-direction: column; align-items: flex-start; gap: 8px; } .section-header > * { text-align: left; } }
@media (min-width: 1101px) {
    body:has(main > .container) .nav-bar, body:has(main > .container) .footer { padding-left: max(24px, calc((100% - 1100px) / 2)); padding-right: max(24px, calc((100% - 1100px) / 2)); }
    body:has(main > .container) .breadcrumb { padding-left: 0; }
}
html body .best-practice, html body .rights-alert, html body .beta-alert, html body .contact-box { background: var(--ground-alt) !important; border: 0 !important; }
html body .text-banner-logo span { font-size: 1.0625rem; letter-spacing: 0; text-transform: none; display: block; }
html body main > .container h2 + p, html body main > .container h2 + ul { margin-top: 0.75rem; }
.faq-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.faq-grid:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 800px) { .faq-grid, .faq-grid:has(> :nth-child(4):last-child) { grid-template-columns: 1fr; } }
.error-container { width: min(1100px, var(--frame)); max-width: none; margin-bottom: 4rem; }
.error-container .error-code { line-height: 1.05; margin-bottom: 1rem; }
.error-container h1 { margin-top: 0; }

/* ===== live review round ===== */
html body .plate-card img { aspect-ratio: auto; height: auto; object-fit: initial; background: transparent; }
.filter-chip.active .count, .filter-chip.active { color: #fff; }
.filter-chip.active .count { opacity: 0.85; }
.collection-toolbar + .collection-filters, .collection-toolbar ~ .collection-filters { margin-top: 1.25rem; }
.collection-toolbar { margin-bottom: 0; }
.collection-filters { margin-bottom: 1.5rem; }
body:has(.error-container) .nav-bar { padding-left: max(24px, calc((100% - 1100px) / 2)); padding-right: max(24px, calc((100% - 1100px) / 2)); }
body:has(.error-container) .breadcrumb { width: min(1100px, var(--frame)); }
.faq-grid { margin-bottom: clamp(32px, 4vw, 56px); }
.record-flow { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .record-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .record-flow { grid-template-columns: 1fr; } }
html body main > .container > .scan-strip { margin-top: 3rem; }
.collection-filters + p, .gallery-note, .filter-note { margin-top: 1.25rem; }
.zenodo-controls + *, .collection-filters ~ .muted { margin-top: 1rem; }
.search-input, .sidebar input[type='search'], .sidebar .input-collection-search { font-size: 0.9375rem; text-overflow: ellipsis; }
@media (max-width: 900px) {
    .pipeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pipe-arrow { display: none; }
    html body table.chips { font-size: 0.8125rem; }
}
@media (max-width: 520px) { .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
html body main > .container > h2, html body main > .container > h3 { margin-top: 5.5rem; }
body:has(.error-container) .nav-bar, body:has(.error-container) .footer { padding-left: max(24px, calc((100% - 1100px) / 2 + 56px)); padding-right: max(24px, calc((100% - 1100px) / 2 + 56px)); }
.error-container { padding: clamp(28px, 4vw, 56px); }
.error-container p { max-width: none; }
