:root {
  color-scheme: light;
  --ink: #22313a;
  --muted: #66747d;
  --line: #dce3e6;
  --accent: #286780;
  font-family: system-ui, sans-serif;
  background: #fff;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 1280px; margin: auto; padding: 36px 24px; }
header { max-width: 760px; margin-bottom: 40px; }
h1 { font-size: clamp(1.5rem, 3vw, 2.3rem); line-height: 1.15; letter-spacing: -.04em; margin: 10px 0 16px; }
header p { color: var(--muted); font-size: .9rem; }
.eyebrow { text-transform: uppercase; font-size: .72rem; letter-spacing: .14em; font-weight: 700; color: #39718a; }
.demo-section { margin: 40px 0 56px; }
.controls { display: grid; grid-template-columns: auto 3em minmax(120px, 1fr) auto; gap: 12px; align-items: center; max-width: 520px; margin: 0 0 24px auto; font-size: .85rem; }
.controls label { color: var(--muted); }
output { text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }
input { min-width: 0; width: 100%; accent-color: #384852; }
button { background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; color: var(--muted); font: inherit; cursor: pointer; }
button:hover { border-color: var(--accent); color: var(--accent); }
.comparison-grid {
  display: grid;
  grid-template-columns: minmax(190px, 2fr) minmax(100px, 1fr) repeat(2, minmax(190px, 2fr));
  gap: 14px 20px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 6px;
}
.comparison-panel {
  display: grid;
  grid-column: span 2;
  grid-row: span var(--comparison-rows, 3);
  grid-template-columns: subgrid;
  grid-template-rows: subgrid;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.panel-heading { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .85rem; font-weight: 600; }
.reference-panel { background: #f6f8fa; }
.reconstruction-panel { background: #fff; }
.activation-pair {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
  aspect-ratio: 1 / 2;
  align-self: center;
  justify-items: center;
  min-width: 0;
  min-height: 0;
}
.tone-0 { --accent: #286780; }
.tone-1 { --accent: #b24928; }
figure { position: relative; margin: 0; min-width: 0; aspect-ratio: 1; overflow: hidden; border-radius: 7px; }
img { display: block; width: 100%; height: 100%; aspect-ratio: 1; object-fit: contain; background: #f0f3f5; }
.original { border: 2px solid var(--line); }
.result { border: 2px solid var(--accent); }
.activation { height: 100%; width: auto; max-width: 100%; min-height: 0; border: 2px solid var(--accent); }
.activation img { object-fit: fill; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 640px) {
  main { padding: 24px 12px; }
  .controls { max-width: none; grid-template-columns: auto 3em minmax(90px, 1fr) auto; }
  .comparison-grid { gap: 12px; }
}

.dimension-marker {
  position: absolute;
  top: 6px;
  left: 6px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #dce3e6;
  border-radius: 4px;
  background: #fff;
  pointer-events: none;
}
.dimension-marker::before { content: ''; width: 9px; height: 9px; background: var(--accent); }
.marker-0::before { border-radius: 50%; }
.marker-1::before { transform: rotate(45deg); border-radius: 1px; }
