:root {
  --bg: #0b0d0c;
  --bg-2: #101311;
  --panel: #141816;
  --panel-2: #1a1f1c;
  --line: #252b27;
  --line-2: #323a35;
  --text: #edf2ee;
  --muted: #8d978f;
  --faint: #5d665f;
  --accent: #c6ff3d;
  --accent-ink: #0b0d0c;
  --accent-2: #ff6b4a;
  --sel: rgba(198, 255, 61, 0.16);
  --danger: #ff5d5d;
  --radius: 18px;
  --radius-s: 11px;
  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);      /* expo-out: entrances */
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);  /* meters, loops */
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1); /* small overshoot: chips, presses */
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body.modal-open { overflow: hidden; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 3vw, 32px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}
body.editing .topbar { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand-mark svg { width: 30px; height: 30px; display: block; }
.brand-mark rect { fill: var(--accent); stroke: none; }
.brand-mark path { stroke: var(--accent-ink); stroke-width: 2.6; }
.brand-name { font-weight: 700; letter-spacing: -0.01em; font-size: 16px; }
.brand-name em { font-style: normal; color: var(--muted); font-weight: 500; }
.topbar-right { display: flex; gap: 10px; align-items: center; }
.status-pill { font-size: 12px; padding: 6px 10px; border-radius: 99px; background: #2a1c17; color: #ffb39f; border: 1px solid #4a2a20; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--panel-2);
  font-weight: 600; letter-spacing: -0.005em;
  transition: transform .2s var(--ease), background .2s, border-color .2s, box-shadow .2s;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { border-color: var(--faint); }
.btn:active { transform: scale(.97); transition-duration: .08s; }
.btn.primary:hover { transform: translateY(-1px); }
.btn.primary:active { transform: translateY(0) scale(.97); }
.btn.xl svg { transition: transform .25s var(--ease-out); }
.btn.xl:hover svg { transform: translateX(3px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { box-shadow: 0 0 0 4px rgba(198, 255, 61, .18); }
.btn.ghost { background: transparent; }
.btn.sm { height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.xl { height: 56px; padding: 0 26px; font-size: 17px; border-radius: 16px; }
.btn.danger { background: transparent; color: var(--danger); border-color: #4a2626; }
.btn.grow, .grow { flex: 1; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2);
  transition: border-color .2s, transform .2s var(--ease);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { border-color: var(--faint); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.on { border-color: var(--accent); color: var(--accent); }

.row { display: flex; align-items: center; }
.gap { gap: 12px; } .gap-s { gap: 8px; }
.hint { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.hint.center { text-align: center; }
.error { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: #2a1414; color: #ffb4b4; border: 1px solid #4a2222; font-size: 14px; }
.busy { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 14px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
.spinner.lg { width: 34px; height: 34px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.label small { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--faint); }
.label output { font-family: var(--mono); text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 400; }
input[type=text], input[type=url] {
  height: 44px; width: 100%; padding: 0 14px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--line-2); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input[type=text]:focus, input[type=url]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(198, 255, 61, .14); }
input::placeholder { color: var(--faint); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; margin: 0; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--accent) var(--p, 0%), var(--line-2) var(--p, 0%)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line-2); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.12); }
input[type=range]:focus-visible { outline: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--accent); }
input[type=range]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--accent); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: var(--text); border: 0; box-shadow: 0 0 0 4px var(--bg); transition: transform .15s; }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--text); border: 0; }
input[type=range]:active::-webkit-slider-thumb { transform: scale(1.2); background: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin: 10px 0; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin: 12px 0; }
.swatch { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.swatch input { width: 30px; height: 30px; padding: 0; border: 1px solid var(--line-2); border-radius: 8px; background: none; cursor: pointer; }
.swatch input::-webkit-color-swatch-wrapper { padding: 3px; }
.swatch input::-webkit-color-swatch { border: 0; border-radius: 5px; }

/* ---------- tabs / seg ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; }
.tab { flex: 1; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 600; transition: background .2s, color .2s; }
.tab:hover { color: var(--text); }
.tab:focus-visible, .seg-btn:focus-visible { outline-offset: -2px; }
.tab.active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line); }
.seg.wide { display: flex; margin: 8px 0 18px; }
.seg.wide .seg-btn { flex: 1; }
.seg-btn { height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; transition: background .2s, color .2s; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--text); color: var(--bg); }

/* ---------- landing ---------- */
.landing {
  --edge: clamp(16px, 3vw, 32px);
  max-width: 1280px; margin: 0 auto; padding: clamp(28px, 7vh, 88px) var(--edge) 56px;
  display: grid; column-gap: clamp(32px, 5vw, 88px);
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  grid-template-areas: "hero card" "take card" "feat feat";
  grid-template-rows: auto 1fr auto;
}
.hero { grid-area: hero; align-self: end; animation: rise .8s var(--ease-out) both; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
/* three-bar level meter: the brand's "sound" glyph, settles after a few beats */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 3px; height: 100%; border-radius: 2px; background: var(--accent); transform-origin: bottom; transform: scaleY(.45); animation: eq .9s var(--ease-in-out) 5 both; }
.eq i:nth-child(2) { animation-delay: .15s; transform: scaleY(.8); }
.eq i:nth-child(3) { animation-delay: .3s; transform: scaleY(.6); }
@keyframes eq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
h1 { margin: 0; font-size: clamp(46px, 7vw, 108px); line-height: .92; letter-spacing: -0.048em; font-weight: 800; }
.lede { max-width: 30em; margin: 28px 0 0; font-size: clamp(16px, 1.35vw, 19px); line-height: 1.5; color: var(--muted); text-wrap: pretty; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* signature: "make noise." is a die-cut sticker that slaps onto the headline, then buzzes and rings */
.noise { display: inline-block; position: relative; margin: .16em 0 .06em .02em; transform: rotate(-3deg); animation: slap .85s .3s var(--ease-out) both; }
.noise-face {
  display: block; padding: .02em .2em .09em .16em; border-radius: .2em;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 0 0 .065em var(--text), 0 .2em .45em -.05em rgba(0, 0, 0, .7);
  animation: buzz .42s 1.12s linear both;
}
.noise-chip {
  position: absolute; right: -.47em; top: calc(50% - .28em); width: .56em; height: .56em; border-radius: 50%;
  display: grid; place-items: center; background: var(--bg); color: var(--accent);
  box-shadow: 0 0 0 .04em var(--text);
  animation: chip .5s 1.05s var(--ease-spring) both;
}
.noise-chip svg { width: .32em; height: .32em; stroke-width: 2.4; }
.noise-chip b { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; animation: ring 1.5s 1.15s var(--ease-out) 2 both; }
.noise-chip b + b { animation-delay: 1.5s; }
.noise:hover .noise-face { animation: buzz2 .42s linear; }
.noise:hover .noise-chip b { animation: ring2 1.2s var(--ease-out) 1; }
.noise:hover .noise-chip b + b { animation-delay: .3s; }
@keyframes slap {
  0% { opacity: 0; transform: translate(.12em, -.25em) scale(1.45) rotate(-14deg); }
  55% { opacity: 1; transform: scale(.96) rotate(-1.5deg); }
  100% { opacity: 1; transform: rotate(-3deg); }
}
@keyframes buzz { 0%, 100% { transform: none; } 20% { transform: translateX(-.018em); } 40% { transform: translateX(.018em); } 60% { transform: translateX(-.012em); } 80% { transform: translateX(.008em); } }
@keyframes buzz2 { 0%, 100% { transform: none; } 20% { transform: translateX(-.018em); } 40% { transform: translateX(.018em); } 60% { transform: translateX(-.012em); } 80% { transform: translateX(.008em); } }
@keyframes chip { from { opacity: 0; transform: scale(.2); } }
@keyframes ring { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(2.6); } }
@keyframes ring2 { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(2.6); } }

.takeaway { grid-area: take; align-self: start; margin-top: 36px; animation: rise .8s .18s var(--ease-out) both; }
.takeaway-label { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.files { list-style: none; margin: 0; padding: 0; max-width: 30em; }
.files li { display: flex; align-items: baseline; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.files code { flex: none; width: 8.6em; font-family: var(--mono); font-size: 13px; color: var(--text); }

.source-card {
  grid-area: card; align-self: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 14px;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .8);
  animation: rise .8s .12s var(--ease-out) both;
}
.source-card .tabs { margin-bottom: 14px; }
.dropzone {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: clamp(240px, 38vh, 360px); padding: 28px; border-radius: 16px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--line-2); background: var(--bg-2);
  transition: border-color .25s, background .25s, transform .25s var(--ease);
}
.dropzone:hover, .dropzone.over, .dropzone:focus-within { border-color: var(--accent); background: #121710; }
.dropzone:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.dropzone.over { transform: scale(1.01); }
.dz-icon { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); margin-bottom: 8px; transition: transform .3s var(--ease); }
.dropzone:hover .dz-icon { transform: translateY(-3px); }
.dz-icon svg { width: 30px; height: 30px; stroke-width: 2.4; }
.dz-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.dz-sub { color: var(--muted); font-size: 14px; }
.dz-sub u { color: var(--text); text-underline-offset: 3px; }
.dz-tip { margin-top: 10px; font-size: 12px; color: var(--faint); }
.dz-tip kbd { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); }
.link-pane { display: flex; flex-direction: column; gap: 14px; padding: 10px 6px 6px; }
.link-pane .row { align-items: flex-end; flex-wrap: wrap; }
.field.sm { width: 150px; flex: none; }

