/* Stemidi — black & white, Bricolage Grotesque */

:root {
  --bg: #0A0A0A;
  --fg: #FAFAFA;
  --soft: #BDBDBD;
  --muted: #9A9A9A;
  --dim: #7A7A7A;
  --line: #262626;
  --line-2: #1A1A1A;
  --raise: #141414;
  --font: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 20px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--fg); text-underline-offset: 3px; }
a:hover { color: var(--soft); }
img, svg, canvas { display: block; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--fg); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.narrow { max-width: 880px; }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.stack-sm, .stack-md, .stack-lg, .stack-xl { display: flex; flex-direction: column; }
.stack-sm { gap: 12px; } .stack-md { gap: 20px; } .stack-lg { gap: 28px; } .stack-xl { gap: 56px; }
.row-between { display: flex; flex-wrap: wrap; gap: 16px 24px; justify-content: space-between; align-items: flex-end; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn-row form { margin: 0; }

/* ---------------------------------------------------------------- type */
.display { margin: 0; font-size: clamp(56px, 8vw, 116px); line-height: .9; font-weight: 700; letter-spacing: -.05em; }
.display-sm { margin: 0; font-size: clamp(44px, 7vw, 96px); line-height: .92; font-weight: 700; letter-spacing: -.05em; }
.h1 { margin: 0; font-size: clamp(44px, 6vw, 72px); line-height: .95; font-weight: 700; letter-spacing: -.045em; }
.h2 { margin: 0; font-size: clamp(40px, 5vw, 64px); line-height: 1; font-weight: 700; letter-spacing: -.04em; }
.h3 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.lead { margin: 0; max-width: 560px; font-size: 20px; line-height: 1.45; color: var(--soft); }
.title-break { overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: 999px; border: 1.5px solid transparent;
  font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s var(--ease), background-color .15s, color .15s, border-color .15s;
}
.btn:active { transform: scale(.97); }
.btn-light { background: var(--fg); color: var(--bg); }
.btn-light:hover { background: #fff; color: var(--bg); }
.btn-dark { background: var(--bg); color: var(--fg); }
.btn-dark:hover { background: #222; color: var(--fg); }
.btn-outline { background: transparent; color: var(--fg); border-color: var(--fg); }
.btn-outline:hover { background: var(--fg); color: var(--bg); }
.btn-outline-dark { background: transparent; color: var(--bg); border-color: var(--bg); }
.btn-outline-dark:hover { background: var(--bg); color: var(--fg); }
.btn-disabled, .btn:disabled { background: var(--line-2); color: var(--dim); border-color: transparent; cursor: not-allowed; }
.btn-outline:disabled { background: transparent; border-color: var(--line); }
.btn-sm { min-height: 44px; padding: 0 20px; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- header / footer */
.site-header { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; justify-content: space-between; padding-top: 28px; padding-bottom: 28px; }
.logo { font-size: 26px; font-weight: 700; letter-spacing: -.04em; text-decoration: none; }
.logo span { font-family: var(--mono); font-size: 13px; font-weight: 500; vertical-align: super; margin-left: 2px; letter-spacing: 0; }
.nav { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
.nav > a:not(.btn):not(.avatar) { text-decoration: none; }
.nav-meta { color: var(--muted); }
.avatar { width: 44px; height: 44px; border-radius: 999px; border: 1px solid #5A5A5A; display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 13px; text-decoration: none; }
.avatar:hover { border-color: var(--fg); color: var(--fg); }

.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.flash { margin: 0; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--line); font-size: 15px; }
.flash-success { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.flash-error { border-color: var(--fg); }

.site-footer { border-top: 1px solid var(--line); margin-top: 96px; }
.site-footer .wrap { padding-top: 48px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 48px; }
.footer-logo { font-size: clamp(80px, 18vw, 240px); font-weight: 800; letter-spacing: -.06em; line-height: .8; }
.footer-row { display: flex; flex-wrap: wrap; gap: 16px 24px; justify-content: space-between; font-size: 14px; color: var(--muted); }
.footer-row nav { display: flex; gap: 24px; }
.footer-row a { color: var(--muted); text-decoration: none; }
.footer-row a:hover { color: var(--fg); }

/* ---------------------------------------------------------------- landing */
.hero { display: flex; flex-wrap: wrap; gap: 64px; align-items: flex-end; padding-top: 72px; padding-bottom: 96px; }
.hero-copy { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 36px; }
.stem-card { flex: 1 1 460px; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stem-card-head { display: flex; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); color: var(--muted); }
.stem-card-head .hi { color: var(--fg); }
.stem-row { display: flex; gap: 18px; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--line-2); }
.stem-row:last-child { border-bottom: 0; }
.stem-name { width: 72px; flex-shrink: 0; font-size: 15px; font-weight: 600; }
.roll { width: 100%; height: 44px; flex: 1; min-width: 0; }

.band { border-top: 1px solid var(--line); }
.band > .wrap { padding-top: 96px; padding-bottom: 96px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); border-top: 1px solid var(--fg); }
.steps li { padding: 28px 32px 0 0; display: flex; flex-direction: column; gap: 14px; }
.steps h3 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.steps p { margin: 0; color: var(--soft); }
.split { display: flex; flex-wrap: wrap; gap: 56px; justify-content: space-between; align-items: flex-start; }
.split > .h2 { flex: 1 1 360px; }
.split > div { flex: 1 1 520px; min-width: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag { border: 1px solid #5A5A5A; border-radius: 999px; padding: 10px 18px; font-weight: 500; }

.pricing { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.price-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 36px; display: flex; flex-direction: column; gap: 28px; }
.price-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; color: var(--soft); flex: 1; }
.price-card .btn { width: 100%; }
.price-card-inverse { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.price-card-inverse ul { color: #333; }
.price-card-inverse .price small { color: #555; }
.price-card-inverse .pill { border-color: var(--bg); }
.price-name { font-size: 18px; font-weight: 600; }
.price { display: flex; align-items: baseline; gap: 8px; }
.price span { font-size: 64px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.price small { color: var(--muted); font-size: 16px; }
.pill { font-size: 12px; border: 1px solid var(--fg); border-radius: 999px; padding: 5px 10px; }

/* ---------------------------------------------------------------- drop zone */
.dropzone {
  position: relative; margin: 0;
  border: 1.5px dashed #5A5A5A; border-radius: var(--radius); padding: 32px;
  display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
  transition: border-color .2s, background-color .2s;
}
.dropzone.is-over { border-color: var(--fg); background: var(--raise); }
.dropzone.is-busy { border-style: solid; border-color: var(--line); }
.dropzone.is-busy .dz-main, .dropzone.is-busy label { display: none; }
.dz-main { display: flex; gap: 18px; align-items: center; min-width: 0; }
.dz-icon { width: 56px; height: 56px; border-radius: 999px; border: 1.5px solid var(--fg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dz-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dz-title { font-size: 20px; font-weight: 600; }
.dz-sub { color: var(--muted); }
.dropzone label.btn { position: relative; }
.dz-progress { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.dz-progress-row { display: flex; justify-content: space-between; gap: 16px; }
.dz-file { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-error { width: 100%; margin: 0; font-size: 15px; }
.dz-hint { margin: -16px 0 0; font-size: 14px; color: var(--muted); }

.bar { height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--fg); transition: width .5s var(--ease); }

/* ---------------------------------------------------------------- forms */
.auth { max-width: 520px; padding-top: 72px; display: flex; flex-direction: column; gap: 20px; }
.form { display: flex; flex-direction: column; gap: 20px; margin-top: 12px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-size: 15px; font-weight: 600; }
.field input {
  min-height: 52px; padding: 0 16px; border-radius: 14px; border: 1px solid #5A5A5A; background: transparent; font-size: 17px;
}
.field input:focus { outline: none; border-color: var(--fg); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--soft); }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--fg); flex-shrink: 0; }
.form-error { margin: 0; padding: 14px 18px; border: 1px solid var(--fg); border-radius: 14px; font-size: 15px; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.panel .form { margin-top: 0; }
.danger summary { cursor: pointer; font-weight: 600; }
.danger[open] summary { margin-bottom: 16px; }

/* ---------------------------------------------------------------- dashboard */
.dash { padding-top: 56px; display: flex; flex-direction: column; gap: 40px; }
.notice {
  background: var(--fg); color: var(--bg); border-radius: var(--radius); padding: 28px 32px;
  display: flex; flex-wrap: wrap; gap: 20px 24px; align-items: center; justify-content: space-between;
}
.notice > div:first-child { display: flex; flex-direction: column; gap: 4px; }
.notice strong { font-size: 22px; letter-spacing: -.02em; }
.notice span { color: #444; }
.notice-dark { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.notice-dark span { color: var(--muted); }
.track-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.track-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 24px; align-items: center;
  padding: 22px 4px; border-bottom: 1px solid var(--line); text-decoration: none; transition: padding .2s var(--ease);
}
.track-item:hover { color: var(--fg); padding-left: 12px; }
.track-name { font-size: 22px; font-weight: 600; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-meta { color: var(--muted); }
.track-status { min-width: 96px; text-align: right; }
.status-done, .status-processing { color: var(--fg); }
.status-failed, .status-expired, .status-queued { color: var(--muted); }
.empty { margin: 0; }

/* ---------------------------------------------------------------- processing */
.processing { padding-top: 96px; display: flex; flex-direction: column; gap: 56px; }
.proc-steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.proc-steps li { display: flex; gap: 20px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); color: var(--dim); }
.proc-steps li > .mono { width: 24px; }
.proc-label { flex: 1; font-size: 22px; font-weight: 500; letter-spacing: -.01em; }
.proc-steps li.is-done, .proc-steps li.is-active { color: var(--fg); }
.proc-steps li.is-active .proc-state { background: var(--fg); color: var(--bg); padding: 6px 12px; border-radius: 999px; }
.proc-steps li.is-active .proc-state::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-radius: 99px; background: var(--bg); animation: pulse 1.2s ease-in-out infinite; vertical-align: middle; }
@keyframes pulse { 50% { opacity: .2; } }

/* ---------------------------------------------------------------- results */
.results { padding-top: 56px; display: flex; flex-direction: column; gap: 40px; }
.results-head { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; align-items: flex-end; }
.results-head > div { min-width: 0; }
.facts { display: flex; margin: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.facts > div { padding: 16px 24px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); }
.facts > div:last-child { border-right: 0; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; font-size: 24px; font-weight: 600; white-space: nowrap; }

.unlock {
  background: var(--fg); color: var(--bg); border-radius: var(--radius); padding: 28px 32px;
  display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between;
}
.unlock-text { display: flex; gap: 18px; align-items: center; }
.unlock-text > div { display: flex; flex-direction: column; gap: 4px; }
.unlock-text svg { flex-shrink: 0; }
.unlock strong { font-size: 22px; letter-spacing: -.02em; }
.unlock span { color: #444; }

.stems { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stem { display: flex; flex-wrap: wrap; gap: 16px 20px; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--line-2); }
.play {
  width: 48px; height: 48px; border-radius: 999px; border: 1.5px solid var(--fg); background: transparent; color: var(--fg);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: background-color .15s, color .15s, transform .15s var(--ease);
}
.play:hover, .play.is-playing { background: var(--fg); color: var(--bg); }
.play:active { transform: scale(.94); }
.play .i-pause, .play.is-playing .i-play { display: none; }
.play.is-playing .i-pause { display: block; }
.stem-label { width: 140px; display: flex; flex-direction: column; gap: 2px; }
.stem-title { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.roll-wrap { position: relative; flex: 1 1 320px; min-width: 0; height: 48px; }
.roll-wrap .roll { height: 48px; }
.roll-head { position: absolute; top: -4px; bottom: -4px; left: 0; width: 1.5px; background: var(--fg); opacity: 0; pointer-events: none; }
.stem.is-playing .roll-head { opacity: 1; }
.stem-dl { display: flex; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  font-family: var(--mono); font-size: 13px; font-weight: 500; text-decoration: none; cursor: pointer;
  background: transparent; color: var(--dim); border: 1px solid #333;
}
.chip:disabled { cursor: not-allowed; }
.chip-on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip-on:hover { background: transparent; color: var(--fg); }
.stems-foot { padding: 18px 24px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; font-size: 15px; color: var(--muted); }

/* ---------------------------------------------------------------- legal pages */
.prose { padding-top: 56px; }
.prose h2 { font-size: 22px; letter-spacing: -.01em; margin: 36px 0 8px; }
.prose p, .prose li { color: var(--soft); }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .site-header { padding-top: 20px; padding-bottom: 20px; }
  .nav { gap: 10px 18px; }
  .nav-meta { display: none; }
  .hero { padding-top: 32px; padding-bottom: 64px; gap: 48px; }
  .dropzone { padding: 22px; }
  .dropzone label.btn { width: 100%; }
  .band > .wrap { padding-top: 64px; padding-bottom: 64px; }
  .price-card, .panel { padding: 24px; }
  .notice, .unlock { padding: 22px; }
  .track-item { grid-template-columns: minmax(0, 1fr) auto; }
  .track-meta { grid-column: 1 / -1; grid-row: 2; }
  .facts { width: 100%; }
  .facts > div { flex: 1; padding: 12px 14px; }
  .facts dd { font-size: 18px; }
  .stem { padding: 16px; }
  .stem-label { width: auto; flex: 1; }
  .roll-wrap { flex-basis: 100%; order: 3; }
  .stem-dl { order: 2; }
  .processing { padding-top: 48px; gap: 40px; }
  .proc-label { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
