/* ============================================
   idfkit Landing Page — Styles
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #060a14;
  --color-bg-elevated: #0c1222;
  --color-bg-card: #0f1629;
  --color-bg-card-hover: #141d35;
  --color-surface: #1a2340;
  --color-border: rgba(99, 130, 237, 0.08);
  --color-border-hover: rgba(99, 130, 237, 0.18);

  --color-text: #e2e8f0;
  --color-text-muted: #8892a8;
  --color-text-dim: #5a6478;

  --color-accent: #3b82f6;
  --color-accent-2: #818cf8;
  --color-accent-3: #60a5fa;
  --color-accent-warm: #ef4444;

  --gradient-brand: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 40%, #ef4444 100%);
  --gradient-warm: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  --gradient-cool: linear-gradient(135deg, #3b82f6 0%, #93c5fd 100%);
  --gradient-card: linear-gradient(180deg, rgba(59, 130, 246, 0.03) 0%, transparent 100%);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);

  --container-width: 1200px;
  --section-spacing: 140px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* --- Container --- */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 41px; /* below the beta bar */
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 24px;
  transition: background 0.4s ease, backdrop-filter 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(6, 10, 20, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom-color: var(--color-border);
}

.nav-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.nav-logo-icon {
  font-size: 1.3rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.25s ease;
  letter-spacing: -0.01em;
}

.nav-link:hover {
  color: var(--color-text);
}

.nav-link-github {
  display: flex;
  align-items: center;
  opacity: 0.6;
  transition: opacity 0.25s ease;
}

.nav-link-github:hover {
  opacity: 1;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: all 0.3s var(--ease-out-quart);
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.2), 0 0 60px rgba(139, 92, 246, 0.1);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.3), 0 0 80px rgba(139, 92, 246, 0.15);
}

.btn-secondary {
  background: var(--color-bg-card);
  color: var(--color-text);
  border: 1px solid var(--color-border-hover);
}

.btn-secondary:hover {
  background: var(--color-bg-card-hover);
  border-color: rgba(99, 179, 237, 0.3);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1rem;
  border-radius: 12px;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  background:
    radial-gradient(ellipse at center, transparent 0%, var(--color-bg) 80%),
    linear-gradient(180deg, transparent 65%, var(--color-bg) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 3;
  text-align: left;
  max-width: 700px;
  padding: 0 24px;
  padding-top: 113px; /* beta bar (41px) + nav (72px) */
  margin-left: max(24px, 6vw);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  color: var(--color-accent);
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 32px;
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.2s both;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent-3);
  animation: pulse 2s ease-in-out infinite;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.35s both;
}

.hero-title-line {
  display: block;
}

.hero-title-gradient {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 0 40px;
  line-height: 1.7;
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.5s both;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-bottom: 60px;
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.65s both;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 32px;
  animation: fadeInUp 0.8s var(--ease-out-expo) 0.8s both;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stat-label {
  font-size: 0.78rem;
  color: var(--color-text-dim);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.hero-stat-divider {
  width: 1px;
  height: 40px;
  background: var(--color-border);
}

/* Scroll indicator */
.hero-scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  animation: fadeInUp 0.8s var(--ease-out-expo) 1.2s both;
}

.hero-scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(180deg, var(--color-accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

/* --- Section Base --- */
.section {
  padding: var(--section-spacing) 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 72px;
}

.section-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.035em;
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* --- Ecosystem Section --- */
.section-ecosystem {
  background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-elevated) 50%, var(--color-bg) 100%);
}

.ecosystem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.eco-card {
  position: relative;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 36px 28px;
  transition: all 0.4s var(--ease-out-quart);
  overflow: hidden;
}

.eco-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.eco-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 40px rgba(59, 130, 246, 0.05);
}

.eco-card:hover::before {
  opacity: 1;
}

.eco-card-featured {
  border-color: rgba(59, 130, 246, 0.15);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.04) 0%, var(--color-bg-card) 100%);
}

.eco-card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-accent);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.eco-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(129, 140, 248, 0.1) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--color-accent);
}

.eco-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-dim);
  margin-bottom: 6px;
}

.eco-card-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.eco-card-desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.65;
  margin-bottom: 20px;
}

.eco-card-features {
  margin-bottom: 24px;
}

.eco-card-features li {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  padding: 5px 0;
  padding-left: 18px;
  position: relative;
}

.eco-card-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-accent);
  opacity: 0.5;
}

.eco-card-code {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.eco-card-code code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--color-accent);
}

.eco-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
  transition: gap 0.25s ease;
}

.eco-card-link:hover {
  gap: 10px;
}