.feature-row { grid-area: feat; list-style: none; padding: 0; margin: clamp(40px, 7vh, 72px) 0 0; display: grid; grid-template-columns: repeat(4, 1fr); column-gap: clamp(16px, 2vw, 28px); animation: rise .8s .24s var(--ease-out) both; }
.feature-row li { padding: 14px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.feature-row b { font-family: var(--mono); font-size: 12px; color: var(--accent); font-weight: 600; }

/* ---------- editor layout ---------- */
.editor {
  display: grid; gap: 14px; padding: 14px clamp(12px, 2vw, 24px) 110px;
  grid-template-columns: minmax(300px, 1.05fr) minmax(320px, 1fr) minmax(320px, .95fr);
  grid-template-areas: "stage preview inspector";
  align-items: start; max-width: 1600px; margin: 0 auto;
}
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; animation: rise .6s var(--ease) both; }
.stage-panel { grid-area: stage; }
.preview-panel { grid-area: preview; animation-delay: .06s; position: sticky; top: 76px; }
.inspector { grid-area: inspector; animation-delay: .12s; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.005em; display: flex; align-items: center; gap: 9px; }
.idx { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font: 600 11px/1 var(--mono); background: var(--sel); color: var(--accent); }
.meta { font-size: 12px; color: var(--muted); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 65%; }

