:root {
  --bg: #ffffff;
  --pane: #f6f8fa;
  --raise: #eaeef2;
  --line: #dde2e7;
  --fg: #1f2328;
  --dim: #59636e;
  --faint: #818b98;
  --accent: #0969da;
  --warn: #9a6700;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 13px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }

.top {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  height: 44px;
  padding: 0 1.1rem;
  line-height: 44px;
  border-bottom: 1px solid var(--line);
}
.brand { color: var(--fg); font-weight: 600; font-size: 15px; letter-spacing: 0.01em; }
.sub { color: var(--faint); font-size: 12px; }

.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 330px;
  height: calc(100% - 44px);
}
.pane { overflow-y: auto; }
.list, .panel { background: var(--pane); }
.list { border-right: 1px solid var(--line); padding: 0.5rem 0 1.5rem; }
.panel { border-left: 1px solid var(--line); padding: 0.75rem 0 1.5rem; }
.center { padding: 1.25rem 1.5rem 2rem; }

/* one heading style for every pane: small caps label; collapsible ones carry a chevron */
.panel h2, .sec > summary {
  margin: 0;
  padding: 0.5rem 1rem;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}
.sec { border-bottom: 1px solid var(--line); }
.sec > summary {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary::before {
  content: "";
  flex: none;
  width: 0;
  height: 0;
  border-left: 4px solid currentColor;
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
  transition: transform 0.12s;
}
.sec[open] > summary::before { transform: rotate(90deg); }
.sec > summary:hover, .sec[open] > summary { color: var(--fg); }
.sec > .body { padding: 0 1rem 0.75rem 1.65rem; }

/* left: family groups */
.list .sec:first-child { border-top: 1px solid var(--line); }
.family .n {
  margin-left: auto;
  padding: 0 0.4rem;
  border-radius: 8px;
  background: var(--raise);
  color: var(--dim);
  font: 10.5px/1.6 var(--mono);
  letter-spacing: 0;
}
.family > .body { padding: 0 0 0.4rem; }
.family button {
  display: block;
  width: 100%;
  padding: 0.28rem 0.9rem 0.28rem 1.65rem;
  border: 0;
  border-left: 2px solid transparent;
  background: none;
  color: var(--fg);
  font-size: 12.5px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}
.family button:hover { background: var(--raise); }
.family button.on { border-left-color: var(--accent); background: var(--raise); font-weight: 500; }

/* center */
.landing { max-width: 34rem; margin: 3rem auto; font-size: 14px; }
.landing h1 { font-size: 26px; font-weight: 600; margin: 0 0 1rem; }
.fine { color: var(--dim); font-size: 12px; }

.view { max-width: 980px; margin: 0 auto; }
.head { margin: 0 0 1rem; }
.head h1 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: 0.005em; }
.head .meta { margin: 0.15rem 0 0; color: var(--dim); font-size: 12.5px; }
.head .warn { color: var(--warn); }

/* the drawing sits on the page itself: white on white, no frame */
.figure {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 0.25rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  cursor: zoom-in;
  transition: border-color 0.12s;
}
.figure:hover { border-color: var(--line); }
.figure img { display: block; max-width: 100%; max-height: 46vh; }

/* three performance plots under the drawing; click to enlarge */
.plots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.35rem 0.35rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: zoom-in;
  transition: border-color 0.12s;
}
.tile:hover { border-color: var(--accent); }
/* plots come about 1600 px wide at 1.7:1 to 2.3:1; one box keeps the captions level */
.tile img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 3px;
}
.tile span {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: center;
}
.tile.none { justify-content: center; min-height: 6rem; cursor: default; }
.plots-none { margin: 1.25rem 0 0; text-align: center; }

/* enlarged plot */
.zoom {
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: none;
  outline: none;
  cursor: zoom-out;
}
.zoom::backdrop { background: rgba(31, 35, 40, 0.55); backdrop-filter: blur(2px); }
.zoom figure { margin: 0; }
.zoom img {
  display: block;
  width: min(1500px, 94vw);  /* plots are exported ~1600 px wide */
  max-height: 84vh;
  object-fit: contain;
  padding: 0.75rem;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.zoom figcaption { margin-top: 0.5rem; color: #fff; font-size: 12px; text-align: center; }

/* right: always-on specs, then collapsible detail */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.55rem 1rem;
  margin: 0.15rem 0 0;
  padding: 0 1rem 0.9rem;
  border-bottom: 1px solid var(--line);
}
.stats div.wide { grid-column: 1 / -1; }
.stats dt { color: var(--faint); font-size: 10.5px; letter-spacing: 0.04em; }
.stats dd { margin: 0; font: 13px/1.3 var(--mono); color: var(--fg); }

/* section bodies: the title's typeface, a step below its size (titles 11.5px caps, body 11px) */
.panel .sec > .body { font-size: 11px; line-height: 1.55; letter-spacing: 0.015em; color: var(--fg); }
table.kv { width: 100%; border-collapse: collapse; font-size: inherit; }
table.kv td { padding: 0.22rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.kv tr:last-child td { border-bottom: 0; }
table.kv td:first-child { color: var(--dim); }
table.kv td:last-child { padding-left: 0.75rem; text-align: right; font-variant-numeric: tabular-nums; }
.prose { margin: 0 0 0.5rem; }
.notes { margin: 0.5rem 0 0; padding-left: 1rem; color: var(--dim); }
.notes li + li { margin-top: 0.3rem; }
.cite { color: var(--dim); }
.cite p { margin: 0 0 0.35rem; }
.cite .file { margin-right: 0.75rem; font-family: var(--mono); font-size: 10px; }
.tag {
  display: inline-block;
  margin: 0 0.25rem 0.25rem 0;
  padding: 0 0.45rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 10px;
  color: var(--dim);
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: 220px minmax(0, 1fr); height: auto; }
  .list { grid-row: span 2; }
  .panel { grid-column: 2; border-left: 0; border-top: 1px solid var(--line); }
  .pane { overflow: visible; }
}
@media (max-width: 720px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .list { grid-row: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .panel { grid-column: 1; }
  .center { padding: 1rem; }
}
