/* PI-AcousticNeRF — Minimal White */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&family=DM+Mono:wght@300;400&display=swap');

/* ── Variables ──────────────────────────────────────────────────────────── */
:root {
  --white:   #ffffff;
  --off:     #f7f7f7;
  --div:     #e8e8e8;
  --text:    #141414;
  --muted:   #999;
  --label:   #555;
  --accent:  #3d5a80;
  --font:    'DM Sans', sans-serif;
  --mono:    'DM Mono', 'Courier New', monospace;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: #0a0a0f;
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 0 20px;
  height: 38px;
  background: #0d1117;
  border-bottom: 1px solid #1e2a36;
  flex-shrink: 0;
  z-index: 20;
}

.header-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.header-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: #d8e4ec;
}

.header-divider {
  color: #2a3a48;
  font-size: 14px;
}

.header-sub {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 300;
  color: #3a5060;
  letter-spacing: 0.04em;
}

.header-meta {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 300;
  color: #2a404e;
  letter-spacing: 0.06em;
}

/* ── Main layout ─────────────────────────────────────────────────────────── */
.main {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ── Canvas ──────────────────────────────────────────────────────────────── */
#canvas-container {
  flex: 1;
  position: relative;
  min-width: 0;
}

#three-canvas { width: 100%; height: 100%; display: block; }

/* ── Figure label ────────────────────────────────────────────────────────── */
.fig-label {
  position: absolute;
  bottom: 14px;
  left: 16px;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 300;
  color: rgba(200, 200, 215, 0.45);
  letter-spacing: 0.01em;
  pointer-events: none;
}

/* ── Loading ─────────────────────────────────────────────────────────────── */
#loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0f;
  z-index: 5;
}

.load-block { width: 180px; }

.load-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 300;
  color: #444;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  text-align: center;
}

.load-bar {
  height: 1px;
  background: #1e1e1e;
}

.load-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.1s linear;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
#sidebar {
  width: 232px;
  background: var(--white);
  border-left: 1px solid var(--div);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
}

#sidebar::-webkit-scrollbar { width: 0; }

section.panel {
  padding: 14px 16px;
}

/* ── Divider ─────────────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--div);
  flex-shrink: 0;
}

/* ── Panel label ─────────────────────────────────────────────────────────── */
.panel-label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.panel-label em {
  font-style: italic;
  font-family: Georgia, serif;
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Model A / B ─────────────────────────────────────────────────────────── */
.model-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 9px;
}

.sel-btn {
  background: var(--white);
  border: 1px solid var(--div);
  color: var(--text);
  font-family: var(--font);
  padding: 11px 6px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.sel-btn:hover:not(.active) {
  background: var(--off);
  border-color: #ccc;
}

.sel-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.sel-letter {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 22px;
  line-height: 1;
  color: #ccc;
  transition: color 0.12s;
}

.sel-btn.active .sel-letter {
  color: rgba(255, 255, 255, 0.55);
}

.sel-name {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.sel-sub {
  font-size: 8.5px;
  font-weight: 300;
  color: var(--muted);
}

.sel-btn.active .sel-sub,
.sel-btn.active .sel-name {
  color: rgba(255, 255, 255, 0.75);
}

.model-note {
  font-size: 9.5px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Frequency buttons ───────────────────────────────────────────────────── */
.freq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.freq-btn {
  background: var(--white);
  border: 1px solid var(--div);
  color: var(--label);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  cursor: pointer;
  padding: 8px 4px;
  text-align: center;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  line-height: 1;
}

.freq-btn:hover:not(.active) {
  background: var(--off);
  border-color: #ccc;
}

.freq-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Colormap ────────────────────────────────────────────────────────────── */
.cmap-bar {
  height: 8px;
  background: linear-gradient(to right,
    #2166ac 0%, #92c5de 35%, #f7f7f7 50%, #f4a582 65%, #b2182b 100%);
  margin-bottom: 5px;
}

.cmap-ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 300;
  color: var(--muted);
  margin-bottom: 2px;
}

.cmap-ends {
  display: flex;
  justify-content: space-between;
  font-size: 8.5px;
  font-weight: 300;
  color: var(--muted);
  font-style: italic;
}

/* ── Overlay toggles ─────────────────────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.toggle-label {
  font-size: 11px;
  font-weight: 400;
  color: var(--text);
  flex: 1;
}

.tog {
  width: 28px;
  height: 14px;
  border: 1.5px solid #d8d8d8;
  background: transparent;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: border-color 0.15s;
}

.tog-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 7px;
  height: 7px;
  background: #d0d0d0;
  transition: transform 0.15s, background 0.15s;
}

.tog.on {
  border-color: var(--accent);
}

.tog.on .tog-thumb {
  transform: translateX(13px);
  background: var(--accent);
}

.res-note {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 300;
  color: var(--muted);
}

.res-note #residual-status {
  color: var(--accent);
}

/* ── Measurements table ──────────────────────────────────────────────────── */
.meas-table {
  width: 100%;
  border-collapse: collapse;
}

.meas-table td {
  padding: 2.5px 0;
  vertical-align: baseline;
  line-height: 1.65;
}

.meas-table .mk {
  font-size: 10px;
  font-weight: 300;
  color: var(--label);
  width: 55%;
  padding-right: 6px;
}

.meas-table .mk em {
  font-style: italic;
  font-family: Georgia, serif;
}

.meas-table .mv {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--text);
  text-align: right;
  letter-spacing: -0.01em;
}

.meas-table .row-sep td {
  padding: 5px 0 4px;
  border-top: 1px solid var(--div);
}

/* ── Reset camera ────────────────────────────────────────────────────────── */
.reset-btn {
  width: 100%;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  margin-bottom: 9px;
  color: var(--label);
}

.nav-hint {
  font-size: 9px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.8;
}

/* ── Legend / footer ─────────────────────────────────────────────────────── */
.fig-footer {
  padding: 12px 16px 18px;
  margin-top: auto;
}

.footer-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9.5px;
  font-weight: 300;
  color: var(--muted);
  margin-bottom: 5px;
}

.leg-swatch {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  display: inline-block;
}

.leg-grad {
  width: 24px;
  height: 8px;
  flex-shrink: 0;
  background: linear-gradient(to right, #2166ac, #92c5de, #f7f7f7, #f4a582, #b2182b);
}

.footnote {
  font-size: 9px;
  font-weight: 300;
  color: #bbb;
  line-height: 1.7;
  margin-top: 10px;
  font-style: italic;
}

.footnote em {
  font-style: normal;
  font-family: Georgia, serif;
}