/* stage + crop */
.stage { background: #070807; border-radius: 12px; display: grid; place-items: center; padding: 10px; min-height: 220px; overflow: hidden; }
.stage-inner { position: relative; line-height: 0; user-select: none; touch-action: none; }
.stage-inner video, .stage-inner img { display: block; max-width: 100%; max-height: 46vh; border-radius: 4px; }
.crop-shade { position: absolute; inset: 0; pointer-events: none; }
.crop-box {
  position: absolute; border: 2px solid var(--accent); cursor: move; outline: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55);
}
.stage-inner { overflow: hidden; border-radius: 4px; }
.crop-box .grid-lines { position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to right, transparent calc(33.33% - .5px), rgba(255,255,255,.35) calc(33.33% - .5px), rgba(255,255,255,.35) calc(33.33% + .5px), transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), rgba(255,255,255,.35) calc(66.66% - .5px), rgba(255,255,255,.35) calc(66.66% + .5px), transparent calc(66.66% + .5px)),
    linear-gradient(to bottom, transparent calc(33.33% - .5px), rgba(255,255,255,.35) calc(33.33% - .5px), rgba(255,255,255,.35) calc(33.33% + .5px), transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), rgba(255,255,255,.35) calc(66.66% - .5px), rgba(255,255,255,.35) calc(66.66% + .5px), transparent calc(66.66% + .5px));
  opacity: 0; transition: opacity .2s; }
