/* Cream ai Hub — motion graphic studio chrome.
   Warm ivory ink on a near-black studio; amber is the only accent. */

@font-face {
  font-family: 'Pretendard';
  src: url('../assets/PretendardVariable.woff2') format('woff2-variations');
  font-weight: 45 920;
  font-style: normal;
  font-display: block;
}

:root {
  --ink: #08080A;
  --ink-2: #0E0E12;
  --panel: #111114;
  --cream: #FBF6EA;
  --cream-dim: rgba(251, 246, 234, 0.62);
  --cream-mute: rgba(251, 246, 234, 0.40);
  --line: rgba(251, 246, 234, 0.11);
  --line-2: rgba(251, 246, 234, 0.06);
  --amber: #E8A33D;
  --amber-hi: #F8CE84;
  --font: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --bar-h: 62px;
  --tp-h: 66px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
html { background: var(--ink); }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--cream);
  background:
    radial-gradient(1100px 620px at 78% -8%, rgba(232, 163, 61, 0.10), transparent 62%),
    radial-gradient(760px 520px at 8% 108%, rgba(232, 163, 61, 0.05), transparent 60%),
    var(--ink);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
::selection { background: var(--amber); color: var(--ink); }

/* ---------------- top bar ---------------- */
.topbar {
  flex: 0 0 auto;
  min-height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px 0 20px;
  border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(11, 11, 14, 0.92), rgba(8, 8, 10, 0.72));
  backdrop-filter: blur(14px);
  z-index: 5;
}
.tb-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  color: var(--ink);
  background: linear-gradient(150deg, var(--amber-hi), var(--amber) 62%, #C8801F);
  box-shadow: 0 4px 14px rgba(232, 163, 61, 0.24);
  flex: 0 0 auto;
}
.logo-mark svg { width: 19px; height: 19px; }
.wordmark { display: inline-flex; align-items: baseline; gap: 5px; letter-spacing: -0.7px; white-space: nowrap; }
.wordmark b { font-weight: 780; font-size: 18px; }
.wordmark i { font-style: normal; font-weight: 420; font-size: 15px; color: var(--cream-dim); }
.tb-tag {
  margin-left: 4px; padding: 2px 7px; border-radius: 5px;
  font-size: 9.5px; font-weight: 640; letter-spacing: 1.6px;
  color: var(--cream-mute); border: 1px solid var(--line);
}
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.seg {
  display: inline-flex; gap: 2px; padding: 3px;
  border: 1px solid var(--line); border-radius: 12px; background: rgba(251, 246, 234, 0.03);
}
.seg button {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px; border-radius: 9px;
  font-size: 12.5px; font-weight: 560; letter-spacing: -0.1px;
  color: var(--cream-dim);
  transition: background 160ms, color 160ms, box-shadow 160ms;
  white-space: nowrap;
}
.seg button:hover { color: var(--cream); background: rgba(251, 246, 234, 0.05); }
.seg button.on {
  color: var(--ink); background: var(--cream);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, 0 4px 14px rgba(0, 0, 0, 0.35);
  font-weight: 700;
}
.seg-ico { display: inline-flex; }
.seg button b { font-weight: 700; font-variant-numeric: tabular-nums; }
.seg button i { font-style: normal; font-weight: 450; opacity: 0.6; margin-left: 4px; }
.ico-l, .ico-p { display: block; border: 1.4px solid currentColor; border-radius: 2px; }
.ico-l { width: 15px; height: 9px; }
.ico-p { width: 8px; height: 13px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--cream-dim);
  transition: color 150ms, background 150ms, border-color 150ms;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { color: var(--cream); background: rgba(251, 246, 234, 0.05); }
.icon-btn[aria-pressed="true"] { color: var(--amber); border-color: rgba(232, 163, 61, 0.42); background: rgba(232, 163, 61, 0.09); }

.mix { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; }
.mix button {
  height: 28px; padding: 0 9px; white-space: nowrap; border-radius: 8px;
  font-size: 11px; font-weight: 620; letter-spacing: 0.4px;
  color: var(--cream-mute);
  transition: color 150ms, background 150ms;
}
.mix button:hover { color: var(--cream); }
.mix button[aria-pressed="true"] { color: var(--cream); background: rgba(251, 246, 234, 0.09); }
.mix button[aria-pressed="false"] { text-decoration: line-through; text-decoration-thickness: 1px; opacity: 0.55; }

