/* ── 던전 크롤러 공식 소개 페이지 ─────────────────────────────
   디자인 방향: 횃불이 켜진 지하 던전. 게임 내 UI 토큰(theme.js)과
   같은 팔레트를 쓴다. 다크 단일 테마 — 게임 자체가 다크이므로
   라이트 모드는 의도적으로 제공하지 않는다. */

@font-face {
  font-family: 'Pixel';
  src: url('DotGothic16-latin.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+2190-2193, U+00D7;
}
@font-face {
  font-family: 'PixelKR';
  src: url('Galmuri11-subset.woff2') format('woff2');
  font-display: swap;
}

:root {
  /* 게임 theme.js 와 동일 계열 */
  --ink: #0b0a12;
  --stone: #14131e;
  --panel: #1a1a2e;
  --cell: #13131f;
  --line: #2e2a4a;
  --bevel: #3a3a5c;

  --amber: #ffd24a;
  --ember: #f4713b;
  --gem: #5fe0ff;
  --venom: #2bb352;

  --text: #d8d9ee;
  --dim: #8f90b8;
  --faint: #7b7da8; /* WCAG AA(4.5:1) 충족선. 더 어둡게 내리지 말 것 */

  --display: 'PixelKR', 'Pixel', 'Apple SD Gothic Neo', sans-serif;
  --body: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo',
    'Pretendard', 'Segoe UI', 'Noto Sans KR', sans-serif;
  --mono: 'Pixel', ui-monospace, monospace;

  --gutter: clamp(20px, 5vw, 64px);
  --section: clamp(72px, 11vw, 148px);
  --maxw: 1120px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.75;
  /* 한국어는 어절 단위로 끊는다 */
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 12px; top: 12px; z-index: 100;
  background: var(--amber); color: var(--ink);
  padding: 8px 16px; border-radius: 4px;
}

/* ── 헤더 ───────────────────────────────────────────── */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px var(--gutter);
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 240ms var(--ease);
}
.site-header[data-scrolled='true'] { border-bottom-color: var(--line); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand img {
  width: 30px; height: 30px;
  border-radius: 7px;
  border: 1px solid var(--line);
  image-rendering: pixelated;
}

/* 언어 전환 — 현재 언어는 눌리지 않는 상태로 표시 */
.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.lang {
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}
.lang a, .lang span {
  padding: 5px 8px;
  color: var(--faint);
  border: 1px solid transparent;
}
.lang a:hover { color: var(--text); text-decoration: none; }
.lang [aria-current='true'] {
  color: var(--amber);
  border-color: color-mix(in srgb, var(--amber) 35%, transparent);
}
.lang .sep { color: var(--line); padding: 0; }

.header-cta {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: var(--amber);
  border: 1px solid #c9a02e;
  box-shadow: inset 1px 1px 0 #ffeaa0, inset -1px -1px 0 #a97f18;
  padding: 9px 16px;
  transition: transform 140ms var(--ease), box-shadow 140ms var(--ease);
}
.header-cta:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: inset 1px 1px 0 #ffeaa0, inset -1px -1px 0 #a97f18,
    0 6px 20px rgba(255, 210, 74, 0.28);
}
.header-cta:active { transform: translateY(1px); }

/* ── 히어로 ─────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 116px 0 64px;
  isolation: isolate;
  overflow: hidden;
}

/* 던전 석벽 + 횃불 광원 */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(70% 46% at 50% 30%, rgba(244, 113, 59, 0.16), transparent 70%),
    radial-gradient(90% 60% at 50% 100%, rgba(95, 224, 255, 0.07), transparent 65%),
    linear-gradient(180deg, #141220 0%, var(--ink) 62%);
}
/* 벽돌 텍스처 */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 64px 32px;
  mask-image: radial-gradient(72% 58% at 50% 34%, #000 20%, transparent 78%);
}

/* CRT 스캔라인 — 히어로에서만 (전면 적용은 과함) */
.scanlines {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.5;
  background: repeating-linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0 2px,
    rgba(0, 0, 0, 0.22) 2px 4px
  );
  mix-blend-mode: multiply;
}

