/* ==========================================================
   가디안 소개 사이트 — DESIGN.md 구현
   ========================================================== */
:root {
  --bg: #0e0a14;
  --surface: #171126;
  --surface-2: #211936;
  --fg: #ede7f4;
  --muted: #a396b8;
  --border: rgba(237, 231, 244, .13);
  --accent: #ef5fb0;
  --accent-2: #93d97f;
  --info: #62c4ee;
  --status-warn: #edb750;
  --status-bad: #e0485a;

  --type-fairy: #f4a8c4;
  --type-psychic: #ef5fb0;
  --type-normal: #b8b0a4;
  --type-fire: #f08a4b;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-6: 24px; --sp-8: 32px; --sp-12: 48px; --sp-16: 64px;
  --sp-24: 96px; --sp-32: 128px;

  --font-display: 'Do Hyeon', sans-serif;
  --font-body: 'Pretendard', sans-serif;
  --font-pixel: 'Press Start 2P', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.pixel { font-family: var(--font-pixel); font-size: 11px; letter-spacing: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 var(--sp-6); }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) var(--sp-6);
  background: rgba(23, 17, 38, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { font-family: var(--font-display); font-size: 20px; }
.nav-logo .pixel { color: var(--accent); font-size: 9px; margin-right: var(--sp-2); }
.nav-right { display: flex; align-items: center; gap: var(--sp-6); }
.poke-switcher {
  background: var(--surface-2); color: var(--fg);
  border: 1px solid var(--border); border-radius: 4px;
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  padding: var(--sp-1) var(--sp-3);
  cursor: pointer;
}
.poke-switcher:hover { border-color: var(--accent); }
.nav-links { display: flex; gap: var(--sp-6); font-size: 14px; font-weight: 600; }
.nav-links a { padding-bottom: 2px; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.nav-links a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.nav-adult { color: var(--status-bad); }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 92vh;
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background-position: center 22%;
  background-size: cover;
  background-repeat: no-repeat;
  filter: saturate(1.05);
}
.hero-fade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(14,10,20,.55) 0%, rgba(14,10,20,.15) 35%, rgba(14,10,20,.92) 82%, var(--bg) 100%);
}
.hero-inner {
  position: relative; z-index: 2;
  max-width: 1080px; margin: 0 auto; width: 100%;
  padding: var(--sp-32) var(--sp-6) var(--sp-16);
}
.hero-no { color: var(--info); margin-bottom: var(--sp-4); text-shadow: 0 4px 0 rgba(0,0,0,.55); }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(52px, 9vw, 84px);
  font-weight: 400; line-height: 1.05;
  text-shadow: 0 0 22px rgba(239, 95, 176, .45), 0 4px 0 rgba(0,0,0,.55);
  animation: heroPulse 2.6s ease-in-out infinite;
}
.hero-en {
  display: block; font-size: clamp(18px, 3vw, 26px);
  color: var(--accent-2); letter-spacing: .3em; margin-top: var(--sp-1);
}
@keyframes heroPulse { 0%, 100% { opacity: 1; } 50% { opacity: .85; } }
.hero-chips { display: flex; gap: var(--sp-2); margin: var(--sp-4) 0 var(--sp-6); flex-wrap: wrap; }
.chip {
  padding: 4px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: var(--bg);
}
.type-psychic { background: var(--type-psychic); }
.type-fairy { background: var(--type-fairy); }
.type-normal { background: var(--type-normal); }
.type-fire { background: var(--type-fire); }
.chip-species { background: transparent; color: var(--fg); border: 1px solid var(--border); }
.hero-copy { max-width: 520px; color: var(--fg); }
.hero-copy em { font-style: normal; color: var(--accent); }
.hero-mind {
  margin-top: var(--sp-6); color: var(--muted); font-size: 15px;
}

/* ---------- sections ---------- */
.section { padding: var(--sp-24) 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.sec-label {
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--info); margin-bottom: var(--sp-2);
}
.sec-label.danger { color: var(--status-bad); }
.sec-title { font-family: var(--font-display); font-size: 34px; font-weight: 400; margin-bottom: var(--sp-4); }
.sec-desc { color: var(--muted); max-width: 640px; margin-bottom: var(--sp-12); }
.sec-desc strong { color: var(--fg); }
.dex-count { color: var(--accent); font-size: 12px; vertical-align: middle; margin-left: var(--sp-3); }

