@import "./brand-system.css";

@font-face {
  font-family: "IBM Plex Sans Condensed";
  src: url("./assets/IBMPlexSansCondensed-Bold-Latin1.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --font-mono: var(--font-ui);
  --font-display: "IBM Plex Sans Condensed", "Arial Narrow", sans-serif;
  --family-flood: #2f6f9f;
  --family-fire: #9f3f2d;
  --family-heat: #94610f;
  --family-winter: #4c6594;
  --family-recovery: #2d6f49;
  --color-navy-deep: #14283e;
  --color-blue-line: #b7d4e8;
  --content-max: 1280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--color-ink); background: var(--color-surface); }
a { color: inherit; }
button, input { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--color-info); outline-offset: 3px; }
svg { display: block; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 14px; background: var(--color-ink-strong); color: white; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 0 clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--color-line);
  background: rgb(255 255 255 / .96);
  backdrop-filter: blur(10px);
}
.wordmark { display: inline-flex; align-items: center; gap: 12px; color: var(--color-navy-deep); font-size: 16px; font-weight: 800; text-decoration: none; }
.wordmark-mark { display: grid; place-items: center; width: 38px; height: 38px; background: var(--color-navy-deep); color: white; font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; }
.site-header nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 32px); }
.site-header nav a { color: var(--color-navy); font-size: 13px; font-weight: 750; text-decoration: none; }
.site-header nav a:hover { color: var(--color-red-cross); }

.hero { min-height: calc(100vh - 64px); display: grid; grid-template-columns: minmax(0, .92fr) minmax(480px, 1.08fr); border-bottom: 1px solid var(--color-line); }
.hero-copy { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: clamp(52px, 7vw, 108px) clamp(28px, 6vw, 92px); }
h1 { max-width: 760px; margin: 0; color: var(--color-navy-deep); font-family: var(--font-display); font-size: clamp(46px, 5.5vw, 78px); font-weight: 700; line-height: .92; letter-spacing: -.025em; text-wrap: balance; }
.hero-lede { max-width: 680px; margin: 26px 0 30px; color: var(--color-muted); font-size: clamp(17px, 1.4vw, 20px); line-height: 1.55; }
.hero-search { width: min(100%, 690px); min-height: 58px; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 0 16px; border: 1px solid var(--color-navy); border-radius: var(--radius-control); background: var(--color-surface); box-shadow: var(--shadow-panel); }
.hero-search:focus-within { border-color: var(--color-info); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-info) 16%, transparent); }
.hero-search svg { width: 24px; height: 24px; fill: none; stroke: var(--color-navy); stroke-width: 2; stroke-linecap: round; }
.hero-search input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--color-ink-strong); font-size: 16px; font-weight: 650; }
.hero-search input::placeholder { color: var(--color-subtle); }
.hero-search kbd { padding: 4px 8px; border: 1px solid var(--color-line); border-radius: 4px; background: var(--color-surface-raised); color: var(--color-muted); font-family: var(--font-mono); font-size: 11px; }
.search-examples { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--color-muted); font-size: 12px; }
.search-examples button { min-height: 44px; padding: 8px 12px; border: 1px solid var(--color-line); border-radius: 999px; background: white; color: var(--color-navy); font-size: 12px; font-weight: 700; cursor: pointer; }
.search-examples button:hover { border-color: var(--color-navy); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 30px; }
.hero-actions .btn { min-height: 46px; text-decoration: none; }
.hero-actions svg, .proof-link svg, .source-action svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.proof-link, .source-action { display: inline-flex; align-items: center; gap: 7px; color: var(--color-info); font-size: 14px; font-weight: 750; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.scope-line { margin: 28px 0 0; color: var(--color-muted); font-size: 13px; line-height: 1.5; }
.scope-line strong { color: var(--color-navy); }

.orbit-panel { min-width: 0; display: grid; place-items: center; overflow: hidden; padding: 44px; background: var(--color-map-blue); }
.orbit-stage { position: relative; width: min(100%, 650px); aspect-ratio: 1; }
.orbit-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.orbit-ring, .orbit-path { fill: none; stroke: var(--color-blue-line); stroke-width: 1.5; stroke-dasharray: 5 7; }
.orbit-path { stroke: var(--color-navy); stroke-dasharray: none; opacity: .42; animation: orbit-focus 850ms cubic-bezier(.16,1,.3,1) both; }
.orbit-path:nth-child(3) { animation-delay: 90ms; }
.orbit-path:nth-child(4) { animation-delay: 180ms; }
@keyframes orbit-focus {
  from { opacity: .16; }
  to { opacity: .42; }
}
.orbit-core { position: absolute; top: 50%; left: 50%; width: 180px; aspect-ratio: 1; display: grid; place-items: center; align-content: center; gap: 10px; padding: 18px; border: 2px solid var(--color-navy-deep); border-radius: 50%; background: white; color: var(--color-navy-deep); text-align: center; transform: translate(-50%, -50%); box-shadow: 0 14px 28px rgb(36 56 79 / .12); }
.orbit-core svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.orbit-core strong { font-family: var(--font-mono); font-size: 19px; line-height: 1.18; letter-spacing: .04em; text-transform: uppercase; }
.orbit-core span { color: var(--color-muted); font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; }
.orbit-node { position: absolute; z-index: 2; width: 148px; min-height: 88px; display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--color-blue-line); border-radius: var(--radius-panel); background: white; color: var(--color-navy-deep); box-shadow: 0 8px 20px rgb(36 56 79 / .1); cursor: pointer; text-align: left; transition: transform 180ms cubic-bezier(.16,1,.3,1), box-shadow 180ms; }
.orbit-node:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgb(36 56 79 / .16); }
.orbit-node svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.orbit-node span { font-size: 12px; font-weight: 800; line-height: 1.25; }
.orbit-node small { grid-column: 2; margin-top: -18px; color: var(--color-muted); font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; }
.orbit-flood { top: 1%; left: 50%; color: var(--family-flood); transform: translateX(-50%); }
.orbit-flood:hover { transform: translateX(-50%) translateY(-3px); }
.orbit-fire { top: 34%; left: 0; color: var(--family-fire); }
.orbit-heat { top: 34%; right: 0; color: var(--family-heat); }
.orbit-winter { bottom: 2%; left: 8%; color: var(--family-winter); }
.orbit-recovery { right: 8%; bottom: 2%; color: var(--family-recovery); }

