:root {
  --paper: #e7eceA;
  --surface: #f5f7f6;
  --ink: #18222b;
  --muted: #5e6b72;
  --line: #c5cfcc;
  --brass: #a8740c;
  --brass-soft: #f1e3c2;
  --sel: rgba(168, 116, 12, 0.14);
  --lane: #eef2f0;
  --lane-dark: #e1e7e4;
  --radius: 10px;
  --display: 'Archivo', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--display);
  font-variation-settings: 'wdth' 100;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 4px; }

.top, main, .foot { width: min(1080px, 100% - 40px); margin-inline: auto; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 0 18px; border-bottom: 1px solid var(--line);
}
.mark {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-weight: 750; font-size: 19px; letter-spacing: 0.01em;
  font-variation-settings: 'wdth' 80;
}
.mark svg { width: 28px; height: 28px; }
.private { font-size: 13px; color: var(--muted); text-align: right; }

.intro { padding: 56px 0 28px; max-width: 760px; }
h1 {
  margin: 0 0 18px;
  font-size: clamp(40px, 7.4vw, 82px);
  line-height: 0.95; font-weight: 800; letter-spacing: -0.01em;
  font-variation-settings: 'wdth' 64;
  text-transform: uppercase;
  text-wrap: balance;
}
.lede { margin: 0; font-size: clamp(17px, 2vw, 20px); color: var(--muted); max-width: 600px; }
h2 {
  margin: 44px 0 6px; font-size: 26px; line-height: 1.1; font-weight: 750;
  font-variation-settings: 'wdth' 70; text-transform: uppercase; letter-spacing: 0.01em;
}
.sub { margin: 0 0 18px; color: var(--muted); max-width: 640px; }