.crop-box:hover .grid-lines, .crop-box.dragging .grid-lines { opacity: 1; }
.crop-box .h { position: absolute; width: 18px; height: 18px; background: var(--accent); border-radius: 50%; border: 3px solid #070807; }
.crop-box .h.nw { left: -10px; top: -10px; cursor: nwse-resize; }
.crop-box .h.ne { right: -10px; top: -10px; cursor: nesw-resize; }
.crop-box .h.sw { left: -10px; bottom: -10px; cursor: nesw-resize; }
.crop-box .h.se { right: -10px; bottom: -10px; cursor: nwse-resize; }
.stage-tools { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 4px; gap: 8px; flex-wrap: wrap; }

/* range (trim + waveform) */
.trim-block, .audio-editor { margin-top: 14px; }
.trim-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.trim-head .label { margin-right: auto; }
.badge { font-family: var(--mono); font-size: 12px; padding: 3px 8px; border-radius: 99px; background: var(--sel); color: var(--accent); }
.badge.warn { background: rgba(255, 107, 74, .16); color: var(--accent-2); }
.range { position: relative; height: 58px; border-radius: 10px; background: var(--bg-2); overflow: visible; touch-action: none; user-select: none; }
.range.wave { height: 72px; }
.range-bg { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 10px; display: block; }
.range-dim { position: absolute; top: 0; bottom: 0; background: rgba(8, 9, 8, .72); pointer-events: none; }
.range-dim.l { left: 0; border-radius: 10px 0 0 10px; }
.range-dim.r { right: 0; border-radius: 0 10px 10px 0; }
.range-sel { position: absolute; top: -2px; bottom: -2px; border: 2px solid var(--accent); border-radius: 10px; cursor: grab; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
.range-sel:active { cursor: grabbing; }
.grip { position: absolute; top: -2px; bottom: -2px; width: 16px; background: var(--accent); cursor: ew-resize; display: grid; place-items: center; outline: none; }
.grip::after { content: ""; width: 2px; height: 18px; border-radius: 2px; background: var(--accent-ink); opacity: .6; }
.grip.l { left: -10px; border-radius: 9px 0 0 9px; }
.grip.r { right: -10px; border-radius: 0 9px 9px 0; }
.grip:focus-visible { box-shadow: 0 0 0 3px rgba(198,255,61,.35); }
.range-head { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--text); border-radius: 2px; pointer-events: none; opacity: 0; transition: opacity .2s; }
.range.playing .range-head { opacity: 1; }
.image-len { margin-top: 14px; }

/* preview */
.chat {
  border-radius: 14px; padding: 26px 18px 20px;
  background-color: #0f1411;
  background-image: radial-gradient(rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 14px 14px;
  display: flex; justify-content: flex-end;
}
.bubble-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; width: min(100%, 340px); }
.sticker-frame { position: relative; width: 100%; aspect-ratio: 1; }
.sticker-frame canvas { width: 100%; height: 100%; display: block; cursor: default; touch-action: none; filter: drop-shadow(0 8px 18px rgba(0,0,0,.35)); }
.sticker-frame canvas.grab { cursor: grab; }
.sticker-frame canvas.grabbing { cursor: grabbing; }
.sticker-frame.checker canvas { background: repeating-conic-gradient(#202622 0 25%, #171b18 0 50%) 0 0 / 22px 22px; border-radius: 6px; }
.sound-chip {
  position: absolute; left: 8px; bottom: 8px; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, .62); color: #fff; display: grid; place-items: center; backdrop-filter: blur(6px);
}
.sound-chip svg { width: 18px; height: 18px; }
.sound-chip .on { display: none; }
.sound-chip.on .on { display: block; }
.sound-chip.on .off { display: none; }
.chat-time { font-size: 11px; color: var(--faint); font-family: var(--mono); }
.transport { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.play-btn { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; transition: transform .2s var(--ease); }
.play-btn:hover { transform: scale(1.05); }
.play-btn svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.play-btn .i-pause { display: none; }
.play-btn.playing .i-pause { display: block; }
.play-btn.playing .i-play { display: none; }
.transport-bar { flex: 1; height: 4px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.transport-bar span { display: block; height: 100%; width: 0; background: var(--text); }

/* inspector */
.inspector-tabs { margin-bottom: 16px; }
.tab-pane { animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }
.sound-sources { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
.src-opt {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--muted);
  font-size: 12px; font-weight: 600; text-align: center; line-height: 1.15;
  transition: border-color .2s, color .2s, background .2s;
}
.src-opt svg { width: 20px; height: 20px; }
.src-opt:hover { color: var(--text); border-color: var(--line-2); }
.src-opt.active { border-color: var(--accent); color: var(--text); background: #141a10; }
.src-opt.active svg { color: var(--accent); }
.src-opt[disabled] { opacity: .35; pointer-events: none; }
.sub-pane { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.sub-pane .row input { flex: 1; }
.mini-drop { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 16px; border-radius: 12px; border: 1.5px dashed var(--line-2); color: var(--muted); font-size: 13px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.mini-drop b { color: var(--text); font-size: 14px; font-weight: 600; }
.mini-drop:hover, .mini-drop:focus-within { border-color: var(--accent); background: #121710; }
.mini-drop:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-audio-pane=record] { flex-direction: row; align-items: center; gap: 14px; }
.rec-btn { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2); font-weight: 600; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); }
.rec-btn.recording { border-color: var(--danger); }
.rec-btn.recording .rec-dot { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }

.emoji-row { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0; }
.emoji-row button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: var(--bg-2); font-size: 20px; line-height: 1; transition: transform .15s var(--ease), border-color .15s; }
.emoji-row button:hover { transform: scale(1.12); border-color: var(--line-2); }
.emoji-row button:active { transform: scale(.92); }
.layer-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.layer-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); text-align: left; font-size: 14px; }
.layer-item.active { border-color: var(--accent); }
.layer-item .lt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-item .lf { font-size: 12px; color: var(--faint); }
.layer-edit { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.layer-edit .grid2 { margin: 0; }
.audio-editor .grid2, .filter-row + .grid2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.filter-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
#addTextBtn svg { color: var(--accent); }
.layer-list:empty::before { content: "No captions yet. Add text, or tap an emoji to drop it on the sticker."; display: block; padding: 14px; border-radius: 10px; border: 1px dashed var(--line-2); color: var(--faint); font-size: 13px; text-align: center; }
.font-row { display: flex; gap: 6px; flex-wrap: wrap; }
.font-row button { height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg-2); font-size: 16px; }
.font-row button.active { border-color: var(--accent); }

.shape-row, .filter-row { gap: 6px; margin: 8px 0 14px; }
.shape-row { display: flex; flex-wrap: wrap; }
.shape-opt { width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); display: grid; place-items: center; transition: border-color .2s, transform .15s var(--ease-out); }
.shape-opt:hover { border-color: var(--line-2); }
.shape-opt:active, .src-opt:active, .filter-opt:active canvas { transform: scale(.94); }
.filter-opt canvas { transition: border-color .2s, transform .15s var(--ease-out); }
.filter-opt:hover canvas { border-color: var(--line-2); }
.shape-opt.active { border-color: var(--accent); }
.shape-opt i { display: block; width: 22px; height: 22px; background: var(--text); }
.shape-opt i.rd { border-radius: 7px; }
.shape-opt i.ci { border-radius: 50%; }
.shape-opt svg { width: 24px; height: 24px; fill: var(--text); stroke: none; }
.filter-opt { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0; border: 0; background: none; font-size: 11px; color: var(--muted); font-weight: 600; }
.filter-opt canvas { width: 100%; height: auto; aspect-ratio: 1; border-radius: 10px; border: 2px solid transparent; display: block; background: var(--bg-2); }
.filter-opt.active canvas { border-color: var(--accent); }
.filter-opt.active { color: var(--text); }

/* export bar */
.export-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 15;
  display: flex; align-items: center; gap: 16px; padding: 10px 10px 10px 20px;
  width: min(760px, calc(100% - 24px));
  background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(16px);
  border: 1px solid var(--line-2); border-radius: 22px; box-shadow: 0 20px 50px rgba(0,0,0,.45);
}
.export-summary { flex: 1; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.export-summary b { color: var(--text); font-weight: 600; font-family: var(--mono); font-size: 12px; }
.export-summary span + span::before { content: ""; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--faint); vertical-align: middle; margin: 0 14px 0 0; }
.export-summary { column-gap: 14px; }