/* ---------- profile ---------- */
.profile-grid {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: var(--sp-12);
  align-items: start;
}
.dex-table { width: 100%; border-collapse: collapse; margin-bottom: var(--sp-6); }
.dex-table td {
  padding: var(--sp-3) var(--sp-2);
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.dex-table td:first-child {
  color: var(--muted); font-weight: 600; width: 110px;
  font-size: 13px; letter-spacing: .08em;
}
.ability-card {
  background: var(--surface); border: 1px solid var(--border);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  padding: var(--sp-6); margin-bottom: var(--sp-6);
}
.section .ability-card { background: var(--surface); }
.ability-card h3 { font-size: 16px; margin-bottom: var(--sp-2); }
.ability-card h3 span { color: var(--accent-2); }
.ability-card p { font-size: 15px; color: var(--muted); }
.persona-list { list-style: none; margin-bottom: var(--sp-6); }
.persona-list li {
  display: grid; grid-template-columns: 74px 1fr; gap: var(--sp-4);
  padding: var(--sp-3) 0; border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.persona-list li b { color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: .04em; }
.persona-code { color: var(--info); }
.gap-note {
  border-left: 4px solid var(--accent-2);
  padding: var(--sp-2) 0 var(--sp-2) var(--sp-4);
  color: var(--fg); font-size: 15px;
}
.profile-art img {
  border-radius: 8px; border: 2px solid var(--surface-2);
}
.profile-art figcaption { margin-top: var(--sp-3); font-size: 13px; color: var(--muted); }
.profile-art .pixel { color: var(--accent); font-size: 9px; margin-right: var(--sp-2); }

/* ---------- speech ---------- */
.speech-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: var(--sp-12); align-items: start; }
.cry-rules {
  background: var(--surface-2); border: 1px solid var(--border);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  padding: var(--sp-6);
}
.cry-rules h3 { font-family: var(--font-display); font-weight: 400; font-size: 20px; margin-bottom: var(--sp-4); }
.cry-rules dl { display: grid; grid-template-columns: 72px 1fr; gap: var(--sp-2) var(--sp-4); font-size: 14px; }
.cry-rules dt {
  color: var(--accent); font-weight: 700; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 4px;
  padding: 2px 0;
}
.cry-rules dd { color: var(--muted); }
.speech-demo { display: flex; flex-direction: column; gap: var(--sp-4); }
.bubble-set { cursor: pointer; }
.bubble {
  position: relative;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 14px 14px 14px 4px;
  padding: var(--sp-4) var(--sp-6);
  transition: border-color .2s, transform .2s;
}
.bubble-set:hover .bubble { border-color: rgba(239, 95, 176, .4); transform: translateY(-2px); }
.bubble .cry { font-size: 18px; font-weight: 700; }
.bubble .tone { font-size: 13px; color: var(--muted); margin-left: var(--sp-2); }
.bubble .hint { position: absolute; right: var(--sp-4); top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--info); }
.mind-box {
  display: none;
  margin: var(--sp-2) 0 0 var(--sp-8);
  padding: var(--sp-3) var(--sp-6);
  background: rgba(239, 95, 176, .09);
  border: 1px solid rgba(239, 95, 176, .35);
  border-radius: 4px 14px 14px 14px;
  color: var(--accent); font-size: 15px;
}
.mind-box::before { content: '텔레파시 · '; font-size: 11px; letter-spacing: .1em; color: var(--muted); }
.bubble-set.open .mind-box { display: block; animation: mindIn .18s ease-out; }
.bubble-set.open .hint { display: none; }
@keyframes mindIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- affinity ---------- */
.affinity-board {
  background: var(--surface); border: 1px solid var(--border);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  padding: var(--sp-8);
  display: grid; grid-template-columns: 220px 1fr; gap: var(--sp-8);
  margin-bottom: var(--sp-6);
}
.stage-tabs { display: flex; flex-direction: column; gap: var(--sp-2); }
.stage-tab {
  text-align: left; cursor: pointer;
  background: transparent; border: 1px solid var(--border); color: var(--muted);
  font-family: var(--font-body); font-size: 14px; font-weight: 600;
  padding: var(--sp-3) var(--sp-4);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
  transition: color .2s, border-color .2s, background .2s;
}
.stage-tab .pixel { font-size: 8px; color: var(--info); display: block; margin-bottom: 2px; }
.stage-tab:hover { border-color: var(--accent); color: var(--fg); }
.stage-tab.active { background: rgba(239, 95, 176, .1); border-color: var(--accent); color: var(--fg); }
.ball-gauge { display: flex; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.ball {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface-2);
  position: relative;
  transition: border-color .25s, background .25s;
}
.ball::after {
  content: ''; position: absolute; left: -2px; right: -2px; top: 50%;
  height: 2px; background: var(--border); transition: background .25s;
}
.ball.on { border-color: var(--accent); background: linear-gradient(180deg, var(--accent) 0 48%, var(--fg) 52% 100%); }
.ball.on::after { background: var(--bg); }
.stage-name { font-family: var(--font-display); font-weight: 400; font-size: 24px; margin-bottom: var(--sp-2); }
.stage-desc { color: var(--muted); font-size: 15px; max-width: 560px; }
.ball-rule {
  display: grid; grid-template-columns: 56px 1fr; gap: var(--sp-6); align-items: start;
  background: var(--surface); border: 1px solid var(--border);
  padding: var(--sp-6);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}
.ball-rule-icon {
  width: 48px; height: 48px; border-radius: 50%;
  border: 2px solid var(--muted); background: var(--surface-2); position: relative;
}
.ball-rule-icon::after { content: ''; position: absolute; left: -2px; right: -2px; top: 50%; height: 2px; background: var(--muted); }
.ball-rule h3 { font-size: 16px; margin-bottom: var(--sp-2); }
.ball-rule p { font-size: 15px; color: var(--muted); }
.ball-rule strong { color: var(--fg); }

