/* ============================================================
   박만수 생일파티 · 디자인 시스템
   무신사풍 블랙/아이보리/화이트 + 낙서 + 찢은 종이 콜라주
   ============================================================ */

:root {
  --ink: #13110f;          /* 잉크 블랙 */
  --ink-soft: #2b2722;
  --ivory: #f3ecdd;        /* 아이보리 종이 */
  --ivory-deep: #e7dcc6;
  --paper: #fbf7ee;        /* 밝은 종이 */
  --white: #ffffff;
  --line: #1a1714;

  /* 무지개 악센트 (작게만) */
  --r-red: #e4572e;
  --r-orange: #f3a712;
  --r-green: #3fa34d;
  --r-blue: #1f7a8c;
  --tape: rgba(243, 167, 18, .42);

  --font-head: 'Paperlogy', 'Pretendard Variable', Pretendard, sans-serif;
  --font-witty: 'SeungriDay', 'Nanum Pen Script', 'Gaegu', cursive;
  --font-body: 'Pretendard Variable', Pretendard, -apple-system, system-ui, sans-serif;

  --shadow-card: 6px 8px 0 rgba(19, 17, 15, .9);
  --shadow-soft: 0 14px 30px rgba(19, 17, 15, .18);
  --radius: 14px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(120% 60% at 50% -10%, #fff8ea 0%, var(--ivory) 46%, var(--ivory-deep) 100%);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.55;
}

a { color: inherit; }

/* 종이 그레인 오버레이 */
.grain {
  position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  opacity: .055; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ───────── 상단바 ───────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(243, 236, 221, .82);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--ink);
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; letter-spacing: .12em; font-size: 14px;
}
.rainbow-mini { width: 34px; height: auto; }
.rainbow-mini.big { width: 64px; }
.topnav { display: flex; gap: clamp(12px, 3vw, 26px); font-weight: 700; font-size: 14px; }
.topnav a { text-decoration: none; position: relative; padding-bottom: 2px; }
.topnav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
.topnav a:hover::after { transform: scaleX(1); }

/* ───────── 히어로 ───────── */
.hero {
  position: relative;
  padding: clamp(40px, 7vw, 90px) clamp(16px, 4vw, 40px) 0;
  overflow: hidden;
}
.hero-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(20px, 4vw, 50px);
  align-items: center;
}
.kicker {
  display: inline-block; font-weight: 800; font-size: 13px; letter-spacing: .14em;
  background: var(--ink); color: var(--paper); padding: 6px 12px; border-radius: 100px;
  transform: rotate(-2deg); margin: 0 0 18px;
}
.hero-title {
  font-family: var(--font-head); font-weight: 900;
  font-size: clamp(56px, 13vw, 132px); line-height: .92; margin: 0; letter-spacing: -.01em;
}
.hero-title .line { display: block; }
.hero-title .accent {
  position: relative; color: var(--paper);
  -webkit-text-stroke: 2px var(--ink);
  text-shadow: 5px 5px 0 var(--ink);
}
.hero-witty {
  font-family: var(--font-witty); font-size: clamp(28px, 5vw, 46px);
  line-height: 1.05; margin: 18px 0 26px; transform: rotate(-2.2deg); color: var(--ink-soft);
}
.hero-facts {
  list-style: none; padding: 0; margin: 0 0 28px;
  display: grid; gap: 6px; font-size: 15px;
}
.hero-facts b {
  display: inline-block; width: 64px; font-family: var(--font-head); font-weight: 700;
  letter-spacing: .05em; color: var(--r-blue);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* 마스코트 */
.hero-mascot { position: relative; margin: 0; text-align: center; }
.hero-mascot img {
  position: relative; z-index: 2; width: min(100%, 420px); height: auto;
  filter: drop-shadow(8px 10px 0 rgba(19,17,15,.16));
  animation: bob 4.5s ease-in-out infinite;
}
.mascot-blob {
  position: absolute; inset: 6% 8% 10% 8%; z-index: 1;
  background: var(--white);
  border: 2.5px solid var(--ink);
  border-radius: 46% 54% 58% 42% / 52% 44% 56% 48%;
  transform: rotate(-6deg);
  box-shadow: var(--shadow-card);
}
.mascot-badge {
  position: absolute; right: 2%; top: 4%; z-index: 3;
  font-family: var(--font-head); font-weight: 900; font-size: 16px; line-height: 1;
  text-align: center; color: var(--paper); background: var(--r-red);
  padding: 12px 10px; border: 2.5px solid var(--ink); border-radius: 50%;
  transform: rotate(12deg); box-shadow: 3px 3px 0 var(--ink);
}
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-12px) } }