/* --- Features Section --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 32px 28px;
  transition: all 0.4s var(--ease-out-quart);
}

.feature-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-3px);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.feature-icon-speed {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.feature-icon-refs {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

.feature-icon-zero {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.feature-icon-3d {
  background: rgba(96, 165, 250, 0.1);
  color: #60a5fa;
}

.feature-icon-weather {
  background: rgba(249, 115, 22, 0.1);
  color: #f97316;
}

.feature-icon-ai {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

.feature-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}

/* --- Code Section --- */
.section-code {
  background: var(--color-bg);
}

.code-tabs {
  max-width: 700px;
  margin: 0 auto;
}

.code-tab-buttons {
  display: flex;
  gap: 4px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
}

.code-tab-btn {
  flex: 1;
  padding: 10px 20px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.code-tab-btn.active {
  background: var(--color-surface);
  color: var(--color-text);
}

.code-tab-btn:hover:not(.active) {
  color: var(--color-text);
}

.code-panel {
  display: none;
}

.code-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.code-block {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.code-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.code-dot-red { background: #ff5f57; }
.code-dot-yellow { background: #febc2e; }
.code-dot-green { background: #28c840; }

.code-filename {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-text-dim);
  margin-left: 8px;
}

.code-block pre {
  padding: 24px;
  overflow-x: auto;
}

.code-block code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--color-text);
}

.code-comment { color: var(--color-text-dim); }
.code-keyword { color: #ef4444; }
.code-string { color: #60a5fa; }

/* --- Beta Announcement Bar --- */
.beta-bar {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
  border-bottom: 1px solid rgba(59, 130, 246, 0.15);
  padding: 10px 24px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 101;
}

.beta-bar-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.82rem;
}

.beta-bar-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--gradient-brand);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.beta-bar-text {
  color: var(--color-text-muted);
}

.beta-bar-text a {
  color: var(--color-accent-3);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.beta-bar-text a:hover {
  color: var(--color-text);
}

/* --- Beta Feedback Section --- */
.section-beta {
  padding: 80px 0 var(--section-spacing);
}

.beta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 48px;
}

.beta-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  transition: all 0.4s var(--ease-out-quart);
}

.beta-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-3px);
}

.beta-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(129, 140, 248, 0.1) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--color-accent);
}

.beta-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.beta-card-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

.btn-beta {
  width: 100%;
  justify-content: center;
  font-size: 0.82rem;
  padding: 10px 16px;
}

.beta-cta {
  text-align: center;
  padding: 48px 40px;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.04) 0%, rgba(129, 140, 248, 0.02) 100%);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
}

.beta-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.4), transparent);
}

.beta-cta-text {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.cta-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Staggered delays for beta grid */
.beta-grid [data-animate]:nth-child(1) { transition-delay: 0.05s; }
.beta-grid [data-animate]:nth-child(2) { transition-delay: 0.15s; }
.beta-grid [data-animate]:nth-child(3) { transition-delay: 0.25s; }

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--color-border);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  transition: color 0.25s ease;
}

.footer-links a:hover {
  color: var(--color-text);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--color-text-dim);
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

@keyframes scrollPulse {
  0% { opacity: 0; transform: scaleY(0); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); transform-origin: top; }
  50.01% { transform-origin: bottom; }
  100% { opacity: 0; transform: scaleY(0); transform-origin: bottom; }
}

/* Scroll-triggered animations */
[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease-out-expo), transform 0.7s var(--ease-out-expo);
}

[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for grid items */
.ecosystem-grid [data-animate]:nth-child(1) { transition-delay: 0.05s; }
.ecosystem-grid [data-animate]:nth-child(2) { transition-delay: 0.15s; }
.ecosystem-grid [data-animate]:nth-child(3) { transition-delay: 0.25s; }

.features-grid [data-animate]:nth-child(1) { transition-delay: 0.0s; }
.features-grid [data-animate]:nth-child(2) { transition-delay: 0.08s; }
.features-grid [data-animate]:nth-child(3) { transition-delay: 0.16s; }
.features-grid [data-animate]:nth-child(4) { transition-delay: 0.24s; }
.features-grid [data-animate]:nth-child(5) { transition-delay: 0.32s; }
.features-grid [data-animate]:nth-child(6) { transition-delay: 0.4s; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .ecosystem-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .beta-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto 48px;
  }
}

@media (max-width: 768px) {
  :root {
    --section-spacing: 100px;
  }

  .nav-links {
    gap: 20px;
  }

  .nav-link:not(.nav-link-github) {
    display: none;
  }

  .hero-content {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    max-width: 90%;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stats {
    flex-direction: column;
    justify-content: center;
    gap: 16px;
  }

  .hero-stat-divider {
    width: 40px;
    height: 1px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .beta-cta {
    padding: 36px 24px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.2rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .code-tab-buttons {
    flex-direction: column;
  }
}
