/* ============ TOKENS ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #6b7280;
  --accent: #0066FF;
  --accent-light: #e8f0ff;
  --border: #e5e7eb;
  --neutral-50: #f9fafb;
  --neutral-100: #f3f4f6;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html.dark {
  --bg: #0a0a0c;
  --fg: #f5f5f7;
  --muted: #8b8b94;
  --accent: #4d8dff;
  --accent-light: #14213d;
  --border: #1f2025;
  --neutral-50: #111114;
  --neutral-100: #16161b;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

::selection { background: var(--accent); color: #fff; }

/* ============ MAGNETIC CURSOR ============ */
.cursor-dot, .cursor-ring { display: none !important; }
.cursor-dot-old, .cursor-ring-old {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  top: 0; left: 0;
  mix-blend-mode: difference;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.25s, height 0.25s, background 0.25s;
}
.cursor-ring {
  width: 36px; height: 36px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.25s var(--ease), height 0.25s var(--ease), border-color 0.25s, background 0.25s;
}
.cursor-ring.hover { width: 64px; height: 64px; background: rgba(255,255,255,0.08); }
.cursor-ring.click { width: 26px; height: 26px; }
@media (hover: none) { .cursor-dot, .cursor-ring { display: none; } }

/* ============ CURTAIN ============ */
#curtain {
  position: fixed; inset: 0;
  z-index: 99998;
  background: var(--fg);
  transform: translateY(-100%);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
#curtain.in  { animation: curtainIn 0.85s cubic-bezier(0.76, 0, 0.24, 1) forwards; }
#curtain.out { animation: curtainOut 0.85s cubic-bezier(0.76, 0, 0.24, 1) forwards; }
@keyframes curtainIn  { 0% { transform: translateY(100%); } 100% { transform: translateY(0); } }
@keyframes curtainOut { 0% { transform: translateY(0); } 100% { transform: translateY(-100%); } }
.curtain-logo {
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 8rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  color: var(--bg);
}
.curtain-logo span { color: var(--accent); }

/* ============ HEADER ============ */
header.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 clamp(20px, 5vw, 80px);
  background: color-mix(in oklab, var(--bg) 75%, transparent);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid color-mix(in oklab, var(--border) 60%, transparent);
  transition: background 0.3s, border-color 0.3s;
}
.header-inner {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.04em;
  display: inline-flex;
  align-items: baseline;
}
.logo span { color: var(--accent); }
.logo-wave {
  display: inline-block;
  animation: wave 4s ease-in-out infinite;
  transform-origin: 70% 70%;
}
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  30% { transform: rotate(14deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}

nav.primary { display: flex; align-items: center; gap: 4px; }
nav.primary a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  position: relative;
}
nav.primary a:hover { color: var(--fg); background: var(--neutral-50); }
nav.primary a.active { color: var(--accent); }

.header-right { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
}
.icon-btn:hover { background: var(--neutral-50); border-color: var(--fg); }
.icon-btn svg { width: 16px; height: 16px; }

.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }
html.dark .theme-toggle .sun { display: block; }
html.dark .theme-toggle .moon { display: none; }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--neutral-50);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.lang-btn {
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-body);
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.2s;
}
.lang-btn.active { background: var(--fg); color: var(--bg); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--fg);
  transition: all 0.3s var(--ease);
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
}
.mobile-menu.open { opacity: 1; pointer-events: all; }
.mobile-menu a {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 800;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.03em;
}

/* ============ COMMON ============ */
section.page-section { padding: clamp(80px, 10vw, 140px) clamp(20px, 5vw, 80px); }
.section-inner { max-width: 1320px; margin: 0 auto; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  font-family: var(--font-mono);
}
.eyebrow::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--accent);
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.4vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
  color: var(--fg);
  text-wrap: balance;
}

/* word-by-word reveal */
.reveal-words .word {
  display: inline-block;
  opacity: 1;
  transform: translateY(0.5em) rotateX(-30deg);
  transform-origin: bottom;
  transition: opacity 0.6s var(--ease), transform 0.7s var(--ease);
}
.reveal-words.visible .word { opacity: 1; transform: translateY(0) rotateX(0); }

.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }
.reveal.d4 { transition-delay: 0.32s; }

/* ============ BUTTONS ============ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: transform 0.3s var(--ease), background 0.3s, box-shadow 0.3s;
  will-change: transform;
  overflow: hidden;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent); box-shadow: 0 12px 32px color-mix(in oklab, var(--accent) 35%, transparent); }
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.25), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}
.btn-primary:hover::before { opacity: 1; }
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--fg); }
.btn .arrow { display: inline-flex; transition: transform 0.35s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn .label-track {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  height: 1.2em;
  overflow: hidden;
}
.btn .label-track span {
  display: block;
  transition: transform 0.35s var(--ease);
}
.btn:hover .label-track span { transform: translateY(-100%); }