.dl-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 15px 0 12px; border-radius: 10px;
  background: var(--amber); color: #21160A;
  font-size: 12.5px; font-weight: 720; letter-spacing: -0.1px;
  box-shadow: 0 6px 20px rgba(232, 163, 61, 0.22);
  transition: transform 140ms, background 140ms, opacity 140ms;
}
.dl-btn svg { width: 17px; height: 17px; }
.dl-btn:hover { background: var(--amber-hi); transform: translateY(-1px); }
.dl-btn:active { transform: translateY(0); }
.dl-btn[disabled] { opacity: 0.45; pointer-events: none; }

/* ---------------- stage ---------------- */
.stage {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  position: relative;
}
.frame {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(251, 246, 234, 0.09);
  transition: width 260ms cubic-bezier(.22,.9,.28,1), height 260ms cubic-bezier(.22,.9,.28,1);
}
.frame canvas { display: block; width: 100%; height: 100%; }
.frame.switching { animation: dip 280ms ease; }
@keyframes dip { 0% { opacity: 1; } 42% { opacity: 0.35; } 100% { opacity: 1; } }

.sound-hint {
  position: absolute; right: 14px; bottom: 14px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px 9px 11px; border-radius: 999px;
  background: rgba(8, 8, 10, 0.66); backdrop-filter: blur(10px);
  border: 1px solid rgba(251, 246, 234, 0.16);
  color: var(--cream); font-size: 12px; font-weight: 560;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: hintIn 520ms 900ms both cubic-bezier(.2,.9,.3,1);
  transition: opacity 240ms, transform 240ms;
}
.sound-hint svg { width: 17px; height: 17px; color: var(--amber); }
.sound-hint:hover { border-color: rgba(232, 163, 61, 0.5); }
.sound-hint.gone { opacity: 0; transform: translateY(6px); pointer-events: none; }
@keyframes hintIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* record overlay */
.rec {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  width: min(440px, calc(100% - 32px));
  padding: 13px 15px 14px;
  border-radius: 14px;
  background: rgba(10, 10, 13, 0.88);
  border: 1px solid rgba(251, 246, 234, 0.14);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  z-index: 4;
}
.rec-top { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.rec-dot { width: 7px; height: 7px; border-radius: 50%; background: #E8574B; box-shadow: 0 0 0 4px rgba(232, 87, 75, 0.16); animation: pulse 1.4s infinite ease-in-out; }
@keyframes pulse { 50% { opacity: 0.35; } }
.rec-label { font-weight: 620; color: var(--cream); }
.rec-pct { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--cream-dim); font-size: 11.5px; }
.rec-cancel { padding: 4px 9px; border-radius: 7px; border: 1px solid var(--line); font-size: 11px; color: var(--cream-dim); }
.rec-cancel:hover { color: var(--cream); border-color: rgba(251, 246, 234, 0.3); }
.rec-track { margin-top: 10px; height: 3px; border-radius: 3px; background: rgba(251, 246, 234, 0.12); overflow: hidden; }
.rec-track i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--amber), var(--amber-hi)); transition: width 140ms linear; }
.rec-note { margin-top: 9px; font-size: 11px; color: var(--cream-mute); line-height: 1.5; }
.rec-actions { margin-top: 9px; }
.rec-link { font-size: 11.5px; color: var(--amber-hi); text-decoration: underline; text-underline-offset: 3px; }

