/* ============================================================
   Card News — 리소 워크숍 (잉크 온 페이퍼)
   랜딩(pluver.site)과 동일 팔레트·서체
   ============================================================ */

@font-face {
  font-family: 'Paperlogy';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-8ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}

:root {
  --paper: #f4f1ea;
  --paper-2: #ebe7dc;
  --panel: #efece4;
  --ink: #16150f;
  --ink-70: rgba(22, 21, 15, .70);
  --ink-60: rgba(22, 21, 15, .60);
  --rule: rgba(22, 21, 15, .16);
  --rule-strong: rgba(22, 21, 15, .30);
  --accent: #c4008f;
  --accent-deep: #a30077;
  --on-ink: #f4f1ea;
  --danger: #b3241a;
  --danger-soft: rgba(179, 36, 26, .09);

  --display: 'Paperlogy', 'Pretendard Variable', sans-serif;
  --sans: 'Pretendard Variable', -apple-system, "Apple SD Gothic Neo", sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --grain-op: .30;
  --grain-blend: multiply;
  --ease: cubic-bezier(.16, 1, .3, 1);

  /* pv-account.css 가 참조하는 변수 별칭 */
  --ink-45: var(--ink-60);
  --text: var(--ink);
  --text-2: var(--ink-70);
  --text-3: var(--ink-60);
  --bg: var(--paper);
  --border: var(--rule);
  --accent-contrast: var(--on-ink);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14130d;
    --paper-2: #1c1b13;
    --panel: #1c1b13;
    --ink: #f2eee3;
    --ink-70: rgba(242, 238, 227, .68);
    --ink-60: rgba(242, 238, 227, .55);
    --rule: rgba(242, 238, 227, .18);
    --rule-strong: rgba(242, 238, 227, .32);
    --accent: #ff5ecb;
    --accent-deep: #ff85d8;
    --on-ink: #14130d;
    --danger: #ff7a6e;
    --danger-soft: rgba(255, 122, 110, .12);
    --grain-op: .22;
    --grain-blend: screen;
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: break-word;
  overflow-x: hidden;
}

/* 인쇄 그레인 */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 999;
  pointer-events: none;
  opacity: var(--grain-op);
  mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 상단바 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px clamp(18px, 4vw, 44px);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--paper-2);
  color: var(--accent);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong {
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -.03em;
}
.brand-ko {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -.01em;
  color: var(--ink-60);
  margin-left: .2em;
  white-space: nowrap;
}
.brand-text > span { font-size: 12px; color: var(--ink-60); }

/* ---------- 무대 ---------- */
.stage {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(14px, 3vw, 36px) clamp(18px, 4vw, 24px) 40px;
}
.view { animation: rise .5s var(--ease); }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.head { text-align: left; margin: clamp(8px, 3vw, 28px) 0 26px; }
.head h1 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(32px, 6.4vw, 52px);
  line-height: 1.06;
  letter-spacing: -.04em;
}
.head h1 em { font-style: normal; color: var(--accent); }
.lede {
  margin: 0;
  color: var(--ink-70);
  font-size: clamp(14.5px, 1.8vw, 16px);
  max-width: 46ch;
  text-wrap: pretty;
}

/* ---------- 패널 · 폼 ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: clamp(20px, 3.4vw, 30px);
}
.form { display: flex; flex-direction: column; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label, .field-label { font-size: 13px; font-weight: 600; color: var(--ink-70); }
.field input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.field input::placeholder { color: var(--ink-60); }
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 0, 143, .12);
}
.hint { font-size: 12.5px; color: var(--ink-60); }
.hint b { color: var(--ink-70); }

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  background: var(--paper);
  width: fit-content;
}
.stepper-btn {
  width: 42px;
  height: 42px;
  border: 0;
  background: none;
  color: var(--ink-70);
  font-size: 20px;
  cursor: pointer;
  border-radius: 3px;
}
.stepper-btn:hover { color: var(--accent); }
.stepper-value {
  min-width: 40px;
  text-align: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 17px;
}

.form-error {
  margin: 0;
  padding: 11px 13px;
  border: 1px solid var(--danger);
  border-radius: 3px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
  font-weight: 500;
}

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 3px;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.btn-primary { background: var(--accent); color: var(--on-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-deep); }
.btn-primary:disabled {
  background: var(--paper-2);
  color: var(--ink-60);
  box-shadow: inset 0 0 0 1px var(--rule);
  cursor: progress;
}
.btn-ghost {
  background: none;
  border: 1px solid var(--rule-strong);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.btn.is-busy .btn-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 진행 ---------- */
.progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.progress-topic {
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.progress-pct { font-family: var(--mono); font-weight: 700; font-size: 15px; color: var(--accent); }

.progress-track {
  height: 8px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--paper);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width .5s var(--ease);
}
.step-label { margin: 12px 0 4px; font-size: 14px; color: var(--ink-70); }

.steps {
  display: flex;
  gap: 20px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-60);
}
.step-dot {
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--rule-strong);
  border-radius: 50%;
}
.step.is-active { color: var(--ink); font-weight: 600; }
.step.is-active .step-dot { border-color: var(--accent); background: var(--accent); }
.step.is-done { color: var(--ink-70); }
.step.is-done .step-dot { border-color: var(--accent); background: var(--accent); opacity: .45; }

.progress-note { margin: 16px 0 0; font-size: 12.5px; color: var(--ink-60); }

.panel-error { margin-top: 16px; text-align: center; }
.err-text { margin: 4px 0 16px; color: var(--danger); font-weight: 600; }

/* ---------- 완료 ---------- */
.done-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 8px 0 18px;
}
.done-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(24px, 4.4vw, 34px);
  letter-spacing: -.035em;
}
.done-actions { display: flex; flex-wrap: wrap; gap: 9px; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.gallery a {
  display: block;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  transition: transform .25s var(--ease), border-color .25s var(--ease);
}
.gallery a:hover { transform: translateY(-3px); border-color: var(--accent); }
.gallery img { display: block; width: 100%; height: auto; }

.done-note { margin: 18px 0 0; font-size: 13px; color: var(--ink-60); }

/* ---------- 푸터 ---------- */
.footer {
  text-align: center;
  padding: 26px 58px calc(26px + env(safe-area-inset-bottom));
  font-size: 12.5px;
  color: var(--ink-60);
}

/* ---------- 계정 표시 ---------- */
.app-account { margin-left: auto; }

/* ---------- 사이트 독 (우하단) ---------- */
.site-dock {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.site-dock-item {
  position: relative;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--paper-2);
  transition: transform .28s var(--ease), border-color .28s var(--ease);
}
.site-dock-item:hover,
.site-dock-item:focus-visible { transform: translateY(-3px); border-color: var(--ink-60); }
.site-dock-item svg { display: block; }
.site-dock-label {
  position: absolute;
  right: calc(100% + 9px);
  top: 50%;
  transform: translateY(-50%) translateX(5px);
  white-space: nowrap;
  font-weight: 600;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--on-ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.site-dock-item:hover .site-dock-label,
.site-dock-item:focus-visible .site-dock-label { opacity: 1; transform: translateY(-50%) translateX(0); }

@media (max-width: 620px) {
  .site-dock { right: 12px; bottom: 12px; }
  .site-dock-item { width: 42px; height: 42px; }
  .site-dock-label { display: none; }
  .brand-text > span { display: none; }
}

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