/* 테이프 조각 */
.hero-tape { position: absolute; width: 120px; height: 38px; background: var(--tape);
  box-shadow: 0 2px 6px rgba(0,0,0,.08); z-index: 3; }
.tape-a { top: 30px; left: 8%; transform: rotate(-18deg); }
.tape-b { top: 70px; right: 12%; transform: rotate(14deg); width: 90px; }

/* 마퀴 */
.marquee {
  margin-top: clamp(36px, 6vw, 70px);
  background: var(--ink); color: var(--paper);
  border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  overflow: hidden; white-space: nowrap;
}
.marquee-track { display: inline-flex; }
.marquee-track span {
  display: inline-block; padding: 12px 0; font-family: var(--font-head); font-weight: 700;
  font-size: 18px; letter-spacing: .04em; animation: scroll 26s linear infinite;
}
@keyframes scroll { from { transform: translateX(0) } to { transform: translateX(-100%) } }

/* ───────── 섹션 공통 ───────── */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(54px, 9vw, 100px) clamp(16px, 4vw, 40px); }
.section-head { margin-bottom: clamp(26px, 4vw, 44px); }
.sec-title {
  font-family: var(--font-head); font-weight: 900; font-size: clamp(34px, 7vw, 62px);
  margin: 0; line-height: 1; letter-spacing: -.01em;
}
.sec-sub {
  font-family: var(--font-witty); font-size: clamp(20px, 3.4vw, 30px);
  margin: 8px 0 0; color: var(--ink-soft);
}
.muted { color: #9a9388; font-weight: 500; }
.doodle-underline { display: inline-block; width: 70px; height: 10px;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='70' height='10'%3E%3Cpath d='M2 6c14-5 30 4 44-1s18-2 22 0' fill='none' stroke='%23e4572e' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E"); }
.doodle-star { color: var(--r-orange); }
.doodle-arrow { color: var(--r-green); font-weight: 800; }

/* ───────── 버튼 ───────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font-family: var(--font-body); font-weight: 800; font-size: 16px;
  padding: 14px 22px; border-radius: 100px; border: 2.5px solid var(--ink);
  text-decoration: none; cursor: pointer; transition: transform .12s, box-shadow .12s;
  background: var(--white); color: var(--ink); box-shadow: 4px 4px 0 var(--ink);
}
.btn:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; margin-top: 8px; font-size: 17px; padding: 16px; }
.btn-map { background: var(--r-blue); color: var(--paper); font-size: 15px; padding: 12px 18px; }
.btn-map--soft { background: var(--ivory-deep); color: var(--ink); cursor: default; box-shadow: 4px 4px 0 var(--ink); }
.btn-map--soft:hover { transform: none; box-shadow: 4px 4px 0 var(--ink); }

/* ───────── 안내 카드 ───────── */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 40px); }
.card {
  position: relative; background: transparent; border: 0; box-shadow: none;
  padding: 32px 28px 30px;
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 8px;
  filter: url(#torn) drop-shadow(6px 8px 0 rgba(19, 17, 15, .9));
}
.card-1st { transform: rotate(-1.4deg); }
.card-2nd { transform: rotate(1.6deg); }
.card-2nd::before { background: var(--ivory); }
.card-pin {
  position: absolute; top: -16px; left: 22px;
  font-family: var(--font-head); font-weight: 900; font-size: 18px;
  background: var(--r-red); color: var(--paper); padding: 6px 14px; border: 2.5px solid var(--ink);
  border-radius: 100px; transform: rotate(-6deg); box-shadow: 2px 2px 0 var(--ink);
}
.card-pin.pin-alt { background: var(--r-green); }
.card-title { font-family: var(--font-head); font-weight: 800; font-size: 26px; margin: 8px 0 10px; }
.card-title i { font-style: normal; display: block; font-size: 18px; color: var(--r-blue); }
.card-meta { font-weight: 700; margin: 0 0 8px; }
.card-desc { margin: 0 0 20px; color: var(--ink-soft); font-size: 15px; }

/* ───────── RSVP ───────── */
.section-rsvp { }
.rsvp-card {
  position: relative; max-width: 560px; background: transparent; border: 0; box-shadow: none;
  padding: clamp(26px, 4vw, 40px);
}
.rsvp-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--white); border: 2.5px solid var(--ink); border-radius: 8px;
  filter: url(#torn) drop-shadow(6px 8px 0 rgba(19, 17, 15, .9));
}
.field { margin-bottom: 22px; }
.field label, .field-label { display: block; font-weight: 800; margin-bottom: 8px; font-size: 15px; }
.field input[type=text] {
  width: 100%; padding: 14px 16px; font-size: 16px; font-family: var(--font-body);
  border: 2px solid var(--ink); border-radius: 10px; background: var(--paper); color: var(--ink);
}
.field input[type=text]:focus { outline: 3px solid var(--r-orange); outline-offset: 1px; }

