/* ==========================================================================
   Paddy Prompt Studio — LUFS loudness meter
   Layers on /blog/style.css (same dark indigo/cyan palette and type scale).
   Only the interactive meter lives here; prose styling is inherited.
   ========================================================================== */

:root {
  --good: #34d399;
  --near: #fcd34d;
  --off:  #fb7185;
}

/* ------------------------------------------------------------ Shell */
.lufs {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border); border-radius: 22px;
  padding: 1.25rem; margin: 0.5rem 0 1rem;
  box-shadow: 0 30px 70px -40px rgba(99, 102, 241, 0.6);
}

/* ------------------------------------------------------------ Drop zone */
.drop {
  display: grid; justify-items: center; gap: 0.55rem; text-align: center;
  padding: 1.4rem 1rem; border: 2px dashed rgba(129, 140, 248, 0.45);
  border-radius: 16px; background: rgba(99, 102, 241, 0.06);
  transition: border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
}
.drop:hover, .drop:focus-visible, .drop.over {
  border-color: #22d3ee; background: rgba(34, 211, 238, 0.08); outline: none;
}
.drop .drop-title {
  font-family: "Space Grotesk", "Inter", sans-serif; font-weight: 800;
  font-size: 1.25rem; color: #fff; margin: 0;
}
.drop .drop-sub { margin: 0; font-size: 0.88rem; color: var(--text-muted); }
.drop .drop-ico { width: 2.6rem; height: 2.6rem; color: #a5b4fc; }
.drop-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-top: 0.3rem; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; cursor: pointer;
  min-height: 44px; padding: 0.6rem 1.15rem; border-radius: 12px;
  font: inherit; font-size: 0.95rem; font-weight: 700; text-decoration: none;
}
.btn-primary { border: 0; background: linear-gradient(135deg, #818cf8, #22d3ee); color: #0b0620; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.04); color: var(--text); border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(129, 140, 248, 0.16); }
.btn-ghost[disabled] { opacity: 0.45; cursor: not-allowed; }

.file-name {
  margin: 0.8rem 0 0; font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8rem; color: #a5f3fc; text-align: center; word-break: break-all; min-height: 1.2em;
}

/* ------------------------------------------------------------ Progress */
.progress-row { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.6rem; }
.progress {
  flex: 1; height: 8px; border-radius: 99px; overflow: hidden;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border-soft);
}
.progress .bar {
  height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, #818cf8, #22d3ee);
  transition: width 120ms linear;
}
.progress-text {
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.72rem;
  color: var(--text-dim); min-width: 2.6rem; text-align: right;
}

/* ------------------------------------------------------------ Thermometer */
.thermo-wrap { margin: 1.1rem 0 0.2rem; }
.thermo-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem;
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.66rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); font-weight: 700;
}
.thermo-head .thermo-value { font-size: 0.85rem; letter-spacing: 0.02em; text-transform: none; color: #fff; }
.thermo {
  position: relative; height: 26px; margin: 0.45rem 0 1.6rem 14px;
  border-radius: 99px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border);
}
.thermo::before { /* the bulb */
  content: ""; position: absolute; left: -14px; top: 50%; width: 34px; height: 34px;
  transform: translateY(-50%); border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #a5f3fc, #22d3ee 45%, #0e7490);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.45);
}
.thermo-fill {
  position: absolute; left: 0; right: 0; top: 3px; bottom: 3px; border-radius: 99px;
  background: linear-gradient(90deg, #22d3ee 0%, #34d399 45%, #fcd34d 72%, #fb7185 100%);
  clip-path: inset(0 100% 0 0 round 99px);
  transition: clip-path 500ms cubic-bezier(.2, .8, .2, 1);
}
.lufs[data-state="busy"] .thermo-fill { transition: clip-path 140ms linear; }
.thermo .tick {
  position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px;
  background: rgba(255, 255, 255, 0.45); border-radius: 2px;
}
.thermo .tick span {
  position: absolute; top: calc(100% + 3px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.6rem; color: var(--text-dim);
}
.thermo .tick.hi { background: #fcd34d; }
.thermo .tick.hi span { color: #fcd34d; }

.lufs-status { margin: 0.7rem 0 0; font-size: 0.88rem; color: var(--text-muted); min-height: 1.3em; }
.lufs-status.err { color: #fca5a5; font-weight: 600; }

/* ------------------------------------------------------------ Results */
.result { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-soft); }
.verdict-box {
  border: 1px solid var(--border); border-radius: 16px; padding: 0.9rem 1rem;
  background: rgba(99, 102, 241, 0.08); margin-bottom: 0.9rem;
}
.verdict-box .v-label {
  margin: 0; font-family: "Space Grotesk", "Inter", sans-serif; font-weight: 800;
  font-size: 1.35rem; color: #fff;
}
.verdict-box .v-line { margin: 0.25rem 0 0; color: var(--text-muted); font-size: 0.93rem; }
.result.bullseye .verdict-box { animation: glow 1.6s ease-out 1; border-color: rgba(52, 211, 153, 0.7); }
@keyframes glow {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.0); }
  30% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.35), 0 0 40px rgba(52, 211, 153, 0.35); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.0); }
}

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.55rem; }
.stat {
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border);
  border-radius: 14px; padding: 0.65rem 0.75rem;
}
.stat .lbl {
  display: block; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.6rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); font-weight: 700;
}
.stat .val {
  display: block; font-family: "Space Grotesk", "Inter", sans-serif; font-weight: 800;
  font-size: 1.6rem; line-height: 1.15; color: #fff; margin-top: 0.15rem;
}
.stat .val small { font-size: 0.55em; color: var(--text-dim); font-weight: 700; margin-left: 0.2em; }
.stat.main { grid-column: span 3; background: rgba(34, 211, 238, 0.07); border-color: rgba(34, 211, 238, 0.35); }
.stat.main .val { font-size: clamp(2.4rem, 10vw, 3.2rem); }
.stat.hot { border-color: rgba(251, 113, 133, 0.6); background: rgba(251, 113, 133, 0.08); }
.stat.hot .val { color: var(--off); }
.res-meta { margin: 0.55rem 0 0; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.75rem; color: var(--text-dim); }

