/* =============================================================================
 * Calliope · styles — DESKTOP-FIRST. É um editor de áudio: o estúdio usa a
 * largura da tela (painel de upload à esquerda · estúdio/preview ao centro ·
 * tratar/baixar à direita). Alvo ~1280–1440px. Fallback responsivo decente pra
 * telas menores (sem quebrar feio). Tokens da casa
 * (tools/docgen/brands/cachola.brand.yaml).
 * ========================================================================== */

/* ---- fontes self-host (woff2, sem CDN) — CSP font-src 'self' --------------- */
@font-face { font-family:"Inter"; font-style:normal; font-weight:400 700; font-display:swap; src:url("/fonts/inter-latin.woff2") format("woff2"); }
@font-face { font-family:"Inter"; font-style:normal; font-weight:400 700; font-display:swap; src:url("/fonts/inter-latin-ext.woff2") format("woff2"); }
@font-face { font-family:"EB Garamond"; font-style:normal; font-weight:400 600; font-display:swap; src:url("/fonts/eb-garamond-latin.woff2") format("woff2"); }
@font-face { font-family:"EB Garamond"; font-style:normal; font-weight:400 600; font-display:swap; src:url("/fonts/eb-garamond-latin-ext.woff2") format("woff2"); }
@font-face { font-family:"EB Garamond"; font-style:italic; font-weight:400; font-display:swap; src:url("/fonts/eb-garamond-italic-latin.woff2") format("woff2"); }
@font-face { font-family:"JetBrains Mono"; font-style:normal; font-weight:400 600; font-display:swap; src:url("/fonts/jetbrains-mono-latin.woff2") format("woff2"); }
@font-face { font-family:"JetBrains Mono"; font-style:normal; font-weight:400 600; font-display:swap; src:url("/fonts/jetbrains-mono-latin-ext.woff2") format("woff2"); }

:root {
  --ink:#121418; --paper:#ffffff; --cream:#faf6ed; --accent:#1f2b3d;
  --muted:#5a6472; --subtle:#e6e2d8; --hair:#dcd8cc;
  --success:#2f5233; --warning:#8a6b3b; --danger:#7a2e2e;
  --sea:#2a5f6e;          /* azul-mar calmo do produto */
  --sea-soft:#e8f0f1;
  --sand:#f4ede0;
  --serif:"EB Garamond", Georgia, serif;
  --sans:"Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  --mono:"JetBrains Mono", ui-monospace, monospace;
  --radius:16px;
  --shadow:0 1px 2px rgba(18,20,24,.04), 0 8px 28px rgba(18,20,24,.06);
  --shadow-lg:0 2px 6px rgba(18,20,24,.05), 0 20px 60px rgba(18,20,24,.10);
  --maxw:1320px;          /* desktop-first: o estúdio respira na largura */
  --maxw-prose:760px;     /* texto honesto/roadmap continua legível, não esticado */
}

