/* ===== Design Tokens ===== */
:root {
  --bg-0: oklch(0.13 0.065 295);
  --bg-1: oklch(0.18 0.08 295);
  --bg-2: oklch(0.23 0.10 295);
  --ink:  oklch(0.985 0.005 295);
  --ink-mute: oklch(0.72 0.02 295);
  --ink-dim:  oklch(0.50 0.025 295);
  --line:   oklch(1 0 0 / 0.08);
  --line-2: oklch(1 0 0 / 0.14);

  --purple-deep:   oklch(0.42 0.20 290);
  --purple:        oklch(0.62 0.25 295);
  --purple-bright: oklch(0.74 0.28 305);
  --neon:   oklch(0.78 0.30 320);
  --money:  oklch(0.92 0.18 110);
  --good:   oklch(0.78 0.20 145);
  --hot:    oklch(0.70 0.22 25);
  --emph: 1;

  --font-kr:      'Pretendard Variable','Pretendard',-apple-system,BlinkMacSystemFont,'Apple SD Gothic Neo','Noto Sans KR',system-ui,sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;
  --font-display: 'Pretendard Variable','Pretendard','Anton',system-ui,sans-serif;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-kr);
  background: #100c1e;
  background: var(--bg-0);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection { background: var(--purple); color: #000; }
img, video, svg { max-width: 100%; }

/* ===== Typography utils ===== */
.mono     { font-family: var(--font-mono); font-feature-settings: 'tnum' 1; }
.tnum     { font-variant-numeric: tabular-nums; }
.live-num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
.mute     { color: var(--ink-mute); }
.dim      { color: var(--ink-dim); }

/* ===== Layout ===== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.surface.in-frame .container { padding: 0 16px; }

/* ===== Frame stage (iOS preview mode) ===== */
.frame-stage {
  min-height: 100vh; padding: 24px 12px 80px;
  display: flex; align-items: flex-start; justify-content: center;
  background:
    radial-gradient(1200px 800px at 70% -10%, oklch(0.30 0.18 305 / 0.45), transparent 60%),
    radial-gradient(900px 700px at -10% 110%, oklch(0.35 0.20 280 / 0.40), transparent 60%),
    var(--bg-0);
}

/* ===== App background (프로덕션 페이지 — 그라디언트 배경) ===== */
.app-bg {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: bisque;
}

/* ===== Surface ===== */
.surface {
  position: relative;
  width: 100%;
  background: var(--bg-0);
  overflow: clip; /* hidden과 동일하게 클리핑하지만 스크롤 컨테이너를 만들지 않아 sticky 동작 유지 */
}
.surface.in-frame {
  width: 402px; height: 874px; overflow-y: auto; overflow-x: hidden;
  border-radius: 38px;
}
.surface.in-frame::-webkit-scrollbar { display: none; }
.surface.in-frame { scrollbar-width: none; }

/* ===== App surface (프로덕션 페이지 — 핸드폰 프레임 없이 모바일 너비 centering) ===== */
.surface.app-surface {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: visible;
  display: flex;
  flex-direction: column;
}
.surface.app-surface > main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ===== Atmospheric background ===== */
.atmos {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(60% 40% at 80% 0%,  var(--purple-bright), transparent 60%),
    radial-gradient(80% 50% at 20% 25%, var(--purple),        transparent 65%),
    radial-gradient(70% 55% at 90% 60%, var(--neon),          transparent 65%),
    radial-gradient(50% 40% at 10% 95%, var(--purple-deep),   transparent 70%),
    var(--bg-0);
  opacity: 0.55;
  filter: saturate(1.2);
}
.atmos.grain::after {
  content: ''; position: absolute; inset: 0;
  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.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.6'/></svg>");
  opacity: 0.18; mix-blend-mode: overlay;
}

/* ===== Page / Section ===== */
.page    { position: relative; z-index: 1; }
section  { position: relative; }

/* ===== Card ===== */
.card {
  border-radius: 20px;
  background: linear-gradient(180deg, oklch(1 0 0 / 0.04), oklch(1 0 0 / 0.02));
  border: 1px solid var(--line);
  padding: 20px;
}

/* ===== Glow box ===== */
.glow-box { position: relative; }
.glow-box::before {
  content: ''; position: absolute; inset: -2px; border-radius: inherit;
  background: linear-gradient(135deg, var(--purple-bright), var(--neon), var(--purple));
  z-index: -1;
  filter: blur(calc(14px * var(--emph)));
  opacity: calc(0.55 * var(--emph));
}

/* ===== Hero amount (font-size overridden by inline style) ===== */
.hero-amount {
  font-family: var(--font-display);
  font-weight: 900; line-height: 0.82; letter-spacing: -0.06em;
  background: linear-gradient(180deg, #fff 0%, var(--purple-bright) 55%, var(--purple) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 calc(80px * var(--emph)) oklch(0.62 0.25 295 / 0.5);
  display: block; text-align: center;
}

/* ===== Pill ===== */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: oklch(1 0 0 / 0.06); border: 1px solid var(--line);
  font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-mute);
}
.pill .dot {
  width: 8px; height: 8px; border-radius: 999px; background: var(--hot);
  box-shadow: 0 0 0 4px oklch(0.70 0.22 25 / 0.25);
  animation: pulseDot 1.4s ease-in-out infinite;
}
.dot {
  width: 8px; height: 8px; border-radius: 999px; background: var(--hot);
  display: inline-block; flex-shrink: 0;
  box-shadow: 0 0 0 4px oklch(0.70 0.22 25 / 0.25);
  animation: pulseDot 1.4s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 4px oklch(0.70 0.22 25 / 0.25); }
  50%       { box-shadow: 0 0 0 8px oklch(0.70 0.22 25 / 0); }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 999px; border: 0; cursor: pointer;
  font-family: var(--font-kr); font-weight: 700; letter-spacing: -0.01em;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn-primary {
  background: linear-gradient(180deg, var(--purple-bright), var(--purple));
  color: #fff; padding: 18px 28px; font-size: 18px;
  box-shadow:
    0 0 0 1px oklch(1 0 0 / 0.18) inset,
    0 12px 40px oklch(0.62 0.25 295 / 0.45),
    0 2px 0 oklch(0 0 0 / 0.25);
}
.btn-primary:hover {
  box-shadow:
    0 0 0 1px oklch(1 0 0 / 0.25) inset,
    0 16px 48px oklch(0.62 0.25 295 / 0.55);
}

