:root {
  --bg: #071013;
  --bg-deep: #04090b;
  --panel: #0c171b;
  --panel-2: #101f24;
  --ink: #edf6f2;
  --muted: #8da19d;
  --faint: #536763;
  --grid: rgba(159, 191, 181, 0.14);
  --grid-strong: rgba(159, 191, 181, 0.26);
  --acid: #c8f560;
  --cyan: #65e6d1;
  --danger: #ff6678;
  --warning: #f6bd60;
  --radius: 18px;
  --mono: "SFMono-Regular", "Cascadia Code", "Liberation Mono", Menlo, monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg-deep);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 2%, rgba(101, 230, 209, 0.09), transparent 25rem),
    radial-gradient(circle at 12% 22%, rgba(200, 245, 96, 0.055), transparent 30rem),
    linear-gradient(180deg, #071013 0%, #071114 45%, #04090b 100%);
  font-family: var(--sans);
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.shell {
  width: min(1540px, calc(100% - 48px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 99;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: #071013;
  background: var(--acid);
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

.hero {
  padding-top: 58px;
  padding-bottom: 28px;
}

.eyebrow,
.card-kicker,
.section-index,
.detail-number,
.notes-grid article > span {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 5px rgba(200, 245, 96, 0.11), 0 0 24px rgba(200, 245, 96, 0.48);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.5fr);
  gap: clamp(34px, 7vw, 110px);
  align-items: end;
  margin-top: 24px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 950px;
  margin-bottom: 22px;
  font-size: clamp(3rem, 7vw, 7.1rem);
  font-weight: 760;
  line-height: 0.91;
  letter-spacing: -0.067em;
}

h1 span {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(237, 246, 242, 0.78);
}

.lede {
  max-width: 780px;
  margin-bottom: 0;
  color: #b7c9c4;
  font-size: clamp(1rem, 1.5vw, 1.22rem);
}

.architecture-card {
  position: relative;
  overflow: hidden;
  padding: 23px 24px 20px;
  border: 1px solid rgba(200, 245, 96, 0.28);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(200, 245, 96, 0.08), rgba(12, 23, 27, 0.82) 54%);
}

.architecture-card::before {
  position: absolute;
  content: "";
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--acid);
}

.architecture-card strong {
  display: block;
  margin: 12px 0 8px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.45;
}

.architecture-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 0.55fr)) minmax(240px, 1.8fr);
  margin: 48px 0 0;
  border-top: 1px solid var(--grid-strong);
  border-bottom: 1px solid var(--grid-strong);
}

.metrics div {
  min-width: 0;
  padding: 17px 20px 16px;
  border-right: 1px solid var(--grid);
}

.metrics div:first-child {
  padding-left: 0;
}

.metrics div:last-child {
  padding-right: 0;
  border-right: 0;
}

.metrics dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.metrics dd {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 1.45rem;
  font-weight: 700;
}

