/* ============================================
   Klarr — Waitlist Landing Page
   Apple-style light theme
   ============================================ */

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

:root {
  --bg: #f8f8fa;
  --bg-secondary: #f5f5f7;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --text-quaternary: #aeaeb2;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.12);
  --card-bg: rgba(245, 245, 247, 0.7);
  --card-border: rgba(0, 0, 0, 0.06);
  --card-hover-border: rgba(0, 0, 0, 0.12);
  --nav-bg: rgba(255, 255, 255, 0.72);
  --input-bg: #f5f5f7;
  --input-border: rgba(0, 0, 0, 0.08);
  --input-focus-border: rgba(0, 0, 0, 0.2);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 100px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display',
    'Segoe UI', Roboto, sans-serif;
  --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* ---------- Bubble Canvas ---------- */
#bubble-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 24px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.nav-inner {
  width: 100%;
  max-width: 980px;
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: opacity var(--transition);
}
.logo:hover {
  opacity: 0.7;
}

.logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 85vh; /* Allows features to peek above the fold */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 140px 24px 80px;
}

.hero-content {
  max-width: 680px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* Pill badge */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.8s 0.2s ease-out forwards;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.4);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

/* Headline */
.hero-headline {
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s 0.35s ease-out forwards;
}

/* Subheadline */
.hero-subheadline {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s 0.5s ease-out forwards;
}

/* Description */
.hero-description {
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text-tertiary);
  line-height: 1.65;
  max-width: 480px;
  margin-bottom: 36px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s 0.65s ease-out forwards;
}

/* Email form */
.email-form {
  width: 100%;
  max-width: 480px;
  margin-bottom: 14px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.8s 0.8s ease-out forwards;
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  padding: 5px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-wrapper:focus-within {
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.email-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 14px 16px;
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.email-input::placeholder {
  color: var(--text-quaternary);
}

.cta-button {
  flex-shrink: 0;
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  background: var(--text-primary);
  color: #fff;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform var(--transition), opacity var(--transition),
    box-shadow var(--transition);
  white-space: nowrap;
}

.cta-button:hover {
  opacity: 0.82;
  transform: scale(1.02);
}

.cta-button:active {
  transform: scale(0.98);
}

/* Micro text */
.micro-text {
  font-size: 0.75rem;
  color: var(--text-quaternary);
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.8s 0.95s ease-out forwards;
}

/* ---------- Features ---------- */
.features {
  position: relative;
  z-index: 1;
  padding: 40px 24px 120px;
}

.cards-row {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  transition: transform var(--transition), border-color var(--transition),
    box-shadow var(--transition);
  opacity: 0;
  transform: translateY(30px);
}

.feature-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out,
    border-color var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
  border-color: var(--card-hover-border);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
}

.card-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 20px;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.card-text {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  line-height: 1.55;
}

/* ---------- Footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 24px 48px;
  border-top: 1px solid var(--border);
}

.footer p {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
}

/* ---------- Animations ---------- */
@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Success State ---------- */
.email-form.success .input-wrapper {
  border-color: rgba(52, 199, 89, 0.3);
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.08);
}

.success-message {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #34c759;
  width: 100%;
}

.email-form.success .input-wrapper > * {
  display: none;
}

.email-form.success .success-message {
  display: flex;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .cards-row {
    grid-template-columns: 1fr;
    max-width: 420px;
    gap: 16px;
  }

  .hero {
    padding: 120px 20px 60px;
  }

  .feature-card {
    padding: 32px 24px;
  }

  .input-wrapper {
    flex-direction: column;
    gap: 0;
  }

  .email-input {
    width: 100%;
    text-align: center;
  }

  .cta-button {
    width: 100%;
    padding: 14px;
  }
}

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

  .hero-subheadline {
    font-size: 1.05rem;
  }

  .hero-description {
    font-size: 0.875rem;
  }
}
