/* ─────────────────────────────────────────────
   반짝 노트 — 공통 디자인 (밤의 작업실)
   어두운 점 격자 책상 위에 종이·테이프·손글씨가 놓인 느낌을 모든 화면이 함께 쓴다.
   ───────────────────────────────────────────── */
:root {
  --bg: #17181d;
  --bg-2: #1d1e25;
  --panel: #23242b;
  --panel-2: #2b2d3a;
  --glass: rgba(28, 29, 36, .66);
  --line: rgba(255, 255, 255, .12);
  --line-2: rgba(255, 255, 255, .2);

  --ink: #ececf1;
  --ink-2: #b9bac4;
  --ink-3: #8b8da0;
  --ink-4: #6f717e;

  --paper: #f5f2ea;
  --paper-2: #ebe6d8;
  --paper-ink: #232019;
  --paper-ink-2: #5d574a;
  --paper-ink-3: #8a8474;

  --peri: #7c8cf8;
  --peri-2: #a5b1ff;
  --lilac: #d78cf8;
  --yellow: #ffd77a;
  --pink: #ffb1c9;
  --mint: #8be9b7;
  --sky: #9fd0ff;
  --coral: #ff8a73;
  --danger: #ff7a7a;

  --font-body: "Noto Sans KR", Inter, system-ui, -apple-system, "Malgun Gothic", sans-serif;
  --font-display: "Jua", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --font-hand: "Nanum Pen Script", "Jua", cursive;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --shadow-1: 0 10px 24px rgba(0, 0, 0, .4);
  --shadow-2: 0 16px 40px rgba(0, 0, 0, .5);
  --ease-pop: cubic-bezier(.22, 1.4, .36, 1);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100%;
  font-family: var(--font-body);
  font-size: 16px; line-height: 1.6;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* 점 격자 책상 */
.desk {
  background-color: var(--bg);
  background-image: radial-gradient(rgba(255, 255, 255, .13) 1.1px, transparent 1.6px);
  background-size: 28px 28px;
}
.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .42) 100%);
}

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 99px;
  font-family: var(--font-display); font-size: 16px; letter-spacing: .01em; white-space: nowrap; text-decoration: none;
  color: var(--ink); background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .14);
  transition: background .2s, transform .2s var(--ease-pop), box-shadow .2s, opacity .2s;
  user-select: none; -webkit-user-select: none;
}
.btn:hover { background: rgba(255, 255, 255, .17); }
.btn:active { transform: scale(.96); }
.btn:focus-visible { outline: 3px solid var(--peri-2); outline-offset: 3px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.primary {
  color: #14151a; border-color: transparent;
  background: linear-gradient(100deg, var(--peri-2), var(--lilac));
  box-shadow: 0 8px 22px rgba(124, 140, 248, .38);
}
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 10px 28px rgba(160, 140, 248, .5); }
.btn.sun {
  color: #3a2c05; border-color: transparent;
  background: linear-gradient(100deg, #ffe49a, var(--yellow));
  box-shadow: 0 8px 22px rgba(255, 215, 122, .3);
}
.btn.sun:hover { filter: brightness(1.05); }
.btn.ink {                      /* 종이 위에 놓이는 어두운 버튼 */
  color: var(--paper); background: #26262e; border-color: transparent;
  box-shadow: 0 8px 18px rgba(35, 32, 25, .28);
}
.btn.ink:hover { background: #33343f; }
.btn.paper { color: var(--paper-ink); background: rgba(35, 32, 25, .07); border-color: rgba(35, 32, 25, .14); }
.btn.paper:hover { background: rgba(35, 32, 25, .13); }
.btn.danger { color: #ffd9d9; background: rgba(255, 122, 122, .14); border-color: rgba(255, 122, 122, .34); }
.btn.danger:hover { background: rgba(255, 122, 122, .26); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.big { min-height: 54px; padding: 0 28px; font-size: 19px; }
.btn.block { width: 100%; }

/* ── 입력 ── */
.field { display: block; }
.field > span {
  display: block; margin-bottom: 7px;
  font-family: var(--font-display); font-size: 15px; color: var(--paper-ink-2);
}
.input {
  width: 100%; min-height: 52px; padding: 0 18px; border-radius: 14px;
  font-size: 18px; font-weight: 500; color: var(--paper-ink);
  background: #fff; border: 2px solid rgba(35, 32, 25, .14); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: #b3ad9d; font-weight: 400; }
.input:focus { border-color: var(--peri); box-shadow: 0 0 0 4px rgba(124, 140, 248, .22); }
.input.dark {
  color: var(--ink); background: rgba(255, 255, 255, .06); border-color: var(--line);
}
.input.dark::placeholder { color: var(--ink-4); }
.input.dark:focus { border-color: var(--peri); }

/* ── 종이 · 테이프 ── */
.paper-card {
  position: relative; background: var(--paper); color: var(--paper-ink);
  border-radius: 6px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .3);
}
.tape-strip {
  position: absolute; width: 112px; height: 30px; pointer-events: none;
  background: rgba(226, 220, 196, .5);
  border-left: 1px dashed rgba(0, 0, 0, .14); border-right: 1px dashed rgba(0, 0, 0, .14);
  box-shadow: 0 2px 5px rgba(0, 0, 0, .18);
}
.tape-strip.mint { background: rgba(150, 222, 200, .5); }
.tape-strip.pink { background: rgba(255, 177, 201, .5); }

/* ── 유리 패널 ── */
.glass {
  background: var(--glass); border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .4);
}

/* ── 모달 ── */
.modal-back {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px;
  background: rgba(10, 10, 14, .62);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  animation: fade-in .22s ease both;
  overflow-y: auto;
}
.modal {
  position: relative; width: min(100%, 520px); padding: 34px 32px 28px;
  animation: modal-in .38s var(--ease-pop) both;
}
.modal h2 { font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1.3; }
.modal .lead { margin-top: 6px; font-size: 15px; color: var(--paper-ink-2); }
.modal .close-x {
  position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-size: 18px; color: var(--paper-ink-3);
  transition: background .2s;
}
.modal .close-x:hover { background: rgba(35, 32, 25, .08); }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(.96) rotate(-1.5deg) } to { opacity: 1; transform: none } }

/* ── 토스트 ── */
#toasts {
  position: fixed; z-index: 400; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast {
  padding: 12px 20px; border-radius: 99px; font-size: 15px; font-weight: 500; max-width: min(90vw, 520px);
  color: var(--ink); background: rgba(35, 36, 43, .94); border: 1px solid var(--line-2);
  box-shadow: var(--shadow-2); animation: toast-in .35s var(--ease-pop) both; text-align: center;
}
.toast.bad { border-color: rgba(255, 122, 122, .5); color: #ffdede; }
.toast.good { border-color: rgba(139, 233, 183, .5); }
.toast.out { animation: toast-out .3s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.94) } to { opacity: 1; transform: none } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) } }

/* ── 작은 것들 ── */
.mono { font-family: var(--font-mono); letter-spacing: .08em; }
.hand { font-family: var(--font-hand); }
.display { font-family: var(--font-display); font-weight: 400; }
.badge-demo {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em;
  color: var(--yellow); border: 1px dashed rgba(255, 215, 122, .55); background: rgba(255, 215, 122, .07);
}
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .22); border-top-color: currentColor;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; }
}
