:root {
  --ink: #111111;
  --paper: #fffdf5;
  --orange: #ff5c35;
  --yellow: #ffd447;
  --blue: #6cd4ff;
  --green: #59e391;
  --pink: #ff8fcf;
  --muted: #e8e5dc;
  --shadow: 7px 7px 0 var(--ink);
  --border: 3px solid var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
a { color: inherit; }
button, select { font: inherit; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; background: var(--yellow); border: var(--border); padding: .75rem 1rem; font-weight: 900; }
.skip-link:focus { top: 1rem; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.25rem;
  padding: .75rem clamp(1rem, 4vw, 4rem);
  background: var(--paper);
  border-bottom: var(--border);
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; font-weight: 950; letter-spacing: -.04em; font-size: 1.15rem; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; background: var(--yellow); border: var(--border); transform: rotate(-3deg); }
nav { display: flex; gap: 1.5rem; }
nav a, .repo-link { font-size: .86rem; font-weight: 850; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.repo-link { justify-self: end; background: var(--ink); color: white; padding: .7rem 1rem; text-decoration: none; border: 2px solid var(--ink); }
.repo-link:hover { background: var(--orange); color: var(--ink); }

main > section { padding: 5rem clamp(1rem, 5vw, 5rem); border-bottom: var(--border); }
.intro { min-height: calc(100vh - 76px); display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); align-items: center; gap: clamp(2rem, 7vw, 7rem); background-image: linear-gradient(rgba(17,17,17,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(17,17,17,.07) 1px, transparent 1px); background-size: 32px 32px; }
.eyebrow { margin: 0 0 .7rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .83rem; font-weight: 900; letter-spacing: .12em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 1.5rem; font-size: clamp(3.5rem, 8vw, 8.5rem); line-height: .83; letter-spacing: -.075em; font-weight: 950; text-transform: uppercase; }
h1 span { color: var(--orange); -webkit-text-stroke: 2px var(--ink); }
.lede { max-width: 720px; font-size: clamp(1.1rem, 1.8vw, 1.45rem); font-weight: 650; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.button { display: inline-block; padding: .9rem 1.25rem; border: var(--border); box-shadow: 4px 4px 0 var(--ink); font-weight: 900; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.button:hover, .button:focus-visible { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.button-primary { background: var(--yellow); }
.button-secondary { background: white; }
.summary-board { background: var(--blue); border: var(--border); box-shadow: var(--shadow); transform: rotate(1.2deg); }
.summary-label { padding: .65rem 1rem; background: var(--ink); color: white; font-weight: 900; letter-spacing: .12em; }
.summary-board dl { margin: 0; padding: 1rem; }
.summary-board dl div { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .85rem 0; border-bottom: 2px solid var(--ink); }
.summary-board dt { font-weight: 800; }
.summary-board dd { margin: 0; font-size: 1.75rem; font-weight: 950; }
.stamp { margin: 0 1rem 1rem; padding: .5rem; border: 2px dashed var(--ink); font-family: ui-monospace, monospace; font-size: .72rem; font-weight: 900; text-align: center; }

.explorer { background: var(--yellow); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
h2 { margin-bottom: 0; font-size: clamp(2.5rem, 5vw, 5.25rem); line-height: .94; letter-spacing: -.055em; font-weight: 950; text-transform: uppercase; }
.section-intro { max-width: 620px; margin-bottom: 0; font-size: 1.1rem; font-weight: 650; }
.dataset-control { min-width: min(100%, 360px); }
.dataset-control label { display: block; margin-bottom: .35rem; font-family: ui-monospace, monospace; font-weight: 900; }
select { width: 100%; padding: .85rem 2.5rem .85rem .85rem; border: var(--border); border-radius: 0; background: white; color: var(--ink); font-weight: 850; box-shadow: 4px 4px 0 var(--ink); }
select:focus-visible { outline: 4px solid var(--orange); outline-offset: 2px; }
.explorer-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 1.5rem; align-items: stretch; }
.chart-card { min-width: 0; background: white; border: var(--border); box-shadow: var(--shadow); }
.chart-header { display: flex; justify-content: space-between; gap: 1rem; padding: 1.2rem; border-bottom: var(--border); }
.chart-kicker { margin-bottom: .2rem; color: #535353; font-family: ui-monospace, monospace; font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.chart-header h3 { margin-bottom: 0; font-size: 1.4rem; }
.result-badge { align-self: center; padding: .35rem .55rem; border: 2px solid var(--ink); background: var(--green); font: 900 .72rem ui-monospace, monospace; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; font-size: .8rem; font-weight: 850; }
.legend span { display: flex; align-items: center; gap: .4rem; }
.legend-line { display: inline-block; width: 24px; height: 4px; background: var(--orange); }
.legend-line.reference { background: var(--blue); border-top: 2px dashed var(--ink); height: 6px; }
.chart-wrap { position: relative; height: 440px; padding: 1rem; }
canvas { width: 100%; height: 100%; display: block; }
.result-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.result-gallery figure { margin: 0; padding: .75rem; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); background: var(--paper); }
.result-gallery figure:nth-child(odd) { border-right: 0; }
.result-gallery .result-feature { grid-column: 1 / -1; border-right: 0; }
.result-gallery img { display: block; width: 100%; height: 230px; object-fit: contain; background: white; border: 2px solid var(--ink); }
.result-gallery .result-feature img { height: 380px; }
.result-gallery figcaption { padding-top: .55rem; font: 900 .75rem ui-monospace, monospace; text-transform: uppercase; }
.chart-footer { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 1.2rem; border-top: var(--border); font-family: ui-monospace, monospace; font-size: .78rem; font-weight: 900; }
.metric-panel { display: flex; flex-direction: column; gap: 1rem; }
.metric { flex: 1; min-width: 0; padding: 1rem; background: var(--paper); border: var(--border); box-shadow: 4px 4px 0 var(--ink); }
.metric-accent { background: var(--orange); padding: 1.3rem; }
.metric-label { display: block; margin-bottom: .35rem; font-family: ui-monospace, monospace; font-size: .73rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.metric strong { display: block; font-size: clamp(1.35rem, 2vw, 2.25rem); line-height: 1.05; }
.metric-accent strong { font-size: clamp(2.6rem, 5vw, 5rem); }
.metric small { display: block; margin-top: .45rem; font-size: .72rem; font-weight: 750; }
.metric-pair { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.disclaimer { margin: 1.5rem 0 0; padding: .7rem 1rem; background: var(--ink); color: white; font-size: .85rem; font-weight: 750; }
.notice { margin-bottom: 1rem; padding: 1rem; border: var(--border); font-weight: 800; }
.notice-error { background: #ffb3b3; }

.method { background: var(--paper); }
.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 3rem 0; padding: 0; list-style: none; border: var(--border); box-shadow: var(--shadow); }
.pipeline li { min-height: 250px; padding: 1.25rem; background: white; border-right: var(--border); }
.pipeline li:last-child { border-right: 0; }
.pipeline li:nth-child(2) { background: var(--blue); }
.pipeline li:nth-child(3) { background: var(--pink); }
.pipeline li:nth-child(4) { background: var(--green); }
.pipeline li > span { font: 900 2rem ui-monospace, monospace; }
.pipeline h3 { margin: 2.5rem 0 .5rem; font-size: 1.45rem; text-transform: uppercase; }
.pipeline p { margin-bottom: 0; font-weight: 600; }
.method-callout { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; padding: 1.4rem; border: var(--border); background: var(--yellow); box-shadow: 4px 4px 0 var(--ink); }
.method-callout strong { font-size: 1.4rem; text-transform: uppercase; }
.method-callout p { margin-bottom: 0; }

.evidence { background: var(--blue); }
.evidence-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.evidence-card { padding: 1.5rem; border: var(--border); box-shadow: var(--shadow); background: white; }
.evidence-card span { display: inline-block; padding: .2rem .5rem; border: 2px solid var(--ink); font: 900 .72rem ui-monospace, monospace; }
.evidence-card h3 { margin: 3rem 0 .7rem; font-size: 1.45rem; }
.evidence-card p { margin-bottom: 0; }
.evidence-good span { background: var(--green); }
.evidence-warn span { background: var(--yellow); }
.evidence-stop span { background: var(--orange); }

.downloads { display: grid; grid-template-columns: minmax(0, .8fr) minmax(340px, 1.2fr); gap: 5vw; background: var(--pink); }
.downloads > div:first-child p:last-child { margin-top: 1.5rem; max-width: 620px; font-size: 1.05rem; font-weight: 650; }
.download-list { border: var(--border); box-shadow: var(--shadow); }
.download-list a { display: flex; justify-content: space-between; gap: 1rem; padding: 1.2rem; background: white; border-bottom: var(--border); text-decoration: none; font-weight: 850; }
.download-list a:last-child { border-bottom: 0; }
.download-list a:hover { background: var(--yellow); }
.credits { background: var(--ink); color: white; }
.credits h2 { color: var(--yellow); }
.credits ul { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; margin: 2.5rem 0 0; padding: 0; list-style: none; }
.credits li { padding: 1rem; border: 2px solid white; font-weight: 850; }
.credits li span { display: block; margin-top: .5rem; color: var(--blue); font: .72rem ui-monospace, monospace; }
footer { display: flex; justify-content: space-between; gap: 1rem; padding: 2rem clamp(1rem, 5vw, 5rem); background: var(--yellow); border-bottom: 8px solid var(--ink); font-size: .85rem; }

@media (max-width: 960px) {
  .topbar { grid-template-columns: 1fr auto; }
  nav { display: none; }
  .intro { min-height: auto; grid-template-columns: 1fr; padding-top: 6rem; padding-bottom: 6rem; }
  .summary-board { max-width: 560px; }
  .explorer-grid { grid-template-columns: 1fr; }
  .metric-panel { display: grid; grid-template-columns: 1fr 1fr; }
  .metric-accent { grid-column: 1 / -1; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .pipeline li:nth-child(2) { border-right: 0; }
  .pipeline li:nth-child(-n+2) { border-bottom: var(--border); }
  .evidence-grid { grid-template-columns: 1fr; }
  .downloads { grid-template-columns: 1fr; }
  .credits ul { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .topbar { min-height: 66px; }
  .brand { font-size: 1rem; }
  .brand-mark { width: 36px; height: 36px; }
  .repo-link { padding: .55rem .7rem; font-size: .75rem; }
  main > section { padding-top: 3.5rem; padding-bottom: 3.5rem; }
  h1 { font-size: clamp(3rem, 18vw, 5rem); }
  h1 span { -webkit-text-stroke-width: 1px; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .chart-header, .chart-footer { flex-direction: column; }
  .chart-wrap { height: 330px; padding: .5rem; }
  .result-gallery { grid-template-columns: 1fr; }
  .result-gallery .result-feature { grid-column: auto; }
  .result-gallery figure, .result-gallery figure:nth-child(odd) { border-right: 0; }
  .result-gallery img, .result-gallery .result-feature img { height: auto; max-height: 330px; }
  .metric-panel { grid-template-columns: 1fr; }
  .metric-accent { grid-column: auto; }
  .metric-pair { gap: .65rem; }
  .pipeline { grid-template-columns: 1fr; }
  .pipeline li { min-height: auto; border-right: 0; border-bottom: var(--border); }
  .pipeline li:last-child { border-bottom: 0; }
  .pipeline h3 { margin-top: 1rem; }
  .method-callout { grid-template-columns: 1fr; gap: .5rem; }
  .credits ul { grid-template-columns: 1fr; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
