/* NeddMaster — quiet, typographic, one accent. */
:root {
  --bg: #0a0a0b;
  --raise: #121214;
  --line: #1e1e21;
  --line-hi: #2c2c31;
  --text: #f0f0f2;
  --muted: #8a8a93;
  --dim: #5a5a63;
  --accent: #d8ff3e;
  --good: #6ee7a8;
  --warn: #ffc46b;
  --bad: #ff7a7a;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.hidden { display: none !important; }

h1, h2, h3 { font-weight: 500; letter-spacing: -0.022em; margin: 0; }

.eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 10px;
}

/* =============================================================== BUTTONS */
.btn {
  appearance: none;
  font: inherit;
  font-size: 14px;
  border-radius: 999px;
  padding: 11px 22px;
  border: 1px solid var(--line-hi);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s, opacity .18s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--text); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #14170a;
  font-weight: 550;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.07); border-color: var(--accent); }
.btn-ghost { color: var(--muted); border-color: transparent; padding: 8px 14px; }
.btn-ghost:hover { color: var(--text); border-color: var(--line-hi); }
.btn-lg { padding: 15px 34px; font-size: 15px; width: 100%; max-width: 340px; }

/* ================================================================== HOME */
.page-home { display: grid; place-items: center; min-height: 100vh; padding: 56px 24px; }
.home { width: 100%; }
.home-inner { max-width: 700px; margin: 0 auto; text-align: center; }

.mark {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 44px;
}
.mark svg { width: 26px; height: 26px; color: var(--text); }

.home h1 {
  font-size: clamp(28px, 5.4vw, 44px); line-height: 1.14; margin-bottom: 20px;
  text-wrap: balance;
}

.lede {
  color: var(--muted); font-size: 16px; max-width: 44ch;
  margin: 0 auto 48px; text-wrap: balance;
}

/* Two equal cards, centred. */
.tabs {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 14px; text-align: left;
}

.tab {
  display: flex; flex-direction: column;
  padding: 28px 26px 22px;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--raise);
  text-decoration: none; color: inherit;
  transition: border-color .2s, background .2s, transform .2s;
}
a.tab:hover { border-color: var(--line-hi); transform: translateY(-2px); }

.tab-icon { color: var(--dim); margin-bottom: 20px; transition: color .2s; }
.tab-icon svg { width: 34px; height: 34px; display: block; }
a.tab:hover .tab-icon { color: var(--accent); }

.tab strong {
  font-size: 21px; font-weight: 500; letter-spacing: -.022em;
  margin-bottom: 7px;
}
.tab em {
  font-style: normal; color: var(--muted);
  font-size: 13.5px; line-height: 1.55; margin-bottom: 22px;
}
.tab-foot {
  margin-top: auto; font-family: var(--mono);
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--dim);
}
.tab-foot-go { color: var(--text); }
.tab-foot-go span { display: inline-block; transition: transform .2s; }
a.tab:hover .tab-foot-go { color: var(--accent); }
a.tab:hover .tab-foot-go span { transform: translateX(4px); }

/* The unbuilt one stays visibly secondary without being hidden. */
.tab:has(.tab-foot:not(.tab-foot-go)) { background: transparent; }
.tab:has(.tab-foot:not(.tab-foot-go)) strong,
.tab:has(.tab-foot:not(.tab-foot-go)) em { opacity: .62; }

.foot-note { color: var(--dim); font-size: 12.5px; margin-top: 44px; }

@media (max-width: 620px) {
  .tabs { grid-template-columns: 1fr; }
  .tab { padding: 24px 22px 20px; }
  .tab em { margin-bottom: 16px; }
  .mark { margin-bottom: 34px; }
  .lede { margin-bottom: 34px; }
}

/* ============================================================== APP SHELL */
.bar {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 26px; border-bottom: 1px solid var(--line);
}
.bar-back {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--text);
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase;
}
.bar-back:hover { color: var(--accent); }
.bar-mark { width: 20px; height: 20px; }
.bar-page {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--dim);
  border-left: 1px solid var(--line-hi); padding-left: 16px;
}
.bar-note { margin-left: auto; font-size: 11.5px; color: var(--dim); }

.app { padding: 0 26px 80px; }
.stage { max-width: 660px; margin: 0 auto; padding-top: 56px; }

