/* ============ Design tokens ============ */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #14161c;
  --ink-2: #545a6b;
  --line: color-mix(in oklab, var(--ink) 12%, transparent);

  --accent: #2a4bf0;
  --accent-2: #6e5bff;
  --accent-ink: #ffffff;

  --grad-hero: radial-gradient(120% 90% at 80% 0%, #e9ecff 0%, transparent 60%),
               radial-gradient(90% 70% at 0% 20%, #f0e9ff 0%, transparent 55%);

  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
                  "Pretendard", "Segoe UI", system-ui, sans-serif;
  --font-text: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard",
               "Segoe UI", system-ui, sans-serif;

  --text-hero: clamp(2.6rem, 1.4rem + 4.6vw, 5rem);
  --text-h2: clamp(1.7rem, 1.1rem + 2.2vw, 2.9rem);
  --text-h3: clamp(1.05rem, 0.95rem + 0.4vw, 1.25rem);
  --text-lede: clamp(1.05rem, 0.98rem + 0.4vw, 1.3rem);

  --space-section: clamp(4.5rem, 3rem + 6vw, 9rem);
  --wrap: 1140px;
  --radius: 18px;
  --radius-lg: 28px;

  --dur: 280ms;
  --dur-slow: 600ms;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-1: 0 1px 2px rgba(20, 22, 28, 0.04), 0 8px 24px rgba(20, 22, 28, 0.06);
  --shadow-2: 0 24px 60px rgba(36, 40, 90, 0.18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.skip-link {
  position: fixed; left: 1rem; top: -3rem; z-index: 200;
  background: var(--ink); color: #fff; padding: 0.6rem 1rem; border-radius: 10px;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ============ Buttons ============ */
.btn {
  --pad: 0.85rem 1.4rem;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: var(--pad); border-radius: 999px; font-weight: 600;
  font-size: 0.98rem; cursor: pointer; border: 1px solid transparent;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              background var(--dur) var(--ease), color var(--dur) var(--ease);
  will-change: transform;
}
.btn-sm { --pad: 0.55rem 1rem; font-size: 0.9rem; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 22px rgba(42, 75, 240, 0.32); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(42, 75, 240, 0.42); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: color-mix(in oklab, var(--accent) 8%, transparent); border-color: transparent; transform: translateY(-2px); }
.btn-light { background: #fff; color: var(--accent); box-shadow: var(--shadow-1); }
.btn-light:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(0,0,0,0.18); }
.btn:focus-visible, a:focus-visible, button:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--accent) 60%, #fff); outline-offset: 2px;
}

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: saturate(140%) blur(14px);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--line); background: color-mix(in oklab, var(--bg) 92%, transparent); }
.header-inner { display: flex; align-items: center; gap: 1.2rem; height: 66px; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-family: var(--font-display); }
.brand-icon { border-radius: 9px; box-shadow: var(--shadow-1); }
.nav { display: flex; gap: 1.6rem; margin-left: auto; font-size: 0.95rem; color: var(--ink-2); }
.nav a { position: relative; padding: 0.3rem 0; transition: color var(--dur) var(--ease); }
.nav a::after { content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform var(--dur) var(--ease); }
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); }
.header-actions { display: flex; align-items: center; gap: 0.8rem; }

.lang-toggle {
  display: inline-flex; align-items: center; gap: 0.35rem; background: none; border: 1px solid var(--line);
  border-radius: 999px; padding: 0.35rem 0.7rem; font-family: var(--font-display); font-weight: 600;
  font-size: 0.82rem; color: var(--ink-2); cursor: pointer; transition: border-color var(--dur) var(--ease);
}
.lang-toggle:hover { border-color: var(--accent); }
.lang-opt { transition: color var(--dur) var(--ease); }
.lang-opt.is-on { color: var(--accent); }
.lang-sep { opacity: 0.4; }

/* ============ Hero ============ */
.hero { position: relative; padding-top: clamp(2.5rem, 1rem + 5vw, 5rem); padding-bottom: var(--space-section); background: var(--grad-hero); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 1rem + 4vw, 4.5rem); align-items: center; }
.eyebrow { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  font-size: 0.78rem; color: var(--accent); margin-bottom: 1rem; }
.hero h1 { font-size: var(--text-hero); font-weight: 700; margin-bottom: 1.2rem; }
.lede { font-size: var(--text-lede); color: var(--ink-2); max-width: 32ch; margin-bottom: 1.8rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 2.4rem; }
.hero-stats { display: flex; gap: 1.8rem; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-family: var(--font-display); font-size: 1.15rem; }
.hero-stats span { font-size: 0.82rem; color: var(--ink-2); }

