/* =============================================================================
   Roomtone — styles
   Dark ground, one accent (sonar teal), three tiers, binary contrast.
   Sections: TOKENS · BASE · MASTHEAD · LAYOUT · INPUTS · OUTPUT · HEADLINE
             AURALIZE · CHARTS · METRICS · MODES · FOOT · RESPONSIVE
   ============================================================================= */

/* ===== TOKENS ============================================================= */
:root {
  --bg:        #07090c;
  --bg-raise:  #0d1116;
  --bg-input:  #11161d;
  --line:      rgba(255,255,255,0.07);
  --line-2:    rgba(255,255,255,0.12);
  --ink:       #f3f6f8;          /* full-brightness data */
  --ink-2:     rgba(243,246,248,0.62);
  --ink-3:     rgba(243,246,248,0.34);
  --accent:    #19e3c2;          /* the one accent */
  --accent-2:  rgba(25,227,194,0.14);
  --warn:      #ffb020;
  --bad:       #ff5c5c;
  --r:         12px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

/* ===== BASE =============================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 78% -10%, rgba(25,227,194,0.06), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; }
button { font-family: inherit; cursor: pointer; color: inherit; }
::selection { background: var(--accent); color: #04211c; }

.app { max-width: 1320px; margin: 0 auto; padding: 22px clamp(14px, 3vw, 34px) 40px; }

/* ===== MASTHEAD ========================================================== */
.masthead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding-bottom: 18px; margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background:
    radial-gradient(circle at 50% 50%, transparent 30%, var(--accent) 31%, transparent 33%),
    radial-gradient(circle at 50% 50%, transparent 50%, var(--accent-2) 51%, transparent 54%),
    radial-gradient(circle at 50% 50%, var(--accent) 14%, transparent 16%);
  box-shadow: 0 0 0 1px var(--line-2), inset 0 0 14px rgba(25,227,194,0.25);
}
.masthead h1 { font-size: 20px; letter-spacing: 0.16em; }
.tagline { color: var(--ink-2); font-size: 13px; margin-top: 1px; }
.model-note {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
  text-align: right; letter-spacing: 0.02em; line-height: 1.4;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px;
}

/* ===== LAYOUT ============================================================ */
.layout { display: grid; grid-template-columns: 320px 1fr; gap: 22px; align-items: start; }

.block { margin-bottom: 22px; }
.block-title {
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-3);
  margin-bottom: 11px;
}

/* ===== INPUTS ============================================================ */
.inputs {
  position: sticky; top: 18px;
  background: var(--bg-raise); border: 1px solid var(--line);
  border-radius: var(--r); padding: 20px;
}
.presets { display: flex; flex-wrap: wrap; gap: 7px; }
.preset {
  background: var(--bg-input); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 12px; font-size: 12px; color: var(--ink-2);
  transition: border-color .15s, color .15s, background .15s;
}
.preset:hover { border-color: var(--line-2); color: var(--ink); }
.preset.active { border-color: var(--accent); color: var(--accent); background: var(--accent-2); }

.dim { display: grid; grid-template-columns: 54px 1fr 56px 14px; align-items: center; gap: 8px; margin-bottom: 9px; }
.dim label { font-size: 12px; color: var(--ink-2); }
.dim .unit { font-size: 11px; color: var(--ink-3); }
.dim-readout { font-family: var(--mono); font-size: 11px; color: var(--ink-3); margin-top: 8px; }

.surface { display: grid; grid-template-columns: 58px 1fr; align-items: center; gap: 10px; margin-bottom: 9px; }
.surface label { font-size: 12px; color: var(--ink-2); }

select, input[type="number"] {
  background: var(--bg-input); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font-family: var(--mono); font-size: 12px; padding: 7px 9px; width: 100%;
}
select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.stepper { margin-bottom: 13px; }
.stepper label { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.stepper-val { font-family: var(--mono); color: var(--ink); }

/* range inputs — themed, single accent */
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px;
  background: var(--line-2); border-radius: 999px; outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg); cursor: pointer;
  box-shadow: 0 0 0 1px var(--accent), 0 0 10px rgba(25,227,194,0.5);
}
input[type="range"]::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%; background: var(--accent);
  border: 2px solid var(--bg); cursor: pointer;
}

