/*
 * Shared inner-page redesign.
 * Direction: restrained institutional portal, derived from the supplied NWAFU
 * reference while preserving every existing route, control and content block.
 */

:root {
  --ref-green: #7f9f72;
  --ref-green-deep: #647a66;
  --ref-green-soft: #edf2e8;
  --ref-lime: #b7cb8a;
  --ref-paper: #f7f6f1;
  --ref-surface: #fffefa;
  --ref-ink: #26352f;
  --ref-text: #495650;
  --ref-muted: #748079;
  --ref-line: #dcded6;
  --ref-line-strong: #bcc4ba;
  --ref-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --ref-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --ref-ease: cubic-bezier(.16, 1, .3, 1);
  --site-header-height: 72px;
}

html[data-theme="dark"] {
  --ref-green: #0b6744;
  --ref-green-deep: #073f2b;
  --ref-green-soft: #1b3027;
  --ref-paper: #111713;
  --ref-surface: #18201b;
  --ref-ink: #edf4ef;
  --ref-text: #c5d0c9;
  --ref-muted: #97a69e;
  --ref-line: #324139;
  --ref-line-strong: #54675d;
}

body:not([data-page="home"]) {
  --ref-nav-image: url("./visuals/resource-terrain.jpg");
  box-sizing: border-box;
  min-width: 320px;
  padding-top: var(--site-header-height);
  color: var(--ref-text);
  background: var(--ref-paper);
  font-family: var(--ref-sans);
  font-size: 16px;
  line-height: 1.72;
  opacity: 1;
}

body[data-page="news"] { --ref-nav-image: url("./visuals/news-editorial.jpg"); }
body[data-page="resources"],
body:is([data-page="academic"], [data-page="methods"], [data-page="public-data"], [data-page="documents"], [data-page="topics"], [data-page="glossary"], [data-page="soil"], [data-page="agriculture"], [data-page="atlas"]) { --ref-nav-image: url("./visuals/resource-terrain.jpg"); }
body[data-page="tools"],
body[data-studio],
body[data-tool],
body:is([data-page="standards"], [data-page="data-analysis"], [data-page="scientific-plotting"], [data-page="document-processing"], [data-page="spatial"], [data-page="calculation"], [data-page="software"]) { --ref-nav-image: url("./visuals/tools-lab.jpg"); }
body[data-page="solutions"],
body[data-page="contact"] { --ref-nav-image: url("./visuals/cooperation-greenhouse.jpg"); }
body[data-page="about"],
body[data-page="knowledge"],
body[data-page="method"] { --ref-nav-image: url("./visuals/about-roots.jpg"); }

body:not([data-page="home"]).inner-reference-ready {
  opacity: 1;
}

body:not([data-page="home"]) *,
body:not([data-page="home"]) *::before,
body:not([data-page="home"]) *::after { box-sizing: border-box; }

body:not([data-page="home"]) :where(h1, h2) {
  font-family: var(--ref-serif);
  font-weight: 650;
  text-wrap: balance;
}

body:not([data-page="home"]) :where(button, input, textarea, select) { font-family: inherit; }

/* Solid floating portal navigation with direction-aware reveal. */
body:not([data-page="home"]) .site-header {
  position: fixed !important;
  z-index: 140;
  top: 0;
  right: 0;
  left: 0;
  width: 100%;
  height: var(--site-header-height) !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, .16) !important;
  color: #fff;
  background: var(--ref-green) !important;
  box-shadow: 0 8px 26px rgba(1, 43, 27, .12) !important;
  backdrop-filter: none !important;
  transform: translateY(0);
  transition: transform 520ms var(--ref-ease), box-shadow 240ms ease !important;
  animation: inner-reference-header-enter 520ms var(--ref-ease) both;
}

body:not([data-page="home"]) .site-header.is-header-hidden { transform: translateY(calc(-100% - 4px)); }
body:not([data-page="home"]) .site-header.is-scrolled { box-shadow: 0 14px 32px rgba(1, 37, 24, .2) !important; }

