/* ===== CSS Custom Properties ===== */
:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-accent: #10b981;
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;
  --color-bg-dark: #0f172a;
  --color-text: #1e293b;
  --color-text-light: #64748b;
  --color-text-inverse: #f8fafc;
  --color-border: #e2e8f0;

  /* AQI Colors */
  --aqi-good: #00e400;
  --aqi-moderate: #ffff00;
  --aqi-unhealthy-sensitive: #ff7e00;
  --aqi-unhealthy: #ff0000;
  --aqi-very-unhealthy: #8f3f97;
  --aqi-hazardous: #7e0023;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --max-width: 1120px;
  --header-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.1);
  --transition: 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-primary-dark);
}

ul {
  list-style: none;
}

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

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  transition: box-shadow var(--transition);
}

.site-header.scrolled {
  box-shadow: var(--shadow);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}

.logo svg {
  width: 32px;
  height: 32px;
}

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

.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-light);
  transition: color var(--transition);
}

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

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--color-primary);
  color: var(--color-text-inverse) !important;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition);
}

.nav-cta:hover {
  background: var(--color-text);
  color: var(--color-text-inverse) !important;
  transform: translateY(-1px);
}

.nav-cta svg {
  width: 16px;
  height: 16px;
}

.nav-tip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: transparent;
  color: var(--color-text-light) !important;
  border: 1px solid var(--color-border, #d1d5db);
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.nav-tip:hover {
  background: var(--color-primary);
  color: var(--color-text-inverse) !important;
  border-color: var(--color-primary);
  color: var(--color-text-inverse) !important;
  transform: translateY(-1px);
}

.nav-tip svg {
  width: 16px;
  height: 16px;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--color-text);
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
}

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

  .nav-links {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition), opacity var(--transition);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    font-size: 17px;
    padding: 8px 0;
  }
}

/* ===== Hero Section ===== */
.hero {
  padding: 140px 24px 80px;
  text-align: center;
  background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
  overflow: hidden;
}

.hero-content {
  max-width: 680px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: #ecfdf5;
  color: #059669;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
}

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

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

.hero h1 {
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: 20px;
}

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

.hero p {
  font-size: 18px;
  color: var(--color-text-light);
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--color-text);
  color: var(--color-text-inverse);
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  transition: all var(--transition);
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary svg {
  width: 20px;
  height: 20px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-border);
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--color-text);
  color: var(--color-text);
  transform: translateY(-2px);
}

/* Hero Phone Mockup */
.hero-phone {
  margin: 60px auto 0;
  max-width: 280px;
  position: relative;
}

.phone-frame {
  position: relative;
  background: #1a1a2e;
  border-radius: 40px;
  padding: 12px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255,255,255,0.1) inset;
}

.phone-screen {
  background: linear-gradient(145deg, #e0f2fe, #ecfdf5);
  border-radius: 30px;
  aspect-ratio: 9 / 19.5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.phone-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 30px;
}

.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 28px;
  background: #1a1a2e;
  border-radius: 0 0 20px 20px;
}

/* ===== AQI Scale Bar ===== */
.aqi-scale {
  padding: 0 24px;
  margin-top: -20px;
  margin-bottom: 80px;
  position: relative;
  z-index: 1;
}

.aqi-scale-inner {
  max-width: 600px;
  margin: 0 auto;
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-lg);
}

.aqi-scale-bar {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg,
    var(--aqi-good) 0%,
    var(--aqi-moderate) 20%,
    var(--aqi-unhealthy-sensitive) 40%,
    var(--aqi-unhealthy) 60%,
    var(--aqi-very-unhealthy) 80%,
    var(--aqi-hazardous) 100%
  );
  margin-bottom: 12px;
}

.aqi-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--color-text-light);
  font-weight: 500;
}

@media (max-width: 480px) {
  .aqi-labels span:nth-child(even) {
    display: none;
  }
}

/* ===== Features Section ===== */
.features {
  padding: 80px 24px;
}

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 60px;
}

