:root {
  --bg: #0d0d1a;
  --surface: #16162a;
  --border: #2a2a4a;
  --accent: #e879f9;
  --accent2: #38bdf8;
  --accent3: #4ade80;
  --text: #e2e8f0;
  --muted: #64748b;
  --cat-size: clamp(80px, 14vw, 160px);
  --surface-glass: rgba(13, 13, 26, 0.65);
  --glass-blur: blur(16px);
  --glow-accent: 0 0 40px rgba(232, 121, 249, 0.20);
  --glow-accent2: 0 0 40px rgba(56, 189, 248, 0.18);
  --pixel-border: 3px solid;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(232,121,249,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(56,189,248,0.07) 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: 'Noto Sans KR', sans-serif;
  overflow-x: hidden;
}
img { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ── STARS ── */
#stars { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  animation: twinkle var(--dur, 3s) var(--delay, 0s) infinite alternate;
}
@keyframes twinkle { from { opacity: .15; } to { opacity: 1; } }

/* ── LAYOUT ── */
.z { position: relative; z-index: 1; }

/* ── LANGUAGE TOGGLE ── */
.lang {
  position: fixed;
  right: 14px;
  top: 14px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  z-index: 2147483647;
  transform: translateZ(0);
}
.lang button {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  padding: 8px 10px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 1px;
}
.lang button[aria-pressed="true"] {
  border-color: var(--accent2);
  box-shadow: 3px 3px 0 var(--accent2);
}
.lang button:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 3px;
}
@media (max-width: 480px) {
  .lang { top: 10px; right: 10px; }
}

/* ── CAT POP ── */
.cat-pop {
  position: fixed;
  left: 0; top: 0;
  width: 72px; height: 72px;
  margin-left: -36px;
  margin-top: -42px;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.2s ease, transform 0.38s cubic-bezier(0.34, 1.45, 0.64, 1);
  filter: drop-shadow(0 0 14px rgba(232, 121, 249, 0.75));
}
.cat-pop img {
  width: 72px; height: 72px;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.cat-pop.visible { opacity: 1; transform: scale(1); }
.cat-pop.wiggle img { animation: cat-pop-wiggle 0.35s ease-in-out infinite alternate; }
@keyframes cat-pop-wiggle {
  from { transform: rotate(-6deg) translateY(0); }
  to   { transform: rotate(6deg) translateY(-3px); }
}
#cat-wrap.dim {
  opacity: 0.22;
  filter: grayscale(0.3);
  transition: opacity 0.25s ease, filter 0.25s ease;
}

/* ── HERO FULLSCREEN ── */
#hero-fullscreen {
  position: relative;
  width: 100%;
  height: 88vh;
  min-height: 560px;
  max-height: 900px;
  overflow: hidden;
}

/* ── STAGE ── */
#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: pointer;
}
#floor {
  position: absolute;
  bottom: 36px; left: 0; right: 0;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--accent) 0 8px, transparent 8px 16px
  );
  opacity: .25;
}
.bg-obj {
  position: absolute;
  bottom: 40px;
  font-size: 22px;
  opacity: .18;
  user-select: none;
}
#cat-wrap {
  position: absolute;
  bottom: 40px;
  width: var(--cat-size);
  height: var(--cat-size);
  transition: left 0.05s linear, bottom 0.12s ease-out;
}
#cat-wrap.flip { transform: scaleX(-1); }
#cat-img { width: 100%; height: 100%; display: block; }

/* ── SPEECH BUBBLE ── */
#bubble {
  position: absolute;
  bottom: calc(var(--cat-size) + 12px);
  background: var(--surface-glass);
  color: var(--text);
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  padding: 6px 10px;
  border-radius: 3px;
  border: 2px solid var(--accent);
  backdrop-filter: var(--glass-blur);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  z-index: 5;
}
#bubble.show { opacity: 1; }
#bubble::after {
  content: '';
  position: absolute;
  bottom: -7px; left: 12px;
  border: 4px solid transparent;
  border-top-color: var(--accent);
}

/* ── CHURU ITEM ── */
.item {
  position: absolute;
  bottom: 40px;
  font-size: 26px;
  display: none;
  z-index: 4;
  animation: bob .5s infinite alternate;
  pointer-events: none;
}
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-6px); } }

/* ── HERO OVERLAY ── */
.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 0 14vh;
  background:
    radial-gradient(
      ellipse 70% 55% at 50% 55%,
      rgba(13, 13, 26, 0.82) 0%,
      rgba(13, 13, 26, 0.55) 35%,
      rgba(13, 13, 26, 0.18) 65%,
      transparent 80%
    ),
    linear-gradient(
      to top,
      rgba(13, 13, 26, 0.55) 0%,
      transparent 40%
    );
  pointer-events: none;
  z-index: 2;
}
.hero-overlay-inner {
  text-align: center;
  pointer-events: all;
  padding: 0 24px;
  max-width: 720px;
  width: 100%;
}
.hero-eyebrow {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(6px, 1.2vw, 8px);
  color: var(--accent2);
  letter-spacing: 4px;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: 12px;
}
.logo {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(16px, 4vw, 36px);
  color: var(--accent);
  text-shadow: 0 0 32px var(--accent), 0 0 8px var(--accent);
  line-height: 1.5;
  letter-spacing: 3px;
  margin-bottom: 14px;
}
.logo span { color: var(--accent2); }
.hero-tagline-text {
  font-size: clamp(12px, 1.8vw, 16px);
  color: var(--text);
  opacity: 0.85;
  margin-bottom: 28px;
  line-height: 1.7;
}
.tagline {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  white-space: pre-wrap;
  word-break: keep-all;
}
@media (max-width: 480px) {
  #hero-fullscreen { height: 82vh; min-height: 540px; }
  .hero-overlay { padding: 2vh 0 10vh; }
  .logo { font-size: clamp(14px, 5vw, 22px); }
  .hero-tagline-text { font-size: 12px; }
}