/* ---------- moves ---------- */
.moves-list { display: flex; flex-direction: column; gap: var(--sp-12); }
.move-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-8); align-items: center;
}
.move-row:nth-child(even) .move-art { order: 2; }
.move-art { position: relative; }
.move-art img {
  border-radius: 8px; border: 1px solid var(--border);
  box-shadow: 0 0 32px rgba(239, 95, 176, .12);
}
.move-art .pixel {
  position: absolute; top: var(--sp-3); left: var(--sp-3);
  background: rgba(14, 10, 20, .8); color: var(--accent);
  padding: 5px 8px; border-radius: 4px; font-size: 9px;
}
.move-info h3 { font-family: var(--font-display); font-weight: 400; font-size: 26px; margin: var(--sp-2) 0 var(--sp-3); }
.move-info .chip { font-size: 11px; }
.move-info p { font-size: 15px; color: var(--muted); margin-bottom: var(--sp-4); }
.move-quip {
  border-left: 4px solid var(--accent);
  padding-left: var(--sp-4);
  font-size: 14px; color: var(--fg);
}

/* ---------- emotion dex ---------- */
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--sp-4);
}
.sticker {
  background: var(--surface); border: 2px solid var(--surface-2);
  border-radius: 6px; overflow: hidden;
  transition: transform .2s, border-color .2s;
}
.sticker:hover { transform: rotate(1.2deg) translateY(-3px); border-color: var(--accent); }
.sticker img { aspect-ratio: 1; object-fit: cover; }
.sticker-label {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-2) var(--sp-3);
  font-size: 13px; font-weight: 600;
}
.sticker-label .pixel { font-size: 8px; color: var(--muted); }
/* ---------- guideline ---------- */
.guide-box {
  background: var(--surface-2); border: 1px solid var(--border);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}
.guide-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) var(--sp-6);
  border-bottom: 1px solid var(--border);
}
.guide-head .pixel { color: var(--accent-2); font-size: 9px; }
.copy-btn {
  cursor: pointer;
  background: transparent; color: var(--fg);
  border: 1px solid var(--accent);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
  padding: var(--sp-2) var(--sp-6);
  font-family: var(--font-body); font-size: 14px; font-weight: 700;
  transition: background .2s, color .2s, border-color .2s;
}
.copy-btn:hover { background: var(--accent); color: var(--bg); }
.copy-btn.done { border-color: var(--accent-2); background: var(--accent-2); color: var(--bg); }
.guide-box pre {
  margin: 0; padding: var(--sp-6);
  max-height: 460px; overflow: auto;
  font-family: var(--font-body); font-size: 13.5px; line-height: 1.7;
  white-space: pre-wrap; word-break: break-all;
  color: var(--muted);
}

/* ---------- nsfw ---------- */
.nsfw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-6);
}
.nsfw-card {
  position: relative; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border);
}
.nsfw-card img { aspect-ratio: 1; object-fit: cover; filter: blur(20px) saturate(.8); transform: scale(1.1); transition: filter .3s; }
.nsfw-card.unlocked img { filter: none; transform: none; }
.nsfw-scrim {
  position: absolute; inset: 0;
  background: rgba(14, 10, 20, .72);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-3);
}
.nsfw-card.unlocked .nsfw-scrim { display: none; }
.nsfw-scrim .pixel { color: var(--status-bad); font-size: 12px; text-shadow: 0 4px 0 rgba(0,0,0,.55); }
.nsfw-btn {
  cursor: pointer;
  background: transparent; color: var(--fg);
  border: 1px solid var(--status-bad);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
  padding: var(--sp-2) var(--sp-6);
  font-family: var(--font-body); font-size: 14px; font-weight: 700;
  transition: background .2s, color .2s;
}
.nsfw-btn:hover { background: var(--status-bad); color: var(--bg); }
.nsfw-name {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: var(--sp-2) var(--sp-3);
  background: rgba(14, 10, 20, .8);
  font-size: 13px; font-weight: 600;
}
.nsfw-card.unlocked .nsfw-name { display: block; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-16) var(--sp-6);
  text-align: center; color: var(--muted); font-size: 14px;
}
.footer .pixel { color: var(--accent); margin-bottom: var(--sp-3); font-size: 10px; }
.footer-mind { margin-top: var(--sp-4); color: var(--accent); font-size: 13px; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .24s ease-out, transform .24s ease-out; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  body { font-size: 16px; }
  .nav-links { gap: var(--sp-4); font-size: 13px; }
  .nav-links a:not(.nav-adult):nth-child(n+5) { display: none; }
  .section { padding: var(--sp-16) 0; }
  .profile-grid, .speech-grid, .move-row, .affinity-board { grid-template-columns: 1fr; }
  .move-row:nth-child(even) .move-art { order: 0; }
  .stage-tabs { flex-direction: row; flex-wrap: wrap; }
  .hero-inner { padding-top: var(--sp-24); }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-title { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .bubble-set.open .mind-box { animation: none; }
  .sticker:hover, .bubble-set:hover .bubble { transform: none; }
}