/* ---------------- transport ---------------- */
.transport {
  flex: 0 0 auto;
  min-height: var(--tp-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px 6px;
  border-top: 1px solid var(--line-2);
  background: rgba(8, 8, 10, 0.6);
  position: relative;
  z-index: 5;
}
.tp-btn {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; color: var(--cream-dim);
  transition: color 140ms, background 140ms;
}
.tp-btn svg { width: 18px; height: 18px; }
.tp-btn:hover { color: var(--cream); background: rgba(251, 246, 234, 0.06); }
.tp-btn.play { width: 40px; height: 40px; background: var(--cream); color: var(--ink); border-radius: 11px; }
.tp-btn.play:hover { background: #fff; }
.tp-btn.play svg { width: 16px; height: 16px; }

.chips { display: flex; align-items: center; gap: 3px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 9px; border-radius: 7px;
  font-size: 11.5px; font-weight: 520; color: var(--cream-mute);
  white-space: nowrap; transition: color 140ms, background 140ms;
}
.chip b { font-weight: 620; font-size: 10px; letter-spacing: 0.4px; color: rgba(251, 246, 234, 0.30); font-variant-numeric: tabular-nums; }
.chip:hover { color: var(--cream); background: rgba(251, 246, 234, 0.05); }
.chip.on { color: var(--cream); background: rgba(251, 246, 234, 0.09); }
.chip.on b { color: var(--amber); }

.tp-time { font-size: 11.5px; color: var(--cream-mute); font-variant-numeric: tabular-nums; letter-spacing: 0.2px; white-space: nowrap; }
.tp-time #tCur { color: var(--cream); }
.tp-sep { margin: 0 4px; opacity: 0.5; }

.speed-wrap { position: relative; }
.speed-btn {
  height: 28px; min-width: 42px; padding: 0 9px; border-radius: 7px;
  border: 1px solid var(--line); font-size: 11.5px; font-weight: 620;
  color: var(--cream-dim); font-variant-numeric: tabular-nums;
}
.speed-btn:hover { color: var(--cream); border-color: rgba(251, 246, 234, 0.24); }
.speed-menu {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 2px; padding: 5px;
  border-radius: 11px; background: #131317; border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6); z-index: 9; min-width: 86px;
}
.speed-menu[hidden] { display: none; }
.speed-menu button { height: 28px; padding: 0 10px; border-radius: 7px; font-size: 11.5px; color: var(--cream-dim); text-align: left; font-variant-numeric: tabular-nums; }
.speed-menu button:hover { background: rgba(251, 246, 234, 0.07); color: var(--cream); }
.speed-menu button.on { background: rgba(232, 163, 61, 0.16); color: var(--amber-hi); font-weight: 680; }

.track {
  flex: 1 1 auto; min-width: 90px; height: 26px; position: relative;
  display: flex; align-items: center; cursor: pointer; touch-action: none;
}
.track::before {
  content: ''; position: absolute; left: 0; right: 0; height: 3px; border-radius: 3px;
  background: rgba(251, 246, 234, 0.13);
}
.track .fill { position: absolute; left: 0; height: 3px; border-radius: 3px; width: 0; background: linear-gradient(90deg, rgba(232,163,61,0.55), var(--amber)); }
.track .head { position: absolute; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--amber-hi); transform: translateX(-4.5px); box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.18); }
.track .ticks { position: absolute; inset: 0; pointer-events: none; }
.track .ticks i { position: absolute; top: 50%; width: 1px; height: 7px; background: rgba(251, 246, 234, 0.22); transform: translateY(-50%); }

/* ---------------- responsive ---------------- */
@media (max-width: 900px) {
  .tb-tag { display: none; }
  .topbar { gap: 10px; padding: 0 12px; }
  .wordmark b { font-size: 16px; }
  .seg button { padding: 0 10px; font-size: 11.5px; }
  .dl-btn span { display: none; }
  .dl-btn { padding: 0 11px; }
  .transport { gap: 8px; padding: 0 12px 6px; }
  .chips { display: none; }
  .tp-time { font-size: 11px; }
}
@media (max-width: 620px) {
  .tb-left .wordmark { display: none; }
  .tb-left { gap: 6px; }
  .topbar { gap: 6px; padding: 0 8px; }
  .tb-right { gap: 5px; }
  .mix button { padding: 0 6px; font-size: 10px; letter-spacing: 0; height: 26px; }
  .mix { padding: 2px; }
  .seg { padding: 2px; }
  .seg button { font-size: 11px; padding: 0 7px; gap: 5px; height: 30px; }
  .seg button i { display: none; }
  .icon-btn { width: 32px; height: 32px; border-radius: 9px; }
  .icon-btn svg { width: 17px; height: 17px; }
  .dl-btn { height: 32px; padding: 0 9px; }
  .stage { padding: 8px; }
  .transport { gap: 6px; padding: 0 10px 4px; }
  .tp-time { font-size: 10.5px; }
  .sound-hint { padding: 7px 12px 7px 9px; font-size: 11px; right: 10px; bottom: 10px; }
  .sound-hint svg { width: 15px; height: 15px; }
}
@media (max-height: 520px) {
  .topbar { min-height: 48px; }
  .transport { min-height: 52px; }
}

/* recording preview canvas */
.frame canvas.reccv { position: absolute; inset: 0; width: 100%; height: 100%; }
body.recording .sound-hint { opacity: 0; pointer-events: none; }