.mono-row {
  display: flex; align-items: center; gap: 0.5rem; margin: 0.7rem 0 0;
  font-size: 0.88rem; color: var(--text-muted); min-height: 44px;
}
.mono-row input { width: 1.2rem; height: 1.2rem; accent-color: #818cf8; }

/* Graph */
.graph-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 1.1rem 0 0.5rem; }
.graph-head h3 { margin: 0; font-size: 1rem; }
.control {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border);
  border-radius: 12px; padding: 0.35rem 0.55rem;
}
.control > .lbl {
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.62rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim); font-weight: 700;
}
.control select {
  font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--text);
  background: #07080d; border: 1px solid var(--border); border-radius: 9px;
  padding: 0.4rem 0.5rem; max-width: 15rem; min-height: 36px;
}
.graph {
  display: block; width: 100%; height: 220px; border-radius: 14px;
  background: #07080d; border: 1px solid var(--border-soft);
}
.legend { display: flex; flex-wrap: wrap; gap: 0.9rem; margin: 0.45rem 0 0; font-size: 0.78rem; color: var(--text-dim); }
.legend i { display: inline-block; width: 1.1rem; height: 3px; vertical-align: middle; margin-right: 0.35rem; border-radius: 2px; }
.legend .l-st { background: #22d3ee; }
.legend .l-m { background: rgba(129, 140, 248, 0.6); }
.legend .l-t { background: repeating-linear-gradient(90deg, #fcd34d 0 5px, transparent 5px 9px); }
.legend .l-i { background: repeating-linear-gradient(90deg, #e8ecf4 0 2px, transparent 2px 5px); }

/* Platform table */
.result h3 { font-size: 1rem; margin: 1.2rem 0 0.5rem; }
.platforms th[scope="row"] { font-weight: 700; color: #fff; white-space: nowrap; }
.platforms tr.sub th[scope="row"] { font-weight: 600; color: var(--text-muted); padding-left: 1.6rem; }
.platforms tr.is-target { background: rgba(252, 211, 77, 0.06); }
.platforms td.adj { font-weight: 600; }
.platforms td.adj.down { color: #fcd34d; }
.platforms td.adj.up { color: #a5f3fc; }
.platforms td.adj.ok { color: var(--good); }
.platforms .pnote { display: block; font-weight: 400; font-size: 0.78rem; color: var(--text-dim); margin-top: 0.15rem; }

.peak-advice { list-style: none; padding: 0; margin: 0.6rem 0 0; display: grid; gap: 0.45rem; }
.peak-advice li {
  padding: 0.6rem 0.8rem; border-radius: 12px; font-size: 0.9rem;
  border: 1px solid var(--border); background: rgba(255, 255, 255, 0.03); color: var(--text-muted);
}
.peak-advice li strong { color: var(--text); }
.peak-advice li.good { border-color: rgba(52, 211, 153, 0.4); }
.peak-advice li.good strong { color: var(--good); }
.peak-advice li.warn { border-color: rgba(252, 211, 77, 0.45); }
.peak-advice li.warn strong { color: var(--near); }
.peak-advice li.bad { border-color: rgba(251, 113, 133, 0.55); background: rgba(251, 113, 133, 0.07); }
.peak-advice li.bad strong { color: var(--off); }

.result-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }

/* A/B */
.ab-panel { margin-top: 1rem; border: 1px solid rgba(129, 140, 248, 0.4); border-radius: 16px; padding: 0.8rem 0.9rem; background: rgba(99, 102, 241, 0.06); }
.ab-panel h3 { margin: 0 0 0.4rem; }
.ab-panel .ab-a { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.78rem; color: #a5f3fc; word-break: break-all; }
.ab-note { margin: 0.5rem 0; font-size: 0.88rem; color: var(--text-muted); }

.tuner-hint {
  margin: 0.9rem 0 0; text-align: center; font-size: 0.85rem; color: var(--text-dim);
}
.tuner-hint kbd, .article-body kbd {
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.78rem;
  background: rgba(129, 140, 248, 0.14); border: 1px solid var(--border-soft);
  border-radius: 5px; padding: 0.05em 0.35em; color: #c7d2fe;
}

/* Suno snippet box in the prose */
.snippet {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 0.8rem 0.9rem;
  background: rgba(255, 255, 255, 0.03); margin: 0 0 1.5rem;
}
.snippet code {
  flex: 1 1 16rem; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.85rem; color: #a5f3fc;
  background: none; padding: 0; white-space: normal;
}

/* ------------------------------------------------------------ Prose tables */
.table-wrap { overflow-x: auto; margin: 0 0 1.5rem; border: 1px solid var(--border); border-radius: var(--radius); }
.result .table-wrap { margin-bottom: 0; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
table.data caption { text-align: left; padding: 0.85rem 1rem 0.2rem; color: var(--text-dim); font-size: 0.82rem; }
table.data th, table.data td { padding: 0.6rem 1rem; text-align: left; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
table.data thead th {
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.68rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--indigo); font-weight: 700;
  background: rgba(255, 255, 255, 0.03);
}
table.data tbody tr:last-child td, table.data tbody tr:last-child th { border-bottom: 0; }
table.data td.mono, table.data th.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.85rem; color: #a5f3fc; white-space: nowrap; }
table.data tbody tr:hover { background: rgba(129, 140, 248, 0.05); }

/* ------------------------------------------------------------ Motion */
@media (prefers-reduced-motion: reduce) {
  .thermo-fill, .progress .bar { transition: none; }
  .result.bullseye .verdict-box { animation: none; }
}
.reduce-motion .thermo-fill, .reduce-motion .progress .bar { transition: none; }

/* ------------------------------------------------------------ Responsive */
@media (max-width: 640px) {
  .lufs { padding: 0.9rem; border-radius: 18px; }
  .drop-actions { width: 100%; }
  .drop-actions .btn-primary, .drop-actions .btn-ghost { width: 100%; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat.main { grid-column: span 2; }
  .stat .val { font-size: 1.35rem; }
  .graph { height: 180px; }
  table.data th, table.data td { padding: 0.55rem 0.7rem; }
  .platforms th[scope="row"] { white-space: normal; }
  .thermo .tick.lo span { display: none; }
}
