* {
  box-sizing: border-box;
}

:root {
  --primary: #1e73be;
  --primary-2: #3f8ed3;
  --accent: #2baf66;
  --bg: #f4fbf9;
  --bg-soft: #eef7fb;
  --paper: #ffffff;
  --ink: #1e2a35;
  --ink-2: #5a6b79;
  --line: #e3eef3;
  --warning: #f59e0b;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

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

.page-bg {
  display: none;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

/* HEADER / NAV */
.site-header {
  background: linear-gradient(135deg, #f7fcff 0%, #eaf5fb 100%);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.brand-copy {
  display: flex;
  flex-direction: column;
}

.brand-copy strong {
  font-size: 1rem;
  color: var(--ink);
}

.brand-copy span {
  font-size: 0.85rem;
  color: var(--ink-2);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--ink-2);
  font-weight: 600;
}

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

.menu-toggle {
  display: none;
  border: none;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 1.1rem;
  cursor: pointer;
}

/* HERO */
.hero {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 24px;
  align-items: center;
  padding: 42px 0 60px;
}

.tag,
.section-tag {
  display: inline-block;
  background: #e6f1fb;
  color: var(--primary);
  border: 1px solid #d5e8f7;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-copy h1 {
  font-size: clamp(2.3rem, 5vw, 4.3rem);
  line-height: 1.02;
  margin: 18px 0 14px;
  color: var(--primary);
}

.hero-copy p {
  color: var(--ink-2);
  max-width: 62ch;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.hero-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.hero-badges span,
.stat-pill,
.timeline-mini span,
.steam-list span,
.code-lite span,
.tree-top span,
.tree-bottom span {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.hero-panel h2 {
  margin: 10px 0 6px;
  font-size: 2rem;
  color: var(--primary);
}

.hero-panel p,
.note,
.caption {
  color: var(--ink-2);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  border-radius: 14px;
  font-weight: 800;
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: #155f9f;
}

.btn-ghost,
.light-btn {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

/* CARDS */
.glass-card,
.metric {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.spotlight {
  position: relative;
}

.mini-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.live-dot {
  color: var(--accent);
  font-weight: 700;
}

.meter {
  width: 100%;
  height: 12px;
  background: #e8f2f7;
  border-radius: 999px;
  overflow: hidden;
  margin: 18px 0;
}

.meter-fill {
  height: 100%;
  width: 52%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--success), var(--warning), var(--danger));
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 18px 0 10px;
}

.hero-grid article {
  background: #f8fcff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.hero-grid small {
  display: block;
  color: var(--ink-2);
  margin-bottom: 4px;
}

.hero-grid strong {
  color: var(--ink);
}

/* SECTION */
.section {
  padding: 72px 0;
}

.dark-section {
  background: var(--bg-soft);
}

.section-head {
  margin-bottom: 26px;
}

.section-head h2 {
  margin: 12px 0 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  color: var(--primary);
}

.section-head .light {
  color: var(--primary);
}

/* LAYOUTS */
.overview-grid,
.cards-3,
.cards-4,
.metrics-grid {
  display: grid;
  gap: 18px;
}

.overview-grid,
.cards-3 {
  grid-template-columns: repeat(3, 1fr);
}

.cards-4,
.metrics-grid {
  grid-template-columns: repeat(4, 1fr);
}

.cards-2,
.problem-layout,
.solution-lower,
.dashboard-grid,
.ai-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

/* ICON CHIP */
.icon-chip {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: white;
  font-weight: 800;
  margin-bottom: 12px;
}

/* TREE */
.tree {
  display: grid;
  gap: 14px;
}

.tree-top,
.tree-bottom,
.stats-row,
.timeline-mini,
.steam-list,
.code-lite {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tree-core {
  color: white;
  font-weight: 800;
  text-align: center;
  border-radius: 14px;
  padding: 14px 16px;
}

.tree-core.danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.tree-core.success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

/* DASHBOARD */
.metric {
  text-align: center;
}

.metric small,
.metric span {
  display: block;
  color: var(--ink-2);
}

.metric strong {
  display: block;
  font-size: 2rem;
  margin: 8px 0;
  color: var(--primary);
}

.dark-card {
  background: var(--paper);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}

.panel-head h3,
.panel-head p {
  margin: 0;
}

.panel-head p {
  color: var(--ink-2);
}

#aqiChart {
  width: 100%;
  height: auto;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--line);
}

.alerts-list {
  display: grid;
  gap: 12px;
}

.alert-item {
  background: #fff8ea;
  border-left: 5px solid var(--warning);
  padding: 14px;
  border-radius: 10px;
}

.alert-item strong {
  display: block;
  color: var(--ink);
}

.alert-item small {
  color: var(--ink-2);
}

/* AI */
.feature-list {
  padding-left: 18px;
  margin: 0;
}

.feature-list li {
  margin-bottom: 10px;
}

.prediction-badge {
  display: inline-block;
  margin-top: 10px;
  background: #e7f7ed;
  color: var(--accent);
  border: 1px solid #cdeed9;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 800;
}

/* VR */
.vr-switch {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.vr-btn {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.vr-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.vr-scene {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
}

.vr-scene.polluted {
  background: linear-gradient(180deg, #d5dde5 0%, #b8c4cf 100%);
}

.vr-scene.clean {
  background: linear-gradient(180deg, #bfe7ff 0%, #b9f0d2 100%);
}

.vr-city {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 58px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.building {
  width: 54px;
  height: 90px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 10px 10px 0 0;
  border: 1px solid rgba(0,0,0,0.05);
}

.building.tall {
  height: 130px;
}

/* FOOTER */
.footer {
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 26px 0 34px;
}

.footer-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.footer p {
  margin: 0.3rem 0 0;
  color: var(--ink-2);
}

/* ANIMATIONS */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: all 0.7s ease;
}

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

/* RESPONSIVE */
@media (max-width: 1024px) {
  .hero,
  .overview-grid,
  .cards-3,
  .cards-4,
  .cards-2,
  .problem-layout,
  .solution-lower,
  .dashboard-grid,
  .ai-grid,
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cards-4,
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }
}

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

  .nav-links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    display: none;
    flex-direction: column;
    box-shadow: var(--shadow);
    z-index: 30;
  }

  .nav-links.show {
    display: flex;
  }

  .hero,
  .overview-grid,
  .cards-3,
  .cards-4,
  .cards-2,
  .problem-layout,
  .solution-lower,
  .dashboard-grid,
  .ai-grid,
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero-copy h1 {
    font-size: 2.2rem;
  }

  .btn {
    width: 100%;
  }

  .panel-head,
  .footer-wrap {
    flex-direction: column;
    align-items: flex-start;
  }

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