/* ============================================
   VideoLoom — Design System
   Based on Stitch design by UI/UX designer
   ============================================ */

/* ---- Design Tokens ---- */
:root {
  /* Surface Colors */
  --surface: #faf9fe;
  --surface-dim: #dad9df;
  --surface-bright: #faf9fe;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f4f3f8;
  --surface-container: #eeedf3;
  --surface-container-high: #e9e7ed;
  --surface-container-highest: #e3e2e7;

  /* On-Surface */
  --on-surface: #1a1b1f;
  --on-surface-variant: #414755;

  /* Primary */
  --primary: #007aff;
  --on-primary: #ffffff;
  --primary-container: #0070eb;
  --primary-fixed-dim: #adc6ff;
  --primary-fixed: #d8e2ff;

  /* Secondary */
  --secondary: #4c4aca;
  --secondary-container: #6664e4;

  /* Tertiary */
  --tertiary: #9e3d00;

  /* Outline */
  --outline: #717786;
  --outline-variant: #c1c6d7;

  /* Error */
  --error: #ba1a1a;

  /* Inverse */
  --inverse-surface: #2f3034;
  --inverse-on-surface: #f1f0f5;

  /* Typography */
  --font-heading: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  --font-mono: "Geist Mono", "SF Mono", SFMono-Regular, "JetBrains Mono", monospace;

  /* Spacing */
  --gutter: 24px;
  --container-max: 1200px;
  --section-padding: 120px;
  --section-padding-mobile: 64px;
  --stack-gap-sm: 8px;
  --stack-gap-md: 16px;
  --stack-gap-lg: 32px;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
}

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

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--on-surface);
  background-color: var(--surface);
  overflow-x: hidden;
}

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

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

/* ---- Background Layers ---- */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
}

.mesh-gradient {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: #faf9fe;
  background-image:
    radial-gradient(at 0% 0%, hsla(210, 100%, 93%, 1) 0, transparent 50%),
    radial-gradient(at 50% 0%, hsla(220, 100%, 95%, 1) 0, transparent 50%),
    radial-gradient(at 100% 0%, hsla(200, 100%, 92%, 1) 0, transparent 50%),
    radial-gradient(at 50% 100%, hsla(215, 100%, 97%, 1) 0, transparent 50%);
}