* { box-sizing:border-box; }
html, body {
  margin:0; padding:0; width:100%;
  overflow-x:hidden;                 /* máscara de borda; o gate ainda exige scrollWidth ok */
  background:var(--cream); color:var(--ink);
  font-family:var(--sans); font-size:16px; line-height:1.6;
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
body { padding-bottom:env(safe-area-inset-bottom); }
img, svg, audio, canvas { max-width:100%; display:block; }
a { color:var(--sea); text-decoration:none; }
a:hover { text-decoration:underline; }
h1, h2, h3 { font-family:var(--serif); font-weight:600; line-height:1.18; letter-spacing:-.01em; margin:0; }
p { margin:0; }

/* ---- house top bar -------------------------------------------------------- */
.ct-topbar {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:12px 28px; padding-top:calc(12px + env(safe-area-inset-top));
  background:var(--accent); color:var(--cream); font-size:13px;
}
.ct-topbar .brand { display:flex; align-items:center; gap:9px; font-weight:600; letter-spacing:.01em; min-width:0; }
.ct-topbar .brand .glyph { width:16px; height:16px; flex:0 0 auto; }
.ct-topbar .brand .sub { font-weight:400; opacity:.66; font-size:12px; white-space:nowrap; }
.ct-topbar .beta {
  font-family:var(--mono); font-size:10px; text-transform:uppercase; letter-spacing:.12em;
  padding:2px 7px; border-radius:999px; background:rgba(250,246,237,.14); color:var(--cream);
}
.ct-topbar .right { display:flex; align-items:center; gap:12px; flex:0 0 auto; }

/* ---- language switch ------------------------------------------------------ */
.lang { display:flex; gap:2px; background:rgba(250,246,237,.1); border-radius:999px; padding:2px; }
.lang button {
  font:inherit; font-size:11px; font-weight:600; letter-spacing:.02em;
  border:0; background:transparent; color:var(--cream); opacity:.6;
  padding:4px 9px; border-radius:999px; cursor:pointer; min-height:28px;
}
.lang button[aria-current="true"] { background:var(--cream); color:var(--accent); opacity:1; }

/* ---- layout shell --------------------------------------------------------- */
main { width:100%; }
.wrap { width:100%; max-width:var(--maxw); margin:0 auto; padding:0 28px; }
.wrap.prose { max-width:var(--maxw-prose); }

/* ---- hero ----------------------------------------------------------------- */
.hero { padding:48px 0 18px; text-align:center; }
.kicker {
  display:inline-flex; align-items:center; gap:7px;
  font-family:var(--mono); font-size:11px; letter-spacing:.08em; text-transform:uppercase;
  color:var(--sea); background:var(--sea-soft); border:1px solid #d6e4e6;
  padding:6px 12px; border-radius:999px; margin-bottom:18px;
}
.kicker .dot { width:7px; height:7px; border-radius:50%; background:var(--success); flex:0 0 auto; }
.hero h1 { font-size:clamp(30px, 4.4vw, 46px); margin:0 auto; max-width:18ch; }
.hero .sub { color:var(--muted); font-size:17px; margin:16px auto 0; max-width:62ch; }
.privacy-pill {
  display:inline-flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:center;
  margin-top:22px; font-size:13px; font-weight:600; color:var(--sea);
  background:#fff; border:1px solid #d6e4e6; border-radius:999px; padding:9px 16px;
  box-shadow:var(--shadow); max-width:100%;
}
.privacy-pill svg { width:15px; height:15px; flex:0 0 auto; }

/* =============================================================================
 * ESTÚDIO — o "console" largo do editor. Três painéis lado a lado no desktop:
 *   [ 1 · Suba o áudio ]  [ 2 · Trate + ouça antes/depois ]  [ 3 · Baixe ]
 * Em telas menores, os painéis empilham (fallback responsivo).
 * ========================================================================== */
.studio-shell {
  background:var(--paper); border:1px solid var(--subtle); border-radius:22px;
  box-shadow:var(--shadow-lg); margin:22px 0 8px; overflow:hidden;
}
.studio-bar {
  display:flex; align-items:center; gap:12px;
  padding:16px 26px; border-bottom:1px solid var(--subtle); background:var(--cream);
}
.studio-bar .dot3 { display:flex; gap:6px; }
.studio-bar .dot3 i { width:10px; height:10px; border-radius:50%; background:var(--hair); display:block; }
.studio-bar .dot3 i:nth-child(1){ background:#d98b7a; } .studio-bar .dot3 i:nth-child(2){ background:#d9c07a; } .studio-bar .dot3 i:nth-child(3){ background:#8fb88f; }
.studio-bar .stitle { font-family:var(--serif); font-size:18px; font-weight:600; }
.studio-bar .ssub { font-family:var(--mono); font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); margin-left:auto; }

.studio-grid {
  display:grid;
  grid-template-columns:minmax(340px, 1.05fr) minmax(420px, 1.4fr) minmax(300px, .95fr);
  align-items:stretch;
}
.panel { padding:26px 26px 28px; min-width:0; border-right:1px solid var(--subtle); }
.panel:last-child { border-right:0; }
.panel.center { background:linear-gradient(180deg,#fff, #fcfaf5); }
.panel.right { background:var(--cream); }

.panel-head {
  display:flex; align-items:baseline; gap:10px; margin-bottom:6px;
}
.panel-head .num {
  font-family:var(--mono); font-size:12px; font-weight:600; color:#fff; background:var(--sea);
  width:24px; height:24px; border-radius:7px; display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto;
}
.panel-head h2 { font-size:19px; }
.panel .hint { color:var(--muted); font-size:13px; margin:4px 0 0; }
.panel-divider { height:1px; background:var(--subtle); margin:18px 0; }
.panel-sublabel {
  font-family:var(--mono); font-size:11px; letter-spacing:.1em; text-transform:uppercase;
  color:var(--sea); margin:0 0 12px; display:block;
}

/* ---- dropzone (grande, "arraste seu áudio aqui") -------------------------- */
.dropzone {
  margin-top:16px; border:2px dashed #cfd8da; border-radius:16px; background:var(--sea-soft);
  padding:44px 22px; text-align:center; cursor:pointer; transition:border-color .18s, background .18s;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  min-height:240px;
}
.dropzone:hover, .dropzone.drag { border-color:var(--sea); background:#dceaec; }
.dropzone.drag { border-style:solid; box-shadow:inset 0 0 0 3px rgba(42,95,110,.12); }
.dropzone .icon { width:48px; height:48px; margin:0 auto 16px; color:var(--sea); }
.dropzone .big { font-weight:700; font-size:18px; }
.dropzone .small { color:var(--muted); font-size:14px; margin-top:6px; }
.dropzone .btn-pick {
  display:inline-block; margin-top:18px; font:inherit; font-weight:600; font-size:14px;
  background:var(--accent); color:var(--cream); border:0; border-radius:10px;
  padding:12px 22px; cursor:pointer; min-height:44px;
}
.dropzone .formats { font-family:var(--mono); font-size:11px; color:var(--muted); margin-top:16px; letter-spacing:.04em; }
input[type="file"] { position:absolute; width:1px; height:1px; opacity:0; overflow:hidden; }

.loaded-row {
  display:flex; align-items:center; gap:12px; margin-top:16px;
  background:var(--sand); border:1px solid var(--hair); border-radius:12px; padding:14px 16px;
}
.loaded-row .wave { width:28px; height:28px; flex:0 0 auto; color:var(--sea); }
.loaded-row .meta { min-width:0; flex:1; }
.loaded-row .fname { display:block; font-weight:600; font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.loaded-row .fmeta { display:block; font-family:var(--mono); font-size:11px; color:var(--muted); margin-top:2px; }

/* ---- presets (botões claros: Praia default / Estúdio) --------------------- */
.presets { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:4px; }
.preset {
  text-align:left; width:100%; cursor:pointer;
  background:#fff; border:1.5px solid var(--subtle); border-radius:14px; padding:16px;
  transition:border-color .16s, background .16s, box-shadow .16s; min-height:44px;
}
.preset:hover { border-color:#cdd6c0; box-shadow:var(--shadow); }
.preset[aria-pressed="true"] { border-color:var(--sea); background:var(--sea-soft); box-shadow:0 0 0 3px rgba(42,95,110,.12); }
.preset .ptitle { display:flex; align-items:center; gap:10px; font-weight:700; font-size:15px; }
.preset .ptitle .swatch { width:20px; height:20px; border-radius:6px; flex:0 0 auto; }
.preset .pdesc { color:var(--muted); font-size:13px; margin-top:8px; }
.preset .check { margin-left:auto; width:18px; height:18px; color:var(--sea); opacity:0; flex:0 0 auto; }
.preset[aria-pressed="true"] .check { opacity:1; }

/* swatches */
.sw-praia { background:linear-gradient(135deg,#2a5f6e,#7fbcc6); }
.sw-estudio { background:linear-gradient(135deg,#1f2b3d,#5a6472); }

/* ---- primary button + progress ------------------------------------------- */
.btn-primary {
  display:flex; align-items:center; justify-content:center; gap:9px; width:100%;
  font:inherit; font-weight:700; font-size:17px; cursor:pointer;
  background:var(--sea); color:#fff; border:0; border-radius:13px; padding:17px 18px;
  min-height:56px; margin-top:18px; transition:background .16s, opacity .16s;
}
.btn-primary:hover { background:#23535f; }
.btn-primary[disabled] { opacity:.5; cursor:not-allowed; }
.btn-primary svg { width:19px; height:19px; flex:0 0 auto; }

.progress { margin-top:18px; }
.progress .bar { height:10px; border-radius:999px; background:var(--sand); overflow:hidden; }
.progress .bar i { display:block; height:100%; width:0; background:linear-gradient(90deg,var(--sea),#7fbcc6); border-radius:999px; transition:width .25s ease; }
.progress .label { font-family:var(--mono); font-size:12px; color:var(--muted); margin-top:8px; text-align:center; }

.spinner { width:19px; height:19px; border:2.5px solid rgba(255,255,255,.4); border-top-color:#fff; border-radius:50%; animation:spin .7s linear infinite; flex:0 0 auto; }
@keyframes spin { to { transform:rotate(360deg); } }

/* placeholder do painel central enquanto não há resultado */
.center-empty {
  margin-top:18px; border:1.5px dashed var(--hair); border-radius:14px;
  padding:30px 20px; text-align:center; color:var(--muted); font-size:14px; background:#fff;
}
.center-empty svg { width:30px; height:30px; margin:0 auto 12px; color:#c3ccc0; }

/* ---- preview / players (antes ↔ depois) ----------------------------------- */
.result { margin-top:6px; }
.player-row { margin-top:14px; }
.player-row .plabel {
  display:flex; align-items:center; gap:8px; font-size:13px; font-weight:600; color:var(--ink); margin-bottom:6px;
}
.player-row .plabel .tag {
  font-family:var(--mono); font-size:10px; text-transform:uppercase; letter-spacing:.08em;
  padding:2px 7px; border-radius:999px;
}
.tag.orig { background:var(--sand); color:var(--muted); }
.tag.treat { background:var(--sea-soft); color:var(--sea); }
audio { width:100%; height:42px; margin-top:2px; }

/* ---- download (painel direito) -------------------------------------------- */
.download-card {
  display:flex; flex-direction:column; height:100%;
}
.dl-empty {
  margin-top:16px; border:1.5px dashed var(--hair); border-radius:14px;
  padding:24px 18px; text-align:center; color:var(--muted); font-size:13px; background:#fff;
}
.dl-empty svg { width:26px; height:26px; margin:0 auto 10px; color:#c3ccc0; }
.btn-download {
  display:flex; align-items:center; justify-content:center; gap:9px; width:100%;
  font:inherit; font-weight:700; font-size:16px; cursor:pointer;
  background:var(--accent); color:var(--cream); border:0; border-radius:13px; padding:16px 18px;
  min-height:54px; margin-top:18px;
}
.btn-download svg { width:18px; height:18px; flex:0 0 auto; }
.btn-ghost {
  display:block; width:100%; text-align:center; margin-top:10px;
  font:inherit; font-weight:600; font-size:14px; color:var(--muted);
  background:transparent; border:0; cursor:pointer; padding:10px; min-height:40px;
}

/* ---- error ---------------------------------------------------------------- */
.error {
  margin-top:14px; background:#fbeeee; border:1px solid #e7c9c9; color:var(--danger);
  border-radius:12px; padding:12px 15px; font-size:14px;
}
.note {
  margin-top:12px; background:var(--sand); border:1px solid var(--hair); color:var(--warning);
  border-radius:12px; padding:11px 14px; font-size:13px;
}

/* ---- disclosure blocks ---------------------------------------------------- */
.disc-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:22px; }
.disc {
  background:#fff; border:1px solid var(--subtle); border-radius:14px; padding:20px;
}
.disc h3 { font-family:var(--sans); font-size:15px; font-weight:700; display:flex; align-items:center; gap:9px; }
.disc h3 svg { width:18px; height:18px; flex:0 0 auto; color:var(--sea); }
.disc p { color:var(--muted); font-size:14px; margin-top:8px; }
.snippet {
  margin-top:12px; background:var(--cream); border:1px dashed var(--hair); border-radius:10px;
  padding:11px 13px; font-size:13px; font-style:italic; color:var(--ink); font-family:var(--serif);
}
.btn-copy {
  margin-top:10px; font:inherit; font-weight:600; font-size:13px; cursor:pointer;
  background:var(--sea-soft); color:var(--sea); border:1px solid #d6e4e6; border-radius:9px;
  padding:8px 14px; min-height:40px; display:inline-flex; align-items:center; gap:7px;
}
.btn-copy svg { width:15px; height:15px; flex:0 0 auto; }

/* ---- honest / how it works ----------------------------------------------- */
.section { padding:34px 0 6px; }
.section > h2 { font-size:26px; text-align:center; }
.section .lead { color:var(--muted); font-size:15px; margin:12px auto 0; max-width:60ch; text-align:center; }

/* ---- roadmap split -------------------------------------------------------- */
.rm-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:22px; }
.rm-col { background:#fff; border:1px solid var(--subtle); border-radius:14px; padding:20px; }
.rm-col.live { border-color:#c7ddca; }
.rm-head {
  display:inline-flex; align-items:center; gap:8px; font-family:var(--mono); font-size:11px;
  letter-spacing:.1em; text-transform:uppercase; padding:5px 11px; border-radius:999px; font-weight:600;
}
.rm-head.live { background:#e7f0e8; color:var(--success); }
.rm-head.soon { background:var(--sand); color:var(--warning); }
.rm-col ul { list-style:none; padding:0; margin:14px 0 0; }
.rm-col li { position:relative; padding:8px 0 8px 26px; font-size:14px; color:var(--ink); border-top:1px solid var(--cream); }
.rm-col li:first-child { border-top:0; }
.rm-col li::before {
  content:""; position:absolute; left:2px; top:13px; width:13px; height:13px; border-radius:50%;
}
.rm-col.live li::before { background:var(--success); }
.rm-col.soon li::before { background:transparent; border:2px solid var(--warning); top:12px; }
.rm-note { color:var(--muted); font-size:13px; margin-top:20px; text-align:center; font-style:italic; }

/* ---- footer --------------------------------------------------------------- */
.ct-footer {
  background:var(--ink); color:#d8d2c4; margin-top:40px;
  padding:24px 28px; padding-bottom:calc(24px + env(safe-area-inset-bottom));
  display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; font-size:12px;
}
.ct-footer .made { display:flex; align-items:center; gap:8px; font-weight:600; }
.ct-footer .made .glyph { width:13px; height:13px; flex:0 0 auto; }
.ct-footer .meta { font-family:var(--mono); opacity:.62; font-size:11px; }

/* =============================================================================
 * RESPONSIVO — o alvo é desktop, mas não quebra feio embaixo.
 *   ≤1080px: estúdio vira 1 coluna (painéis empilham), com sublabels de passo.
 *   ≤640px : compacta paddings, presets em 1 coluna, dropzone menor.
 * ========================================================================== */
@media (max-width:1080px) {
  :root { --maxw:760px; }
  .studio-grid { grid-template-columns:1fr; }
  .panel { border-right:0; border-bottom:1px solid var(--subtle); }
  .panel:last-child { border-bottom:0; }
  .panel.center { background:#fff; }
  .dropzone { min-height:200px; padding:36px 20px; }
}

@media (max-width:640px) {
  .wrap { padding:0 16px; }
  .ct-topbar { padding:10px 16px; padding-top:calc(10px + env(safe-area-inset-top)); }
  .ct-footer { padding:22px 16px; padding-bottom:calc(22px + env(safe-area-inset-bottom)); }
  .hero { padding:40px 0 12px; }
  .hero h1 { font-size:clamp(28px, 8vw, 38px); max-width:14ch; }
  .studio-bar { padding:14px 18px; }
  .studio-bar .ssub { display:none; }
  .panel { padding:22px 18px 24px; }
  .dropzone { min-height:auto; padding:30px 18px; }
  .dropzone .icon { width:38px; height:38px; }
  .dropzone .big { font-size:16px; }
  .presets { grid-template-columns:1fr; }
  .disc-grid { grid-template-columns:1fr; }
  .rm-grid { grid-template-columns:1fr; }
}

/* ---- reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion:reduce) {
  * { animation-duration:.001ms !important; transition-duration:.001ms !important; }
}

.hidden { display:none !important; }