/* ===== OUTPUT ============================================================ */
.output { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel {
  background: var(--bg-raise); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px 18px;
}
.panel h3 { font-size: 12px; color: var(--ink-2); font-weight: 500; letter-spacing: 0.02em; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

/* ===== HEADLINE (Tier 1) ================================================ */
.headline {
  display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center;
  background:
    linear-gradient(180deg, rgba(25,227,194,0.05), transparent 70%),
    var(--bg-raise);
  border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px;
}
.rt-hero { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 4px; }
.rt-value { font-family: var(--mono); font-size: 72px; font-weight: 600; line-height: 0.9; letter-spacing: -0.03em; color: var(--ink); }
.rt-unit { font-family: var(--mono); font-size: 26px; color: var(--accent); }
.rt-label { grid-column: 1 / -1; font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); margin-top: 8px; }

.verdict { border-left: 1px solid var(--line); padding-left: 24px; }
.verdict-tag {
  display: inline-block; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--ink);
}
.verdict-tag[data-band="dry"]      { color: var(--accent); border-color: var(--accent); }
.verdict-tag[data-band="balanced"] { color: var(--accent); border-color: var(--accent); }
.verdict-tag[data-band="live"]     { color: var(--warn);   border-color: var(--warn); }
.verdict-tag[data-band="wet"]      { color: var(--bad);    border-color: var(--bad); }
.verdict-line { font-size: 15px; color: var(--ink); margin-top: 11px; }
.verdict-tone { font-size: 13px; color: var(--ink-2); margin-top: 3px; }

/* ===== ROOM 3D (see the sound) ========================================= */
.room3d {
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(25,227,194,0.05), transparent 60%),
    var(--bg-raise);
}
.room3d canvas {
  width: 100%; height: 320px; display: block; margin-top: 6px;
  cursor: grab; touch-action: none;
}
.room3d canvas:active { cursor: grabbing; }
.r3d-hint { font-family: var(--mono); font-size: 10px; color: var(--ink-3); letter-spacing: 0.04em; }

/* ===== AURALIZE (the gift) ============================================== */
.auralize { background: linear-gradient(180deg, rgba(25,227,194,0.04), transparent), var(--bg-raise); }
.mix { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.1em; }
.mix input[type="range"] { width: 130px; }
.sources { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.src {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--bg-input); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 8px; font-size: 12px; color: var(--ink-2);
  transition: border-color .15s, color .15s, transform .08s;
}
.src:hover { border-color: var(--line-2); color: var(--ink); }
.src:active { transform: scale(0.97); }
.src.active { border-color: var(--accent); color: var(--accent); background: var(--accent-2); }
.src-ico { width: 22px; height: 22px; position: relative; opacity: 0.9; }
.src-ico::before {
  content: ""; position: absolute; inset: 0;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  background: currentColor;
}
.src-ico[data-i="clap"]::before  { -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 22%, transparent 24%); mask-image: radial-gradient(circle at 50% 50%, #000 22%, transparent 24%); }
.aural-hint { font-size: 11.5px; color: var(--ink-3); margin-top: 12px; font-family: var(--mono); }

/* play arrow + tiny waveform per source icon, drawn with conic/linear masks */
.src-ico { background:
  linear-gradient(currentColor, currentColor) center/3px 60% no-repeat; opacity: 0.55; }
.src.active .src-ico { opacity: 1; }

/* ===== CHARTS (Tier 2) ================================================== */
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart canvas { width: 100%; height: 150px; display: block; margin-top: 6px; }

/* ===== METRICS ========================================================== */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.metric {
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 14px; display: flex; flex-direction: column; gap: 4px;
}
.m-val { font-family: var(--mono); font-size: 19px; color: var(--ink); letter-spacing: -0.01em; }
.m-key { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }

/* ===== MODES (Tier 3) =================================================== */
.modes canvas { width: 100%; height: 90px; display: block; }
.legend { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.legend .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-left: 6px; }
.legend .ok { background: var(--accent); } .legend .warn { background: var(--warn); } .legend .bad { background: var(--bad); }
.modes-note { font-family: var(--mono); font-size: 11px; color: var(--ink-2); margin-top: 10px; }

/* ===== FOOT ============================================================= */
.foot {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
}

/* ===== RESPONSIVE ======================================================= */
@media (max-width: 940px) {
  .layout { grid-template-columns: 1fr; }
  .inputs { position: static; }
  .headline { grid-template-columns: 1fr; gap: 16px; }
  .verdict { border-left: none; border-top: 1px solid var(--line); padding-left: 0; padding-top: 16px; }
  .charts { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .model-note { text-align: left; }
}