/* 횃불 플리커 */
.torch {
  position: absolute;
  z-index: -1;
  width: clamp(180px, 26vw, 340px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 176, 60, 0.4), transparent 68%);
  filter: blur(22px);
  animation: flicker 3.7s infinite steps(1, end);
}
.torch.left { top: 14%; left: -4%; }
.torch.right { top: 22%; right: -6%; animation-delay: -1.4s; animation-duration: 4.3s; }

@keyframes flicker {
  0%, 100% { opacity: 0.92; transform: scale(1); }
  12% { opacity: 0.62; transform: scale(0.96); }
  26% { opacity: 1; transform: scale(1.03); }
  41% { opacity: 0.74; transform: scale(0.98); }
  58% { opacity: 0.98; transform: scale(1.01); }
  73% { opacity: 0.66; transform: scale(0.97); }
  86% { opacity: 0.95; transform: scale(1.02); }
}

.hero-inner { position: relative; z-index: 2; }

/* 로고 원본은 타이틀 화면 캡처. 밝기를 알파로 복사해 배경을 지웠고(assets 참고),
   screen 블렌드로 남은 어두운 반투명 화소까지 배경에 녹인다. */
.hero-logo {
  width: min(520px, 82vw);
  height: auto;
  margin: 0 auto 4px;
  image-rendering: pixelated;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 30px rgba(244, 113, 59, 0.3));
  /* 잘라낸 가장자리를 부드럽게 마무리한다 */
  mask-image: radial-gradient(82% 84% at 50% 50%, #000 66%, transparent 100%);
}

.hero-tag {
  font-family: var(--display);
  font-size: clamp(1.05rem, 1.6vw + 0.7rem, 1.6rem);
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 10px;
}
.hero-tag b { color: var(--amber); font-weight: inherit; }

.hero-sub {
  color: var(--dim);
  font-size: clamp(0.9rem, 0.4vw + 0.82rem, 1rem);
  max-width: 33rem;
  margin: 0 auto 30px;
}

/* 스토어 배지 줄 */
.stores {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 18px;
}
.badge-apple {
  display: block;
  transition: transform 160ms var(--ease), filter 160ms var(--ease);
}
.badge-apple:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 8px 22px rgba(255, 255, 255, 0.14));
}
.badge-apple img { height: 52px; width: auto; }

/* Google Play 배지 — 구글이 제공하는 공식 아트워크. 이미지 안쪽에 필수 여백이
   포함돼 있어, 애플 배지(52px)와 같은 높이로 두면 버튼이 더 작아 보인다.
   60px 로 키워 시각적 높이를 맞춘다. */
.badge-play {
  display: inline-flex;
  align-items: center;
  transition: transform .18s ease, filter .18s ease;
}
.badge-play:hover { transform: translateY(-2px); filter: brightness(1.08); }
.badge-play img { height: 60px; width: auto; display: block; }

/* 미출시 플랫폼 — 배지 대신 상태 칩 */
.badge-soon {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 52px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cell);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  cursor: default;
}
.badge-soon .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--venom);
  box-shadow: 0 0 8px var(--venom);
  animation: pulse 2.4s infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }

.hero-note {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-transform: uppercase;
}

/* 스크롤 유도 */
.scroll-cue {
  position: absolute;
  bottom: 8px; left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  padding: 4px 12px;
  background: color-mix(in srgb, var(--ink) 72%, transparent);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--faint);
  animation: bob 2.6s infinite ease-in-out;
}
@keyframes bob { 50% { transform: translate(-50%, 7px); } }

