/* ═══════════════════════════════════════════════════════════
   미래 설계소! 유런이 — 플랫폼 공통 디자인 시스템
   Dark Mode · Neon Mint/Purple · Rounded · Mobile-first
   ═══════════════════════════════════════════════════════════ */
:root {
  color-scheme: dark;
  --bg: #0b0f17;
  --surface: #131925;
  --surface-2: #1a2130;
  --line: rgb(255 255 255 / 0.08);
  --line-strong: rgb(255 255 255 / 0.16);
  --text: #eef2f8;
  --muted: #94a3b8;
  --mint: #2dd4bf;
  --mint-soft: rgb(45 212 191 / 0.14);
  --purple: #8b5cf6;
  --purple-soft: rgb(139 92 246 / 0.16);
  --warm: #fbbf24;
  --grad: linear-gradient(120deg, var(--mint), var(--purple));
  --radius: 0.5rem;      /* rounded-lg */
  --radius-xl: 1rem;
  --shadow-glow: 0 0 0 1px rgb(45 212 191 / 0.25), 0 12px 40px -12px rgb(139 92 246 / 0.45);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(700px 400px at 10% -10%, rgb(139 92 246 / 0.18), transparent 70%),
    radial-gradient(600px 400px at 100% 0%, rgb(45 212 191 / 0.12), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: 'Pretendard', 'Inter', 'Noto Sans KR', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

/* ───────── Header ───────── */
.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(16px);
  background: rgb(11 15 23 / 0.82);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 1rem; height: 4rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1.35rem; letter-spacing: .02em; white-space: nowrap; }
.brand b { color: var(--mint); }
.nav { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: .5rem .8rem; border-radius: var(--radius);
  font-size: .9rem; font-weight: 600; color: var(--muted); white-space: nowrap;
  transition: color .2s, background .2s;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--mint); background: var(--mint-soft); }
@media (max-width: 720px) {
  .site-header__inner { height: auto; padding-block: .6rem; flex-wrap: wrap; }
  .nav { width: 100%; }
}

/* ───────── Layout ───────── */
.page { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.page-head { margin-bottom: 1.5rem; }
.eyebrow { font-family: 'Outfit', sans-serif; font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--mint); font-weight: 700; margin: 0 0 .4rem; }
.page-title { font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 800; margin: 0; letter-spacing: -.02em; }
.page-desc { color: var(--muted); margin: .4rem 0 0; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .65rem 1.1rem; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--surface-2);
  font-weight: 700; font-size: .9rem;
  transition: transform .15s var(--ease), border-color .2s, background .2s, box-shadow .2s;
}
.btn:hover { border-color: var(--mint); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { border: 0; background: var(--grad); color: #071016; box-shadow: 0 8px 24px -8px rgb(45 212 191 / .6); }
.btn--primary:hover { box-shadow: 0 10px 30px -6px rgb(139 92 246 / .7); }
.btn--ghost { background: transparent; }
.btn--sm { padding: .45rem .75rem; font-size: .8rem; }

/* ───────── Tabs & Pills ───────── */
.tabs { display: inline-flex; padding: .25rem; gap: .25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tab {
  padding: .55rem 1rem; border: 0; border-radius: calc(var(--radius) - 2px);
  background: transparent; font-weight: 700; font-size: .9rem; color: var(--muted);
  transition: background .2s, color .2s;
}
.tab[aria-selected="true"] { background: var(--grad); color: #071016; }
.pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.pill {
  padding: .45rem .95rem; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: .85rem; font-weight: 600; color: var(--muted);
  transition: all .2s;
}
.pill:hover { color: var(--text); border-color: var(--mint); }
.pill[aria-pressed="true"] { color: #071016; background: var(--mint); border-color: var(--mint); }

/* Toggle switch */
.switch { display: inline-flex; align-items: center; gap: .6rem; font-size: .85rem; font-weight: 600; color: var(--muted); cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 2.6rem; height: 1.45rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-strong); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: var(--text); transition: transform .25s var(--ease); }
.switch input:checked { background: var(--purple); }
.switch input:checked::after { transform: translateX(1.15rem); }

/* ───────── Cards ───────── */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.card--interactive { cursor: pointer; text-align: left; padding: 0; width: 100%; }
.card--interactive:hover { transform: translateY(-4px); border-color: rgb(45 212 191 / .4); box-shadow: var(--shadow-glow); }

/* 생성형 썸네일 (이미지 등록 전 기본 커버) */
.thumb {
  position: relative; aspect-ratio: 16 / 9;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 25% 20%, hsl(var(--h) 90% 65% / .55), transparent 55%),
    radial-gradient(circle at 80% 85%, hsl(calc(var(--h) + 60) 85% 55% / .45), transparent 55%),
    linear-gradient(135deg, hsl(var(--h) 45% 16%), hsl(calc(var(--h) + 40) 45% 10%));
  font-size: 3rem;
}
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb__play {
  position: absolute; width: 3rem; height: 3rem; border-radius: 50%;
  display: grid; place-items: center; background: rgb(0 0 0 / .55); backdrop-filter: blur(4px);
  font-size: 1rem; opacity: 0; transform: scale(.8); transition: all .25s var(--ease);
}
.card--interactive:hover .thumb__play { opacity: 1; transform: scale(1); }

.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .2rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--purple-soft); color: #c4b5fd; }
.badge--mint { background: var(--mint-soft); color: var(--mint); }
.muted { color: var(--muted); }
.empty { padding: 3rem 1rem; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* ───────── Dialog (native <dialog>) ───────── */
dialog.modal {
  width: min(92vw, 760px); max-height: 90dvh;
  padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-xl);
  background: var(--surface); color: var(--text);
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / .8);
  opacity: 0; transform: translateY(16px) scale(.98);
  transition: opacity .25s var(--ease), transform .25s var(--ease), overlay .25s allow-discrete, display .25s allow-discrete;
}
dialog.modal[open] { opacity: 1; transform: none; }
@starting-style { dialog.modal[open] { opacity: 0; transform: translateY(16px) scale(.98); } }
dialog.modal::backdrop { background: rgb(3 6 12 / .75); backdrop-filter: blur(6px); }
dialog.modal--sm { width: min(92vw, 460px); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.modal__title { margin: 0; font-size: 1.05rem; font-weight: 800; }
.modal__body { padding: 1.25rem; overflow-y: auto; }
.modal__foot { display: flex; justify-content: flex-end; gap: .5rem; padding: 1rem 1.25rem; border-top: 1px solid var(--line); }
.icon-btn { width: 2.25rem; height: 2.25rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--mint); }

/* ───────── Form ───────── */
.field { display: grid; gap: .4rem; margin-bottom: 1rem; }
.field label { font-size: .85rem; font-weight: 700; }
.input, .textarea, .select {
  width: 100%; padding: .7rem .85rem; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--line-strong); color: var(--text); font: inherit;
}
.textarea { min-height: 9rem; resize: vertical; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-soft); }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; cursor: pointer; }
.check input { accent-color: var(--mint); width: 1.1rem; height: 1.1rem; margin-top: .15rem; }

/* ───────── Toast ───────── */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; z-index: 100;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: .75rem 1.1rem; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--mint); font-weight: 600; font-size: .9rem;
  transition: all .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