@keyframes inner-reference-header-enter {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

body:not([data-page="home"]) .header-inner {
  grid-template-columns: 250px minmax(0, 1fr) 132px;
  height: var(--site-header-height) !important;
}

body:not([data-page="home"]) .brand { gap: 12px; }
body:not([data-page="home"]) .brand-mark {
  width: 40px;
  height: 40px;
  padding: 2px;
  border-radius: 2px;
  background: #fff;
  box-shadow: none;
}
body:not([data-page="home"]) .brand-mark img { border-radius: 0; }
body:not([data-page="home"]) .brand-copy strong {
  color: #fff !important;
  font-family: var(--ref-serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .12em;
}
body:not([data-page="home"]) .brand-copy small {
  margin-top: 3px;
  color: rgba(255,255,255,.68) !important;
  font-size: 9px;
  letter-spacing: .16em;
}

body:not([data-page="home"]) .main-nav { gap: clamp(8px, 1.25vw, 20px); }
body:not([data-page="home"]) :is(.nav-primary, .nav-expand, .header-icon) { color: #fff !important; }
body:not([data-page="home"]) .nav-primary {
  padding-inline: 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .06em;
}
body:not([data-page="home"]) .nav-primary::after {
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 3px;
  background: var(--ref-lime) !important;
}
body:not([data-page="home"]) .header-actions { gap: 0; }
body:not([data-page="home"]) .header-quick-actions {
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
}
body:not([data-page="home"]) .header-icon { border-radius: 0; }
body:not([data-page="home"]) .header-icon + .header-icon::before { background: rgba(255,255,255,.22) !important; }
body:not([data-page="home"]) .header-icon:hover { color: var(--ref-lime) !important; background: rgba(255,255,255,.08); }
body:not([data-page="home"]) :is(.header-contact, .header-resource) { display: none !important; }
body:not([data-page="home"]) .site-scroll-progress { height: 2px; }
body:not([data-page="home"]) .site-scroll-progress i { background: var(--ref-lime); }

body:not([data-page="home"]) .mega-menu {
  top: var(--site-header-height) !important;
  border: 0;
  border-top: 3px solid var(--ref-lime);
  border-radius: 0;
  background: var(--ref-surface);
  box-shadow: 0 24px 50px rgba(3, 35, 23, .18);
}
body:not([data-page="home"]) .mega-menu :where(a, strong) { color: var(--ref-ink); }
body:not([data-page="home"]) .mega-menu small { color: var(--ref-muted); }
body:not([data-page="home"]) .nav-backdrop { top: var(--site-header-height); }

/* Desktop dropdowns already render their visible panel on `.mega-shell`.
   Keep the animated outer viewport transparent so it does not read as a
   second card behind the actual menu. */
@media (min-width: 961px) {
  body:not([data-page="home"]) .mega-menu {
    top: calc(100% - 2px) !important;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body:not([data-page="home"]) .mega-shell {
    border-top-color: var(--ref-green);
    background: var(--ref-surface);
    box-shadow: 0 8px 22px rgba(47, 61, 53, .14);
  }
}

/* Shared scale, rules and controls. */
body:not([data-page="home"]) :where(.sp-kicker, .inner-kicker, .news-section-kicker, .service-eyebrow, .section-index, .studio-kicker, .standards-kicker) {
  color: var(--ref-green);
  font-size: 12px;
  letter-spacing: .16em;
}

body:not([data-page="home"]) :where(.sp-action, .service-button, .button, .official-source-link, .news-filter-bar button, .radar-filter button, .release-filter button) {
  border-radius: 0 !important;
}

body:not([data-page="home"]) :where(input, textarea, select) { border-radius: 0 !important; }

body:not([data-page="home"]) :where(.inner-local-nav, .news-section-switcher, .service-local-nav, .knowledge-local-nav, .studio-switcher) {
  top: var(--site-header-height) !important;
  border-bottom: 1px solid var(--ref-line);
  background: color-mix(in srgb, var(--ref-paper) 94%, transparent);
}

/* First-level section portals. */
.section-portal {
  --sp-forest: var(--ref-green-deep);
  --sp-forest-2: var(--ref-green);
  --sp-lime: var(--ref-lime);
  --sp-cream: var(--ref-paper);
  background: var(--ref-paper) !important;
}

.section-portal .sp-shell { width: min(calc(100% - clamp(48px, 7vw, 104px)), 1320px); }
.section-portal .sp-title {
  font-family: var(--ref-serif);
  font-size: clamp(42px, 4.5vw, 60px) !important;
  font-weight: 650;
  letter-spacing: -.045em;
  line-height: 1.08;
}
.section-portal .sp-lead { margin-top: 22px; font-size: 16px; line-height: 1.85; }
.section-portal .sp-section { padding: clamp(72px, 7vw, 104px) 0; }
.section-portal .sp-section-head {
  grid-template-columns: minmax(0, .9fr) minmax(320px, .55fr);
  gap: clamp(54px, 8vw, 120px);
  margin-bottom: clamp(38px, 5vw, 60px);
}
.section-portal .sp-section-head h2,
.section-portal .sp-news-index-head h2 {
  font-family: var(--ref-serif);
  font-size: clamp(34px, 3.4vw, 46px);
  font-weight: 650;
  letter-spacing: -.04em;
}
.section-portal .sp-section-head > p { padding-top: 18px; border-color: var(--ref-line-strong); font-size: 15px; }

.section-portal :where(.sp-news-hero, .sp-tools-hero, .sp-coop-hero) { min-height: clamp(500px, 62svh, 590px); }
.section-portal :where(.sp-news-hero, .sp-tools-hero, .sp-coop-hero)::before { background: rgba(3, 28, 18, .54) !important; }
.section-portal :where(.sp-news-hero, .sp-tools-hero, .sp-coop-hero) > img,
.section-portal .sp-news-hero .sp-hero-image { inset: 0; width: 100%; height: 100%; transform: scale(1.01); }

.section-news .sp-news-hero-inner {
  grid-template-columns: minmax(0, 1fr) minmax(330px, .55fr);
  gap: clamp(48px, 7vw, 96px);
  padding-top: 78px;
  padding-bottom: 40px;
}
.section-news .sp-news-copy .sp-title { max-width: 760px; }
.section-news .sp-news-index { padding: 56px 0 84px; background: var(--ref-surface); }
.section-news .sp-news-index-head { margin-bottom: 22px; }
.section-news .sp-news-item {
  grid-template-columns: 34px 96px 120px minmax(0,1fr) 100px;
  min-height: 104px;
  padding-block: 17px;
  border-color: var(--ref-line);
}
.section-news .sp-news-summary h3 { font-family: var(--ref-serif); font-size: 20px; font-weight: 650; }

.section-resources .sp-resources-hero,
.section-about .sp-about-hero {
  grid-template-columns: minmax(390px, .9fr) minmax(0, 1.1fr);
  min-height: clamp(520px, 64svh, 610px);
  padding-top: 0;
}
.section-resources .sp-resource-intro,
.section-about .sp-about-copy { padding-top: 68px; padding-bottom: 56px; }
.section-resources .sp-resource-visual,
.section-about .sp-about-visual { min-height: clamp(520px, 64svh, 610px); }
.section-resources .sp-resource-visual::before { background: rgba(4, 38, 25, .28); }
.section-resources .sp-resource-search { margin-top: 30px; border-radius: 0; }
.section-resources .sp-resource-index { bottom: 32px; }
.section-resources .sp-archive-row {
  grid-template-columns: 74px minmax(180px,.6fr) minmax(0,1.2fr) 28px;
  min-height: 112px;
  border-color: var(--ref-line);
}
.section-resources .sp-archive-row h3 { font-family: var(--ref-serif); }

.section-tools .sp-tools-copy {
  grid-template-columns: minmax(260px,.55fr) minmax(0,1.45fr);
  padding-top: 72px;
  padding-bottom: 24px;
}
.section-tools .sp-tools-copy-text { grid-column: 2; }
.section-tools .sp-tool-command { margin-top: 26px; }
.section-tools .sp-tool-command a { min-height: 78px; }
.section-tools .sp-tool-command strong { margin-top: 12px; }
.section-tools .sp-tools-register { background: var(--ref-paper); }
.section-tools .sp-tools-register,
.section-tools .sp-tools-register .sp-section-head h2 { color: var(--ref-ink); }
.section-tools .sp-tools-register .sp-section-head > p { border-color: var(--ref-line-strong); color: var(--ref-muted); }
.section-tools .sp-tool-console { min-height: 510px; }
.section-tools .sp-tool-console { border-color: var(--ref-line-strong); }
.section-tools .sp-tool-list { border-color: var(--ref-line); }
.section-tools .sp-tool-choice { min-height: 68px; border-color: var(--ref-line); color: var(--ref-muted); }
.section-tools .sp-tool-choice :is(strong, small),
.section-tools .sp-tool-choice > span:last-child { color: inherit; }
.section-tools .sp-tool-choice:hover,
.section-tools .sp-tool-choice[aria-selected="true"] { color: var(--ref-ink); background: var(--ref-green-soft); }
.section-tools .sp-tool-choice[aria-selected="true"] small,
.section-tools .sp-tool-choice[aria-selected="true"] > span:last-child { color: var(--ref-green); }
.section-tools .sp-tool-preview { padding: clamp(36px, 5vw, 66px); background: var(--ref-green-soft); }
.section-tools .sp-tool-preview::before { display: none; }
.section-tools .sp-tool-preview h3 { color: var(--ref-ink); font-family: var(--ref-serif); font-size: clamp(38px, 4vw, 54px); }
.section-tools .sp-tool-preview p { color: var(--ref-text); }
.section-tools .sp-tool-preview li { border-color: var(--ref-line-strong); color: var(--ref-text); }
.section-tools .sp-tool-preview .sp-action { color: #fff; border-color: var(--ref-green); background: var(--ref-green); }

.section-solutions .sp-coop-copy {
  grid-template-columns: minmax(0,.95fr) minmax(420px,.72fr);
  padding-top: 58px;
  padding-bottom: 58px;
}
.section-solutions .sp-coop-copy-panel {
  padding: 42px 0 42px 42px;
  color: #fff;
  border-color: rgba(255,255,255,.38);
}
.section-solutions .sp-coop-copy .sp-kicker { color: var(--ref-lime); }
.section-solutions .sp-coop-copy .sp-lead { color: rgba(255,255,255,.75); }
.section-solutions .sp-service-path { min-height: 136px; }
.section-solutions .sp-service-path h3 { font-family: var(--ref-serif); font-size: clamp(25px,2.4vw,33px); }

.section-about .sp-about-statement { color: var(--ref-ink); background: var(--ref-green-soft); }
.section-about .sp-about-statement blockquote { font-family: var(--ref-serif); font-size: clamp(34px,4.2vw,56px); }
.section-about .sp-about-statement blockquote em { color: var(--ref-green); }
.section-about .sp-principle-lines { margin-top: 54px; }
.section-about .sp-principle-lines { border-color: var(--ref-line-strong); }
.section-about .sp-principle-lines article { border-color: var(--ref-line); }
.section-about .sp-principle-lines small { color: var(--ref-green); }
.section-about .sp-principle-lines p { color: var(--ref-muted); }
.section-about .sp-roadmap-flow article { min-height: 238px; padding: 28px 26px; }
.section-about .sp-roadmap-flow h3 { margin-top: 60px; font-family: var(--ref-serif); }

/* News timelines and editorial subpages. */
.news-section-page {
  --news-paper: var(--ref-paper);
  --news-surface: var(--ref-surface);
  --news-ink: var(--ref-ink);
  --news-muted: var(--ref-muted);
  --news-line: var(--ref-line);
  --news-line-strong: var(--ref-line-strong);
  --news-copper: var(--ref-green);
  --news-green: var(--ref-green);
}
.news-section-page .news-shell { width: min(calc(100% - clamp(48px,7vw,104px)), 1320px); }
.news-section-page .news-breadcrumb { margin-bottom: 20px; font-size: 13px; }
.news-section-page :where(.timeline-hero, .radar-hero, .release-hero, .editorial-cover) {
  padding-top: 42px;
  padding-bottom: 42px;
  border-color: var(--ref-line-strong);
}
.news-section-page .timeline-hero-grid { grid-template-columns: minmax(0,1fr) minmax(340px,.64fr); gap: clamp(48px,7vw,100px); }
.news-section-page .timeline-hero-copy { min-height: 300px; }
.news-section-page :where(.timeline-hero h1, .radar-hero h1, .editorial-cover h1, .release-hero h1) {
  font-family: var(--ref-serif);
  font-size: clamp(39px,4vw,52px);
  font-weight: 650;
  letter-spacing: -.04em;
}
.news-section-page .timeline-visual { min-height: 300px; }
.news-section-page .timeline-main { padding: 48px 0 82px; }
.news-section-page .timeline-layout { grid-template-columns: 190px minmax(0,1fr); gap: clamp(36px,6vw,84px); }
.news-section-page .timeline-entry { grid-template-columns: 104px minmax(0,1fr) 150px; min-height: 112px; padding: 21px 0; border-color: var(--ref-line); }
.news-section-page .timeline-entry h2 { font-size: 21px; }
.news-section-page :where(.news-filter-bar, .radar-filter, .release-filter) button[aria-pressed="true"] {
  border-color: var(--ref-green);
  background: var(--ref-green);
}

/* Common content, search, contact and resource pages. */
body:not([data-page="home"]) {
  --inner-paper: var(--ref-paper);
  --inner-paper-2: var(--ref-green-soft);
  --inner-surface: var(--ref-surface);
  --inner-ink: var(--ref-ink);
  --inner-ink-2: var(--ref-text);
  --inner-muted: var(--ref-muted);
  --inner-faint: var(--ref-muted);
  --inner-line: var(--ref-line);
  --inner-line-strong: var(--ref-line-strong);
  --inner-accent: var(--ref-green);
  --inner-accent-soft: var(--ref-green-soft);
  --inner-green: var(--ref-green);
}

body:not([data-page="home"]) .inner-container { width: min(calc(100% - clamp(48px,7vw,104px)), 1320px); }
body:not([data-page="home"]) .inner-hero { min-height: 300px; background: var(--ref-paper); }
body:not([data-page="home"]) .inner-hero-grid {
  min-height: 300px;
  grid-template-columns: minmax(0,1fr) minmax(320px,.58fr);
  gap: clamp(52px,8vw,116px);
  padding-block: 54px 48px;
}
body:not([data-page="home"]) .inner-hero h1 { font-size: clamp(38px,3.8vw,50px); font-weight: 650; }
body:not([data-page="home"]) .inner-hero-summary p { font-size: 15px; }
body:not([data-page="home"]) .inner-facts span { border-radius: 0; background: transparent; }
body:not([data-page="home"]) .inner-section { padding-block: clamp(60px,6vw,82px); }
body:not([data-page="home"]) .inner-section-head { margin-bottom: 38px; }
body:not([data-page="home"]) .inner-section-head h2 { font-size: clamp(30px,3vw,40px); }

.resource-library-page .resource-breadcrumb + .inner-hero-grid { min-height: 260px; padding-top: 38px; }
.resource-library-page .inner-hero h1 { font-family: var(--ref-serif); font-size: clamp(38px,3.8vw,50px); }
.resource-library-page .resource-family-list,
.resource-library-page .resource-route-lines { border-top-color: var(--ref-green); }
.resource-library-page .resource-family-list h3 { font-family: var(--ref-serif); font-size: 24px; }
.resource-library-page :where(.resource-card, .source-card, .catalog-card, .archive-card) { border-radius: 0 !important; box-shadow: none !important; }

/* Service pages inherit one institutional green family. */
.service-page {
  --service-paper: var(--ref-paper);
  --service-surface: var(--ref-surface);
  --service-ink: var(--ref-ink);
  --service-muted: var(--ref-muted);
  --service-line: var(--ref-line);
  --service-line-strong: var(--ref-line-strong);
  --service-blue: var(--ref-green);
  --service-blue-soft: var(--ref-green-soft);
  --service-green: var(--ref-green-deep);
  --service-lime: var(--ref-lime);
}
.service-page .service-container { width: min(calc(100% - clamp(48px,7vw,104px)),1320px); }
.service-page .service-hero h1 { font-family: var(--ref-serif); font-size: clamp(42px,4.5vw,60px); font-weight: 650; line-height: 1.06; }
.service-page .service-lead { font-size: 16px; }
.service-page .service-section { padding-block: clamp(64px,7vw,92px); }
.service-page :where(.service-heading h2, .tool-fit-intro h2, .tool-boundary-layout h2, .platform-fit-heading h2, .platform-output-title h2, .service-start h2) {
  font-family: var(--ref-serif);
  font-size: clamp(33px,3.5vw,46px);
}
.service-page .service-start,
.service-page .tool-service-start { color: var(--ref-ink); background: var(--ref-green-soft); }
.service-page :where(.service-start, .tool-service-start) :where(h2, h3, p, li, strong) { color: inherit; }
.service-page :where(article, .service-button, .service-panel, .platform-card) { border-radius: 0 !important; }

/* Data, plotting and document workspaces: same shell, function remains intact. */
body[data-studio] {
  --studio-accent: var(--ref-green);
  --studio-accent-rgb: 10, 90, 58;
  --studio-soft: var(--ref-green-soft);
  background: var(--ref-paper);
}
body[data-studio] .studio-masthead { background: var(--ref-green-soft); }
body[data-studio] .studio-hero-copy h1 { font-family: var(--ref-serif); font-size: clamp(38px,3.8vw,50px); font-weight: 650; }
body[data-studio] .studio-hero-copy > p:not(.studio-kicker) { font-size: 16px; }
body[data-studio] .studio-switcher > .container { min-height: 56px; }
body[data-studio] .studio-switcher > .container > div a { min-width: 100px; font-size: 14px; }
body[data-studio] .studio-section-heading h2 { font-family: var(--ref-serif); font-size: clamp(29px,2.8vw,38px); }
body[data-studio] .studio-panel { border-radius: 0; box-shadow: none; }
body[data-studio] :where(.studio-field input, .studio-field textarea, .studio-field select, button) { border-radius: 0 !important; }

/* Standards directory remains dense, but reads like an editorial index. */
body[data-page="standards"] {
  --container: 1320px;
  --search-paper: var(--ref-paper);
  --search-panel: var(--ref-surface);
  --search-soft: var(--ref-green-soft);
  --search-soft-green: var(--ref-green-soft);
  --search-line: var(--ref-line);
  --search-line-strong: var(--ref-line-strong);
  --search-ink: var(--ref-ink);
  --search-text: var(--ref-text);
  --search-muted: var(--ref-muted);
  --search-green: var(--ref-green);
  --search-green-hover: var(--ref-green-deep);
  --search-accent: var(--ref-green);
}
body[data-page="standards"] .standards-masthead-top { min-height: 44px; }
body[data-page="standards"] .standards-masthead-grid {
  grid-template-columns: minmax(300px,.65fr) minmax(480px,1.35fr);
  gap: clamp(42px,6vw,84px);
  padding-top: 30px;
  padding-bottom: 26px;
}
body[data-page="standards"] .standards-masthead h1 { font-family: var(--ref-serif); font-size: clamp(36px,3.3vw,46px); }
body[data-page="standards"] .standards-search input { height: 56px; border-radius: 0; box-shadow: none; }
body[data-page="standards"] .standards-search button { height: 56px; border-radius: 0; }
body[data-page="standards"] .standards-category-tabs { min-height: 54px; }
body[data-page="standards"] .standards-category-tabs button { height: 54px; }
body[data-page="standards"] .standards-workbench { column-gap: 42px; }
body[data-page="standards"] :where(.standards-record, .standards-detail, .standards-sidebar, .standards-filter-group) { border-radius: 0 !important; box-shadow: none !important; }

/* Long-form knowledge detail. */
body[data-page="knowledge"] {
  --knowledge-accent: var(--ref-green);
  --paper: var(--ref-paper);
  --surface: var(--ref-surface);
  --heading: var(--ref-ink);
  --text: var(--ref-text);
  --muted: var(--ref-muted);
  --line: var(--ref-line);
  --line-strong: var(--ref-line-strong);
}
body[data-page="knowledge"] .knowledge-hero { min-height: auto; background: var(--ref-paper); }
body[data-page="knowledge"] .knowledge-hero::before { display: none; }
body[data-page="knowledge"] .knowledge-hero-layout { padding-block: 54px 46px; }
body[data-page="knowledge"] .knowledge-hero h1 { font-family: var(--ref-serif); font-size: clamp(42px,4.7vw,62px); font-weight: 650; letter-spacing: -.045em; }
body[data-page="knowledge"] .knowledge-abstract { font-size: 16px; }
body[data-page="knowledge"] .knowledge-shell { padding-block: 68px 108px; }
body[data-page="knowledge"] .knowledge-section { padding-block: 58px 64px; }
body[data-page="knowledge"] .knowledge-section h2 { font-family: var(--ref-serif); font-size: clamp(30px,3vw,40px); }
body[data-page="knowledge"] :where(.knowledge-hero-figure, .knowledge-note, button) { border-radius: 0 !important; }

/* Remove decorative generated geometry inherited from older visual directions. */
body:not([data-page="home"]) :where(.sp-tool-preview::before, .knowledge-hero::before) { box-shadow: none !important; }

/* Uniform light portal system: no dark theme blocks or saturated green panels. */
html[data-theme] body:not([data-page="home"]) {
  --paper: var(--ref-paper);
  --paper-2: var(--ref-green-soft);
  --surface: var(--ref-surface);
  --surface-soft: #f1f2ec;
  --surface-alpha: rgba(255, 254, 250, .96);
  --heading: var(--ref-ink);
  --text: var(--ref-text);
  --muted: var(--ref-muted);
  --muted-2: #879189;
  --line: var(--ref-line);
  --line-strong: var(--ref-line-strong);
  --success: var(--ref-green);
  --lime: var(--ref-lime);
  --lime-strong: var(--ref-green);
  color-scheme: light;
}

body:not([data-page="home"]) .site-header,
body:not([data-page="home"]) .site-header.is-scrolled {
  border-bottom: 1px solid var(--ref-line) !important;
  color: var(--ref-ink);
  background: rgba(255, 254, 250, .97) !important;
  box-shadow: 0 8px 24px rgba(47, 61, 53, .08) !important;
  /* The body becomes visible only after the generated shell is mounted.
     Starting another translate-in animation here exposed a blank header slot
     for the first 520ms, so the mounted header must be stable immediately. */
  animation: none !important;
}
body:not([data-page="home"]) .brand-mark { border: 1px solid var(--ref-line); }
body:not([data-page="home"]) .brand-copy strong,
body:not([data-page="home"]) :is(.nav-primary, .nav-expand, .header-icon) { color: var(--ref-ink) !important; }
body:not([data-page="home"]) .brand-copy small { color: var(--ref-muted) !important; }
body:not([data-page="home"]) .nav-primary::after,
body:not([data-page="home"]) .site-scroll-progress i { background: var(--ref-green) !important; }
body:not([data-page="home"]) .header-icon + .header-icon::before { background: var(--ref-line) !important; }
body:not([data-page="home"]) .header-icon:hover { color: var(--ref-green-deep) !important; background: var(--ref-green-soft); }
body:not([data-page="home"]) .theme-toggle { display: none !important; }
body:not([data-page="home"]) .mega-menu { border-top-color: var(--ref-green); }

body:not([data-page="home"]) .site-footer {
  color: var(--ref-muted);
  border-top: 1px solid var(--ref-line);
  background: #f1f2ec;
}
body:not([data-page="home"]) .footer-intro,
body:not([data-page="home"]) .footer-col a,
body:not([data-page="home"]) .footer-col span,
body:not([data-page="home"]) .footer-bottom { color: var(--ref-muted); }
body:not([data-page="home"]) .footer-col strong { color: var(--ref-ink); }
body:not([data-page="home"]) .footer-bottom { border-top-color: var(--ref-line); }
body:not([data-page="home"]) .footer-col a:hover { color: var(--ref-green-deep); }

.section-portal :where(.sp-news-hero, .sp-resources-hero, .sp-tools-hero, .sp-coop-hero, .sp-about-hero) {
  min-height: clamp(520px, 64svh, 620px);
  color: var(--ref-ink);
  background: var(--ref-paper);
}
.section-portal :where(.sp-news-hero, .sp-tools-hero, .sp-coop-hero)::before,
.section-portal .sp-news-hero::after { display: none; }

.section-portal :where(.sp-news-hero .sp-hero-image, .sp-tools-hero > img, .sp-coop-hero > img) {
  position: absolute;
  inset: 0 0 0 auto;
  width: 52%;
  height: 100%;
  object-fit: cover;
  transform: none;
}

/* Keep the dark laboratory photograph as a supporting visual, never as the
   tools page's theme surface. The explicit selector outranks the legacy
   full-bleed image rule above. */
.section-tools .sp-tools-hero > img {
  left: auto;
  right: 0;
  width: 52%;
  height: 100%;
  transform: none !important;
}

.section-news .sp-news-hero-inner,
.section-tools .sp-tools-copy,
.section-solutions .sp-coop-copy {
  grid-template-columns: minmax(340px, .88fr) minmax(0, 1.12fr);
  align-items: center;
  min-height: clamp(520px, 64svh, 620px);
  gap: clamp(54px, 7vw, 104px);
  padding-top: 54px;
  padding-bottom: 54px;
}

.section-news .sp-news-copy,
.section-tools .sp-tools-copy-text,
.section-solutions .sp-coop-copy-panel { grid-column: 1; }
.section-news .sp-news-copy .sp-kicker,
.section-tools .sp-tools-copy .sp-kicker,
.section-solutions .sp-coop-copy .sp-kicker,
.section-resources .sp-resource-intro .sp-kicker { color: var(--ref-green-deep); }
.section-news .sp-news-copy .sp-lead,
.section-tools .sp-tools-copy .sp-lead,
.section-solutions .sp-coop-copy .sp-lead,
.section-resources .sp-resource-intro .sp-lead { color: var(--ref-muted); }

.section-news .sp-news-rail {
  grid-column: 2;
  align-self: end;
  margin-bottom: 0;
  padding: 14px 22px;
  border-top: 3px solid var(--ref-green);
  color: var(--ref-ink);
  background: rgba(255, 254, 250, .94);
}
.section-news .sp-news-rail > span,
.section-news .sp-news-rail a small { color: var(--ref-muted); }
.section-news .sp-news-rail a { border-color: var(--ref-line); }
.section-news .sp-news-rail a strong { color: var(--ref-ink); }
.section-news .sp-news-rail a > :is(i, span:last-child) { color: var(--ref-green-deep); }

.section-resources .sp-resources-hero,
.section-about .sp-about-hero { background: var(--ref-paper); }
.section-resources .sp-resource-intro,
.section-about .sp-about-copy {
  color: var(--ref-ink);
  background: var(--ref-paper);
}
.section-resources .sp-resource-search {
  border-color: var(--ref-line-strong);
  background: var(--ref-surface);
}
.section-resources .sp-resource-search input { color: var(--ref-ink); }
.section-resources .sp-resource-search input::placeholder { color: var(--ref-muted); }
.section-resources .sp-resource-search button {
  color: var(--ref-ink);
  background: var(--ref-lime);
}
.section-resources .sp-resource-visual::before { display: none; }

.section-tools .sp-tools-copy-text { align-self: center; }
.section-tools .sp-tool-command {
  grid-column: 1;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 8px;
  border-color: var(--ref-line-strong);
  background: var(--ref-surface);
}
.section-tools .sp-tool-command a {
  min-height: 72px;
  border-color: var(--ref-line);
  color: var(--ref-ink);
}
.section-tools .sp-tool-command small { color: var(--ref-muted); }
.section-tools .sp-tool-command strong { margin-top: 9px; color: var(--ref-ink); }
.section-tools .sp-tool-command a:hover strong { color: var(--ref-green-deep); }

.section-solutions .sp-coop-copy-panel {
  align-self: center;
  padding: 34px 0;
  color: var(--ref-ink);
  border: 0;
  border-top: 3px solid var(--ref-green);
  background: rgba(255, 254, 250, .92);
}
.section-solutions .sp-coop-copy .sp-action,
.section-portal .sp-action {
  color: var(--ref-ink);
  border-color: var(--ref-line-strong);
  background: var(--ref-surface);
}
.section-solutions .sp-coop-copy .sp-action:hover,
.section-portal .sp-action:hover { border-color: var(--ref-green); background: var(--ref-green-soft); }

.section-portal :where(.sp-news-index, .sp-resource-map, .sp-tools-register, .sp-coop-stage, .sp-process-ribbon, .sp-about-statement, .sp-roadmap) {
  color: var(--ref-ink);
  background: var(--ref-paper);
}
.section-portal :where(.sp-process-ribbon, .sp-about-statement) { background: var(--ref-green-soft); }
.section-portal :where(.sp-process-ribbon, .sp-about-statement) :where(h2, h3, p, strong, blockquote) { color: var(--ref-ink); }
.section-portal .sp-process-list { border-color: var(--ref-line-strong); }
.section-portal .sp-process-list li { border-color: var(--ref-line); }
.section-portal .sp-process-list li::before { color: var(--ref-green-deep); }
.section-portal .sp-process-list span { color: var(--ref-muted); }
.section-portal .sp-contact-band {
  color: var(--ref-ink);
  border-block: 1px solid var(--ref-line);
  background: #f1f2ec;
}
.section-portal .sp-contact-band .sp-action {
  color: var(--ref-ink);
  border-color: var(--ref-green);
  background: var(--ref-green-soft);
}

.service-page .service-start,
.service-page .tool-service-start,
.service-page .tool-output-primary {
  color: var(--ref-ink) !important;
  background: var(--ref-green-soft) !important;
}

body:not([data-page="home"]) :where(.contact-context, .tool-output-primary) {
  color: var(--ref-ink);
  background-color: var(--ref-green-soft);
}
body:not([data-page="home"]) .contact-context :where(h2, p, small, dt, dd) { color: inherit; }

html[data-theme] body:not([data-page="home"]) .rp-workbench {
  --rp-bg: #fffefa;
  --rp-surface: #fffefa;
  --rp-surface-soft: #f3f3ed;
  --rp-surface-selected: var(--ref-green-soft);
  --rp-ink: var(--ref-ink);
  --rp-text: var(--ref-text);
  --rp-muted: var(--ref-muted);
  --rp-faint: #879189;
  --rp-line: var(--ref-line);
  --rp-line-strong: var(--ref-line-strong);
  --rp-green: var(--ref-green-deep);
  --rp-green-hover: var(--ref-green);
  --rp-lime: var(--ref-lime);
}
body:not([data-page="home"]) .rp-search-submit,
body:not([data-page="home"]) .rp-primary-action {
  color: var(--ref-ink);
  border-color: var(--ref-lime);
  background: var(--ref-lime);
}
body:not([data-page="home"]) .rp-search-submit:hover,
body:not([data-page="home"]) .rp-primary-action:hover {
  color: var(--ref-ink);
  border-color: var(--ref-green);
  background: var(--ref-green-soft);
}

@media (max-width: 1100px) {
  body:not([data-page="home"]) .header-inner { grid-template-columns: 220px minmax(0,1fr) 96px; }
  body:not([data-page="home"]) .main-nav { gap: 2px; }
  body:not([data-page="home"]) .nav-primary { padding-inline: 8px; font-size: 14px; }
  .section-portal .sp-tool-command { grid-template-columns: repeat(3,1fr); }
  .section-portal .sp-tool-command a:nth-child(3n) { border-right: 0; }
  .section-news .sp-news-item { grid-template-columns: 30px 90px 112px minmax(0,1fr); }
  .section-news .sp-news-direct { display: none; }
}

@media (max-width: 960px) {
  :root { --site-header-height: 64px; }
  body:not([data-page="home"]) .site-header,
  body:not([data-page="home"]) .header-inner { height: var(--site-header-height) !important; }
  body:not([data-page="home"]) .header-inner { grid-template-columns: 1fr auto; }
  body:not([data-page="home"]) .brand-mark { width: 36px; height: 36px; }
  body:not([data-page="home"]) .main-nav {
    top: var(--site-header-height);
    height: calc(100dvh - var(--site-header-height));
    background-color: rgba(250, 249, 244, .78);
    background-image: var(--ref-nav-image);
    background-position: center;
    background-size: cover;
    background-blend-mode: screen;
  }
  body:not([data-page="home"]) .main-nav .nav-primary { color: var(--ref-ink) !important; }
  body:not([data-page="home"]) .menu-toggle { color: var(--ref-ink); }
  body:not([data-page="home"]) .menu-toggle span,
  body:not([data-page="home"]) .menu-toggle::before,
  body:not([data-page="home"]) .menu-toggle::after { background: var(--ref-ink) !important; }
  .section-portal .sp-section-head,
  .section-news .sp-news-hero-inner,
  .news-section-page .timeline-hero-grid,
  body:not([data-page="home"]) .inner-hero-grid,
  .service-page .service-heading { grid-template-columns: 1fr; gap: 30px; }
  .section-resources .sp-resources-hero,
  .section-about .sp-about-hero { grid-template-columns: 1fr; }
  .section-resources .sp-resource-intro,
  .section-about .sp-about-copy { min-height: 430px; padding-top: 64px; }
  .section-resources .sp-resource-visual,
  .section-about .sp-about-visual { min-height: 420px; }
  .section-tools .sp-tools-copy { grid-template-columns: 1fr; }
  .section-tools .sp-tools-copy-text { grid-column: 1; }
  .section-solutions .sp-coop-copy { grid-template-columns: minmax(0,.55fr) minmax(350px,.85fr); }
  .news-section-page .timeline-hero-copy { min-height: 220px; }
  .news-section-page .timeline-visual { min-height: 280px; }
  .news-section-page .timeline-layout { grid-template-columns: 1fr; }
  .news-section-page .timeline-index { position: static; }

  .section-portal :where(.sp-news-hero, .sp-tools-hero, .sp-coop-hero) {
    display: grid;
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(300px, 48vw);
  }
  .section-portal :where(.sp-news-hero .sp-hero-image, .sp-tools-hero > img, .sp-coop-hero > img) {
    position: relative;
    inset: auto;
    grid-row: 2;
    width: 100%;
    height: 100%;
  }
  .section-tools .sp-tools-hero > img {
    position: relative;
    inset: auto;
    grid-row: 2;
    width: 100%;
    height: 100%;
  }
  .section-news .sp-news-hero-inner,
  .section-tools .sp-tools-copy,
  .section-solutions .sp-coop-copy {
    grid-row: 1;
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 48px;
    padding-bottom: 48px;
  }
  .section-news .sp-news-rail { display: none; }
  .section-tools .sp-tool-command { grid-column: 1; }
  .section-solutions .sp-coop-copy-panel { grid-column: 1; }
}

@media (max-width: 720px) {
  body:not([data-page="home"]) { font-size: 15px; }
  body:not([data-page="home"]) .brand-copy small { display: none; }
  body:not([data-page="home"]) .brand-copy strong { font-size: 16px; }
  .section-portal .sp-shell,
  .news-section-page .news-shell,
  body:not([data-page="home"]) .inner-container,
  .service-page .service-container { width: min(calc(100% - 36px), 1320px); }
  .section-portal .sp-title { font-size: clamp(37px,12vw,48px) !important; }
  .section-portal :where(.sp-news-hero, .sp-tools-hero, .sp-coop-hero) { min-height: 0; }
  .section-news .sp-news-hero-inner { padding-top: 48px; }
  .section-news .sp-news-rail { display: none; }
  .section-news .sp-news-item { grid-template-columns: 64px minmax(0,1fr); gap: 14px; }
  .section-news .sp-news-item-index,
  .section-news .sp-news-item-type,
  .section-news .sp-news-source { display: none; }
  .section-news .sp-news-summary { grid-column: 2; }
  .section-resources .sp-resource-index { grid-template-columns: 1fr; }
  .section-resources .sp-resource-index a { display: none; }
  .section-resources .sp-resource-index a:nth-child(-n+3) { display: block; min-height: 62px; border-right: 0; }
  .section-tools .sp-tool-command { grid-template-columns: repeat(2,1fr); }
  .section-tools .sp-tool-console { grid-template-columns: 1fr; }
  .section-tools .sp-tool-list { border-right: 0; }
  .section-solutions .sp-coop-copy { grid-template-columns: 1fr; align-items: end; }
  .section-solutions .sp-coop-copy-panel { grid-column: 1; padding: 32px 0 0; border-left: 0; border-top: 1px solid var(--ref-line-strong); }
  .section-solutions .sp-service-path,
  .section-resources .sp-archive-row { grid-template-columns: 54px 1fr; gap: 16px; padding-block: 22px; }
  .section-solutions .sp-service-path p,
  .section-solutions .sp-service-path > span,
  .section-resources .sp-archive-row p,
  .section-resources .sp-archive-row > span { grid-column: 2; }
  .section-about .sp-roadmap-flow { grid-template-columns: 1fr; }
  .section-about .sp-roadmap-flow article { min-height: 190px; border-right: 0; border-bottom: 1px solid var(--ref-line); }
  .news-section-page .timeline-entry { grid-template-columns: 78px minmax(0,1fr); }
  .news-section-page .timeline-entry > :last-child { grid-column: 2; }
  body:not([data-page="home"]) .inner-hero-grid { padding-block: 42px; }
  body:not([data-page="home"]) .inner-hero h1 { font-size: clamp(34px,10vw,44px); }
  body[data-page="standards"] .standards-masthead-grid { grid-template-columns: 1fr; gap: 22px; }
  body[data-page="standards"] .standards-toolbar { grid-template-columns: 1fr; }
}

/* Resource landing hero: keep the supplied terrain photograph as one complete
   visual field. The copy and category shortcuts float on the photograph
   instead of reserving an opaque half-page column beside it. */
.section-resources .sp-resources-hero {
  position: relative;
  display: grid;
  min-height: clamp(600px, 68svh, 680px);
  grid-template-columns: 1fr;
  overflow: hidden;
  color: #fff;
  background: #d9ddd5;
  isolation: isolate;
}

.section-resources .sp-resource-visual {
  position: absolute;
  z-index: 0;
  inset: 0;
  min-height: 0;
}

.section-resources .sp-resource-visual > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
  transform: none !important;
}

.section-resources .sp-resource-visual::before {
  display: block;
  z-index: 1;
  background: rgba(20, 31, 25, .32);
}

.section-resources .sp-resource-intro {
  position: relative;
  z-index: 2;
  align-self: center;
  width: min(640px, calc(100% - 48px));
  min-height: 0;
  margin: 0 0 108px max(24px, calc((100vw - min(calc(100% - 48px), var(--sp-max))) / 2));
  padding: 0;
  color: #fff;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-shadow: 0 2px 22px rgba(8, 18, 13, .36);
  backdrop-filter: none;
}

.section-resources .sp-resource-intro .sp-kicker { color: rgba(255, 255, 255, .84); }
.section-resources .sp-resource-intro .sp-title { color: #fff; }
.section-resources .sp-resource-intro .sp-lead { color: rgba(255, 255, 255, .86); }
.section-resources .sp-resource-search { text-shadow: none; }

.section-resources .sp-resource-index {
  z-index: 3;
  right: max(24px, calc((100vw - min(calc(100% - 48px), var(--sp-max))) / 2));
  bottom: 24px;
  left: max(24px, calc((100vw - min(calc(100% - 48px), var(--sp-max))) / 2));
  grid-template-columns: repeat(6, 1fr);
  border-top: 1px solid rgba(255, 255, 255, .58);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.section-resources .sp-resource-index a,
.section-resources .sp-resource-index a:nth-child(3n),
.section-resources .sp-resource-index a:nth-child(3n + 2) {
  min-height: 82px;
  padding: 15px 16px;
  border-right: 1px solid rgba(255, 255, 255, .28);
  color: #fff;
  text-shadow: 0 2px 12px rgba(8, 18, 13, .48);
}

.section-resources .sp-resource-index a:last-child { border-right: 0; }
.section-resources .sp-resource-index small { color: rgba(255, 255, 255, .7); }
.section-resources .sp-resource-index strong { color: #fff; }

@media (max-width: 960px) {
  .section-resources .sp-resources-hero { min-height: 760px; }
  .section-resources .sp-resource-intro {
    align-self: start;
    width: min(640px, calc(100% - 48px));
    margin: 56px 24px 190px;
    padding: 0;
  }
  .section-resources .sp-resource-visual { min-height: 0; }
  .section-resources .sp-resource-index {
    right: 24px;
    bottom: 24px;
    left: 24px;
    grid-template-columns: repeat(3, 1fr);
  }
  .section-resources .sp-resource-index a,
  .section-resources .sp-resource-index a:nth-child(3n),
  .section-resources .sp-resource-index a:nth-child(3n + 2) {
    min-height: 74px;
    padding: 13px 14px;
    border-right: 1px solid rgba(255, 255, 255, .28);
  }
  .section-resources .sp-resource-index a:nth-child(3n) { border-right: 0; }
}

@media (max-width: 720px) {
  .section-resources .sp-resources-hero { min-height: 670px; }
  .section-resources .sp-resource-intro {
    width: calc(100% - 36px);
    margin: 42px 18px 132px;
    padding: 0;
  }
  .section-resources .sp-resource-search { margin-top: 22px; }
  .section-resources .sp-resource-index {
    right: 18px;
    bottom: 18px;
    left: 18px;
    grid-template-columns: repeat(3, 1fr);
  }
  .section-resources .sp-resource-index a:nth-child(-n+3) {
    display: block;
    min-height: 68px;
    padding: 11px 10px;
  }
  .section-resources .sp-resource-index a:nth-child(3) { border-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  body:not([data-page="home"]) { transition: none !important; }
  body:not([data-page="home"]) .site-header { transform: translateY(0) !important; transition: none !important; animation: none !important; }
}

/* Image-only landing mastheads: no text, controls, navigation or cards over
   the photograph on any of the five primary section landing pages. */
.section-news .sp-news-hero-inner,
.section-resources .sp-resource-intro,
.section-resources .sp-resource-index,
.section-tools .sp-tools-copy,
.section-solutions .sp-coop-copy,
.section-about .sp-about-copy,
.section-about .sp-about-caption {
  display: none !important;
}

.section-portal :where(.sp-news-hero, .sp-resources-hero, .sp-tools-hero, .sp-coop-hero, .sp-about-hero) {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(480px, 31vw, 620px);
  min-height: clamp(480px, 31vw, 620px) !important;
  overflow: hidden;
  background: #d9ddd5;
}

.section-portal :where(.sp-news-hero .sp-hero-image, .sp-tools-hero > img, .sp-coop-hero > img),
.section-resources .sp-resource-visual > img,
.section-about .sp-about-visual > img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  transform: none !important;
}

.section-resources .sp-resource-visual,
.section-about .sp-about-visual {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 0;
}

.section-resources .sp-resource-visual::before,
.section-about .sp-about-visual::before {
  display: none !important;
}

@media (max-width: 720px) {
  .section-portal :where(.sp-news-hero, .sp-resources-hero, .sp-tools-hero, .sp-coop-hero, .sp-about-hero) {
    height: clamp(300px, 72vw, 420px);
    min-height: clamp(300px, 72vw, 420px) !important;
  }
}
