:root {
  --bg: #0b0e14;
  --bg-top: #1b2735;
  --surface: #151a23;
  --surface-sunk: #0b0e14;
  --border: #4a4228;
  --gold: #d4af37;
  --gold-hover: #b5952f;
  --text: #fbf5e5;
  --muted: #94a3b8;
  --faint: #64748b;
  --pink: #f472b6;
  --violet: #a78bfa;
  --serif: 'Gowun Batang', 'Nanum Myeongjo', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  color-scheme: dark;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at top, var(--bg-top), var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 16px/1.7 var(--sans);
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.3; margin: 0; }
h1 { font-size: clamp(2rem, 6vw, 3rem); color: var(--gold); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; color: var(--gold); }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }

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

.back { display: inline-flex; gap: 6px; color: var(--muted); text-decoration: none; font-size: .95rem; }
.back:hover { color: var(--text); }

.hero { text-align: center; margin: 32px 0 40px; display: grid; gap: 12px; }
.hero p { color: var(--muted); font-size: 1.1rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
}
.card.sunk { background: var(--surface-sunk); border-color: color-mix(in srgb, var(--gold) 30%, transparent); }
.stack { display: grid; gap: 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 28px;
  border: 1px solid transparent; border-radius: 999px;
  background: var(--gold); color: var(--bg);
  font: 600 1rem var(--sans); text-decoration: none; cursor: pointer;
  transition: background .2s, transform .2s;
}
.btn:hover { background: var(--gold-hover); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--gold); border-color: var(--gold); }
.btn.ghost:hover { background: color-mix(in srgb, var(--gold) 12%, transparent); }
.btn.kakao { background: #fee500; color: #191919; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

.features { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.feature {
  display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
  text-decoration: none; transition: transform .2s, box-shadow .2s;
}
.feature:hover { transform: translateY(-4px); box-shadow: 0 0 24px color-mix(in srgb, var(--gold) 12%, transparent); }
.feature p { color: var(--muted); flex: 1; }
.feature .icon {
  width: 88px; height: 88px; display: grid; place-items: center; font-size: 2.4rem;
  border-radius: 50%; background: var(--surface-sunk); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
}

.site-footer { text-align: center; color: var(--faint); font-size: .875rem; padding: 32px 16px; display: grid; gap: 6px; }
.site-footer a { text-underline-offset: 4px; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--surface); border: 1px solid var(--gold); color: var(--text);
  padding: 12px 20px; border-radius: 12px; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; max-width: calc(100vw - 32px); z-index: 10;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.spinner {
  width: 40px; height: 40px; margin: 0 auto; border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--gold) 25%, transparent); border-top-color: var(--gold);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.fade-in { animation: fade-in .5s ease both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } }

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

.badge { display: inline-block; justify-self: start; padding: 4px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.badge.good { background: #d4af3722; color: var(--gold); }
.badge.bad { background: #f8717122; color: #f87171; }
.badge.mixed { background: #60a5fa22; color: #60a5fa; }
.badge.psychological { background: #a78bfa22; color: var(--violet); }

.crumbs { color: var(--faint); font-size: .85rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.article { max-width: 720px; margin: 24px auto 0; display: grid; gap: 36px; }
.article section { display: grid; gap: 14px; color: #cbd5e1; }
.article h2 { color: var(--text); font-size: 1.35rem; }
.article .lead { color: var(--muted); font-size: 1.05rem; }
.case { display: grid; gap: 4px; padding-left: 14px; border-left: 2px solid var(--border); }
.case h3 { font-size: 1.05rem; }
.cta p { color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: .8rem; padding: 2px 10px; border-radius: 999px; background: #d4af371a; color: var(--gold); }
.tarot-head { display: grid; grid-template-columns: 160px 1fr; gap: 24px; align-items: start; }
.tarot-head img { border-radius: 10px; border: 2px solid var(--gold); background: #f5ecd7; }
.topic-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.pager { display: flex; justify-content: space-between; gap: 12px; }
.pager a { color: var(--gold); text-decoration: none; }
.link-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.link-grid a {
  display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; text-align: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: .95rem;
}
.link-grid a:hover { border-color: var(--gold); color: var(--gold); }
.directory { display: grid; gap: 16px; margin-top: 48px; }
@media (max-width: 560px) { .tarot-head { grid-template-columns: 110px 1fr; gap: 16px; } }