/* ── HERO DOWNLOAD ROW ── */
.hero-dl-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  width: 100%;
  margin-bottom: 10px;
}
.hero-dl-row > .btn {
  flex: 0 0 auto;
  justify-content: center;
  min-width: 0;
}
.dl-subtitle-hero {
  color: var(--muted);
  font-size: 11px;
}
@media (max-width: 480px) {
  .hero-dl-row { flex-direction: column; align-items: stretch; }
  .hero-dl-row > .btn { width: 100%; }
}

/* ── BUTTONS ── */
.btn {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(7px, 1.4vw, 9px);
  padding: 12px 22px;
  border: 3px solid;
  border-radius: 3px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .08s, box-shadow .08s;
  background: var(--surface-glass);
  backdrop-filter: var(--glass-blur);
}
.btn-secondary { opacity: 0.75; }
.btn:active { transform: translate(2px,2px) !important; box-shadow: 0 0 !important; }
.btn-w  { color: var(--accent2); border-color: var(--accent2); box-shadow: 4px 4px 0 var(--accent2); }
.btn-w:hover  { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--accent2), var(--glow-accent2); }
.btn-m  { color: var(--accent);  border-color: var(--accent);  box-shadow: 4px 4px 0 var(--accent); }
.btn-m:hover  { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--accent), var(--glow-accent); }
.btn-mi { color: #f59e0b; border-color: #f59e0b; box-shadow: 4px 4px 0 #f59e0b; }
.btn-mi:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 #f59e0b; }
.btn-gh { color: var(--accent3); border-color: var(--accent3); box-shadow: 4px 4px 0 var(--accent3); }
.btn-gh:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--accent3); }

/* ── SECTION LABEL ── */
.section-label {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(8px, 1.8vw, 11px);
  color: var(--accent2);
  letter-spacing: 2px;
  text-align: center;
  padding: 64px 24px 0;
}
@media (max-width: 480px) {
  .section-label { padding-top: 48px; }
}

/* ── FEATURES ── */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 24px 40px 64px;
  max-width: 1100px;
  margin: 0 auto;
}
@media (max-width: 860px) {
  .features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .features { grid-template-columns: 1fr; padding: 20px 20px 48px; }
}
.card {
  background: var(--surface-glass);
  border: var(--pixel-border) var(--border);
  border-radius: 10px;
  padding: 28px 20px 24px;
  backdrop-filter: var(--glass-blur);
  box-shadow: 4px 4px 0 var(--border);
  transition: border-color .2s, transform .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: repeating-linear-gradient(
    90deg, var(--accent) 0 8px, transparent 8px 16px
  );
  opacity: 0.45;
}
.card:hover {
  border-color: var(--accent);
  transform: translate(-2px, -6px);
  box-shadow: 6px 10px 0 var(--accent), var(--glow-accent);
}
.card-icon { font-size: 32px; margin-bottom: 14px; }
.card h3 {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--accent);
  margin-bottom: 10px;
  letter-spacing: 2px;
}
.card p { font-size: 13px; color: var(--muted); line-height: 1.75; }

/* ── HOW IT WORKS ── */
.how {
  max-width: 640px;
  margin: 0 auto 80px;
  padding: 0 24px;
  text-align: center;
}
.how h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(8px, 1.8vw, 11px);
  color: var(--accent2);
  margin-bottom: 28px;
  letter-spacing: 1px;
}
.steps {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}
.steps::before {
  content: '';
  position: absolute;
  left: 43px;
  top: 41px;
  bottom: 41px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent2), var(--accent3));
  opacity: 0.3;
}
.step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--surface-glass);
  border: var(--pixel-border) var(--border);
  border-radius: 6px;
  padding: 18px 20px;
  backdrop-filter: var(--glass-blur);
  box-shadow: 3px 3px 0 var(--border);
  transition: border-color .2s, box-shadow .2s;
}
.step:hover {
  border-color: var(--accent2);
  box-shadow: 3px 3px 0 var(--accent2);
}
.step-num {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  min-width: 46px;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: 3px solid var(--accent);
  color: var(--accent);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  background: var(--surface);
  box-shadow: 3px 3px 0 var(--accent);
}
.step:nth-child(1) .step-num { border-color: var(--accent);  color: var(--accent);  box-shadow: 3px 3px 0 var(--accent); }
.step:nth-child(2) .step-num { border-color: var(--accent2); color: var(--accent2); box-shadow: 3px 3px 0 var(--accent2); }
.step:nth-child(3) .step-num { border-color: var(--accent3); color: var(--accent3); box-shadow: 3px 3px 0 var(--accent3); }
.step strong { display: block; margin-bottom: 4px; font-size: 14px; }
.step p { font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 28px 24px;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: var(--muted);
  line-height: 2.2;
}

/* ── SCROLL REVEAL ── */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.55s ease, transform 0.55s ease;
  }
  .reveal.in {
    opacity: 1;
    transform: translateY(0);
  }
  .card:nth-child(2).reveal { transition-delay: 0.08s; }
  .card:nth-child(3).reveal { transition-delay: 0.16s; }
  .card:nth-child(4).reveal { transition-delay: 0.24s; }
  .step:nth-child(2).reveal { transition-delay: 0.10s; }
  .step:nth-child(3).reveal { transition-delay: 0.20s; }
}