.toggle { display: inline-flex; border: 2px solid var(--ink); border-radius: 100px; overflow: hidden; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle label {
  margin: 0; padding: 11px 22px; font-weight: 800; cursor: pointer; background: var(--paper);
  transition: background .15s, color .15s;
}
.toggle label + input + label { border-left: 2px solid var(--ink); }
#att-yes:checked + label { background: var(--ink); color: var(--paper); }
#att-no:checked ~ label[for=att-no],
#att-no:checked + label { background: var(--r-red); color: var(--paper); }
.form-result { margin: 14px 0 0; font-weight: 700; min-height: 22px; }
.form-result.ok { color: var(--r-green); }
.form-result.err { color: var(--r-red); }

/* ───────── 위시리스트 ───────── */
.wish-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.wish-mascot {
  width: clamp(120px, 18vw, 200px); height: auto; flex: none;
  filter: drop-shadow(6px 8px 0 rgba(19,17,15,.14));
  transform: rotate(3deg); margin-bottom: -6px;
}
@media (max-width: 640px) { .wish-mascot { display: none; } }
.wish-hint { margin: -10px 0 26px; font-size: 14px; color: var(--ink-soft); }
.wish-hint a { font-weight: 800; text-underline-offset: 3px; }
.wish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; }
.loading { grid-column: 1/-1; text-align: center; color: var(--ink-soft); }