.metrics .snapshot dd {
  overflow: hidden;
  color: #b7c9c4;
  font-size: 0.82rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.controls-panel {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto auto auto auto;
  gap: 22px;
  align-items: end;
  margin: 24px 0;
  padding: 17px 18px;
  border: 1px solid var(--grid-strong);
  border-radius: var(--radius);
  background: rgba(7, 16, 19, 0.88);
  backdrop-filter: blur(14px);
}

.search-wrap label,
.filter-group legend {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.67rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.search-wrap input {
  width: 100%;
  min-height: 39px;
  padding: 8px 12px;
  color: var(--ink);
  border: 1px solid var(--grid-strong);
  border-radius: 9px;
  outline: 0;
  background: #071013;
}

.search-wrap input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(101, 230, 209, 0.12);
}

.filter-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip,
.ghost-button {
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid var(--grid-strong);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.filter-chip {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.69rem;
  text-transform: uppercase;
}

.filter-chip[aria-pressed="true"] {
  color: #061014;
  border-color: var(--acid);
  background: var(--acid);
}

.filter-chip:focus-visible,
.ghost-button:focus-visible,
.legend-item:focus-visible,
.copy-button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.toggle {
  display: flex;
  gap: 9px;
  align-items: center;
  min-height: 39px;
  color: #b7c9c4;
  font-size: 0.78rem;
  white-space: nowrap;
  cursor: pointer;
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle span {
  position: relative;
  width: 34px;
  height: 19px;
  border: 1px solid var(--grid-strong);
  border-radius: 999px;
  background: #0b171a;
}

.toggle span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 11px;
  height: 11px;
  content: "";
  border-radius: 50%;
  background: var(--muted);
  transition: transform 160ms ease, background 160ms ease;
}

.toggle input:checked + span {
  border-color: rgba(200, 245, 96, 0.7);
}

.toggle input:checked + span::after {
  background: var(--acid);
  transform: translateX(15px);
}

.toggle input:focus-visible + span {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.ghost-button {
  color: var(--ink);
  border-radius: 9px;
  font-family: var(--mono);
  font-size: 0.72rem;
}

.ghost-button:hover {
  border-color: var(--cyan);
}

.trace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

.trace-column,
.detail-panel {
  min-width: 0;
  border: 1px solid var(--grid-strong);
  border-radius: var(--radius);
  background: rgba(9, 19, 22, 0.78);
}

.trace-column {
  overflow: hidden;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  min-height: 82px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--grid-strong);
}

.section-heading > div:first-child {
  display: flex;
  gap: 14px;
  align-items: baseline;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: 1.12rem;
  letter-spacing: -0.025em;
}

.precision-key {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.65rem;
}

.precision-key span {
  display: flex;
  gap: 6px;
  align-items: center;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot.exact {
  background: var(--acid);
}

.dot.coarse {
  border: 1px dashed var(--muted);
}

.line-dash {
  width: 18px;
  border-top: 1px dashed var(--warning);
}

.trace-scroll {
  overflow: auto;
  max-height: min(68vh, 920px);
  background:
    linear-gradient(90deg, rgba(7, 16, 19, 0.98), transparent 150px),
    #081215;
  scrollbar-color: #31524b #091416;
  scrollbar-width: thin;
}

#trace-svg {
  display: block;
  width: 1580px;
  min-width: 1580px;
  height: auto;
  font-family: var(--sans);
}

.scroll-hint {
  margin: 0;
  padding: 9px 22px;
  color: var(--faint);
  border-top: 1px solid var(--grid);
  font-family: var(--mono);
  font-size: 0.65rem;
  text-align: right;
}

.svg-stage-line {
  stroke: var(--grid);
  stroke-width: 1;
}

.svg-stage-cap {
  fill: #0f1e22;
  stroke: var(--grid-strong);
}

.svg-stage-short {
  fill: var(--acid);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.svg-stage-label {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.svg-stage-desc {
  fill: var(--muted);
  font-size: 9px;
}

.svg-axis-title {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.svg-band {
  fill: rgba(101, 230, 209, 0.018);
  stroke: var(--grid);
  stroke-width: 1;
}

.svg-band.alt {
  fill: rgba(200, 245, 96, 0.018);
}

.svg-band.provisional {
  fill: rgba(246, 189, 96, 0.025);
  stroke: rgba(246, 189, 96, 0.23);
  stroke-dasharray: 5 6;
}

.svg-band-label {
  fill: #c6d5d1;
  font-size: 11px;
  font-weight: 650;
}

.svg-band-time {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.svg-band-note {
  fill: var(--faint);
  font-size: 9px;
}

.route-segment {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.64;
  cursor: pointer;
  transition: opacity 150ms ease, stroke-width 150ms ease;
}

.route-segment:hover,
.route-segment.selected {
  stroke-width: 3.6;
  opacity: 1;
}

.route-segment.dimmed,
.event-node.dimmed,
.terminal-label.dimmed,
.lineage.dimmed {
  opacity: 0.08;
}

.route-segment.control-route {
  stroke-dasharray: 7 7;
  opacity: 0.8;
}

.lineage {
  fill: none;
  stroke: rgba(232, 140, 255, 0.76);
  stroke-width: 1.6;
  stroke-dasharray: 4 7;
}

.lineage-label {
  fill: #e88cff;
  font-family: var(--mono);
  font-size: 9px;
}

.event-node {
  cursor: pointer;
  outline: none;
  transition: opacity 150ms ease;
}

.event-node .node-core {
  fill: #071013;
  stroke-width: 2.3;
}

.event-node.exact .node-core,
.event-node.logged .node-core {
  fill: currentColor;
}

.event-node.ordered .node-core,
.event-node.cycle .node-core,
.event-node.date .node-core {
  stroke-dasharray: 2 2;
}

.event-node.control-node .node-core {
  fill: #071013;
  stroke-dasharray: 4 3;
}

.event-node:hover .node-halo,
.event-node:focus .node-halo,
.event-node.selected .node-halo {
  opacity: 0.22;
}

.node-halo {
  fill: currentColor;
  opacity: 0;
}

.node-kill-x {
  stroke: #071013;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.terminal-label {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  pointer-events: none;
}

.selected-event-label-bg {
  fill: #071013;
  stroke: var(--grid-strong);
}

.selected-event-label {
  fill: var(--ink);
  font-family: var(--mono);
  font-size: 9px;
}

.idea-I001 { color: #ff6678; stroke: #ff6678; }
.idea-I002 { color: #55dcc2; stroke: #55dcc2; }
.idea-I003 { color: #f6bd60; stroke: #f6bd60; }
.idea-I004 { color: #ff8b64; stroke: #ff8b64; }
.idea-I005 { color: #59a8ff; stroke: #59a8ff; }
.idea-I006 { color: #9c83ff; stroke: #9c83ff; }
.idea-I007 { color: #48d4f2; stroke: #48d4f2; }
.idea-I008 { color: #e88cff; stroke: #e88cff; }
.idea-I009 { color: #86df72; stroke: #86df72; }
.idea-I010 { color: #ffb45c; stroke: #ffb45c; }

.legend-block {
  padding: 18px 22px 22px;
  border-top: 1px solid var(--grid-strong);
}

.legend-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.legend-heading h3 {
  margin-bottom: 0;
  font-size: 0.86rem;
}

.legend-heading span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.67rem;
}

.idea-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.legend-item {
  display: grid;
  grid-template-columns: 8px 42px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 9px 10px;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
  text-align: left;
  cursor: pointer;
}

.legend-item:hover,
.legend-item[aria-pressed="true"] {
  border-color: var(--grid-strong);
  background: rgba(255, 255, 255, 0.035);
}

.legend-swatch {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}

.legend-id,
.legend-state,
.detail-meta,
.source-card code,
.event-time {
  font-family: var(--mono);
}

.legend-id {
  font-size: 0.72rem;
  font-weight: 700;
}

.legend-title {
  overflow: hidden;
  color: #b7c9c4;
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-state {
  color: var(--muted);
  font-size: 0.59rem;
  text-transform: uppercase;
}

.legend-item.hidden-by-filter {
  display: none;
}

.detail-panel {
  position: sticky;
  top: 18px;
  min-height: 420px;
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.detail-placeholder,
.detail-content {
  padding: 24px;
}

.detail-placeholder h2,
.detail-content h2 {
  margin: 12px 0;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.detail-placeholder p,
.detail-content > p {
  color: var(--muted);
  font-size: 0.86rem;
}

.detail-id-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.detail-id {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 800;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--grid-strong);
  border-radius: 999px;
  color: #b7c9c4;
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
}

.status-badge.killed { color: var(--danger); border-color: rgba(255, 102, 120, 0.45); }
.status-badge.parked { color: var(--warning); border-color: rgba(246, 189, 96, 0.45); }
.status-badge.developing { color: var(--cyan); border-color: rgba(101, 230, 209, 0.45); }
.status-badge.seed { color: #b9a8ff; border-color: rgba(185, 168, 255, 0.45); }

.detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
}

.detail-meta div {
  padding: 9px 10px;
  border: 1px solid var(--grid);
  border-radius: 8px;
}

.detail-meta span {
  display: block;
  color: var(--faint);
  font-size: 0.56rem;
  text-transform: uppercase;
}

.detail-meta strong {
  display: block;
  margin-top: 3px;
  font-size: 0.72rem;
}

.claim-box {
  margin: 18px 0;
  padding: 14px;
  border: 1px solid rgba(101, 230, 209, 0.2);
  border-radius: 9px;
  background: rgba(101, 230, 209, 0.025);
}

.claim-box p {
  margin: 8px 0 0;
  color: #c7d7d3;
  font-size: 0.81rem;
}

.gate-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.gate {
  padding: 8px 9px;
  border: 1px solid var(--grid);
  border-radius: 7px;
}

.gate span,
.gate strong {
  display: block;
  font-family: var(--mono);
}

.gate span {
  color: var(--faint);
  font-size: 0.56rem;
  text-transform: uppercase;
}

.gate strong {
  margin-top: 2px;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.gate.good strong { color: var(--acid); }
.gate.adequate strong { color: var(--cyan); }
.gate.poor {
  border-color: rgba(255, 102, 120, 0.3);
  background: rgba(255, 102, 120, 0.03);
}
.gate.poor strong { color: var(--danger); }

.kill-box,
.event-box {
  margin: 18px 0;
  padding: 14px;
  border: 1px solid rgba(255, 102, 120, 0.26);
  border-left: 3px solid var(--danger);
  border-radius: 8px;
  background: rgba(255, 102, 120, 0.045);
}

.event-box {
  border-color: rgba(101, 230, 209, 0.23);
  border-left-color: var(--cyan);
  background: rgba(101, 230, 209, 0.035);
}

.kill-box strong,
.event-box strong {
  display: block;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.kill-box p,
.event-box p {
  margin-bottom: 0;
  color: #c0d0cc;
  font-size: 0.82rem;
}

.event-time {
  margin: 7px 0 0;
  color: var(--acid);
  font-size: 0.67rem;
}

.redteam-list {
  display: grid;
  gap: 9px;
}

.redteam-card {
  padding: 12px;
  border: 1px solid var(--grid);
  border-left: 3px solid var(--muted);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.13);
}

.redteam-card.bin-fatal {
  border-left-color: var(--danger);
  background: rgba(255, 102, 120, 0.035);
}

.redteam-card.bin-reframe {
  border-left-color: var(--warning);
  background: rgba(246, 189, 96, 0.03);
}

.redteam-card.bin-empirical {
  border-left-color: var(--cyan);
}

.redteam-card.bin-blocker {
  border-left-color: #d99a77;
}

.redteam-top,
.judge-header {
  display: flex;
  justify-content: space-between;
  gap: 9px;
  align-items: center;
}

.redteam-bin,
.redteam-code,
.redteam-source,
.judge-feasibility {
  font-family: var(--mono);
  font-size: 0.58rem;
}

.redteam-bin {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.redteam-code {
  color: var(--faint);
  text-align: right;
}

.redteam-card h4 {
  margin: 9px 0 5px;
  font-size: 0.81rem;
}

.redteam-card p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.74rem;
}

.redteam-source {
  display: block;
  overflow-wrap: anywhere;
  color: var(--faint);
}

.judge-box {
  margin: 18px 0;
  padding: 14px;
  border: 1px solid rgba(200, 245, 96, 0.22);
  border-radius: 9px;
  background: rgba(200, 245, 96, 0.028);
}

.judge-box h3 {
  margin: 10px 0 6px;
  font-size: 0.86rem;
}

.judge-box p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.76rem;
}

.judge-feasibility {
  color: var(--acid);
}

.detail-subhead {
  margin: 22px 0 9px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.journey-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.journey-list li {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 0 7px 12px;
  border-left: 1px solid var(--grid-strong);
}

.journey-list li::before {
  position: absolute;
  top: 14px;
  left: -3px;
  width: 5px;
  height: 5px;
  content: "";
  border-radius: 50%;
  background: currentColor;
}

.journey-list .journey-stage {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.65rem;
}

.journey-list .journey-label {
  color: #c0d0cc;
  font-size: 0.74rem;
}

.journey-list .control-entry {
  color: var(--warning);
}

.source-list {
  display: grid;
  gap: 8px;
}

.source-card {
  padding: 11px;
  border: 1px solid var(--grid);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
}

.source-card code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--cyan);
  font-size: 0.67rem;
}

.source-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.69rem;
}

.copy-button {
  margin-top: 8px;
  padding: 4px 7px;
  color: var(--ink);
  border: 1px solid var(--grid-strong);
  border-radius: 6px;
  background: transparent;
  font-family: var(--mono);
  font-size: 0.58rem;
  cursor: pointer;
}

.reading-notes {
  margin-top: 22px;
  border: 1px solid var(--grid-strong);
  border-radius: var(--radius);
  background: rgba(9, 19, 22, 0.7);
}

.section-heading.compact {
  min-height: 68px;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.notes-grid article {
  min-width: 0;
  padding: 24px;
  border-right: 1px solid var(--grid-strong);
}

.notes-grid article:last-child {
  border-right: 0;
}

.notes-grid h3 {
  margin: 10px 0 8px;
  font-size: 0.95rem;
}

.notes-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding-top: 28px;
  padding-bottom: 42px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.65rem;
}

footer p {
  max-width: 850px;
  margin-bottom: 0;
}

@media (max-width: 1120px) {
  .controls-panel {
    grid-template-columns: minmax(220px, 1fr) 1fr 1fr;
  }

  .toggle,
  .ghost-button {
    align-self: center;
  }

  .trace-layout {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
    max-height: none;
  }

  .detail-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
    gap: 0 28px;
  }

  .detail-content > * {
    grid-column: 1;
  }

  .detail-content .source-heading,
  .detail-content .source-list {
    grid-column: 2;
  }

  .detail-content .source-heading {
    grid-row: 1;
    margin-top: 0;
  }

  .detail-content .source-list {
    grid-row: 2 / span 8;
  }
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 28px, 1540px);
  }

  .hero {
    padding-top: 38px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2.9rem, 14vw, 5.2rem);
  }

  .architecture-card {
    max-width: none;
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .metrics div,
  .metrics div:first-child,
  .metrics div:last-child {
    padding: 13px 12px;
    border-right: 1px solid var(--grid);
    border-bottom: 1px solid var(--grid);
  }

  .metrics .snapshot {
    grid-column: 1 / -1;
    border-bottom: 0;
  }

  .controls-panel {
    grid-template-columns: 1fr 1fr;
  }

  .search-wrap {
    grid-column: 1 / -1;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .precision-key {
    justify-content: flex-start;
  }

  .idea-legend,
  .notes-grid,
  .detail-content {
    grid-template-columns: 1fr;
  }

  .notes-grid article {
    border-right: 0;
    border-bottom: 1px solid var(--grid-strong);
  }

  .notes-grid article:last-child {
    border-bottom: 0;
  }

  .detail-content .source-heading,
  .detail-content .source-list,
  .detail-content > * {
    grid-column: 1;
    grid-row: auto;
  }

  footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
