@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.css');

:root {
  --paper: #fbfbfb;
  --raised: #ffffff;
  --ink: #333333;
  --ink-strong: #1a1a1a;
  --ink-soft: #5c5c5c;
  --ink-faint: #8a8a8a;
  --edge: #ececec;
  --muted: #f5f5f5;
  --promo: #1a1a1a;
  --danger: #a33a3a;

  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-12: 3rem;

  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui,
    'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;


  --motion: 180ms;
  --ease: cubic-bezier(0.32, 0.72, 0.35, 1);
}

@media (prefers-color-scheme: dark) {
  .icon { filter: brightness(0.84) drop-shadow(0 2px 4px rgb(0 0 0 / 0.55)); }

  :root {
    --paper: #151515;
    --raised: #1e1e1e;
    --ink: #e8e8e8;
    --ink-strong: #f5f5f5;
    --ink-soft: #ababab;
    --ink-faint: #8a8a8a;
    --edge: #2f2f2f;
    --muted: #1e1e1e;
    --promo: #f5f5f5;
    --danger: #e58b8b;

  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

*, *::before, *::after { box-sizing: border-box; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  font-feature-settings: 'tnum' 0;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  font-family: var(--font);
  line-height: 1.2;
  letter-spacing: -0.035em;
  margin: 0 0 var(--sp-4);
  color: var(--ink-strong);
  word-break: keep-all;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; }
h2 { font-size: clamp(1.25rem, 2vw, 1.5rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; }
p { margin: 0 0 var(--sp-4); max-width: 68ch; }

a { color: inherit; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--promo);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.skip {
  position: absolute;
  left: -9999px;
  top: var(--sp-2);
  background: var(--ink-strong);
  color: var(--paper);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius);
  z-index: 100;
}
.skip:focus { left: var(--sp-4); }

.icon {
  display: inline-block;
  flex: none;
  vertical-align: -0.24em;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgb(30 30 40 / 0.18));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: var(--sp-2) var(--sp-6);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--ink-strong);
  color: var(--paper);
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--motion) var(--ease), filter var(--motion);
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn:active { transform: translateY(0) scale(0.98); filter: brightness(0.96); }
.btn--ghost {
  background: var(--raised);
  color: var(--ink);
  border-color: var(--edge);
}
.btn--ghost:hover { background: var(--muted); }
.btn--danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.empty {
  border: 1px dashed var(--edge);
  border-radius: var(--radius);
  padding: var(--sp-12) var(--sp-6);
  text-align: center;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--muted) 50%, transparent);
}
.empty svg { color: var(--ink-faint); margin-bottom: var(--sp-3); }
.empty h3 { color: var(--ink-soft); }

.modal {
  position: relative;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--raised);
  color: var(--ink-strong);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.22), 0 4px 12px rgb(0 0 0 / 0.12);
  padding: var(--sp-6);
  width: min(34rem, calc(100vw - 2rem));
  max-height: min(40rem, calc(100dvh - 4rem));
  overflow: visible;
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transition-property: opacity, transform, overlay, display;
  transition-duration: 200ms;
  transition-timing-function: var(--ease);
  transition-behavior: allow-discrete;
}
.modal[open] { opacity: 1; transform: translateY(0) scale(1); }
@starting-style {
  .modal[open] { opacity: 0; transform: translateY(12px) scale(0.97); }
}

.modal::backdrop {
  background: rgb(15 15 20 / 0.55);
  -webkit-backdrop-filter: blur(6px) saturate(0.9);
  backdrop-filter: blur(6px) saturate(0.9);
  opacity: 0;
  transition-property: opacity, overlay, display;
  transition-duration: 200ms;
  transition-timing-function: var(--ease);
  transition-behavior: allow-discrete;
}
.modal[open]::backdrop { opacity: 1; }
@starting-style {
  .modal[open]::backdrop { opacity: 0; }
}

.modal__dismiss { position: absolute; top: var(--sp-3); right: var(--sp-3); margin: 0; z-index: 1; }
.modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-faint);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--motion), color var(--motion);
}
.modal__close:hover { background: var(--edge); color: var(--ink-strong); }

.modal__title { margin: 0 var(--sp-8) var(--sp-1) 0; font-size: 1.125rem; }
.modal__hint { margin: 0 0 var(--sp-4); font-size: 0.8125rem; color: var(--ink-faint); line-height: 1.5; }
.modal__body {
  margin: 0 calc(var(--sp-6) * -1) calc(var(--sp-6) * -1);
  padding: var(--sp-6);
  border-top: 1px solid var(--edge);
  max-height: min(26rem, calc(100dvh - 16rem));
  overflow-y: auto;
}
.modal__body .field { margin-bottom: var(--sp-6); }
.modal__body .field label { margin-bottom: var(--sp-1); }
.modal__body .field input,
.modal__body .field select { min-height: 46px; }
.modal__body .field textarea { min-height: 10rem; resize: vertical; line-height: 1.5; }
.modal__body .field .hint { margin-top: var(--sp-1); line-height: 1.5; }
.modal__body .formgrid { gap: 0 var(--sp-5); }
.modal__body .choices { margin-bottom: var(--sp-6); }
.modal__body .field:last-of-type,
.modal__body .choices:last-of-type { margin-bottom: 0; }
.modal__actions {
  display: flex;
  gap: var(--sp-2);
  justify-content: flex-end;
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--edge);
}

@media (prefers-reduced-motion: reduce) {
  .modal, .modal::backdrop { transition-duration: 0.01ms; }
}
