/* ============================================================
   AI메이트 — Design tokens & base
   ============================================================ */

:root {
  /* Colors */
  --bg: #FFFFFF;
  --bg-tint: #F5F3FF;          /* very light lavender */
  --bg-tint-2: #EFEBFF;
  --surface: #FFFFFF;
  --surface-soft: #FAFAFE;

  --border: #ECE9F6;
  --border-strong: #DDD7F0;

  --ink-900: #0A0A14;
  --ink-700: #2A2A38;
  --ink-500: #5D5D7D;
  --ink-300: #A7A4BD;
  --ink-on-primary: #FFFFFF;

  /* Brand purple */
  --primary: #6C19FF;
  --primary-deep: #4B0DC2;
  --primary-soft: #A78BFA;
  --primary-tint: #EBE0FF;
  --primary-glow: rgba(108, 25, 255, 0.18);

  /* Accent */
  --accent-indigo: #4F46E5;
  --accent-soft: #C8B8FF;

  /* Status */
  --success: #30CB80;
  --warning: #FA8C27;
  --error: #F81D52;

  /* Type */
  --font-sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --font-display: 'Pretendard Variable', Pretendard, -apple-system, system-ui, sans-serif;

  /* Spacing scale (4pt) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-14: 56px;
  --s-16: 64px;
  --s-20: 80px;
  --s-24: 96px;
  --s-30: 120px;
  --s-40: 160px;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-2xl: 36px;
  --r-full: 999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(20, 10, 40, 0.04);
  --shadow-sm: 0 2px 6px rgba(20, 10, 40, 0.05), 0 1px 2px rgba(20, 10, 40, 0.04);
  --shadow-md: 0 8px 24px rgba(40, 20, 80, 0.07), 0 2px 6px rgba(20, 10, 40, 0.04);
  --shadow-lg: 0 20px 48px rgba(40, 20, 80, 0.10), 0 4px 12px rgba(20, 10, 40, 0.05);
  --shadow-pop: 0 24px 60px rgba(108, 25, 255, 0.30), 0 8px 20px rgba(108, 25, 255, 0.18);
  --shadow-card-hover: 0 16px 40px rgba(40, 20, 80, 0.12), 0 4px 8px rgba(20, 10, 40, 0.05);

  /* Layout */
  --content-max: 1200px;
  --gutter: 24px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 160ms;
  --dur-med: 280ms;
  --dur-slow: 600ms;
}

/* ============================================================
   Reset & base
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-900);
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

::selection { background: var(--primary-tint); color: var(--primary-deep); }

/* ============================================================
   Typography ramp
   ============================================================ */

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 var(--s-4) 0;
}
.eyebrow-dot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  display: inline-block;
}

h1, .h1 {
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 0;
  text-wrap: balance;
}
h2, .h2 {
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 var(--s-6) 0;
  text-wrap: balance;
}
h3, .h3 {
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.022em;
  margin: 0 0 var(--s-3) 0;
}
.lead {
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.6;
  color: var(--ink-500);
  font-weight: 500;
  text-wrap: pretty;
}
.body { font-size: 16px; line-height: 1.7; color: var(--ink-500); }
.caption { font-size: 13px; color: var(--ink-500); letter-spacing: 0.01em; }

/* ============================================================
   Layout primitives
   ============================================================ */

.wrap {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section {
  padding: clamp(80px, 10vw, 140px) 0;
}
.section-tight {
  padding: clamp(56px, 7vw, 88px) 0;
}

.section-head {
  max-width: 720px;
  margin: 0 auto var(--s-14) auto;
  text-align: center;
}
.section-head.left {
  margin-left: 0;
  text-align: left;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  padding: 0 26px;
  border-radius: var(--r-full);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: var(--ink-on-primary);
  box-shadow: var(--shadow-pop);
}
.btn-primary:hover {
  background: var(--primary-deep);
  transform: translateY(-2px);
  box-shadow: 0 28px 70px rgba(108, 25, 255, 0.38), 0 10px 24px rgba(108, 25, 255, 0.22);
}
.btn-primary:active { transform: translateY(0); filter: brightness(0.96); }

.btn-ghost {
  background: var(--surface);
  color: var(--ink-900);
  box-shadow: 0 0 0 1px var(--border-strong) inset, var(--shadow-sm);
}
.btn-ghost:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--border-strong) inset, var(--shadow-md); }

.btn-arrow::after {
  content: "→";
  font-size: 18px;
  transition: transform var(--dur-fast) var(--ease);
}
.btn-arrow:hover::after { transform: translateX(4px); }

.btn-sm { height: 44px; padding: 0 18px; font-size: 14px; }
.btn-lg { height: 64px; padding: 0 32px; font-size: 17px; }

/* ============================================================
   Header
   ============================================================ */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-med) var(--ease), background var(--dur-med) var(--ease);
}
.header.scrolled {
  border-bottom-color: var(--border);
  background: rgba(255, 255, 255, 0.92);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-indigo) 100%);
  position: relative;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.logo-mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  border-top-color: transparent;
  border-right-color: transparent;
}
.nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav a {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-700);
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease);
}
.nav a:hover { color: var(--primary); }
.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
@media (max-width: 980px) {
  .nav { display: none; }
}

/* ============================================================
   Reveal-on-scroll
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
  will-change: opacity, transform;
}
.reveal.in {
  opacity: 1;
  transform: none;
}
/* Above-the-fold safety: hero content is visible by default so it
   never sits invisible if IntersectionObserver fires late */
.hero .reveal { opacity: 1; transform: none; }
.hero .reveal:not(.in) { transition: none; }
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}
.reveal-stagger.in > * { opacity: 1; transform: none; }
.reveal-stagger.in > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.in > *:nth-child(2) { transition-delay: 70ms; }
.reveal-stagger.in > *:nth-child(3) { transition-delay: 140ms; }
.reveal-stagger.in > *:nth-child(4) { transition-delay: 210ms; }
.reveal-stagger.in > *:nth-child(5) { transition-delay: 280ms; }
.reveal-stagger.in > *:nth-child(6) { transition-delay: 350ms; }