.method-strip { display: grid; grid-template-columns: minmax(250px, .7fr) minmax(0, 1.7fr); gap: clamp(30px, 5vw, 76px); align-items: center; padding: 52px max(24px, calc((100vw - var(--content-max)) / 2)); background: var(--color-navy-deep); color: white; }
.method-strip h2, .live-demo-section h2, .ideas-section h2, .start-section h2, .source-section h2 { margin: 0; font-size: clamp(30px, 3vw, 44px); line-height: 1.05; letter-spacing: -.03em; }
.method-strip > div > p { max-width: 460px; margin: 14px 0 0; color: #cbd8e5; line-height: 1.6; }
.method-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0; padding: 0; list-style: none; }
.method-flow li { position: relative; min-height: 140px; padding: 8px 24px; border-left: 1px solid #49617a; }
.method-flow li:first-child { border-left: 0; }
.method-flow span { display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 20px; border: 1px solid #8099b1; border-radius: 50%; color: white; font-family: var(--font-mono); font-size: 12px; }
.method-flow strong { display: block; font-size: 14px; line-height: 1.3; }
.method-flow small { display: block; margin-top: 8px; color: #aebfd0; font-size: 12px; line-height: 1.45; }

.live-demo-section { max-width: var(--content-max); margin: 0 auto; padding: 96px 24px 24px; scroll-margin-top: 64px; }
.live-demo-heading { display: flex; justify-content: space-between; gap: 36px; align-items: end; }
.live-demo-heading p { max-width: 720px; margin: 16px 0 0; color: var(--color-muted); line-height: 1.6; }
.live-demo-heading .source-action { flex: none; }
.demo-shell { margin-top: 34px; overflow: hidden; border: 1px solid var(--color-line); border-radius: var(--radius-panel); background: var(--color-canvas); }
.demo-switcher { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--color-line); background: white; }
.demo-switcher a { min-height: 76px; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 14px 18px; border-left: 1px solid var(--color-line); color: var(--color-navy); text-decoration: none; }
.demo-switcher a:first-child { border-left: 0; }
.demo-switcher a:hover { background: var(--color-surface-raised); }
.demo-switcher a[aria-current="true"] { background: var(--color-navy-deep); color: white; }
.demo-switcher strong { font-size: 14px; line-height: 1.25; }
.demo-switcher span { color: var(--color-muted); font-size: 11px; line-height: 1.35; }
.demo-switcher a[aria-current="true"] span { color: #cbd8e5; }
#earthEngineDemo { width: 100%; height: clamp(620px, 72vh, 820px); display: block; border: 0; background: var(--color-map-blue); }
.demo-note { max-width: 920px; margin: 16px 0 0; color: var(--color-muted); font-size: 12px; line-height: 1.55; }
.demo-note a { color: var(--color-info); font-weight: 750; text-underline-offset: 3px; }

.ideas-section { max-width: var(--content-max); margin: 0 auto; padding: 96px 24px 110px; }
.ideas-heading { display: flex; justify-content: space-between; gap: 30px; align-items: end; }
.ideas-heading > div > p { max-width: 720px; margin: 16px 0 0; color: var(--color-muted); line-height: 1.6; }
.results-count { flex: none; margin: 0; color: var(--color-red-dark); font-family: var(--font-mono); font-size: 13px; font-weight: 700; text-transform: uppercase; }
.filter-deck { position: sticky; top: 64px; z-index: 20; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto; gap: 18px; align-items: end; margin-top: 34px; padding: 16px 0; border-top: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); background: rgb(255 255 255 / .97); }
.filter-group { min-width: 0; }
.filter-label { display: block; margin-bottom: 7px; color: var(--color-muted); font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.segment-control { display: flex; }
.segment-control button { min-height: 44px; }
.clear-button { min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: var(--color-info); font-size: 13px; font-weight: 750; cursor: pointer; }
.clear-button:hover { text-decoration: underline; text-underline-offset: 4px; }
.ledger-head { display: grid; grid-template-columns: 74px minmax(0, 1.45fr) minmax(210px, .85fr) minmax(190px, .7fr); gap: 22px; padding: 20px 0 12px; color: var(--color-muted); font-family: var(--font-mono); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.idea-row { display: grid; grid-template-columns: 74px minmax(0, 1.45fr) minmax(210px, .85fr) minmax(190px, .7fr); gap: 22px; padding: 28px 0; border-top: 1px solid var(--color-line); scroll-margin-top: 174px; }
.idea-number { color: var(--color-info); font-family: var(--font-mono); font-size: 26px; font-weight: 500; }
.idea-title-block h3 { margin: 6px 0 8px; color: var(--color-navy-deep); font-size: 20px; line-height: 1.2; }
.idea-title-block > p { margin: 0; color: var(--color-muted); font-size: 14px; line-height: 1.55; }
.family-label, .phase-label, .status-label { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border: 1px solid currentColor; border-radius: 999px; font-size: 10px; font-weight: 800; line-height: 1; }
.family-label[data-family="hurricane-flood"] { color: var(--family-flood); }
.family-label[data-family="wildfire-smoke"] { color: var(--family-fire); }
.family-label[data-family="heat-drought"] { color: var(--family-heat); }
.family-label[data-family="winter-water"] { color: var(--family-winter); }
.family-label[data-family="exposure-recovery"] { color: var(--family-recovery); }
.idea-details { margin-top: 14px; }
.idea-details summary { width: fit-content; color: var(--color-info); font-size: 12px; font-weight: 750; cursor: pointer; }
.idea-details div { max-width: 68ch; margin-top: 10px; padding: 14px 16px; background: var(--color-surface-raised); color: var(--color-muted); font-size: 13px; line-height: 1.55; }
.idea-details strong { color: var(--color-navy); }
.idea-sources h4, .idea-boundary h4 { margin: 5px 0 9px; color: var(--color-muted); font-family: var(--font-mono); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.idea-sources ul { margin: 0; padding: 0; list-style: none; }
.idea-sources li + li { margin-top: 7px; }
.idea-sources a { display: inline-flex; align-items: center; gap: 5px; color: var(--color-info); font-size: 12px; font-weight: 700; text-underline-offset: 3px; }
.idea-sources svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.idea-boundary { color: var(--color-muted); font-size: 12px; line-height: 1.5; }
.status-label { margin-bottom: 8px; color: var(--color-success); }
.status-label[data-status="validate"] { color: var(--color-warning); }
.phase-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.phase-label { border-color: var(--color-line); color: var(--color-muted); }
.empty-state { padding: 60px 24px; border-top: 1px solid var(--color-line); background: var(--color-surface-raised); text-align: center; }
.empty-state h3 { margin: 0; color: var(--color-navy); }
.empty-state p { max-width: 620px; margin: 12px auto 20px; color: var(--color-muted); line-height: 1.5; }

.start-section { padding: 84px max(24px, calc((100vw - var(--content-max)) / 2)); background: var(--color-navy-deep); color: white; }
.start-heading { display: flex; justify-content: space-between; gap: 32px; align-items: end; }
.start-heading p { max-width: 460px; margin: 0; color: #b8c8d8; line-height: 1.55; }
.priority-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin: 42px 0 0; padding: 0; border-top: 1px solid #49617a; list-style: none; counter-reset: priorities; }
.priority-list li { min-width: 0; padding: 24px 22px; border-left: 1px solid #49617a; counter-increment: priorities; }
.priority-list li:first-child { border-left: 0; padding-left: 0; }
.priority-list li::before { content: counter(priorities, decimal-leading-zero); display: block; margin-bottom: 28px; color: #8da6be; font-family: var(--font-mono); font-size: 12px; }
.priority-list button { padding: 0; border: 0; background: transparent; color: white; font-size: 14px; font-weight: 750; line-height: 1.35; text-align: left; cursor: pointer; }
.priority-list button:hover { color: #a9d5f2; }
.priority-list small { display: block; margin-top: 10px; color: #9db0c2; font-size: 11px; line-height: 1.4; }

.source-section { max-width: var(--content-max); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); gap: clamp(48px, 8vw, 110px); margin: 0 auto; padding: 96px 24px; }
.source-section > div > p { max-width: 680px; margin: 18px 0 22px; color: var(--color-muted); font-size: 16px; line-height: 1.65; }
.guardrail { padding: 28px; border: 1px solid var(--color-line); border-radius: var(--radius-panel); background: var(--color-surface-raised); }
.guardrail h3 { margin: 0 0 12px; color: var(--color-navy); font-size: 18px; }
.guardrail p { margin: 0; color: var(--color-muted); font-size: 13px; line-height: 1.6; }
.guardrail p + p { margin-top: 12px; }

footer { display: grid; grid-template-columns: auto minmax(0, 720px); justify-content: space-between; gap: 40px; padding: 34px max(24px, calc((100vw - var(--content-max)) / 2)); border-top: 1px solid var(--color-line); background: var(--color-canvas); }
footer div { display: flex; flex-direction: column; gap: 5px; }
footer strong { color: var(--color-navy); }
footer span, footer p { color: var(--color-muted); font-size: 11px; line-height: 1.5; }
footer p { margin: 0; }

@media (max-width: 1080px) {
  .site-header nav a:nth-child(2), .site-header nav a:nth-child(4) { display: none; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { min-height: calc(100vh - 64px); }
  .orbit-panel { min-height: 720px; }
  .method-strip { grid-template-columns: 1fr; }
  .live-demo-heading { align-items: flex-start; flex-direction: column; }
  .filter-deck { grid-template-columns: 1fr; position: relative; top: auto; }
  .clear-button { justify-self: start; }
  .ledger-head { display: none; }
  .idea-row { grid-template-columns: 58px minmax(0, 1fr) minmax(190px, .68fr); }
  .idea-boundary { grid-column: 2 / -1; }
  .priority-list { grid-template-columns: repeat(3, 1fr); }
  .priority-list li:nth-child(4) { border-left: 0; }
}

@media (max-width: 720px) {
  .site-header { min-height: 58px; padding: 0 14px; }
  .wordmark { font-size: 14px; }
  .wordmark-mark { width: 34px; height: 34px; }
  .site-header nav { gap: 14px; }
  .site-header nav a { display: none; }
  .site-header nav a:nth-child(1) { display: inline; }
  .hero { min-height: 0; }
  .hero-copy { min-height: 0; padding: 58px 20px 52px; }
  h1 { font-size: clamp(38px, 12vw, 54px); }
  .hero-lede { margin: 20px 0 24px; font-size: 16px; }
  .hero-search { min-height: 54px; }
  .hero-search kbd { display: none; }
  .hero-actions { align-items: flex-start; flex-direction: column; }
  .orbit-panel { min-height: 520px; padding: 24px 10px; }
  .orbit-stage { width: min(100%, 500px); }
  .orbit-core { width: 126px; gap: 6px; padding: 12px; }
  .orbit-core strong { font-size: 13px; }
  .orbit-core span { display: none; }
  .orbit-node { width: 112px; min-height: 70px; grid-template-columns: 26px minmax(0, 1fr); padding: 8px; }
  .orbit-node svg { width: 25px; height: 25px; }
  .orbit-node span { font-size: 10px; }
  .orbit-node small { margin-top: -12px; font-size: 8px; }
  .orbit-fire { left: 1%; }
  .orbit-heat { right: 1%; }
  .orbit-winter { left: 3%; }
  .orbit-recovery { right: 3%; }
  .method-strip, .start-section { padding: 58px 20px; }
  .method-flow { grid-template-columns: 1fr; margin-top: 24px; }
  .method-flow li, .method-flow li:first-child { min-height: 0; padding: 18px 0 18px 54px; border-left: 0; border-top: 1px solid #49617a; }
  .method-flow span { position: absolute; top: 16px; left: 0; }
  .live-demo-section { padding: 70px 18px 16px; }
  .demo-switcher { grid-template-columns: 1fr; }
  .demo-switcher a, .demo-switcher a:first-child { min-height: 66px; border-top: 1px solid var(--color-line); border-left: 0; }
  .demo-switcher a:first-child { border-top: 0; }
  #earthEngineDemo { height: 720px; }
  .ideas-section { padding: 70px 18px 80px; }
  .ideas-heading, .start-heading { align-items: flex-start; flex-direction: column; }
  .results-count { order: -1; }
  .filter-deck { margin-top: 26px; }
  .segment-control { width: 100%; }
  .idea-row { grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 26px 0; }
  .idea-number { font-size: 20px; }
  .idea-title-block { grid-column: 2; }
  .idea-sources, .idea-boundary { grid-column: 2; }
  .priority-list { grid-template-columns: 1fr; }
  .priority-list li, .priority-list li:first-child, .priority-list li:nth-child(4) { padding: 22px 0; border-left: 0; border-top: 1px solid #49617a; }
  .priority-list li:first-child { border-top: 0; }
  .priority-list li::before { margin-bottom: 8px; }
  .source-section { grid-template-columns: 1fr; padding: 70px 20px; }
  footer { grid-template-columns: 1fr; padding: 30px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orbit-path { animation: none; }
  .orbit-node, .action-tile { transition: none; }
}
