:root {
    --ink: #111111;
    --ink-2: #3f3f46;
    --sub: #71717a;
    --faint: #a1a1aa;
    --line: #e7e5e4;
    --line-2: #f0efed;
    --bg: #fafaf9;
    --card: #ffffff;
    --accent: #6d4aff;
    --accent-soft: #f1edff;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(17, 17, 17, .04), 0 8px 28px rgba(17, 17, 17, .07);
    --nav-h: 60px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
    margin: 0;
    font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}
/* The hero glow is wider than a phone; clip it without breaking the sticky nav. */
main { overflow-x: clip; }

button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ── buttons ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 38px; padding: 0 16px;
    border-radius: 999px; border: 1px solid transparent;
    font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none;
    transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.dark:hover:not(:disabled) { background: #2b2b2b; }
.btn.line { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn.line:hover { border-color: #cfccc8; }
.btn.line.on { border-color: var(--accent); background: var(--accent-soft); color: #4a2fd6; }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover, .btn.ghost.on { background: rgba(17, 17, 17, .05); }
.btn.sm { height: 34px; padding: 0 13px; font-size: 13px; }

/* ── nav ── */
.nav {
    position: sticky; top: 0; z-index: 20;
    height: var(--nav-h);
    display: flex; align-items: center; gap: 28px;
    padding: 0 28px;
    background: rgba(250, 250, 249, .82);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid transparent;
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.brand svg { width: 24px; height: 24px; }
.nav-links { display: flex; gap: 22px; }
.nav-links a { color: var(--sub); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--ink); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* segmented control (stats page range) */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--line-2); border-radius: 999px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--sub); white-space: nowrap; transition: background .15s, color .15s; }
.seg button:hover { color: var(--ink); }
.seg button.active { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(17, 17, 17, .1); }

/* ── hero ── */
.hero {
    position: relative;
    max-width: 760px; margin: 0 auto;
    padding: 84px 24px 56px;
    display: flex; flex-direction: column; align-items: center; text-align: center;
}
.glow {
    position: absolute; z-index: -1; left: 50%; top: 40px; width: 1100px; height: 520px; transform: translateX(-50%);
    background:
        radial-gradient(closest-side at 30% 55%, rgba(109, 74, 255, .20), transparent),
        radial-gradient(closest-side at 68% 45%, rgba(255, 152, 92, .20), transparent),
        radial-gradient(closest-side at 50% 80%, rgba(255, 94, 160, .12), transparent);
    filter: blur(24px); pointer-events: none;
}
.eyebrow {
    display: inline-block; padding: 6px 12px; border-radius: 999px;
    background: var(--card); border: 1px solid var(--line);
    font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.hero h1 { margin-top: 22px; font-size: clamp(36px, 6vw, 60px); line-height: 1.16; font-weight: 700; letter-spacing: -0.04em; word-break: keep-all; }
.lead { margin-top: 18px; font-size: 18px; line-height: 1.65; color: var(--sub); word-break: keep-all; }
.hero .slot { width: 100%; margin-top: 36px; text-align: left; }

/* ── composer ── */
.composer {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 16px 14px 12px 20px;
    transition: border-color .15s, box-shadow .15s;
}
.composer:focus-within { border-color: #bdbab5; box-shadow: 0 1px 2px rgba(17, 17, 17, .05), 0 12px 36px rgba(17, 17, 17, .1); }
.composer textarea {
    display: block; width: 100%; border: 0; outline: 0; resize: none; background: transparent;
    font-size: 16px; line-height: 1.6; min-height: 58px; max-height: 220px; padding: 0;
}
.composer textarea::placeholder, .input::placeholder { color: var(--faint); }
.composer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.picks { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pick { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--sub); white-space: nowrap; }
.pick select { border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; height: 34px; background: var(--card); color: var(--ink); font-size: 13px; font-weight: 600; }
.composer-hint { margin-top: 10px; padding: 0 6px; font-size: 12.5px; color: var(--faint); line-height: 1.6; word-break: keep-all; }
.over { color: #b42318; }

.panel { margin-top: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.label { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; background: var(--card); font-size: 15px; outline: 0; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17, 17, 17, .06); }
textarea.input { display: block; resize: vertical; line-height: 1.6; }
.hint { margin-top: 8px; font-size: 12.5px; color: var(--faint); line-height: 1.6; word-break: keep-all; }
.knobs { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; }
.range { display: flex; align-items: center; gap: 9px; flex: 1 1 260px; font-size: 13px; color: var(--sub); white-space: nowrap; }
.range b { min-width: 62px; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.range input { flex: 1; min-width: 0; accent-color: var(--ink); }

.note-line { margin-top: 12px; padding: 11px 14px; border-radius: 12px; background: var(--accent-soft); color: #3d2bb0; font-size: 14px; line-height: 1.6; word-break: keep-all; }
.note-line.center { text-align: center; margin-top: 20px; }
.inline { border: 0; background: none; padding: 0; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.form-error { margin-top: 12px; padding: 11px 14px; border-radius: 12px; background: #fef3f2; border: 1px solid #fecdca; color: #b42318; font-size: 14px; }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.chips button {
    word-break: keep-all;
    border: 1px solid var(--line); background: rgba(255, 255, 255, .7); border-radius: 999px;
    padding: 8px 14px; font-size: 13.5px; color: var(--ink-2); transition: border-color .15s, background .15s;
}
.chips button:hover { border-color: #cfccc8; background: #fff; }
.chips button.selected { border-color: var(--accent); background: var(--accent-soft); color: #4a2fd6; }
.engine { margin-top: 18px; font-size: 13px; color: var(--sub); }
.engine::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #22a565; vertical-align: 1px; }
.engine.busy::before { background: #e8a13a; }
.engine.down::before { background: #d92d20; }
.engine:empty { display: none; }

/* ── bands ── */
.band { max-width: 1080px; margin: 0 auto; padding: 64px 24px; }
.band h2 { font-size: clamp(26px, 3.6vw, 36px); font-weight: 700; letter-spacing: -0.035em; text-align: center; }
.band-lead { margin-top: 12px; text-align: center; color: var(--sub); font-size: 16px; line-height: 1.6; word-break: keep-all; text-wrap: balance; }
.band-lead:empty { display: none; }
.tracks-band { max-width: 808px; padding-top: 24px; }
.empty { word-break: keep-all; text-wrap: balance; margin-top: 28px; padding: 34px 20px; text-align: center; color: var(--faint); font-size: 15px; border: 1px dashed #d9d6d2; border-radius: 20px; }

.tracks { list-style: none; margin: 32px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.track { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; text-align: left; }
.track.active { border-color: #cfc5ff; box-shadow: 0 0 0 3px var(--accent-soft); }
.track-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.track-meta { font-size: 13px; color: var(--sub); }
.badge { flex: none; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; background: var(--line-2); color: var(--ink-2); }
.badge.running, .badge.queued { background: var(--accent-soft); color: #4a2fd6; }
.badge.done { background: #e9faf0; color: #067a3a; }
.badge.failed { background: #fef3f2; color: #b42318; }
.track-prompt {
    margin-top: 8px; font-size: 15px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.track-status { margin-top: 10px; font-size: 13.5px; color: var(--sub); line-height: 1.6; word-break: keep-all; }
.track-status.error { color: #b42318; }
.track.active .track-status::after { content: ''; display: inline-block; width: 14px; text-align: left; animation: dots 1.2s steps(4, end) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '·'; } 50% { content: '··'; } 75% { content: '···'; } }
.track audio { display: block; width: 100%; margin-top: 12px; height: 40px; }
.track-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.step-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 26px; }
.step-card .num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; }
.step-card h3 { margin-top: 18px; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.step-card p { margin-top: 8px; color: var(--sub); font-size: 15px; line-height: 1.65; word-break: keep-all; }
.foot { max-width: 1080px; margin: 0 auto; padding: 28px 24px 48px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--faint); line-height: 1.6; word-break: keep-all; }

@media (max-width: 720px) {
    .nav { padding: 0 16px; gap: 14px; }
    .nav-links { display: none; }
    .hero { padding: 48px 16px 40px; }
    .lead { font-size: 16px; }
    .lead br { display: none; }
    .composer { border-radius: 20px; padding: 14px 12px 12px 16px; }
    .composer-row .btn.dark { width: 100%; height: 44px; font-size: 15px; }
    .band { padding: 48px 16px; }
    .tracks-band { padding-top: 16px; }
    .steps { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .track.active .track-status::after { animation: none; content: '···'; }
}
