/* Musico — base: tokens, typography, primitives */
:root {
  --ink-0: #06070a;
  --ink-1: #0b0d12;
  --ink-2: #11141b;
  --ink-3: #171b24;
  --ink-4: #20252f;
  --ink-5: #2c3240;
  --line: rgba(236, 226, 206, 0.07);
  --line-2: rgba(236, 226, 206, 0.12);
  --line-3: rgba(236, 226, 206, 0.2);

  --text: #efe9dd;
  --text-2: #b1ab9f;
  --text-3: #7a766e;
  --text-4: #57544e;

  --brass: #e3c48c;
  --brass-2: #c9a263;
  --brass-glow: rgba(227, 196, 140, 0.22);
  --rh: #ff9170;
  --rh-deep: #e0603d;
  --rh-glow: rgba(255, 145, 112, 0.45);
  --lh: #5fd3c6;
  --lh-deep: #2ea596;
  --lh-glow: rgba(95, 211, 198, 0.45);
  --danger: #ff7a70;
  --ok: #8fdcaa;

  --ivory: #f5efe2;
  --ivory-2: #e6dcc8;
  --paper: #fbf8f1;

  --f-display: "Fraunces", "Iowan Old Style", "Palatino", Georgia, serif;
  --f-ui: "Hanken Grotesk", ui-sans-serif, -apple-system, "Helvetica Neue", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --shadow-1: 0 1px 0 rgba(255,255,255,.04) inset, 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 1px 0 rgba(255,255,255,.05) inset, 0 12px 32px -12px rgba(0,0,0,.7), 0 2px 6px rgba(0,0,0,.35);
  --shadow-3: 0 30px 80px -24px rgba(0,0,0,.85), 0 8px 24px -8px rgba(0,0,0,.6);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink-1);
  color: var(--text);
  font: 15px/1.5 var(--f-ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
}
/* concert-hall atmosphere: a warm stage light from above + fine grain */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(1200px 520px at 50% -180px, rgba(227,196,140,.10), transparent 70%),
    radial-gradient(900px 600px at 110% 110%, rgba(95,211,198,.035), transparent 60%),
    radial-gradient(900px 600px at -10% 100%, rgba(255,145,112,.03), transparent 60%);
}
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#app { position: relative; z-index: 1; min-height: 100%; }

