/* ============================================
   KidTab Landing Page
   Aesthetic: "Storybook Finance" — warm, papery,
   friendly, trustworthy. Parents of school-age kids.
   ============================================ */

:root {
  /* Brand */
  --color-blue: #6986A9;
  --color-green: #4BB367;
  --color-blue-light: #8EA8C8;
  --color-green-light: #6FCF87;
  --color-gold: #E8A135;
  --color-purple: #AF52DE;

  /* Surfaces */
  --color-bg: #FBF8F3;
  --color-surface: #FFFFFF;
  --color-surface-raised: #FFFFFF;
  --color-surface-tinted: #F0EDE6;

  /* Text */
  --color-text: #2C3E50;
  --color-text-secondary: #6B7C8D;
  --color-text-muted: #9AABB8;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(44, 62, 80, 0.06);
  --shadow-md: 0 4px 16px rgba(44, 62, 80, 0.08);
  --shadow-lg: 0 8px 40px rgba(44, 62, 80, 0.10);
  --shadow-xl: 0 16px 64px rgba(44, 62, 80, 0.12);

  /* Layout */
  --max-width: 1120px;
  --nav-height: 72px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;

  /* Type */
  --font-display: 'Fredoka', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1A1D23;
    --color-surface: #22262E;
    --color-surface-raised: #2A2F38;
    --color-surface-tinted: #1E2128;
    --color-text: #E8ECF1;
    --color-text-secondary: #9AA5B4;
    --color-text-muted: #5E6A76;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.35);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* Subtle noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* ============================================
   Floating Coins (decorative)
   ============================================ */
.coins {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.coin {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  opacity: 0.07;
  animation: float linear infinite;
}

.coin-1 { background: var(--color-green); color: #fff; top: 10%; left: 5%; animation-duration: 22s; animation-delay: 0s; }
.coin-2 { background: var(--color-blue); color: #fff; top: 30%; right: 8%; animation-duration: 26s; animation-delay: -4s; }
.coin-3 { background: var(--color-gold); color: #fff; top: 55%; left: 12%; animation-duration: 20s; animation-delay: -8s; }
.coin-4 { background: var(--color-green); color: #fff; top: 75%; right: 15%; animation-duration: 24s; animation-delay: -12s; }
.coin-5 { background: var(--color-blue); color: #fff; top: 90%; left: 40%; animation-duration: 28s; animation-delay: -16s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-30px) rotate(90deg); }
  50% { transform: translateY(0) rotate(180deg); }
  75% { transform: translateY(30px) rotate(270deg); }
}

/* ============================================
   Navigation
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;
  background: color-mix(in srgb, var(--color-bg) 85%, transparent);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 6%, transparent);
  transition: background 0.3s ease;
}

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

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.nav-wordmark {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.wm-kid { color: var(--color-blue); }
.wm-tab { color: var(--color-green); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 15px;
  font-weight: 500;
}

.nav-links a {
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}

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

.nav-cta {
  background: var(--color-green);
  color: #fff !important;
  padding: 8px 20px;
  border-radius: 100px;
  font-weight: 600;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease;
}

.nav-cta:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 16px rgba(75, 179, 103, 0.3);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all 0.3s var(--ease-out);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--color-surface);
  padding: 16px 24px;
  flex-direction: column;
  gap: 16px;
  z-index: 99;
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 6%, transparent);
  box-shadow: var(--shadow-lg);
  font-size: 17px;
  font-weight: 500;
}

.mobile-menu.open {
  display: flex;
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
}

/* ============================================
   Hero
   ============================================ */
.hero {
  position: relative;
  padding: calc(var(--nav-height) + 60px) 24px 120px;
  background: linear-gradient(170deg,
    color-mix(in srgb, var(--color-blue) 8%, var(--color-bg)) 0%,
    var(--color-bg) 50%,
    color-mix(in srgb, var(--color-green) 5%, var(--color-bg)) 100%
  );
  overflow: hidden;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  background: color-mix(in srgb, var(--color-blue) 12%, transparent);
  color: var(--color-blue);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
  animation: fadeInUp 0.6s var(--ease-out) both;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
  animation: fadeInUp 0.6s var(--ease-out) 0.1s both;
}

.hero-accent {
  background: linear-gradient(135deg, var(--color-blue), var(--color-green));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  margin-top: 20px;
  font-size: 18px;
  line-height: 1.7;
  color: var(--color-text-secondary);
  max-width: 480px;
  animation: fadeInUp 0.6s var(--ease-out) 0.2s both;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  animation: fadeInUp 0.6s var(--ease-out) 0.3s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
  border: none;
}

.btn-primary {
  background: var(--color-green);
  color: #fff;
  box-shadow: 0 4px 16px rgba(75, 179, 103, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 28px rgba(75, 179, 103, 0.35);
}

.btn-ghost {
  background: color-mix(in srgb, var(--color-text) 6%, transparent);
  color: var(--color-text-secondary);
}

.btn-ghost:hover {
  background: color-mix(in srgb, var(--color-text) 10%, transparent);
  color: var(--color-text);
  transform: translateY(-1px);
}

/* Phone mockup */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  animation: fadeInUp 0.8s var(--ease-out) 0.4s both;
}

.phone-frame {
  width: 280px;
  background: var(--color-surface);
  border-radius: 32px;
  padding: 12px;
  box-shadow: var(--shadow-xl), 0 0 0 1px color-mix(in srgb, var(--color-text) 6%, transparent);
  transform: perspective(800px) rotateY(-4deg) rotateX(2deg);
  transition: transform 0.4s var(--ease-out);
}

.phone-frame:hover {
  transform: perspective(800px) rotateY(0deg) rotateX(0deg);
}

.phone-screen {
  background: var(--color-bg);
  border-radius: 22px;
  padding: 20px 16px;
  min-height: 400px;
}

.mock-header {
  text-align: center;
  margin-bottom: 16px;
}

.mock-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}

.mock-family {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.mock-child {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}

.mock-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.mock-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mock-name {
  font-weight: 600;
  font-size: 13px;
}

.mock-balance {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.mock-trend {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
}

.mock-trend.up {
  color: var(--color-green);
  background: color-mix(in srgb, var(--color-green) 12%, transparent);
}

.mock-activity {
  margin-top: 16px;
}

.mock-act-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  display: block;
  margin-bottom: 8px;
}

.mock-act-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-secondary);
  padding: 6px 0;
}

.mock-act-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.mock-act-icon.earn {
  background: color-mix(in srgb, var(--color-green) 15%, transparent);
  color: var(--color-green);
}

.mock-act-icon.spend {
  background: color-mix(in srgb, #E74C3C 12%, transparent);
  color: #E74C3C;
}

.hero-piggy {
  position: absolute;
  bottom: -20px;
  right: -20px;
  animation: piggyBounce 4s var(--ease-out) infinite;
  opacity: 0.15;
}

.hero-piggy img {
  border-radius: 50%;
}

@keyframes piggyBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(3deg); }
}

.hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  line-height: 0;
}

.hero-wave svg {
  width: 100%;
  height: 80px;
}

@media (max-width: 768px) {
  .hero {
    padding: calc(var(--nav-height) + 40px) 24px 100px;
  }
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }
  .hero-sub {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-actions {
    justify-content: center;
    flex-wrap: wrap;
  }
  .phone-frame {
    transform: none;
    width: 260px;
  }
  .phone-frame:hover {
    transform: none;
  }
  .hero-piggy {
    display: none;
  }
}

/* ============================================
   Sections shared
   ============================================ */
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

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

.section-tag {
  display: inline-block;
  background: color-mix(in srgb, var(--color-green) 12%, transparent);
  color: var(--color-green);
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ============================================
   Features
   ============================================ */
.features {
  padding: 80px 0 100px;
  background: var(--color-surface);
  position: relative;
}

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

.feature-card {
  padding: 32px 28px;
  background: var(--color-bg);
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--color-text) 5%, transparent);
  transition: all 0.3s var(--ease-out);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--accent, var(--color-green)) 30%, transparent);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

