/* Kumo — shared styles for the landing page and the studio.
   Layout: studio = 232px sidebar · main column · 360px side panel; landing = 1200px column. */
:root {
  --bg: #f7f7f4; --surface: #ffffff; --sunk: #f0f0ec; --hover: #ebebe6; --ink: #15171a; --ink2: #3b3e44;
  --muted: #6c7077; --faint: #9a9da3; --line: #e3e3dd; --line2: #d4d4cd;
  --accent: #2f4bff; --accent-soft: #e8ebff; --accent-ink: #1f33c7; --ok: #1d8656; --warn: #a96500; --bad: #c3362a;
  --btn: #15171a; --btn-ink: #ffffff; --shadow: 0 1px 2px rgba(20, 22, 26, .06), 0 8px 28px rgba(20, 22, 26, .08);
  --font: "Hanken Grotesk", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --r: 12px; --r-s: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111214; --surface: #18191c; --sunk: #202125; --hover: #26282c; --ink: #f0f0ec; --ink2: #d0d1cd;
    --muted: #9b9fa6; --faint: #6f737a; --line: #2a2c30; --line2: #373a3f;
    --accent: #8096ff; --accent-soft: #1f2547; --accent-ink: #aab8ff; --ok: #4cc48b; --warn: #e3a646; --bad: #ff7b6e;
    --btn: #f0f0ec; --btn-ink: #121315; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111214; --surface: #18191c; --sunk: #202125; --hover: #26282c; --ink: #f0f0ec; --ink2: #d0d1cd;
  --muted: #9b9fa6; --faint: #6f737a; --line: #2a2c30; --line2: #373a3f;
  --accent: #8096ff; --accent-soft: #1f2547; --accent-ink: #aab8ff; --ok: #4cc48b; --warn: #e3a646; --bad: #ff7b6e;
  --btn: #f0f0ec; --btn-ink: #121315; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
h1, h2, h3 { text-wrap: balance; margin: 0; letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tnum { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* buttons & chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line2); background: var(--surface); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.btn.primary:hover { opacity: .88; background: var(--btn); }
.btn.primary:disabled { opacity: .35; cursor: not-allowed; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn svg { width: 16px; height: 16px; flex: none; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; display: inline-grid; place-items: center; color: var(--ink2); }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.on { color: var(--accent); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 500; color: var(--ink2); white-space: nowrap; }
.chip:hover { border-color: var(--line2); background: var(--hover); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip svg { width: 15px; height: 15px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--sunk); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.ok { color: var(--ok); }
.pill.accent { background: var(--accent-soft); color: var(--accent-ink); }
.kbd { font-size: 11px; padding: 1px 5px; border: 1px solid var(--line2); border-radius: 4px; color: var(--muted); }

/* voice avatar: rounded tile with a small waveform in the voice's hue */
.av { --h: 220; position: relative; width: 36px; height: 36px; flex: none; border-radius: 10px; background: hsl(var(--h) 70% 93%); display: grid; place-items: center; border: 0; padding: 0; color: hsl(var(--h) 55% 38%); }
:root[data-theme="dark"] .av { background: hsl(var(--h) 30% 20%); color: hsl(var(--h) 70% 72%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .av { background: hsl(var(--h) 30% 20%); color: hsl(var(--h) 70% 72%); } }
.av .bars { display: flex; gap: 2px; align-items: center; height: 16px; }
.av .bars i { width: 3px; border-radius: 2px; background: currentColor; }
.av .bars i:nth-child(1) { height: 6px; } .av .bars i:nth-child(2) { height: 13px; } .av .bars i:nth-child(3) { height: 16px; } .av .bars i:nth-child(4) { height: 10px; } .av .bars i:nth-child(5) { height: 5px; }
.av .play { position: absolute; inset: 0; border-radius: inherit; display: grid; place-items: center; background: var(--btn); color: var(--btn-ink); opacity: 0; transition: opacity .12s; }
.av .play svg { width: 14px; height: 14px; }
.av:hover .play, .av.playing .play { opacity: 1; }
.av.playing .bars i { animation: bounce .9s ease-in-out infinite; }
.av.lg { width: 48px; height: 48px; border-radius: 13px; }
@keyframes bounce { 50% { transform: scaleY(.45); } }
.av.playing .bars i:nth-child(2) { animation-delay: .15s; } .av.playing .bars i:nth-child(3) { animation-delay: .3s; } .av.playing .bars i:nth-child(4) { animation-delay: .45s; }

/* form controls */
.field { display: grid; gap: 8px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink2); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.input, .select { height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 0 12px; width: 100%; }
.input:focus, .select:focus { border-color: var(--accent); outline: none; }
.range { width: 100%; accent-color: var(--ink); }
.range-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line2); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(16px); }
:root[data-theme="dark"] .switch input:checked + span::after { background: var(--bg); }

/* menus, dialogs, toast */
.menu { position: fixed; z-index: 60; min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: grid; }
.menu button { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; font-size: 14px; }
.menu button:hover, .menu button.on { background: var(--hover); }
.menu button small { margin-left: auto; color: var(--muted); font-size: 12px; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.menu .mh { font-size: 12px; color: var(--muted); padding: 6px 10px 2px; font-weight: 600; }
dialog.dlg { border: 0; padding: 0; border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); max-width: min(560px, calc(100vw - 32px)); width: 100%; }
dialog.dlg::backdrop { background: rgba(10, 11, 13, .45); }
.dlg-body { padding: 24px; display: grid; gap: 16px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--btn); color: var(--btn-ink); padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.bar-progress { height: 4px; border-radius: 4px; background: var(--sunk); overflow: hidden; }
.bar-progress i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: rot .8s linear infinite; flex: none; }
@keyframes rot { to { transform: rotate(360deg); } }

/* wordmark */
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; letter-spacing: -0.03em; text-decoration: none; color: var(--ink); }
.brand .mark { width: 26px; height: 26px; border-radius: 8px; background: var(--ink); color: var(--bg); display: grid; place-items: center; }
.brand .mark svg { width: 16px; height: 16px; }