h1, h2, h3 { font-family: var(--f-display); font-weight: 400; letter-spacing: -0.015em; margin: 0; }
p { margin: 0; }
a { color: var(--brass); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
::selection { background: rgba(227,196,140,.35); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--f-mono); font-feature-settings: "zero" 0; letter-spacing: -0.01em; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { font: 600 11px/1 var(--f-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none !important; }
.brand svg.mark { width: 30px; height: 30px; flex: none; filter: drop-shadow(0 4px 10px rgba(227,196,140,.18)); }
.brand .word { font: 500 23px/1 var(--f-display); font-variation-settings: "opsz" 144, "SOFT" 50; letter-spacing: -0.02em; }
.brand .word i { font-style: italic; color: var(--brass); font-weight: 400; }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--ink-3); --bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--bd); color: var(--text);
  font: 600 13.5px/1 var(--f-ui); letter-spacing: .005em; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-1);
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease), box-shadow .2s var(--ease), color .18s;
}
.btn:hover { --bg: var(--ink-4); --bd: var(--line-3); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary {
  --bg: linear-gradient(180deg, #ecd3a2, #d2ad6c); --bd: rgba(255,230,180,.5);
  background: var(--bg); color: #1d160b; box-shadow: 0 1px 0 rgba(255,255,255,.45) inset, 0 8px 22px -8px rgba(227,196,140,.55);
}
.btn.primary:hover { filter: brightness(1.05); box-shadow: 0 1px 0 rgba(255,255,255,.45) inset, 0 12px 28px -8px rgba(227,196,140,.7); }
.btn.ghost { --bg: transparent; --bd: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { --bg: rgba(255,255,255,.05); color: var(--text); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; }
.icon-btn {
  width: 36px; height: 36px; padding: 0; border-radius: 10px; display: inline-grid; place-items: center;
  background: transparent; border: 1px solid transparent; color: var(--text-2); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .15s var(--ease);
}
.icon-btn:hover { background: rgba(255,255,255,.06); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn[aria-pressed="true"] { color: var(--brass); background: rgba(227,196,140,.1); border-color: rgba(227,196,140,.25); }
.icon-btn[disabled] { opacity: .35; cursor: not-allowed; }

/* ---------- chips / badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px;
  font: 500 11.5px/1 var(--f-mono); color: var(--text-2); background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px;
  font: 600 10.5px/1 var(--f-ui); letter-spacing: .08em; text-transform: uppercase; }
.badge.warn { color: #f3c77a; background: rgba(243,199,122,.1); border: 1px solid rgba(243,199,122,.22); }
.badge.danger { color: var(--danger); background: rgba(255,122,112,.1); border: 1px solid rgba(255,122,112,.22); }
.badge.ok { color: var(--ok); background: rgba(143,220,170,.08); border: 1px solid rgba(143,220,170,.2); }
.badge.brass { color: var(--brass); background: rgba(227,196,140,.08); border: 1px solid rgba(227,196,140,.22); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }

/* ---------- segmented control ---------- */
.seg { position: relative; display: inline-flex; padding: 3px; border-radius: 999px; background: var(--ink-0); border: 1px solid var(--line-2);
  box-shadow: 0 1px 0 rgba(255,255,255,.03), inset 0 1px 3px rgba(0,0,0,.5); }
.seg button { position: relative; z-index: 1; height: 30px; padding: 0 14px; border: 0; background: none; border-radius: 999px; cursor: pointer;
  font: 600 12.5px/1 var(--f-ui); color: var(--text-3); transition: color .2s var(--ease); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text-2); }
.seg button[aria-checked="true"] { color: var(--text); }
.seg .thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; border-radius: 999px;
  background: linear-gradient(180deg, var(--ink-5), var(--ink-4)); border: 1px solid var(--line-3);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 4px 12px -4px rgba(0,0,0,.7);
  transition: left .32s var(--ease-spring), width .32s var(--ease-spring); }
.seg button .pip { width: 7px; height: 7px; border-radius: 50%; }

/* ---------- toasts ---------- */
#toasts { position: fixed; top: 18px; right: 18px; max-height: calc(100vh - 36px); overflow: hidden; z-index: 100; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { pointer-events: auto; min-width: 260px; max-width: 380px; padding: 12px 14px 12px 14px; border-radius: 14px;
  background: rgba(23,27,36,.92); backdrop-filter: blur(14px); border: 1px solid var(--line-2); box-shadow: var(--shadow-3);
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; font-size: 13.5px;
  animation: toast-in .4s var(--ease-spring) both; }
.toast.out { animation: toast-out .25s var(--ease) both; }
.toast .t-ico { width: 18px; height: 18px; margin-top: 1px; color: var(--brass); }
.toast.error .t-ico { color: var(--danger); }
.toast b { display: block; font-weight: 600; margin-bottom: 2px; }
.toast span { color: var(--text-2); }
.toast .x { background: none; border: 0; color: var(--text-3); cursor: pointer; padding: 0; width: 18px; height: 18px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(12px); } }

/* ---------- misc ---------- */
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(227,196,140,.2); border-top-color: var(--brass); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.view-enter { animation: view-in .5s var(--ease) backwards; } /* not "both": a lasting transform would trap position:fixed children (the drop veil) */
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
select.select {
  appearance: none; height: 34px; padding: 0 34px 0 12px; border-radius: 10px; background: var(--ink-0) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b1ab9f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--line-2); font-size: 13px; cursor: pointer; width: 100%;
}
select.select:hover { border-color: var(--line-3); }
#print-root { position: fixed; left: -12000px; top: 0; width: 740px; visibility: hidden; pointer-events: none; }

.studio ~ #toasts, body:has(.view.studio) #toasts { top: 78px; }