/* result modal */
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(5, 6, 5, .74); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 16px; animation: fade .25s; }
.modal-card { position: relative; width: min(940px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 26px; padding: 26px; animation: pop .45s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.modal-x { position: absolute; top: 14px; right: 14px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel-2); display: grid; place-items: center; transition: border-color .2s, transform .2s var(--ease-out); }
.modal-x svg { width: 18px; height: 18px; }
.modal-x:hover { border-color: var(--faint); transform: rotate(90deg); }
.result-grid { display: grid; grid-template-columns: 300px 1fr; gap: 28px; }
.result-preview { display: flex; flex-direction: column; gap: 12px; }
.checker { aspect-ratio: 1; border-radius: 16px; background: repeating-conic-gradient(#202622 0 25%, #171b18 0 50%) 0 0 / 22px 22px; display: grid; place-items: center; overflow: hidden; }
.checker img { width: 100%; height: 100%; object-fit: contain; animation: land .8s .12s var(--ease-out) both; }
@keyframes land { 0% { opacity: 0; transform: scale(1.3) rotate(-10deg); } 60% { opacity: 1; transform: scale(.97) rotate(1deg); } 100% { transform: none; } }
.downloads .dl { animation: rise .5s var(--ease-out) both; }
.downloads .dl:nth-child(2) { animation-delay: .06s; } .downloads .dl:nth-child(3) { animation-delay: .12s; }
.downloads .dl:nth-child(4) { animation-delay: .18s; } .downloads .dl:nth-child(5) { animation-delay: .24s; }
.result-preview video { width: 100%; border-radius: 12px; background: #000; }
.result-info h2 { margin: 0 0 18px; font-size: 30px; letter-spacing: -0.03em; line-height: 1.05; }
.downloads { display: grid; gap: 8px; }
.dl { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); text-decoration: none; color: var(--text); transition: border-color .2s, transform .2s var(--ease); }
.dl:hover { border-color: var(--accent); transform: translateY(-2px); }
.dl:active { transform: scale(.985); }
.result-info .eyebrow { margin-bottom: 12px; }
.howto summary { padding: 6px 0; }
.dl.primary { border-color: rgba(198, 255, 61, .5); background: #131a0e; }
.dl .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-2); flex: none; }
.dl.primary .ic { background: var(--accent); color: var(--accent-ink); }
.dl .ic svg { width: 19px; height: 19px; }
.dl .tx { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dl .tx b { font-weight: 600; font-size: 15px; }
.dl .tx small { color: var(--muted); font-size: 13px; }
.dl .sz { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.dl .ok { color: var(--accent); } .dl .bad { color: var(--accent-2); }
.howto { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.howto summary { font-weight: 700; cursor: pointer; }
.howto ol { padding-left: 20px; color: var(--muted); font-size: 14px; display: grid; gap: 6px; }
.howto ol b { color: var(--text); font-weight: 600; }

.recents { max-width: 1600px; margin: 0 auto; padding: 0 clamp(12px, 2vw, 24px) 120px; }
.landing ~ .recents { max-width: 1280px; padding: 0 clamp(16px, 3vw, 32px) 64px; }
body.editing .recents { max-width: 1600px; padding: 8px clamp(12px, 2vw, 24px) 132px; }
.recents h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 12px; }
.recent-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.recent-row button { flex: none; width: 92px; height: 92px; border-radius: 14px; border: 1px solid var(--line); background: repeating-conic-gradient(#1c211e 0 25%, #151916 0 50%) 0 0 / 16px 16px; padding: 4px; transition: border-color .2s, transform .2s var(--ease); }
.recent-row button:hover { border-color: var(--accent); transform: translateY(-2px); }
.recent-row img { width: 100%; height: 100%; object-fit: contain; }

.render-veil { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(5,6,5,.6); backdrop-filter: blur(6px); }
.veil-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 34px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line-2); text-align: center; }
.veil-card { min-width: 300px; gap: 12px; animation: pop .4s var(--ease-out); }
.veil-card small { color: var(--muted); font-family: var(--mono); font-size: 12px; min-height: 1.4em; }
.veil-eq { display: flex; align-items: center; gap: 4px; height: 36px; margin-bottom: 4px; }
.veil-eq i { width: 5px; height: 100%; border-radius: 3px; background: var(--accent); transform: scaleY(.3); animation: eq 1s var(--ease-in-out) infinite; }
.veil-eq i:nth-child(2) { animation-delay: .12s; } .veil-eq i:nth-child(3) { animation-delay: .24s; }
.veil-eq i:nth-child(4) { animation-delay: .36s; } .veil-eq i:nth-child(5) { animation-delay: .48s; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 60; padding: 10px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px; animation: pop .3s var(--ease); max-width: calc(100% - 32px); }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .landing { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "card" "take" "feat"; grid-template-rows: none; row-gap: 28px; max-width: 720px; }
  .hero, .takeaway { align-self: start; }
  .takeaway { margin-top: 4px; }
  .landing ~ .recents { max-width: 720px; }
}
@media (max-width: 1280px) {
  .editor { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "stage preview" "inspector preview"; }
}
/* two-column editor: dock the export bar under the sticky preview, never over the inspector */
@media (min-width: 861px) and (max-width: 1280px) {
  .export-bar {
    --pad: clamp(12px, 2vw, 24px);
    left: auto; transform: none; right: var(--pad);
    width: calc((100% - 2 * var(--pad) - 14px) / 2);
    padding-left: 16px; gap: 12px;
  }
  .export-summary { column-gap: 10px; font-size: 12px; }
  .export-summary span + span::before { margin-right: 10px; }
  .btn.xl { padding: 0 20px; }
  /* keep the sticky preview clear of the docked bar on short laptop screens */
  .bubble-wrap { width: min(100%, 340px, calc(100vh - 430px)); }
}
@media (max-width: 860px) {
  .editor { grid-template-columns: minmax(0, 1fr); grid-template-areas: "preview" "stage" "inspector"; padding-bottom: 120px; }
  .preview-panel { position: static; }
  .bubble-wrap { width: min(100%, 300px); }
  .feature-row { grid-template-columns: 1fr 1fr; row-gap: 20px; margin-top: 12px; }
  .export-bar { left: 0; right: 0; bottom: 0; transform: none; width: auto; border-radius: 18px 18px 0 0; border-width: 1px 0 0; padding: 10px max(12px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .toast { bottom: 104px; }
  .result-grid { grid-template-columns: 1fr; }
  .result-grid { gap: 20px; }
  .result-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 420px; width: calc(100% - 52px); margin: 0; }
  .result-preview video { aspect-ratio: 1; height: 100%; object-fit: contain; }
  .result-info h2 { font-size: 26px; }
  .export-summary { font-size: 12px; }
}
@media (max-width: 520px) {
  .sound-sources { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .src-opt { padding: 10px 2px 8px; font-size: 11px; }
  .audio-editor .grid2, .filter-row + .grid2 { grid-template-columns: 1fr; }
  .files code { width: 7.6em; }
  .files li { gap: 10px; font-size: 13px; }
  .export-summary span:nth-child(n+3) { display: none; }
  h1 { font-size: 13.4vw; }
  .noise { margin-right: .5em; }
  .grid2 { grid-template-columns: 1fr; }
  .field.sm { width: calc(50% - 6px); }
  .link-pane .btn.grow { flex-basis: 100%; }
  .brand-name em { display: none; }
  .export-bar { padding-left: 14px; gap: 10px; }
  .btn.xl { height: 50px; padding: 0 18px; font-size: 16px; }
  .modal-card { padding: 20px 16px; }
}
/* phones and touch screens: 44px targets */
@media (max-width: 520px), (pointer: coarse) {
  .seg-btn { height: 40px; }
  .seg { padding: 2px; }
  .tab { height: 44px; }
  .icon-btn, .emoji-row button { width: 44px; height: 44px; }
  .swatch input { width: 40px; height: 40px; }
  .sound-chip { width: 40px; height: 40px; }
  .modal-x { width: 44px; height: 44px; }
}
@media (pointer: coarse) {
  .crop-box .h { width: 24px; height: 24px; }
  .crop-box .h.nw { left: -13px; top: -13px; } .crop-box .h.ne { right: -13px; top: -13px; }
  .crop-box .h.sw { left: -13px; bottom: -13px; } .crop-box .h.se { right: -13px; bottom: -13px; }
  .crop-box .h::before { content: ""; position: absolute; inset: -10px; }
  .grip { width: 22px; } .grip.l { left: -14px; } .grip.r { right: -14px; }
  .emoji-row button, .icon-btn { width: 44px; height: 44px; }
  .seg-btn { height: 38px; }
  .dz-tip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* raw error detail under friendly error messages */
.err-detail { margin-top: 8px; font-size: 12px; }
.err-detail summary { cursor: pointer; color: #ff9c9c; }
.err-detail code { display: block; margin-top: 6px; font-family: var(--mono); white-space: pre-wrap; word-break: break-word; color: #f3c9c9; opacity: .85; }
