/* 세자 v1.3 PWA — 디자인 토큰 + 인증/홈 (DESIGN.md 기반) */

:root {
  --ink-deepest: #0A0A0C;
  --ink-deep:    #15151A;
  --ink-mid:     #1E1E24;
  --ink-light:   #2A2A33;
  --ink-line:    #3A3A45;

  --hanji-white: #F4EFE2;
  --hanji-cream: #E8E2D2;
  --hanji-mute:  #8B8B95;
  --hanji-fade:  #5A5A63;

  --gold-bright:  #D4B26A;
  --gold-primary: #C9A658;
  --gold-deep:    #8B7339;
  --gold-faint:   rgba(201, 166, 88, 0.12);

  --kakao-yellow: #FEE500;
  --kakao-text:   #191600;

  --font-display: "Noto Serif KR", "Noto Serif TC", serif;
  --font-body: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-han: "Noto Serif TC", "Noto Serif KR", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--ink-deepest); color: var(--hanji-white); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
body {
  min-height: 100vh;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.96 0 0 0 0 0.94 0 0 0 0 0.88 0 0 0 0.018 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 56px 28px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.logo { margin-bottom: 48px; }
.logo .name { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.logo .romaji { font-family: var(--font-body); font-size: 12px; color: var(--gold-deep); margin-left: 12px; letter-spacing: 0.3em; vertical-align: middle; }
.logo .underline { height: 1px; width: 56px; background: var(--gold-deep); margin-top: 12px; }

.hero {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.4;
  font-weight: 500;
  margin-bottom: 56px;
}
.hero .em { color: var(--gold-bright); font-weight: 700; }

.meta-label {
  font-size: 12px;
  color: var(--hanji-mute);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 12px;
}

/* 카카오 버튼 — 도장 모션 */
.btn-kakao {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 64px;
  background: var(--kakao-yellow);
  color: var(--kakao-text);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
  border: 0;
  border-radius: 0;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btn-kakao:active {
  transform: scale(0.97) rotate(-1.2deg);
}
.btn-kakao .kakao-symbol {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--kakao-text);
  color: var(--kakao-yellow);
  font-size: 14px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

.aside {
  text-align: center;
  font-size: 13px;
  color: var(--hanji-mute);
  letter-spacing: 0.15em;
  margin: 16px 0;
}

.btn-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 64px;
  background: var(--gold-primary);
  color: var(--ink-deepest);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.05em;
  border: 2px solid var(--gold-deep);
  border-radius: 0;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
}
.btn-stamp:active {
  transform: scale(0.97) rotate(-1.2deg);
  background: var(--gold-bright);
}
.btn-stamp::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, var(--gold-faint) 0%, transparent 70%);
  opacity: 0;
  pointer-events: none;
}
.btn-stamp:active::after {
  animation: ink-spread 0.6s ease-out;
}
@keyframes ink-spread {
  0%   { opacity: 0; transform: scale(0.4); }
  40%  { opacity: 1; }
  100% { opacity: 0; transform: scale(1.6); }
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 56px;
  background: transparent;
  color: var(--gold-primary);
  border: 1.5px solid var(--gold-deep);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 16px;
  transition: border-color 0.2s, background 0.2s;
}
.btn-outline:hover, .btn-outline:active {
  border-color: var(--gold-primary);
  background: var(--gold-faint);
}
.btn-outline.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.hr-gold {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold-deep), transparent);
  margin: 32px 0 24px;
}

.note {
  font-size: 14px;
  line-height: 1.7;
  color: var(--hanji-mute);
}

/* 홈 placeholder */
.card.placeholder {
  background: var(--ink-mid);
  border: 1px solid var(--ink-line);
  border-left: 4px solid var(--gold-primary);
  padding: 28px 24px;
  margin: 24px 0;
}
.card.placeholder p {
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.5;
  color: var(--hanji-white);
  margin-bottom: 24px;
}
.card.placeholder .btn-stamp[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  border-color: var(--gold-deep);
  background: var(--ink-light);
  color: var(--hanji-mute);
}

/* 로딩 */
.page-loading { justify-content: center; align-items: center; }
.loading-text {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--hanji-cream);
  letter-spacing: 0.05em;
}

/* 진입 staggered */
.logo, .hero, .btn-kakao, .aside, .btn-outline, .hr-gold, .note, .card {
  opacity: 0;
  transform: translateY(8px);
  animation: rise-in 0.5s ease-out forwards;
}
.logo { animation-delay: 0.0s; }
.hero { animation-delay: 0.08s; }
.btn-kakao { animation-delay: 0.16s; }
.aside { animation-delay: 0.24s; }
.btn-outline { animation-delay: 0.32s; }
.hr-gold, .note { animation-delay: 0.40s; }
.card { animation-delay: 0.16s; }
@keyframes rise-in { to { opacity: 1; transform: translateY(0); } }
