:root {
  /* Default to dark if not provided */
  --bg: #09090b;
  --bg-secondary: #121214;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --accent: #FF6B00;
  --accent-glow: rgba(255, 107, 0, 0.4);
  --border: rgba(255, 255, 255, 0.08);
  --glass-bg: rgba(24, 24, 27, 0.6);
  --topbar-bg: rgba(9, 9, 11, 0.7);
  --shadow-color: rgba(0, 0, 0, 0.5);
}

:root[data-theme="light"] {
  --bg: #f8fafc;
  --bg-secondary: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --accent: #e66000;
  --accent-glow: rgba(255, 107, 0, 0.15);
  --border: rgba(15, 23, 42, 0.12);
  --glass-bg: rgba(255, 255, 255, 0.75);
  --topbar-bg: rgba(255, 255, 255, 0.85);
  --shadow-color: rgba(15, 23, 42, 0.1);
}

:root[data-theme="dark"] .sun-icon { display: block; }
:root[data-theme="dark"] .moon-icon { display: none; }
:root[data-theme="light"] .sun-icon { display: none; }
:root[data-theme="light"] .moon-icon { display: block; }

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  width: 100%;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  position: relative;
  overflow-x: hidden;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Background Effects */
.ambient-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  background: var(--accent-glow);
  filter: blur(140px);
  border-radius: 50%;
  z-index: -1;
  opacity: 0.5;
  top: -150px;
  left: -200px;
  transition: background 0.3s ease;
}

.ambient-glow-2 {
  background: var(--text-muted);
  opacity: 0.1;
  top: 40%;
  right: -200px;
  left: auto;
}

/* Topbar */
.topbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 50;
  background: var(--topbar-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.brand-logo img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.brand-name {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: color 0.2s ease, background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  color: var(--text);
  background: var(--border);
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1.1rem;
}

.btn-ghost {
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--border);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid rgba(255, 107, 0, 0.6);
  box-shadow: 0 4px 14px 0 rgba(255, 107, 0, 0.25);
}

.btn-primary:hover {
  background: #d95a00;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 rgba(255, 107, 0, 0.35);
}

/* Layout */
.main-content {
  flex-grow: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 8rem 2rem 4rem;
}

/* Hero Section */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-bottom: 6rem;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}

.badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid var(--accent);
}

.title {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.text-gradient {
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 90%;
}

.hero-actions {
  margin-top: 1rem;
}

/* Visual / Mockup */
.hero-visual {
  position: relative;
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 24px;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.mockup-wrapper {
  padding: 1rem;
  box-shadow: 0 24px 64px -12px var(--shadow-color), 0 0 0 1px var(--border);
  transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
  transition: transform 0.5s ease, box-shadow 0.3s ease;
}

.mockup-wrapper:hover {
  transform: perspective(1000px) rotateY(-2deg) rotateX(2deg);
}

.mockup-img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  display: block;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding-bottom: 4rem;
}

.feature {
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

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

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.feature h3 {
  font-size: 1.5rem;
  font-weight: 600;
}

.feature p {
  color: var(--text-muted);
  line-height: 1.6;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Responsive */
/* Mockup & Phone Frame */
/* Mockup Layout */
.mockup-wrapper {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  transition: transform 0.4s ease;
}

.mockup-wrapper:hover {
  transform: translateY(-10px) scale(1.02);
}

.mockup-img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.3s ease;
  filter: drop-shadow(0 30px 60px rgba(0,0,0,0.5));
}

/* Theme Switching Logic */
.mockup-light {
  display: none;
}

[data-theme="light"] .mockup-light {
  display: block;
}

[data-theme="light"] .mockup-dark {
  display: none;
}

@media (max-width: 992px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }
  
  .hero-content {
    align-items: center;
  }
  
  .subtitle {
    max-width: 100%;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .main-content {
    padding: 6rem 1rem 2rem;
  }

  .title {
    font-size: 2.25rem;
  }

  .ambient-glow {
    display: none;
  }

  .hero {
    gap: 2rem;
    margin-bottom: 3rem;
  }

  .topbar-inner {
    padding: 0.75rem 1rem;
    width: 100%;
  }
  
  .brand-name {
    font-size: 1.1rem;
  }
  
  .nav-links {
    gap: 0.5rem;
  }

  .nav-links .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .nav-links .btn-ghost {
    display: none !important;
  }
}