.btn-ghost {
  background: oklch(1 0 0 / 0.06); color: var(--ink);
  padding: 12px 18px; font-size: 14px;
  border: 1px solid var(--line); border-radius: 999px;
}
.btn-ghost:hover { background: oklch(1 0 0 / 0.10); }

.btn:disabled, .btn[disabled], .btn--inactive {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== Marquee ===== */
.marquee {
  display: flex; overflow: hidden;
  border-block: 1px solid var(--line);
  background: oklch(0 0 0 / 0.35);
}
.marquee-track {
  display: inline-flex; gap: 36px; padding: 14px 0; flex: 0 0 auto;
  animation: scrollX 30s linear infinite;
}
@keyframes scrollX {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ===== Form ===== */
.input {
  width: 100%; padding: 16px;
  border-radius: 14px;
  background: oklch(1 0 0 / 0.10);
  border: 1px solid oklch(1 0 0 / 0.22);
  color: var(--ink); font-family: var(--font-kr); font-size: 16px;
  transition: border-color .15s ease, background .15s ease;
  display: block;
}
.input::placeholder { color: oklch(0.60 0.02 295); }
.input:focus { outline: 0; border-color: var(--purple-bright); background: oklch(1 0 0 / 0.14); }
textarea.input { resize: vertical; min-height: 90px; }
select.input {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-mute) 50%),
    linear-gradient(135deg, var(--ink-mute) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 3px),
    calc(100% - 16px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.label { font-size: 13px; color: oklch(0.82 0.03 295); margin-bottom: 8px; display: block; letter-spacing: -0.005em; }

/* ===== Flex / Grid utils ===== */
.row  { display: flex; align-items: center; }
.col  { display: flex; flex-direction: column; }
.grid { display: grid; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }

/* ===== Scroll reveal animation ===== */
.reveal-init {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* ===== Custom scrollbar ===== */
.nice-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.nice-scroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; }

/* ===== Modal / overlay animations ===== */
@keyframes fade     { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp  { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ===== Chip ===== */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  font-family: var(--font-mono);
}
.chip--good   { background: oklch(0.78 0.20 145 / 0.18); color: oklch(0.88 0.18 150); border: 1px solid oklch(0.78 0.20 145 / 0.35); }
.chip--hot    { background: oklch(0.70 0.22 25 / 0.18);  color: oklch(0.85 0.16 30);  border: 1px solid oklch(0.70 0.22 25 / 0.35); }
.chip--money  { background: oklch(0.92 0.18 110 / 0.16); color: oklch(0.93 0.18 110); border: 1px solid oklch(0.92 0.18 110 / 0.35); }
.chip--purple { background: oklch(0.62 0.25 295 / 0.22); color: oklch(0.86 0.16 305); border: 1px solid oklch(0.74 0.28 305 / 0.45); }
.chip--mute   { background: oklch(1 0 0 / 0.06); color: var(--ink-mute); border: 1px solid var(--line); }
.chip--xs     { font-size: 10px; padding: 3px 7px; }

/* ===== Password field helpers ===== */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 50px; }

/* iOS Safari 네이티브 자동완성 버튼 억제 */
.pw-wrap .input::-webkit-credentials-auto-fill-button {
  display: none !important;
  pointer-events: none;
}

.pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 999px;
  background: transparent; border: 0; color: var(--ink-mute); cursor: pointer;
  display: grid; place-items: center;
  -webkit-appearance: none;
  appearance: none;
}