/* ============================================================== DROPZONE */
.dropzone {
  border: 1px dashed var(--line-hi); border-radius: 18px;
  padding: 72px 30px; text-align: center;
  transition: border-color .2s, background .2s;
}
.dropzone.over { border-color: var(--accent); background: rgba(216, 255, 62, .04); }
.dropzone h1 { font-size: 25px; margin-bottom: 8px; }
.dropzone p { color: var(--muted); font-size: 13.5px; margin: 0 0 28px; }

.drop-mark { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 34px; margin-bottom: 26px; }
.drop-mark span {
  width: 3px; border-radius: 2px; background: var(--line-hi);
  animation: bob 1.7s ease-in-out infinite;
}
.drop-mark span:nth-child(1) { height: 30%; animation-delay: 0s; }
.drop-mark span:nth-child(2) { height: 70%; animation-delay: .16s; }
.drop-mark span:nth-child(3) { height: 100%; animation-delay: .32s; }
.drop-mark span:nth-child(4) { height: 55%; animation-delay: .48s; }
.drop-mark span:nth-child(5) { height: 82%; animation-delay: .64s; }
@keyframes bob { 0%, 100% { transform: scaleY(.55); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .drop-mark span { animation: none; } }

/* =============================================================== WORKING */
.working { padding: 90px 0; text-align: center; }
.working-bar { height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; margin-bottom: 26px; }
.working-bar > div { height: 100%; width: 0%; background: var(--accent); transition: width .3s ease; }
.working p { color: var(--text); font-size: 15px; margin: 0 0 6px; }
.working-file { font-family: var(--mono); font-size: 11.5px; color: var(--dim); }

/* ================================================================ RESULT */
.result-head { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.result-head > div { flex: 1; min-width: 0; }
.result-head h1 {
  font-size: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.character {
  font-family: var(--mono); font-size: 12px; color: var(--accent);
  margin: 8px 0 0; letter-spacing: .02em;
}
.summary { color: var(--muted); font-size: 15px; margin: 0 0 32px; max-width: 54ch; }

.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 34px; }
.card { background: var(--bg); padding: 16px 14px; }
.card-label { font-size: 10.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; }
.card-value { font-family: var(--mono); font-size: 19px; margin: 7px 0 3px; letter-spacing: -.02em; }
.card-note { font-size: 11.5px; color: var(--muted); }
.card.good .card-value { color: var(--good); }
.card.warn .card-value { color: var(--warn); }
.card.bad .card-value { color: var(--bad); }
@media (max-width: 620px) { .cards { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================== A/B PLAYER */
.ab { display: flex; align-items: center; gap: 18px; margin-bottom: 36px; }
.btn-play {
  width: 52px; height: 52px; border-radius: 50%; padding: 0;
  display: grid; place-items: center; font-size: 15px; flex: 0 0 auto;
  border-color: var(--line-hi);
}
.btn-play:hover { border-color: var(--accent); color: var(--accent); }
.ab-body { flex: 1; min-width: 0; }
.ab-wave { height: 54px; }
#waveform { width: 100%; height: 54px; display: block; cursor: pointer; }
.ab-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-family: var(--mono); font-size: 11px; color: var(--dim); margin-top: 8px;
}
.ab-toggle { display: inline-flex; border: 1px solid var(--line-hi); border-radius: 999px; overflow: hidden; }
.seg {
  appearance: none; font: inherit; font-size: 11px; font-family: var(--mono);
  background: transparent; border: 0; color: var(--muted);
  padding: 5px 14px; cursor: pointer; letter-spacing: .06em;
}
.seg.active { background: var(--text); color: var(--bg); }

/* =============================================================== ACTIONS */
.actions { text-align: center; margin-bottom: 14px; }
.mode-row { display: inline-flex; border: 1px solid var(--line-hi); border-radius: 999px; overflow: hidden; margin-bottom: 20px; }
.mode {
  appearance: none; font: inherit; font-size: 13px;
  background: transparent; border: 0; color: var(--muted);
  padding: 9px 20px; cursor: pointer;
}
.mode.active { background: var(--text); color: var(--bg); }
.mode-hint { color: var(--dim); font-size: 12.5px; margin: 14px auto 0; max-width: 46ch; }

.export-note {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; font-family: var(--mono); font-size: 12px;
  color: var(--muted); line-height: 1.8; margin-bottom: 26px;
}
.export-note b { color: var(--accent); font-weight: 500; }

/* ============================================================== DISCLOSE */
.disclose { border-top: 1px solid var(--line); }
.disclose summary {
  cursor: pointer; padding: 18px 0; font-size: 14px; color: var(--muted);
  list-style: none; display: flex; align-items: center; gap: 9px;
}
.disclose summary::-webkit-details-marker { display: none; }
.disclose summary::before { content: '+'; font-family: var(--mono); color: var(--dim); }
.disclose[open] summary::before { content: '−'; }
.disclose summary:hover { color: var(--text); }

/* ========================================================== FINDINGS */
.section-title {
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--dim); font-family: var(--mono); font-weight: 400;
  margin: 34px 0 4px; display: flex; align-items: center; gap: 9px;
}
.count {
  background: var(--raise); border: 1px solid var(--line-hi);
  border-radius: 999px; padding: 1px 8px; font-size: 11px; color: var(--text);
}
.findings { border-top: 1px solid var(--line); margin-bottom: 34px; }
.finding {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 15px 0; border-bottom: 1px solid var(--line);
}
.sev {
  width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; margin-top: 7px;
}
.sev.good { background: var(--good); }
.sev.warn { background: var(--warn); }
.sev.bad { background: var(--bad); }
.finding-body { flex: 1; min-width: 0; }
.finding-body strong { display: block; font-size: 14px; font-weight: 500; margin-bottom: 3px; }
.finding-body .hz { font-family: var(--mono); font-size: 11.5px; color: var(--dim); font-weight: 400; }
.finding-body span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.finding-kind {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--dim); flex: 0 0 auto; margin-top: 4px;
}
.no-findings { color: var(--muted); font-size: 14px; padding: 18px 0; margin: 0; }
.curve-title em { font-style: normal; text-transform: none; letter-spacing: 0; }

.decisions { padding-bottom: 22px; }
.decision { padding: 14px 0; border-top: 1px solid var(--line); }
.decision:first-child { border-top: 0; }
.decision strong { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.decision span { color: var(--muted); font-size: 13px; }

.advanced { padding-bottom: 26px; }
/* Exactly six metrics — a fixed track count avoids the orphan cell that
   auto-fit leaves when the row does not divide evenly. */
.measure {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; margin-bottom: 26px;
}
@media (max-width: 760px) { .measure { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 420px) { .measure { grid-template-columns: repeat(2, 1fr); } }
.measure > div { background: var(--bg); padding: 11px 12px; }
.measure dt { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .09em; }
.measure dd { font-family: var(--mono); font-size: 14px; margin: 4px 0 0; }

.curve { margin-bottom: 26px; }
.curve-title { display: block; font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .09em; margin-bottom: 10px; }
#tilt-canvas { width: 100%; height: 130px; display: block; }

.sliders { display: grid; gap: 16px; margin-bottom: 22px; }
.slider label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.slider label b { font-family: var(--mono); color: var(--text); font-weight: 400; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%;
  height: 1px; background: var(--line-hi); cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: var(--text); cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%; border: 0;
  background: var(--text); cursor: pointer;
}

.opt { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--muted); cursor: pointer; margin-bottom: 18px; }
.opt input { accent-color: var(--accent); margin-top: 3px; }

.fmt { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
select {
  font: inherit; font-size: 13px; background: var(--raise); color: var(--text);
  border: 1px solid var(--line-hi); border-radius: 8px; padding: 8px 11px;
}

/* ================================================================== SOON */
.soon { text-align: center; padding-top: 110px; }
.soon h1 { font-size: 27px; margin-bottom: 16px; }
.soon p { color: var(--muted); max-width: 44ch; margin: 0 auto 30px; }

/* ================================================================= TOAST */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 18px);
  background: var(--text); color: var(--bg);
  padding: 11px 20px; border-radius: 999px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .24s; z-index: 60;
  max-width: 88vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  .app { padding: 0 18px 60px; }
  .stage { padding-top: 36px; }
  .dropzone { padding: 54px 20px; }
  .bar { padding: 15px 18px; gap: 12px; }
  .bar-note { display: none; }
  .ab { gap: 13px; }
}