.wish-item {
  position: relative; background: transparent; border: 0; box-shadow: none;
  padding: 24px 22px 22px; display: flex; flex-direction: column; min-height: 168px;
}
.wish-item::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--paper); border: 2.5px solid var(--ink); border-radius: 8px;
  filter: url(#torn-sm) drop-shadow(6px 8px 0 rgba(19, 17, 15, .9));
}
.wish-item:nth-child(3n+1) { transform: rotate(-1.5deg); }
.wish-item:nth-child(3n+2) { transform: rotate(1.2deg); }
.wish-item:nth-child(3n+2)::before { background: var(--ivory); }
.wish-item:nth-child(3n)   { transform: rotate(-.6deg); }
.wish-item .tape {
  position: absolute; top: -12px; left: 50%; width: 70px; height: 24px;
  background: var(--tape); transform: translateX(-50%) rotate(-4deg);
}
.wish-emoji { font-size: 34px; line-height: 1; margin-bottom: 6px; }
.wish-name { font-family: var(--font-head); font-weight: 800; font-size: 19px; margin: 0 0 12px; }
.wish-claimers { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.claim-chip {
  font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 100px;
  background: var(--ink); color: var(--paper); transform: rotate(-2deg);
}
.claim-chip.mine { background: var(--r-green); }
.wish-empty { font-size: 13px; color: var(--ink-soft); margin: 0 0 14px; }
.wish-action { margin-top: auto; }
.wish-btn {
  width: 100%; font-family: var(--font-body); font-weight: 800; font-size: 14px;
  padding: 10px; border: 2px solid var(--ink); border-radius: 100px; cursor: pointer;
  background: var(--white); transition: background .15s;
}
.wish-btn:hover { background: var(--ivory-deep); }
.wish-btn.claimed { background: var(--r-green); color: var(--paper); }
.wish-item.is-claimed::before { filter: url(#torn-sm) drop-shadow(5px 6px 0 var(--r-green)); }

/* 1차 선정 사유 */
.card-why { list-style: none; padding: 0; margin: 4px 0 18px; display: grid; gap: 7px; font-size: 14px; line-height: 1.4; }
.card-why b { color: var(--r-red); }

/* 위시리스트 노트 / 링크 */
.wish-note { margin: -6px 0 8px; font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.wish-link {
  display: inline-block; margin: 0 0 10px; font-size: 12.5px; font-weight: 800;
  color: var(--r-blue); text-decoration: none; border-bottom: 2px solid var(--r-blue);
}
.wish-link:hover { color: var(--ink); border-color: var(--ink); }

/* RSVP 체크박스 */
.check { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14.5px; margin: 8px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); cursor: pointer; flex: none; }
#opts-field { transition: opacity .2s; }
.check-note { margin: 8px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-soft); font-weight: 600; }

/* 선물 배송지 박스 */
.ship-box {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 30px; padding: 20px 24px; background: var(--ink); color: var(--paper);
  border-radius: 12px; box-shadow: var(--shadow-card);
}
.ship-label { margin: 0 0 6px; font-weight: 800; font-size: 14px; }
.ship-box .muted { color: #c9bfa8; }
.ship-addr { margin: 0; font-family: var(--font-head); font-weight: 700; font-size: clamp(17px, 2.4vw, 22px); }
.ship-sub { margin: 5px 0 0; font-size: 14px; opacity: .85; }
.ship-copy { background: var(--paper); color: var(--ink); flex: none; }

/* ───────── 만수 캐릭터 이모지 배치 ───────── */
.rsvp-layout { display: flex; align-items: center; gap: clamp(16px, 4vw, 48px); flex-wrap: wrap; }
.rsvp-layout .rsvp-card { flex: 1 1 360px; }
.rsvp-mascot-wrap { flex: 0 0 auto; text-align: center; margin: 0; }
#rsvp-mascot {
  width: clamp(150px, 20vw, 230px); height: auto;
  filter: drop-shadow(6px 8px 0 rgba(19, 17, 15, .14));
  animation: bob 4.5s ease-in-out infinite; transition: opacity .18s;
}
.rsvp-mascot-cap {
  margin-top: 4px; font-family: var(--font-witty); font-size: clamp(22px, 3vw, 30px);
  color: var(--ink-soft); transform: rotate(-2deg);
}

.card { overflow: visible; }
.card-mascot {
  position: absolute; right: -12px; bottom: -20px;
  width: clamp(92px, 13vw, 132px); height: auto; transform: rotate(6deg);
  filter: drop-shadow(4px 5px 0 rgba(19, 17, 15, .16)); pointer-events: none;
}

.footer-mascot {
  width: clamp(140px, 20vw, 188px); height: auto; display: block; margin: 0 auto -6px;
  filter: drop-shadow(6px 8px 0 rgba(0, 0, 0, .28));
}

@media (max-width: 640px) {
  .card-mascot { width: 84px; right: 0; bottom: -10px; }
  .rsvp-mascot-wrap { width: 100%; }
}

/* ───────── 푸터 ───────── */
.footer {
  text-align: center; background: var(--ink); color: var(--paper);
  padding: clamp(50px, 8vw, 90px) 20px; margin-top: 40px;
}
.footer-big { font-family: var(--font-head); font-weight: 900; font-size: clamp(30px, 6vw, 56px); line-height: 1.05; margin: 14px 0 10px; }
.footer-small { font-size: 13px; opacity: .8; }
.footer-small a { font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

/* ───────── 토스트 ───────── */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 140%);
  background: var(--ink); color: var(--paper); font-weight: 800;
  padding: 14px 22px; border-radius: 100px; box-shadow: var(--shadow-soft);
  z-index: 9999; transition: transform .35s cubic-bezier(.2,.9,.3,1.3); max-width: 90vw;
}
.toast.show { transform: translate(-50%, 0); }

/* ───────── 반응형 ───────── */
@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-mascot { order: -1; max-width: 320px; margin: 0 auto; }
  .cards { grid-template-columns: 1fr; }
  .topnav { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-mascot img { animation: none; }
  .marquee-track span { animation: none; }
}