#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* ---- Glassmorphism ---- */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* ---- macOS Shadow ---- */
.macos-shadow {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* ---- Typography ---- */
.font-headline-display {
  font-family: var(--font-heading);
  font-size: 64px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.font-headline-lg {
  font-family: var(--font-heading);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.font-headline-md {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.333;
}

.font-body-lg {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.5;
}

.font-body-md {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.font-label-mono {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.428;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

/* ---- Navigation ---- */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 50;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: var(--stack-gap-md);
}

.navbar-logo span {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--on-surface);
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: var(--stack-gap-md);
  margin-left: 32px;
}

.navbar-links a {
  font-size: 15px;
  color: var(--on-surface-variant);
  transition: color 0.2s;
}

.navbar-links a:hover {
  color: var(--primary);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--stack-gap-md);
}

/* ---- Language Toggle ---- */
.btn-lang {
  background: transparent;
  color: var(--on-surface-variant);
  border: 1px solid rgba(193, 198, 215, 0.4);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.btn-lang:hover {
  background: rgba(0, 122, 255, 0.08);
  color: var(--primary);
  border-color: var(--primary);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.95);
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-primary-lg {
  padding: 16px 32px;
  border-radius: var(--radius-xl);
  font-size: 18px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-primary-hero {
  padding: 16px 32px;
  border-radius: var(--radius-xl);
  font-size: 18px;
  background-color: #007aff;
  color: white;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-primary-hero:hover {
  filter: brightness(1.1);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: var(--on-surface);
  border: 1px solid rgba(193, 198, 215, 0.3);
  padding: 20px 40px;
  border-radius: var(--radius-2xl);
  font-size: 18px;
}

.btn-outline:hover {
  background: white;
}

.btn-nav {
  background-color: var(--primary);
  color: white;
  padding: 8px 24px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
}

.btn-nav:hover {
  filter: brightness(1.1);
}

/* ---- Hero Section ---- */
.hero {
  position: relative;
  padding: calc(var(--section-padding) + 64px) 0 var(--section-padding);
  overflow: hidden;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero-content {
  z-index: 10;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(0, 122, 255, 0.1);
  color: var(--primary);
  margin-bottom: 24px;
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero-title {
  margin-bottom: var(--stack-gap-md);
}

.hero-subtitle {
  color: var(--on-surface-variant);
  margin-bottom: 40px;
  max-width: 576px;
}

.hero-cta {
  display: flex;
  gap: var(--stack-gap-md);
  flex-wrap: wrap;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.hero-visual-inner {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 24px;
}

.hero-glow {
  position: absolute;
  top: -80px;
  right: -80px;
  width: 384px;
  height: 384px;
  background: rgba(0, 122, 255, 0.15);
  filter: blur(120px);
  border-radius: 50%;
  z-index: -10;
}

.desktop-mockup {
  position: relative;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.4);
  aspect-ratio: 16 / 10;
  background-color: var(--surface-container-low);
  transition: transform 0.5s;
}

.desktop-mockup:hover {
  transform: scale(1.02);
}

.desktop-mockup img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-bubble {
  position: absolute;
  bottom: 24px;
  left: 24px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  z-index: 20;
  transition: transform 0.3s;
}

.camera-bubble:hover {
  transform: scale(1.1);
}

.camera-bubble img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.section-alt {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.section-features {
  background: rgba(250, 249, 254, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ---- Features Section ---- */
.features-header {
  text-align: center;
  margin-bottom: 64px;
}

.features-header h2 {
  margin-bottom: var(--stack-gap-md);
}

.features-header p {
  color: var(--on-surface-variant);
  max-width: 576px;
  margin: 0 auto;
}

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

.feature-card {
  padding: 32px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(193, 198, 215, 0.3);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: box-shadow 0.3s;
}

.feature-card:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.feature-card-header {
  margin-bottom: 24px;
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(0, 122, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 28px;
  margin-bottom: var(--stack-gap-md);
}

.feature-card h3 {
  margin-bottom: var(--stack-gap-sm);
}

.feature-card > p {
  color: var(--on-surface-variant);
}

.feature-card-media {
  margin-top: auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(193, 198, 215, 0.2);
}

.feature-card-media img {
  width: 100%;
  height: auto;
  display: block;
}

/* Specific feature card: Bubble */
.feature-bubble-preview {
  margin-top: auto;
  background: rgba(0, 122, 255, 0.05);
  border-radius: var(--radius-xl);
  padding: 24px;
  display: flex;
  justify-content: center;
}

.feature-bubble-preview .camera-demo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.feature-bubble-preview .camera-demo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Specific feature card: Audio Visualizer */
.audio-visualizer {
  margin-top: auto;
  height: 96px;
  background: linear-gradient(to right, rgba(0, 122, 255, 0.1), rgba(76, 74, 202, 0.1));
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 16px;
}

.audio-bar {
  width: 6px;
  border-radius: var(--radius-full);
  background: rgba(0, 122, 255, 0.6);
  animation: audioPulse 1.5s ease-in-out infinite;
}

.audio-bar:nth-child(1) { height: 32px; animation-delay: 0s; }
.audio-bar:nth-child(2) { height: 48px; animation-delay: 0.1s; }
.audio-bar:nth-child(3) { height: 24px; animation-delay: 0.2s; }
.audio-bar:nth-child(4) { height: 56px; animation-delay: 0s; }
.audio-bar:nth-child(5) { height: 32px; animation-delay: 0.15s; }

@keyframes audioPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(0.8); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ---- FAQ Section ---- */
.faq-header {
  text-align: center;
  margin-bottom: 48px;
}

.faq-list {
  max-width: 768px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid rgba(193, 198, 215, 0.3);
  padding-bottom: 24px;
  margin-bottom: 24px;
}

.faq-item:last-child {
  margin-bottom: 0;
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  color: var(--on-surface);
  line-height: 1.333;
}

.faq-question:hover {
  color: var(--primary);
}

.faq-chevron {
  transition: transform 0.3s;
  font-size: 28px;
  color: var(--on-surface-variant);
  flex-shrink: 0;
}

.faq-chevron.open {
  transform: rotate(180deg);
}

.faq-answer {
  margin-top: 16px;
  color: var(--on-surface-variant);
  display: none;
}

.faq-answer.open {
  display: block;
}

/* ---- CTA Section ---- */
.cta-section {
  padding: var(--section-padding) 0;
}

.cta-card {
  max-width: 1024px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 2rem;
  padding: 80px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.6);
  position: relative;
  overflow: hidden;
}

.cta-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.1), rgba(76, 74, 202, 0.05), transparent);
}

.cta-card h2 {
  margin-bottom: 24px;
}

.cta-card p {
  color: var(--on-surface-variant);
  margin-bottom: 40px;
  max-width: 576px;
  margin-left: auto;
  margin-right: auto;
}

.cta-actions {
  display: flex;
  justify-content: center;
  gap: var(--stack-gap-md);
  flex-wrap: wrap;
}

/* ---- Footer ---- */
.footer {
  padding: var(--section-padding-mobile) 0;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(193, 198, 215, 0.3);
}

.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--stack-gap-md);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--stack-gap-sm);
}

.footer-brand span {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
}

.footer-brand p {
  color: var(--on-surface-variant);
}

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

.footer-links a {
  color: var(--on-surface-variant);
  opacity: 0.8;
  transition: color 0.2s, opacity 0.2s;
}

.footer-links a:hover {
  color: var(--primary);
  opacity: 1;
}

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

  .hero .container {
    gap: 40px;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: var(--section-padding-mobile);
  }

  .font-headline-display {
    font-size: 40px;
    letter-spacing: -0.01em;
  }

  .font-headline-lg {
    font-size: 32px;
  }

  .font-body-lg {
    font-size: 18px;
  }

  .hero .container {
    grid-template-columns: 1fr;
    gap: 48px;
  }

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

  .features-grid {
    grid-template-columns: 1fr;
  }

  .cta-card {
    padding: 40px 24px;
    border-radius: var(--radius-2xl);
  }

  .footer .container {
    flex-direction: column;
    text-align: center;
    gap: 24px;
  }

  .footer-brand {
    align-items: center;
  }

  .navbar-links {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero-cta {
    flex-direction: column;
  }

  .hero-cta .btn-primary-hero {
    width: 100%;
  }

  .cta-actions {
    flex-direction: column;
  }

  .cta-actions .btn {
    width: 100%;
  }
}