.section-label {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.section-header p {
  font-size: 17px;
  color: var(--color-text-light);
  line-height: 1.7;
}

.features-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.feature-card {
  padding: 32px;
  border-radius: var(--radius);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  transition: all var(--transition);
}

.feature-card:hover {
  border-color: transparent;
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.feature-icon svg {
  width: 24px;
  height: 24px;
}

.feature-icon.blue {
  background: #eff6ff;
  color: var(--color-primary);
}

.feature-icon.green {
  background: #ecfdf5;
  color: #059669;
}

.feature-icon.orange {
  background: #fff7ed;
  color: #ea580c;
}

.feature-icon.purple {
  background: #faf5ff;
  color: #9333ea;
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

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

/* ===== Screenshots Section ===== */
.screenshots {
  padding: 80px 0;
  background: var(--color-bg-alt);
  overflow: hidden;
}

.screenshots .section-header {
  padding: 0 24px;
}

.screenshots-track {
  display: flex;
  gap: 24px;
  padding: 0 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.screenshots-track::-webkit-scrollbar {
  display: none;
}

.screenshot-item {
  flex: 0 0 auto;
  scroll-snap-align: center;
}

.screenshot-phone {
  width: 220px;
  background: #1a1a2e;
  border-radius: 32px;
  padding: 10px;
  box-shadow: var(--shadow-lg);
}

.screenshot-phone .screen {
  border-radius: 24px;
  aspect-ratio: 9 / 19.5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.screenshot-phone .screen img,
.screenshot-phone .screen video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 24px;
}

/* Center the screenshots on desktop */
@media (min-width: 769px) {
  .screenshots-track {
    justify-content: center;
    overflow-x: visible;
  }
}

/* ===== How It Works ===== */
.how-it-works {
  padding: 80px 24px;
}

.steps {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  position: relative;
}

.steps::before {
  content: '';
  position: absolute;
  top: 28px;
  left: 15%;
  right: 15%;
  height: 2px;
  background: var(--color-border);
}

.step {
  text-align: center;
  position: relative;
}

.step-number {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-text);
  color: var(--color-text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  margin: 0 auto 20px;
  position: relative;
  z-index: 1;
}

.step h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.step p {
  font-size: 14px;
  color: var(--color-text-light);
  line-height: 1.6;
}

@media (max-width: 600px) {
  .steps {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .steps::before {
    display: none;
  }
}

/* ===== CTA Section ===== */
.cta {
  padding: 80px 24px;
  background: var(--color-bg-dark);
  text-align: center;
}

.cta-inner {
  max-width: 580px;
  margin: 0 auto;
}

.cta h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: var(--color-text-inverse);
  margin-bottom: 16px;
  line-height: 1.2;
}

.cta p {
  font-size: 17px;
  color: #94a3b8;
  margin-bottom: 32px;
  line-height: 1.7;
}

.cta .btn-primary {
  background: var(--color-bg);
  color: var(--color-text);
}

.cta .btn-primary:hover {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

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

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

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

.footer-links a {
  font-size: 14px;
  color: var(--color-text-light);
  transition: color var(--transition);
}

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

.footer-copy {
  font-size: 14px;
  color: var(--color-text-light);
}

@media (max-width: 600px) {
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ===== Legal Pages ===== */
.legal-page {
  padding: 120px 24px 80px;
  min-height: 100vh;
}

.legal-content {
  max-width: 720px;
  margin: 0 auto;
}

.legal-content h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  margin-bottom: 32px;
  line-height: 1.2;
}

.legal-content p {
  margin-bottom: 16px;
  line-height: 1.8;
  color: var(--color-text);
}

.legal-content ul {
  list-style: disc;
  padding-left: 24px;
  margin-bottom: 16px;
}

.legal-content li {
  margin-bottom: 12px;
  line-height: 1.7;
  color: var(--color-text);
}

.legal-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin-top: 36px;
  margin-bottom: 12px;
}

.legal-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
}

.legal-content a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===== Scroll Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
