:root {
  --paper: #f3f1ec;
  --card: #ffffff;
  --ink: #18202b;
  --muted: #5d6877;
  --line: #d9d5cc;
  --blue: #0a5cc2;
  --orange: #d9712a;
  --radius: 14px;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.5; }
main, .masthead, footer { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

.masthead { display: flex; gap: 32px; align-items: flex-end; justify-content: space-between;
  padding-top: 36px; padding-bottom: 22px; flex-wrap: wrap; }
.title { max-width: 640px; }
.eyebrow { margin: 0 0 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--orange); font-weight: 700; }
h1 { margin: 0; font-size: clamp(30px, 5vw, 46px); line-height: 1.05; letter-spacing: -.02em; }
.lede { margin: 12px 0 0; color: var(--muted); font-size: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, auto); gap: 0; margin: 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.stats div { padding: 12px 18px; border-left: 1px solid var(--line); }
.stats div:first-child { border-left: 0; }
.stats dt { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }

.viewer { position: relative; }
#stage { position: relative; height: min(72vh, 720px); min-height: 420px; border-radius: var(--radius);
  border: 1px solid var(--line); overflow: hidden;
  background: radial-gradient(120% 90% at 50% 15%, #ffffff 0%, #eceae4 60%, #dedbd3 100%); }
#gl { width: 100%; height: 100%; display: block; touch-action: none; }
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); }
.dim-label { font-size: 12.5px; font-weight: 650; color: var(--blue); background: rgba(255,255,255,.93);
  padding: 1px 6px; border-radius: 6px; border: 1px solid rgba(10,92,194,.28); white-space: nowrap;
  font-variant-numeric: tabular-nums; }
.dim-label.note { color: var(--ink); border-color: rgba(24,32,43,.22); font-weight: 600; }
.dim-label.tilt { color: #fff; background: var(--orange); border-color: var(--orange); }

.panel { position: absolute; left: 14px; top: 14px; display: flex; flex-direction: column; gap: 10px;
  background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  box-shadow: 0 6px 24px rgba(24,32,43,.08); width: 236px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: #fff; color: var(--ink); font: inherit; font-size: 13px;
  font-weight: 600; padding: 8px 4px; cursor: pointer; border-left: 1px solid var(--line); }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--ink); color: #fff; }
.seg button:focus-visible, .files a:focus-visible, .sheet:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--blue); }
.range { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.range input { flex: 1; accent-color: var(--blue); min-width: 0; }
.hint { margin: 8px 2px 0; font-size: 13px; color: var(--muted); }

.block { margin-top: 44px; }
.block h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.01em; }
.block .note { margin: 0 0 16px; color: var(--muted); font-size: 14.5px; }
.sheets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sheet { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; transition: box-shadow .15s, transform .15s; }
.sheet:hover { box-shadow: 0 8px 28px rgba(24,32,43,.12); transform: translateY(-1px); }
.sheet img { display: block; width: 100%; height: auto; }

.two { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; }
.two h2 + .list { margin-bottom: 26px; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; }
tr:first-child th, tr:first-child td { border-top: 0; }
th { font-weight: 600; color: var(--muted); width: 38%; }
td { font-variant-numeric: tabular-nums; }
.list { margin: 8px 0 0; padding-left: 20px; font-size: 15px; }
.list li { margin: 6px 0; }
.list.cols { columns: 2; column-gap: 40px; }
.list.cols li { break-inside: avoid; }
.files { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.files a { display: inline-flex; align-items: baseline; gap: 8px; padding: 10px 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none;
  font-weight: 600; font-size: 14.5px; }
.files a:hover { border-color: var(--blue); color: var(--blue); }
.files small { font-size: 11px; letter-spacing: .08em; color: var(--muted); }
footer { margin-top: 48px; padding-top: 18px; padding-bottom: 40px; color: var(--muted); font-size: 13px;
  border-top: 1px solid var(--line); }

@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); width: 100%; }
  .stats div:nth-child(3) { border-left: 0; }
  .stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .panel { position: static; width: auto; margin-top: 10px; box-shadow: none; }
  #stage { height: 62vh; min-height: 360px; }
  .sheets, .two { grid-template-columns: 1fr; }
  .two { gap: 28px; }
  .list.cols { columns: 1; }
  .dim-label { font-size: 11px; padding: 0 4px; }
}
@media (prefers-reduced-motion: reduce) { .sheet { transition: none; } }