/* 배경을 걷는 몬스터들 */
.wanderers {
  position: absolute;
  inset: auto 0 0;
  height: 148px;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.sprite {
  position: absolute;
  bottom: 26px;
  width: 40px; height: 40px;
  background-repeat: no-repeat;
  background-size: 160px 40px;
  image-rendering: pixelated;
  transform: scale(1.8);
  transform-origin: bottom center;
  opacity: 0.85;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
  animation: walkframes 0.62s steps(4) infinite, march linear infinite;
}
@keyframes walkframes { to { background-position-x: -160px; } }
@keyframes march { from { left: -8%; } to { left: 108%; } }

/* ── 공통 섹션 ──────────────────────────────────────── */
.section { padding-block: var(--section); position: relative; }
.section + .section { border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  color: var(--ember);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.6vw + 0.9rem, 2.6rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.section-lead {
  color: var(--dim);
  max-width: 38rem;
  font-size: clamp(0.92rem, 0.4vw + 0.84rem, 1.02rem);
}

/* ── 지표 스트립 ────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(146px, 1fr));
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}
.stat {
  background: var(--stone);
  padding: 28px 20px;
  text-align: center;
}
.stat dt {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  color: var(--amber);
  line-height: 1.2;
}
.stat dd {
  color: var(--dim);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  margin-top: 4px;
}

/* ── 특징 ───────────────────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-top: 44px;
}
.feature {
  grid-column: span 6;
  position: relative;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 70%, transparent), var(--cell));
  border: 1px solid var(--line);
  box-shadow: inset 1px 1px 0 color-mix(in srgb, var(--bevel) 60%, transparent),
    inset -1px -1px 0 #0c0c18;
  padding: 30px 26px 28px;
  overflow: hidden;
  transition: border-color 220ms var(--ease), transform 220ms var(--ease);
}
.feature:hover {
  border-color: color-mix(in srgb, var(--amber) 45%, var(--line));
  transform: translateY(-3px);
}
/* 첫 카드를 크게 — 균일 그리드 회피 */
.feature.wide { grid-column: span 12; display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; align-items: center; }
.feature.third { grid-column: span 4; }

.feature h3 {
  font-family: var(--display);
  font-size: clamp(1.1rem, 1vw + 0.85rem, 1.4rem);
  margin-bottom: 10px;
  color: var(--text);
}
.feature p { color: var(--dim); font-size: 0.92rem; }
.feature .tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  color: var(--ember);
  border: 1px solid color-mix(in srgb, var(--ember) 40%, transparent);
  padding: 2px 9px;
  margin-bottom: 14px;
}

.feature-art {
  position: relative;
  min-height: 168px;
  border: 1px solid var(--line);
  background:
    radial-gradient(60% 60% at 50% 68%, rgba(255, 176, 60, 0.16), transparent 70%),
    repeating-linear-gradient(90deg, #101018 0 32px, #0e0e16 32px 64px);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.feature-art .sprite {
  position: static;
  transform: scale(2.6);
  animation: walkframes 0.7s steps(4) infinite;
  opacity: 1;
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.chip {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  color: var(--dim);
  background: var(--cell);
  border: 1px solid var(--line);
  padding: 4px 10px;
}
.chip[data-rarity='legend'] { color: #ffb03a; border-color: #6b4a12; }
.chip[data-rarity='epic'] { color: #c07bff; border-color: #4a2a6b; }
.chip[data-rarity='rare'] { color: #5fa8ff; border-color: #1e3a68; }

/* ── 스크린샷 갤러리 ────────────────────────────────── */
.shots {
  display: flex;
  gap: 18px;
  margin-top: 40px;
  /* 전체 폭 스크롤이지만 첫 카드는 본문 좌측선에 맞춘다 */
  padding: 6px max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter))) 22px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.shot {
  flex: 0 0 auto;
  width: clamp(200px, 24vw, 256px);
  scroll-snap-align: center;
}
.shot figure {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  background: linear-gradient(180deg, #23223a, #101018);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  transition: transform 260ms var(--ease);
}
.shot:hover figure { transform: translateY(-6px); }
.shot img {
  border-radius: 9px;
  width: 100%;
  height: auto; /* width/height 속성으로 비율만 예약하고 실제 높이는 비율대로 */
  image-rendering: pixelated;
}
.shot figcaption {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-align: center;
  margin-top: 12px;
}

/* ── 최종 CTA ───────────────────────────────────────── */
.cta {
  text-align: center;
  background:
    radial-gradient(60% 100% at 50% 100%, rgba(244, 113, 59, 0.14), transparent 70%),
    var(--stone);
}
.cta .stores { margin-top: 30px; }
.qr {
  margin: 26px auto 0;
  width: 132px;
  padding: 10px;
  background: #fff;
  border-radius: 8px;
}
.qr img { image-rendering: pixelated; }
.qr-label {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  color: var(--faint);
  margin-top: 10px;
}

/* ── 지원 ───────────────────────────────────────────── */
.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 36px;
}
.support-card {
  border: 1px solid var(--line);
  background: var(--cell);
  padding: 24px 22px;
}
.support-card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
  font-family: var(--display);
}
.support-card p { color: var(--dim); font-size: 0.88rem; }

/* ── 커뮤니티 ───────────────────────────────────────── */
.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 36px;
}
.community-card {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 55%, transparent), var(--cell));
  box-shadow: inset 1px 1px 0 color-mix(in srgb, var(--bevel) 45%, transparent),
    inset -1px -1px 0 #0c0c18;
  padding: 20px 22px;
  transition: border-color 220ms var(--ease), transform 220ms var(--ease);
}
.community-card:hover { text-decoration: none; transform: translateY(-3px); }
/* 아이콘 배지에만 브랜드 원색 — 카드 본체는 던전 패널 톤을 유지한다 */
.community-card .ic {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  border-radius: 11px;
}
.community-card .ic svg { width: 27px; height: 27px; display: block; }
.community-card .txt { display: flex; flex-direction: column; min-width: 0; }
.community-card .ct-title {
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.3;
}
.community-card .ct-sub {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  color: var(--faint);
  margin-top: 4px;
}
.community-card.discord .ic { background: #5865f2; color: #fff; }
.community-card.discord:hover { border-color: color-mix(in srgb, #5865f2 62%, var(--line)); }
.community-card.kakao .ic { background: #fee500; color: #3c1e1e; }
.community-card.kakao:hover { border-color: color-mix(in srgb, #ffe200 60%, var(--line)); }

/* ── 푸터 ───────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 44px;
  background: #08080f;
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  justify-content: space-between;
  align-items: flex-start;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  list-style: none;
}
.footer-links a { color: var(--dim); font-size: 0.85rem; }
.footer-links a:hover { color: var(--amber); }
.footer-legal {
  margin-top: 28px;
  color: var(--faint);
  font-size: 0.75rem;
  line-height: 1.9;
}

/* ── 진입 애니메이션 ──────────────────────────────────
   기본값은 "보임". JS가 살아 있을 때만 숨겼다가 드러낸다.
   스크립트가 실패해도 본문이 사라지지 않게 하기 위함. */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 620ms var(--ease), transform 620ms var(--ease);
}
.js-reveal .reveal.is-in { opacity: 1; transform: none; }

/* ── 반응형 ─────────────────────────────────────────── */
@media (max-width: 860px) {
  .feature, .feature.third { grid-column: span 12; }
  .feature.wide { grid-template-columns: 1fr; }
  .feature.wide .feature-art { order: -1; min-height: 148px; }
}
@media (max-width: 520px) {
  /* 헤더 한 줄 유지 — 영문 브랜드명이 길어 두 줄로 접힌다 */
  .site-header .brand-name { display: none; }
  .header-cta { white-space: nowrap; padding: 9px 13px; }
  .header-right { gap: 8px; }

  .hero { padding-top: 96px; }
  .hero-tag { font-size: 1.02rem; max-width: 19rem; margin-inline: auto; }
  .hero-logo { width: 90vw; }
  .stores { gap: 10px; }
  .badge-apple img { height: 46px; }
  .badge-play img { height: 54px; }
  .wanderers { height: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .wanderers { display: none; }
  .js-reveal .reveal { opacity: 1; transform: none; }
}