@media (max-width: 900px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   How It Works
   ============================================ */
.how-it-works {
  padding: 100px 0;
  background: var(--color-bg);
}

.steps {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.step {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.step-number {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-blue), var(--color-green));
  color: #fff;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(75, 179, 103, 0.2);
}

.step-content h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
}

.step-content p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--color-text-secondary);
}

.step-connector {
  width: 2px;
  height: 40px;
  background: linear-gradient(to bottom, var(--color-blue-light), var(--color-green-light));
  margin-left: 23px;
  border-radius: 2px;
  opacity: 0.4;
}

/* ============================================
   Privacy Section
   ============================================ */
.privacy-section {
  padding: 20px 0 100px;
  background: var(--color-bg);
}

.privacy-card {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--color-blue) 8%, var(--color-surface)),
    var(--color-surface),
    color-mix(in srgb, var(--color-green) 6%, var(--color-surface))
  );
  border-radius: var(--radius);
  padding: 60px 48px;
  text-align: center;
  border: 1px solid color-mix(in srgb, var(--color-text) 6%, transparent);
  box-shadow: var(--shadow-md);
}

.privacy-icon {
  display: inline-flex;
  width: 80px;
  height: 80px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-green) 10%, transparent);
  color: var(--color-green);
  margin-bottom: 24px;
}

.privacy-card h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}

.privacy-card p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text-secondary);
  max-width: 640px;
  margin: 0 auto;
}

@media (max-width: 560px) {
  .privacy-card {
    padding: 40px 24px;
  }
}

/* ============================================
   Download CTA
   ============================================ */
.download {
  padding: 80px 0 100px;
  background: var(--color-surface);
}

.download-inner {
  text-align: center;
}

.download-logo {
  margin: 0 auto 24px;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  animation: piggyFloat 5s var(--ease-out) infinite;
}

@keyframes piggyFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.download h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 38px);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 12px;
}

.download p {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin-bottom: 28px;
}

.app-store-badge {
  display: inline-block;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.2s ease;
  border-radius: 10px;
  overflow: hidden;
}

.app-store-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.coming-soon {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 12px;
  font-style: italic;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  padding: 40px 24px;
  border-top: 1px solid color-mix(in srgb, var(--color-text) 6%, transparent);
  background: var(--color-surface);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
}

.footer-brand img {
  border-radius: 8px;
}

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

.footer-links a {
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}

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

.footer-copy {
  font-size: 13px;
  color: var(--color-text-muted);
  width: 100%;
  text-align: center;
  margin-top: 8px;
}

.footer-link {
  color: var(--color-text-secondary);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--color-text-secondary) 40%, transparent);
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

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

/* ============================================
   Scroll reveal animations
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.features-grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.features-grid .reveal:nth-child(3) { transition-delay: 0.16s; }
.features-grid .reveal:nth-child(4) { transition-delay: 0.24s; }
.features-grid .reveal:nth-child(5) { transition-delay: 0.32s; }
.features-grid .reveal:nth-child(6) { transition-delay: 0.4s; }

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .phone-frame { transform: none; }
}