/* ============ Phone + wallet demo ============ */
.hero-visual { position: relative; display: flex; justify-content: center; }
.glow { position: absolute; border-radius: 50%; filter: blur(60px); z-index: 0; pointer-events: none; }
.glow-a { width: 360px; height: 360px; background: rgba(110, 91, 255, 0.35); top: -30px; right: -20px; }
.glow-b { width: 300px; height: 300px; background: rgba(42, 75, 240, 0.28); bottom: -20px; left: -10px; }

.phone {
  position: relative; z-index: 1; width: min(330px, 78vw); aspect-ratio: 330 / 660;
  background: #0c0d12; border-radius: 46px; padding: 12px;
  box-shadow: var(--shadow-2), inset 0 0 0 2px rgba(255,255,255,0.06);
}
.phone-notch { position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  width: 116px; height: 26px; background: #0c0d12; border-radius: 999px; z-index: 3; }
.phone-screen { position: relative; height: 100%; background: #f3f4f8; border-radius: 36px; overflow: hidden;
  padding: 40px 16px 16px; display: flex; flex-direction: column; }
.demo-head { margin-bottom: 12px; }
.demo-title { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.demo-tabs { display: flex; gap: 4px; background: #e6e8f0; border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.demo-tab { flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 0.45rem 0.4rem;
  font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--ink-2); cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.demo-tab.is-active { background: #fff; color: var(--ink); box-shadow: var(--shadow-1); }
.tab-count { opacity: 0.6; font-weight: 700; }

.card-stack { position: relative; flex: 1; }
.cw-card {
  position: absolute; left: 0; right: 0; top: 0;
  height: 110px; border-radius: 16px; padding: 14px 16px; color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 10px 22px rgba(0,0,0,0.22); overflow: hidden;
  transform: translateY(calc(var(--i, 0) * var(--step, 52px)));
  transition: transform var(--dur-slow) var(--ease), opacity var(--dur) var(--ease);
  display: grid; grid-template-columns: 1fr auto; align-content: start; gap: 2px 8px;
  --step: 52px;
}
.cw-card[hidden] { display: none; }
.cw-front { height: 150px; }
.cw-brand { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.cw-sub { grid-column: 1; font-size: 0.6rem; letter-spacing: 0.14em; opacity: 0.66; }
.cw-badge { justify-self: end; align-self: start; font-size: 0.62rem; font-weight: 700; padding: 3px 8px;
  border-radius: 999px; background: rgba(255,255,255,0.22); }
.cw-exp { background: rgba(255,80,78,0.95); }
.cw-soon { background: rgba(232,80,78,0.95); }
.cw-ok { background: rgba(15,157,88,0.95); }
.cw-done { background: rgba(255,255,255,0.28); }
.cw-barcode { grid-column: 1 / -1; align-self: end; height: 30px; margin-top: 8px; border-radius: 4px;
  background: repeating-linear-gradient(90deg, #fff 0 2px, transparent 2px 4px, #fff 4px 5px, transparent 5px 8px);
  opacity: 0.92; }
.cw-valid { grid-column: 1 / -1; font-size: 0.66rem; font-weight: 600; margin-top: 6px; }
.cw-valid i { font-style: normal; opacity: 0.7; margin-right: 4px; }

/* spread on hover (pointer devices only) */
@media (hover: hover) {
  .phone:hover .cw-card { --step: 60px; }
  .phone:hover .cw-front { transform: translateY(calc(var(--i, 0) * 60px + 6px)); }
}
/* one-time fan-out when the demo first scrolls into view */
.card-stack.peek .cw-card { --step: 60px; }
.card-stack.peek .cw-front { transform: translateY(calc(var(--i, 0) * 60px + 6px)); }
.demo-hint { margin-top: 12px; font-size: 0.72rem; color: var(--ink-2); text-align: center; }

/* ============ Sections ============ */
.section { padding-block: var(--space-section); }
.section-alt { background: linear-gradient(180deg, #fff, var(--bg)); }
.section-head { max-width: 30ch; margin-bottom: clamp(2rem, 1rem + 3vw, 3.5rem); }
.kicker { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  font-size: 0.76rem; color: var(--accent); margin-bottom: 0.7rem; }
.section h2 { font-size: var(--text-h2); }

/* ============ Bento ============ */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.tile { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.6rem; box-shadow: var(--shadow-1); overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.tile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--accent); opacity: 0; transition: opacity var(--dur) var(--ease); }
.tile:hover { transform: translateY(-6px); box-shadow: var(--shadow-2); border-color: transparent; }
.tile:hover::before { opacity: 1; }
.tile-lg { grid-column: span 1; grid-row: span 2; display: flex; flex-direction: column; }
.tile-wide { grid-column: span 2; }
.tile-icon { width: 50px; height: 50px; display: grid; place-items: center; font-size: 1.5rem; border-radius: 14px;
  background: color-mix(in oklab, var(--accent) 12%, #fff); margin-bottom: 1rem; }
.tile h3 { font-size: var(--text-h3); margin-bottom: 0.5rem; }
.tile p { color: var(--ink-2); font-size: 0.96rem; }
.tile-lg p { margin-top: auto; }

/* ============ Steps ============ */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; counter-reset: s; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.8rem 1.6rem; }
.step-num { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); margin-bottom: 1rem; box-shadow: 0 8px 18px rgba(42,75,240,0.3); }
.step h3 { font-size: var(--text-h3); margin-bottom: 0.4rem; }
.step p { color: var(--ink-2); font-size: 0.96rem; }

/* ============ Privacy band ============ */
.privacy-band { display: grid; grid-template-columns: auto 1fr; gap: 1.4rem; align-items: center;
  background: linear-gradient(135deg, #11131a, #1f2440); color: #fff; border-radius: var(--radius-lg);
  padding: clamp(1.6rem, 1rem + 2vw, 2.8rem); box-shadow: var(--shadow-2); }
.privacy-band h2 { color: #fff; font-size: clamp(1.4rem, 1rem + 1.6vw, 2.1rem); margin-bottom: 0.5rem; }
.privacy-band p { color: rgba(255,255,255,0.78); max-width: 60ch; }
.privacy-mark { font-size: 2.4rem; width: 76px; height: 76px; display: grid; place-items: center;
  background: rgba(255,255,255,0.1); border-radius: 20px; }
.privacy-link { display: inline-block; margin-top: 1rem; font-weight: 600; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.5); padding-bottom: 2px;
  transition: border-color var(--dur) var(--ease); }
.privacy-link:hover { border-color: #fff; }

/* ============ CTA ============ */
.cta { padding-block: var(--space-section); background: var(--grad-hero); }
.cta-inner { text-align: center; max-width: 40ch; margin-inline: auto; }
.cta-icon { margin: 0 auto 1.2rem; border-radius: 20px; box-shadow: var(--shadow-2); }
.cta h2 { font-size: var(--text-h2); margin-bottom: 0.6rem; }
.cta-inner > p { color: var(--ink-2); margin-bottom: 1.6rem; }
.cta-actions { display: flex; justify-content: center; gap: 0.8rem; }
.cta-note { font-size: 0.8rem; color: var(--ink-2); margin-top: 1rem; }

/* ============ Footer ============ */
.site-footer { border-top: 1px solid var(--line); padding-block: 1.6rem; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.footer-brand img { border-radius: 7px; }
.footer-links { display: flex; gap: 1.4rem; font-size: 0.9rem; }
.footer-links a { color: var(--ink-2); transition: color var(--dur) var(--ease); }
.footer-links a:hover { color: var(--accent); }
.footer-mail { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem;
  color: var(--ink-2); transition: color var(--dur) var(--ease); }
.footer-mail:hover { color: var(--accent); }
.footer-copy { color: var(--ink-2); font-size: 0.86rem; }

/* ============ Legal / document pages ============ */
.doc-main { padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem) var(--space-section); }
.doc { max-width: 760px; margin-inline: auto; }
.doc-head { margin-bottom: 2.4rem; padding-bottom: 1.6rem; border-bottom: 1px solid var(--line); }
.doc-head h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.8rem); margin-bottom: 0.6rem; }
.doc-eff { color: var(--ink-2); font-size: 0.9rem; }
.doc-block { font-size: 1rem; line-height: 1.9; color: var(--ink); }
.doc-block.intro { color: var(--ink-2); margin-bottom: 2.8rem; }
.doc-section { margin-bottom: 2.8rem; }
.doc-section h2 { font-size: 1.2rem; margin-bottom: 0.9rem; letter-spacing: -0.01em; }
.doc-section p { margin-bottom: 1rem; line-height: 1.9; color: var(--ink-2); }
.doc-section p:last-child { margin-bottom: 0; }
.doc-section ul { margin: 0.6rem 0 1rem; padding-left: 1.2rem; color: var(--ink-2); line-height: 1.9; }
.doc-section li { margin-bottom: 0.5rem; }
.doc-section a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.doc-back { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 2.4rem;
  font-weight: 600; color: var(--accent); }
.doc-back:hover { text-decoration: underline; }

/* ============ Reveal animation ============ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .cw-card, .btn, .tile { transition: none; }
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { order: 1; }
  .hero-visual { order: 2; }
  .lede, .section-head { margin-inline: auto; }
  .hero-cta, .hero-stats { justify-content: center; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .tile-lg { grid-row: span 1; }
  .tile-wide { grid-column: span 2; }
}
@media (max-width: 620px) {
  .nav { display: none; }
  .steps { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr; }
  .tile-wide { grid-column: span 1; }
  .privacy-band { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .hero-stats { gap: 1.2rem; }
}