/* ---------- loader ---------- */
.loader { padding-bottom: 24px; }
.drop {
  position: relative; display: grid; place-items: center;
  min-height: 220px; padding: 32px 24px;
  background: var(--surface); border: 1.5px dashed var(--muted); border-radius: var(--radius);
  cursor: pointer; overflow: hidden; text-align: center;
  transition: border-color .2s, background .2s;
}
.drop:hover, .drop.over { border-color: var(--brass); background: #fbfcfb; }
.drop-strings { position: absolute; inset: 22px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.drop-strings i { display: block; height: 1px; background: var(--line); }
.drop-strings i:nth-child(n+4) { height: 1.5px; }
.drop:hover .drop-strings i, .drop.over .drop-strings i { animation: twang .5s ease-out; }
.drop-strings i:nth-child(2) { animation-delay: .04s !important; }
.drop-strings i:nth-child(3) { animation-delay: .08s !important; }
.drop-strings i:nth-child(4) { animation-delay: .12s !important; }
.drop-strings i:nth-child(5) { animation-delay: .16s !important; }
.drop-strings i:nth-child(6) { animation-delay: .2s !important; }
@keyframes twang { 0%,100% { transform: scaleY(1); } 30% { transform: scaleY(3); background: var(--brass); } }
.drop-text { position: relative; display: grid; gap: 6px; background: var(--surface); padding: 14px 22px; border-radius: 8px; }
.drop-text strong {
  font-size: 22px; font-weight: 750; text-transform: uppercase; font-variation-settings: 'wdth' 72;
}
.drop-text span { color: var(--muted); font-size: 15px; }

.link-btn {
  background: none; border: 0; padding: 12px 0; cursor: pointer;
  color: var(--ink); text-decoration: underline; text-decoration-color: var(--brass);
  text-underline-offset: 4px; text-decoration-thickness: 1.5px; font-weight: 550;
}
.link-btn:hover { color: var(--brass); }

/* ---------- setup ---------- */
.setup { padding-bottom: 12px; }
.file-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.file-name { margin: 0; font-weight: 700; font-size: 20px; overflow-wrap: anywhere; }
.file-meta { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.file-row .link-btn { flex: none; padding-top: 2px; }
.wave {
  display: block; width: 100%; height: 96px; margin: 14px 0 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: crosshair;
}
.range { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; }
.range label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.range input {
  width: 96px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); font-family: var(--mono); font-size: 16px; color: var(--ink);
}
.small {
  padding: 9px 16px; border: 1px solid var(--ink); border-radius: 999px; background: transparent;
  cursor: pointer; font-weight: 600; font-size: 15px;
}
.small:hover { background: var(--ink); color: var(--surface); }

.options { margin: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.options summary { padding: 14px 0; cursor: pointer; font-weight: 650; }
.opt-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 20px 28px; padding: 4px 0 20px; }
.opt-grid > label { display: grid; gap: 6px; align-content: start; font-weight: 600; font-size: 15px; }
.opt-grid select { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.opt-grid input[type=range] { accent-color: var(--brass); width: 100%; }
.check { display: block !important; }
.check input { accent-color: var(--brass); width: 17px; height: 17px; vertical-align: -3px; margin-right: 6px; }
.check span { display: block; margin-top: 4px; color: var(--muted); font-weight: 400; font-size: 14px; }
.hint { color: var(--muted); font-weight: 400; font-size: 14px; }

.primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 30px; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--surface); text-decoration: none; cursor: pointer;
  font-weight: 750; font-size: 17px; letter-spacing: 0.03em; text-transform: uppercase;
  font-variation-settings: 'wdth' 85;
  transition: background .15s, transform .15s;
}
.primary:hover { background: #26343f; }
.primary:active { transform: translateY(1px); }
.primary:disabled { opacity: .5; cursor: progress; }
.progress { margin-top: 18px; max-width: 520px; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--brass); transition: width .2s; }
.progress p { margin: 8px 0 0; color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.error { margin: 16px 0 0; padding: 12px 14px; border-left: 3px solid #a3392b; background: #f6e7e4; color: #6d2016; border-radius: 4px; }

/* ---------- results ---------- */
.results { padding-top: 36px; margin-top: 36px; border-top: 2px solid var(--ink); }
.summary { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { display: grid; align-content: start; gap: 4px; padding: 18px 20px; background: var(--surface); }
.stat.wide { grid-column: 1 / -1; }
.stat .label { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.stat .val { font-size: 30px; line-height: 1.05; font-weight: 800; font-variation-settings: 'wdth' 70; text-transform: uppercase; }
.stat.key .val { font-size: 40px; color: var(--brass); }
.stat .note { font-size: 14px; color: var(--muted); }

.player { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 26px 0 14px; }
.play {
  display: grid; place-items: center; width: 52px; height: 52px; border: 0; border-radius: 50%;
  background: var(--brass); color: #fff; cursor: pointer;
}
.play svg { width: 22px; height: 22px; }
.play:hover { background: #8f6209; }
.speed { display: inline-flex; border: 1px solid var(--ink); border-radius: 999px; overflow: hidden; }
.speed button { border: 0; background: transparent; padding: 8px 14px; cursor: pointer; font-weight: 650; font-variant-numeric: tabular-nums; }
.speed button + button { border-left: 1px solid var(--ink); }
.speed button.on { background: var(--ink); color: var(--surface); }
.check.inline { font-size: 15px; }

.roll-wrap {
  overflow-x: auto; overscroll-behavior-x: contain;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  scrollbar-color: var(--line) transparent;
}
.roll { position: relative; min-width: 100%; }
.lane { position: absolute; left: 0; right: 0; display: flex; align-items: center; background: var(--lane); border-bottom: 1px solid rgba(197,207,204,.35); }
.lane.dark { background: var(--lane-dark); }
.lane.c { border-bottom-color: var(--line); }
.lane[data-name]::before {
  content: attr(data-name); position: sticky; left: 0; z-index: 1; padding: 0 6px;
  font: 600 10px/1 var(--mono); color: var(--muted);
}
.rnote {
  position: absolute; display: flex; align-items: center; padding: 0 5px; min-width: 16px;
  border: 0; border-radius: 4px; background: var(--ink); color: var(--surface); cursor: pointer;
  font: 700 11px/1 var(--display); white-space: nowrap; overflow: hidden;
  box-shadow: 0 1px 0 rgba(0,0,0,.15);
  transition: transform .1s, background .1s;
}
.rnote.out { background: var(--brass); }
.rnote:hover, .rnote.is-on { transform: scale(1.12); background: #000; z-index: 2; }
.rnote.out.is-on, .rnote.out:hover { background: #7a5207; }
.playhead { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: var(--brass); pointer-events: none; z-index: 3; }

.phrases { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.phrases li { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ph-time { font: 500 14px/32px var(--mono); color: var(--muted); }
.ph-notes { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-width: 42px; height: 34px; padding: 0 10px; border: 1px solid var(--ink); border-radius: 999px;
  background: var(--surface); cursor: pointer;
  font-weight: 750; font-size: 16px; font-variation-settings: 'wdth' 85;
}
.chip sub { font-size: 10px; color: var(--muted); font-weight: 500; margin-left: 1px; }
.chip.out { border-color: var(--brass); background: var(--brass-soft); }
.chip:hover, .chip.is-on { background: var(--ink); color: var(--surface); }
.chip:hover sub, .chip.is-on sub { color: var(--line); }

.tab-section { margin-top: 12px; }
.tab-locked { position: relative; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.tab-preview { margin: 0; padding: 22px; filter: blur(3.5px); opacity: .7; user-select: none; font: 14px/1.5 var(--mono); overflow: hidden; white-space: pre; min-height: 220px; }
.unlock-card {
  position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
  width: min(440px, calc(100% - 32px)); padding: 22px; display: grid; gap: 10px; justify-items: start;
  background: var(--surface); border: 1px solid var(--ink); border-radius: var(--radius);
  box-shadow: 0 18px 40px -20px rgba(24,34,43,.45);
}
.unlock-card p { margin: 0 0 4px; }
.unlock-card .link-btn { padding: 4px 0; font-size: 14px; }
.tab { margin: 0; padding: 20px; background: var(--ink); color: #e9eee9; border-radius: var(--radius); font: 14px/1.5 var(--mono); overflow-x: auto; }
.downloads { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

.notes-on { margin: 56px 0 0; padding-top: 6px; border-top: 1px solid var(--line); }
.notes-on ul { margin: 0; padding-left: 20px; color: var(--muted); max-width: 720px; }
.notes-on li { margin-bottom: 8px; }
.notes-on li::marker { color: var(--brass); }
.foot { padding: 40px 0 48px; color: var(--muted); font-size: 13px; }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .top, main, .foot { width: calc(100% - 32px); }
  .private { font-size: 12px; max-width: 150px; }
  .intro { padding: 36px 0 22px; }
  .opt-grid { grid-template-columns: 1fr; }
  .summary { grid-template-columns: 1fr 1fr; }
  .stat.key { grid-column: 1 / -1; }
  .stat { padding: 14px 16px; }
  .stat .val { font-size: 24px; }
  .stat.key .val { font-size: 32px; }
  .primary { width: 100%; }
  .phrases li { grid-template-columns: 1fr; gap: 6px; }
  .ph-time { line-height: 1; }
  .unlock-card .primary { width: 100%; }
  .tab-preview { min-height: 280px; }
  .file-row { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.foot { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.foot a { color: inherit; }
.paid-note { margin: 0 0 16px; padding: 10px 14px; border-radius: 8px; background: var(--sel); color: var(--ink); font-weight: 600; max-width: 600px; }
