/* ==========================================================================
   HAZEFREE RESEARCH PORTAL - DESIGN SYSTEM
   Modern Academic & Atmospheric Data Interface
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Prompt:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Option 1: Clean Academic Science Palette */
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-glass: rgba(255, 255, 255, 0.82);
  --bg-subtle: #f1f5f9;
  --border-subtle: #e2e8f0;
  --border-focus: #10b981;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #94a3b8;
  --text-inverse: #ffffff;
  
  /* Academic Atmospheric Accents */
  --color-primary: #0f766e;        /* Deep academic teal */
  --color-primary-hover: #115e59;
  --color-primary-light: #ccfbf1;
  --color-forest: #15803d;         /* Environmental green */
  --color-forest-light: #dcfce7;
  --color-sky: #0284c7;            /* Atmospheric blue */
  --color-sky-light: #e0f2fe;
  
  /* Air Quality Index Scale (Thailand & WHO Standards) */
  --aqi-good: #10b981;             /* 0 - 25 µg/m³ Very Good */
  --aqi-moderate: #3b82f6;         /* 26 - 37 µg/m³ Good */
  --aqi-sensitive: #f59e0b;        /* 38 - 50 µg/m³ Moderate */
  --aqi-unhealthy: #f97316;        /* 51 - 90 µg/m³ Unhealthy */
  --aqi-hazardous: #ef4444;        /* > 90 µg/m³ Hazardous */
  --aqi-purple: #8b5cf6;
  
  /* Shadows & Elevation */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.1), 0 6px 14px -4px rgba(15, 23, 42, 0.05);
  --shadow-glow: 0 0 24px rgba(16, 185, 129, 0.2);
  
  /* Typography */
  --font-display: 'Outfit', 'Prompt', sans-serif;
  --font-body: 'Prompt', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   OPTION 2: DARK OBSERVATORY THEME OVERRIDES
   ========================================================================== */
body.theme-dark {
  --bg-primary: #070b14;
  --bg-surface: #0f172a;
  --bg-surface-glass: rgba(15, 23, 42, 0.75);
  --bg-subtle: #1e293b;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-focus: #06b6d4;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --text-inverse: #070b14;
  
  --color-primary: #06b6d4;
  --color-primary-hover: #0891b2;
  --color-primary-light: rgba(6, 182, 212, 0.15);
  --color-forest: #10b981;
  --color-forest-light: rgba(16, 185, 129, 0.15);
  --color-sky: #38bdf8;
  --color-sky-light: rgba(56, 189, 248, 0.15);
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px rgba(6, 182, 212, 0.3);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

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

img, svg {
  display: block;
  max-width: 100%;
}

button, input, select {
  font: inherit;
}

.container {
  width: 100%;
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ==========================================================================
   PRODUCTION ANNOUNCEMENT & TOP RESEARCH STRIP
   ========================================================================== */
.announcement-strip {
  background: linear-gradient(90deg, #064e3b 0%, #0f766e 60%, #0369a1 100%);
  color: #f0fdf4;
  padding: 0.55rem 1rem;
  font-size: 0.84rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
  z-index: 1100;
}

.announcement-strip .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.announcement-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.announcement-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
}

.announcement-link {
  color: #67e8f9;
  font-weight: 600;
  text-decoration: underline;
  transition: color var(--transition-fast);
}

.announcement-link:hover {
  color: #a5f3fc;
}

.theme-variant-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all var(--transition-fast);
}

.theme-variant-link:hover {
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

/* ==========================================================================
   REFERENCE THEME: DUAL-TIER HEADER
   ========================================================================== */
.ref-header-top {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.65rem 0;
  position: relative;
  z-index: 1000;
}

.ref-header-top .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.ref-logo-group {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.ref-cmu-brand {
  display: flex;
  flex-direction: column;
}

.ref-cmu-brand strong {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1;
  letter-spacing: -0.02em;
}

.ref-cmu-brand span {
  font-size: 0.65rem;
  color: #64748b;
  letter-spacing: 0.02em;
}

.ref-partner-logos {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.ref-logo-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #334155;
  transition: all var(--transition-fast);
}

.ref-logo-pill:hover {
  border-color: #0f766e;
  color: #0f766e;
}

.ref-nav-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.ref-nav-item a {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.ref-nav-item a:hover {
  color: #0f766e;
  background: #f1f5f9;
}

.ref-nav-item.active a {
  color: #15803d;
  font-weight: 700;
}

.ref-lang-dropdown {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

/* Tier 2: Navy Subbar */
.ref-subbar-navy {
  background: #15293e;
  color: #e2e8f0;
  padding: 0.45rem 0;
  font-size: 0.82rem;
}

.ref-subbar-navy .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ref-subbar-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: #cbd5e1;
}

.ref-lang-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.ref-lang-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}

.ref-lang-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ref-lang-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .3s;
  border-radius: 22px;
}

.ref-lang-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.ref-lang-switch input:checked + .ref-lang-slider {
  background-color: #10b981;
}

.ref-lang-switch input:checked + .ref-lang-slider:before {
  transform: translateX(22px);
}

/* ==========================================================================
   MODERN HAZFREE PORTAL - 3 FLAGSHIP PLATFORMS SHOWCASE & DESIGN SYSTEM
   ========================================================================== */

/* Modern Header & Glassmorphic Navigation */
.portal-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.portal-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  gap: 1.25rem;
}

.portal-brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text-main);
  flex-shrink: 0;
}

.portal-brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f766e 0%, #0284c7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
}

.portal-brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.portal-brand-text h1 span {
  color: #0f766e;
}

.portal-brand-text p {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 500;
  line-height: 1.2;
}

.portal-nav-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.portal-nav-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.portal-nav-link:hover {
  color: #0f766e;
  background: #f1f5f9;
}

.portal-nav-link.active {
  color: #0f766e;
  background: #ecfdf5;
}

.portal-nav-link.highlight-btn {
  background: #f0fdfa;
  color: #0f766e;
  border: 1px solid #ccfbf1;
}

.portal-nav-link.highlight-btn:hover {
  background: #0f766e;
  color: #ffffff;
  border-color: #0f766e;
}

.portal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Secondary Telemetry Strip */
.portal-subbar {
  background: #0f172a;
  color: #94a3b8;
  font-size: 0.8rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-subbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.portal-subbar-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: #e2e8f0;
}

.portal-subbar-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulseStatus 2s infinite;
}

@keyframes pulseStatus {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.portal-partner-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.portal-partner-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   PORTAL HERO SECTION
   ========================================================================== */
.portal-hero {
  position: relative;
  padding: 3.5rem 0 3.75rem 0;
  background: radial-gradient(ellipse at 50% -20%, #e0f2fe 0%, #f8fafc 50%, #ffffff 100%);
  overflow: hidden;
  border-bottom: 1px solid #e2e8f0;
}

.portal-hero-mesh {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 15% 30%, rgba(15, 118, 110, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 85% 25%, rgba(2, 132, 199, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.portal-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 980px;
  margin: 0 auto;
}

.portal-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.12);
}

.portal-hero-title {
  font-family: var(--font-display);
  font-size: 2.85rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #0f172a;
  margin-bottom: 1rem;
}

.portal-hero-title .title-accent {
  font-size: calc(1em - 4pt);
  font-weight: 800;
  letter-spacing: -0.015em;
  background: linear-gradient(135deg, #0f766e 0%, #0284c7 60%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
  margin-top: 0.35rem;
}

.portal-hero-desc {
  font-size: 1.05rem;
  color: #475569;
  line-height: 1.65;
  margin-bottom: 2rem;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

/* Quick Navigation Links Ribbon */
.portal-quickbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.portal-quick-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
}

.portal-quick-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  border-color: #0f766e;
  color: #0f766e;
}

.portal-quick-pill .url-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ==========================================================================
   THE 3 FLAGSHIP PLATFORMS SHOWCASE (HERO PILLARS GRID)
   ========================================================================== */
.portal-pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  text-align: left;
}

.pillar-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 1.65rem 1.45rem;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.pillar-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0f766e, #0284c7);
  transition: height 0.2s ease;
}

.pillar-card.card-dashboard::before {
  background: linear-gradient(90deg, #0284c7, #2563eb);
}

.pillar-card.card-geomap::before {
  background: linear-gradient(90deg, #0d9488, #10b981);
}

.pillar-card.card-tpie::before {
  background: linear-gradient(90deg, #7c3aed, #0d9488);
}

.pillar-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 22px 45px rgba(15, 23, 42, 0.12);
  border-color: #94a3b8;
}

.pillar-card:hover::before {
  height: 6px;
}

.pillar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.15rem;
}

.pillar-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 6px;
}

.badge-dash {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-geo {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.badge-twin {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.pillar-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #10b981;
}

.pillar-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.pillar-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.pillar-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pillar-icon-box.dash {
  background: #eff6ff;
  color: #2563eb;
}

.pillar-icon-box.geo {
  background: #f0fdf4;
  color: #16a34a;
}

.pillar-icon-box.twin {
  background: #f5f3ff;
  color: #7c3aed;
}

.pillar-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.pillar-desc {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 1.15rem;
}

/* Feature bullets */
.pillar-features {
  list-style: none;
  margin: 0 0 1.25rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.pillar-feature-item {
  font-size: 0.78rem;
  color: #334155;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  line-height: 1.35;
}

.pillar-feature-item svg {
  flex-shrink: 0;
  margin-top: 2px;
}

/* Interactive Screenshot Preview Frame */
.pillar-screenshot-frame {
  margin-top: 0.35rem;
  margin-bottom: 1.15rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  display: block;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.pillar-screenshot-frame:hover {
  transform: translateY(-3px);
  border-color: #0f766e;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
}

.screenshot-browser-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
}

.browser-dots {
  display: flex;
  gap: 4px;
}

.browser-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.browser-dots span:nth-child(1) { background: #f87171; }
.browser-dots span:nth-child(2) { background: #fbbf24; }
.browser-dots span:nth-child(3) { background: #34d399; }

.browser-domain {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #64748b;
  font-weight: 600;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-badge-live {
  font-size: 0.55rem;
  font-weight: 700;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.03em;
}

.screenshot-img-box {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #0f172a;
}

.screenshot-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.35s ease;
}

.pillar-screenshot-frame:hover .screenshot-img-box img {
  transform: scale(1.05);
}

.screenshot-hover-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.pillar-screenshot-frame:hover .screenshot-hover-overlay {
  opacity: 1;
}

.screenshot-hover-overlay span {
  background: #ffffff;
  color: #0f172a;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Interactive Preview Box inside each card */
.pillar-preview-widget {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem;
  margin-bottom: 1.35rem;
  font-size: 0.75rem;
}

.widget-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.widget-metric-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.widget-metric-val {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.widget-metric-unit {
  font-size: 0.72rem;
  color: #64748b;
}

.widget-bars-wrap {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 28px;
  margin-top: 0.25rem;
}

.widget-bar {
  flex: 1;
  border-radius: 2px;
  background: #cbd5e1;
  transition: height 0.3s ease;
}

/* Pillar Card Launch Button */
.btn-pillar-launch {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-launch-dash {
  background: linear-gradient(135deg, #0284c7 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.btn-launch-dash:hover {
  background: linear-gradient(135deg, #0369a1 0%, #1e40af 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35);
  transform: translateY(-2px);
}

.btn-launch-geo {
  background: linear-gradient(135deg, #0d9488 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.btn-launch-geo:hover {
  background: linear-gradient(135deg, #0f766e 0%, #047857 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(13, 148, 136, 0.35);
  transform: translateY(-2px);
}

.btn-launch-twin {
  background: linear-gradient(135deg, #7c3aed 0%, #0f766e 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.btn-launch-twin:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #115e59 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.35);
  transform: translateY(-2px);
}

.btn-pillar-launch svg {
  transition: transform 0.2s ease;
}

.btn-pillar-launch:hover svg {
  transform: translateX(4px);
}

/* ==========================================================================
   PORTAL TELEMETRY RIBBON (Directly below hero)
   ========================================================================== */
.portal-telemetry-ribbon {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 1.5rem 0;
}

.ribbon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.ribbon-metric-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.ribbon-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ribbon-metric-card .label {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 2px;
  line-height: 1.2;
}

.ribbon-metric-card .value {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.ribbon-metric-card .sub-label {
  font-size: 0.7rem;
  font-weight: 600;
}

.ref-action-card {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-decoration: none;
}

.ref-action-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
  border-color: #10b981;
}

.ref-action-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 0.85rem;
  background: #ecfdf5;
  color: #10b981;
}

.ref-action-card h4 {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.4rem;
  line-height: 1.2;
}

.ref-action-card p {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
}

/* The Realistic Compact Dashboard Preview Card in Hero Right */
.hero-ref-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.ref-preview-card {
  width: 100%;
  max-width: 640px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22), 0 6px 18px rgba(15, 23, 42, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.95);
  overflow: hidden;
  position: relative;
}

/* 3-Panel Dashboard Body */
.ref-preview-body-v2 {
  display: grid;
  grid-template-columns: 110px 1fr 148px;
  min-height: 252px;
}

/* Left Metrics Panel */
.ref-dash-panel-left {
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  padding: 0.55rem 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.ref-dash-tabs-mini {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  margin-bottom: 0.1rem;
}

.ref-dash-tab-mini {
  font-size: 0.5rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 2px;
  color: #64748b;
  background: #e2e8f0;
  border: none;
  cursor: pointer;
  line-height: 1.3;
}

.ref-dash-tab-mini.active {
  background: #3b82f6;
  color: #fff;
}

.ref-pm25-box {
  background: #fff;
  border: 1px solid #fecaca;
  border-left: 2.5px solid #ef4444;
  border-radius: 5px;
  padding: 0.35rem 0.4rem;
}

.ref-pm25-box .box-label {
  font-size: 0.46rem;
  color: #64748b;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 2px;
}

.ref-pm25-box .box-val {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 900;
  color: #ef4444;
  line-height: 1;
}

.ref-pm25-box .box-unit {
  font-size: 0.45rem;
  color: #94a3b8;
  margin-top: 2px;
}

.ref-hotspot-box {
  background: #fff;
  border: 1px solid #fed7aa;
  border-left: 2.5px solid #ea580c;
  border-radius: 5px;
  padding: 0.3rem 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ref-hotspot-box .hs-dot {
  color: #ef4444;
  font-size: 0.75rem;
}

.ref-hotspot-box .hs-val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 900;
  color: #ea580c;
  line-height: 1;
}

.ref-hotspot-box .hs-label {
  font-size: 0.46rem;
  color: #64748b;
  line-height: 1.2;
}

.ref-mini-barchart {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.ref-mini-bars-wrap {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 42px;
  border-bottom: 1px solid #e2e8f0;
}

.ref-mini-bar {
  flex: 1;
  border-radius: 1px 1px 0 0;
  min-width: 4px;
}

.ref-mini-bars-label {
  font-size: 0.43rem;
  color: #94a3b8;
  text-align: center;
  margin-top: 3px;
  font-family: var(--font-mono);
}


/* Center Map Panel — see T-PIE iframe section below for full definition */


/* Right Province Panel */
.ref-dash-panel-right {
  background: #fff;
  border-left: 1px solid #e2e8f0;
  padding: 0.45rem 0.42rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  overflow: hidden;
}

.ref-prov-data-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.52rem;
  font-weight: 700;
  color: #0f172a;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.2rem;
  margin-bottom: 0.1rem;
  flex-shrink: 0;
}

.ref-prov-data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5px 0;
}

.ref-prov-data-name {
  font-size: 0.56rem;
  color: #334155;
  font-weight: 500;
}

.ref-prov-data-badge {
  font-size: 0.46rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 1px 4px;
  border-radius: 2px;
  color: #fff;
  white-space: nowrap;
}

.ref-heatmap-forward {
  margin-top: auto;
  border-top: 1px solid #f1f5f9;
  padding-top: 0.28rem;
  flex-shrink: 0;
}

.ref-heatmap-title-sm {
  font-size: 0.48rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.22rem;
}

.ref-heatmap-rows {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ref-heatmap-row-sm {
  display: flex;
  gap: 1px;
}

.ref-heatmap-cell-sm {
  flex: 1;
  height: 8px;
  border-radius: 1px;
}

/* ============================================================
   T-PIE LIVE IFRAME MAP PANEL
   ============================================================ */

.ref-dash-panel-map {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, #bfdbfe 0%, #dbeafe 40%, #e0f2fe 75%, #f0f9ff 100%);
}

/* Shell constrains the iframe to the panel bounds */
.tpie-iframe-shell {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* T-PIE screenshot — fills panel, transitions background-position and background-size for smooth camera pan/zoom */
.tpie-snapshot-bg {
  position: absolute;
  inset: 0;
  background-image: url('../images/tpie-dashboard.png');
  background-repeat: no-repeat;
  background-size: 195%;
  background-position: 50% 36%;
  transition: background-position 2s cubic-bezier(0.4, 0, 0.2, 1), background-size 2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
  z-index: 1;
}

#tpie-map-wrap:hover .tpie-snapshot-bg {
  filter: brightness(1.04);
}

/* LIVE badge — top-left corner */
.tpie-badge-live {
  position: absolute;
  top: 6px;
  left: 7px;
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 0.52rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 3px 7px 3px 5px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  letter-spacing: 0.04em;
  z-index: 20;
}

/* Pulsing red dot inside the LIVE badge */
.tpie-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  animation: tpiePulse 1.4s ease-in-out infinite;
}

@keyframes tpiePulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%       { transform: scale(1.5); opacity: 0.6; }
}

/* Link badge — top-right corner */
.tpie-badge-link {
  position: absolute;
  top: 6px;
  right: 7px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.72);
  color: #93c5fd;
  font-size: 0.5rem;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  text-decoration: none;
  z-index: 20;
  transition: all 0.2s ease;
}

.tpie-badge-link:hover {
  background: rgba(37, 99, 235, 0.85);
  color: #ffffff;
  transform: translateY(-1px);
}

/* View label — bottom-left corner */
.tpie-view-label {
  position: absolute;
  bottom: 18px;
  left: 7px;
  background: rgba(15, 23, 42, 0.65);
  color: #e2e8f0;
  font-size: 0.48rem;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  z-index: 20;
  transition: opacity 0.4s ease;
}

/* Progress bar — bottom edge, fills over 20 s */
.tpie-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
  z-index: 20;
}

.tpie-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #3b82f6);
  border-radius: 0 2px 2px 0;
}

/* Fallback SVG — shown only when iframe embedding is blocked */
.tpie-fallback-svg {
  position: absolute;
  inset: 0;
}


.ref-preview-topbar {
  padding: 0.5rem 0.85rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
}

.ref-preview-tabs {
  display: flex;
  gap: 0.2rem;
  background: #e2e8f0;
  padding: 2px;
  border-radius: 5px;
}

.ref-preview-tab {
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}

.ref-preview-tab.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.ref-preview-body {
  padding: 0.75rem;
  display: grid;
  grid-template-columns: 1.3fr 0.95fr;
  gap: 0.65rem;
  background: #f1f5f9;
  position: relative;
}

.ref-map-area {
  position: relative;
  background: #e2e8f0;
  border-radius: 10px;
  min-height: 205px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
}

.floating-telemetry-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-radius: 7px;
  padding: 0.35rem 0.55rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  border: 1px solid rgba(255,255,255,0.8);
  z-index: 10;
}

.floating-telemetry-badge strong {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
}

.floating-telemetry-badge span {
  display: block;
  font-size: 0.58rem;
  color: #64748b;
  margin-top: 1px;
}

.floating-hotspot-badge {
  position: absolute;
  top: 55px;
  left: 8px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-radius: 6px;
  padding: 0.25rem 0.45rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.62rem;
}

.floating-hotspot-badge strong {
  color: #ef4444;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.ref-preview-right-panel {
  background: #ffffff;
  border-radius: 10px;
  padding: 0.6rem;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.provincial-mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.2rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.67rem;
}

.provincial-mini-badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  color: #fff;
}

/* ==========================================================================
   DUAL RESEARCH INTELLIGENCE GRID (Directly below hero)
   ========================================================================== */
.ref-intel-section {
  padding: 2rem 0 3.5rem 0;
  background: #ffffff;
}

.ref-intel-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
}

.ref-intel-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.ref-intel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
}

.ref-intel-header h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #0f172a;
  margin: 0;
}

.ref-intel-dots {
  color: #94a3b8;
  font-weight: 700;
  letter-spacing: 0.15em;
  cursor: pointer;
}

/* ==========================================================================
   MOBILE NAVIGATION DRAWER
   ========================================================================== */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  z-index: 2100;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-drawer.open {
  right: 0;
}

.mobile-drawer-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2050;
  display: none;
}

.mobile-drawer-overlay.active {
  display: block;
}

.mobile-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-drawer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 1.5rem 0;
}

.mobile-drawer-links a {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

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

/* ==========================================================================
   AIR QUALITY THRESHOLD REFERENCE LEGEND
   ========================================================================== */
.aqi-legend-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.aqi-legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.aqi-legend-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.65rem;
}

.aqi-legend-item {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid;
  background: var(--bg-subtle);
}

.aqi-legend-item.good { border-color: var(--aqi-good); }
.aqi-legend-item.moderate { border-color: var(--aqi-moderate); }
.aqi-legend-item.sensitive { border-color: var(--aqi-sensitive); }
.aqi-legend-item.unhealthy { border-color: var(--aqi-unhealthy); }
.aqi-legend-item.hazardous { border-color: var(--aqi-hazardous); }

.aqi-legend-range {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
}

.aqi-legend-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .aqi-legend-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ==========================================================================
   PARTNER BRAND STRIP
   ========================================================================== */
.partner-strip {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.65rem 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.partner-strip .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.partner-title {
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.partner-logos {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.partner-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-subtle);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.partner-pill:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.partner-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-forest);
}

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-surface-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon-shield {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0f766e 0%, #15803d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
  flex-shrink: 0;
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text-main);
  margin: 0;
}

.brand-text h1 span {
  color: var(--color-forest);
}

.brand-tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.4rem 0.2rem;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--color-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-switch {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px;
}

.lang-btn {
  background: transparent;
  border: none;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-btn.active {
  background: var(--bg-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #0f766e 0%, #15803d 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #115e59 0%, #166534 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.35);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border-focus);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.btn-danger-warroom {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger-warroom:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.45);
}

.btn-sm {
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-main);
  cursor: pointer;
}

/* ==========================================================================
   LIVE ENVIRONMENTAL TELEMETRY STRIP
   ========================================================================== */
.telemetry-strip {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.6rem 0;
  position: relative;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 1.25rem;
  align-items: center;
}

.telemetry-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.telemetry-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.telemetry-item.pm25 .telemetry-icon {
  background: var(--color-forest-light);
  color: var(--color-forest);
}

.telemetry-item.hotspots .telemetry-icon {
  background: #fef2f2;
  color: #ef4444;
}

.telemetry-item.ventilation .telemetry-icon {
  background: var(--color-sky-light);
  color: var(--color-sky);
}

.telemetry-item.sensors .telemetry-icon {
  background: #faf5ff;
  color: #8b5cf6;
}

.telemetry-meta {
  display: flex;
  flex-direction: column;
}

.telemetry-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.telemetry-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}

.telemetry-value {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.telemetry-unit {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.telemetry-status {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-left: 0.35rem;
}

.telemetry-status.good {
  background: #dcfce7;
  color: #166534;
}

.telemetry-status.moderate {
  background: #fef3c7;
  color: #b45309;
}

.telemetry-status.unhealthy {
  background: #fee2e2;
  color: #991b1b;
}

.telemetry-sync {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  color: var(--text-light);
  font-family: var(--font-mono);
}

.sync-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-forest);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  padding: 4.5rem 0 3.5rem 0;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 15% 10%, rgba(15, 118, 110, 0.08) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 60%, rgba(2, 132, 199, 0.07) 0%, transparent 45%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(15, 118, 110, 0.2);
}

.hero-title {
  font-family: var(--font-display);
  font-size: 2.85rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 1.25rem;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, #0f766e 0%, #15803d 60%, #0284c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.12rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 620px;
}

.hero-btn-group {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.hero-metrics {
  display: flex;
  gap: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-subtle);
}

.hero-metric-item strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.hero-metric-item span {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Hero Right Interactive Card Preview */
.hero-visual-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  transition: transform var(--transition-fast);
}

.hero-visual-card:hover {
  transform: translateY(-4px);
}

.card-map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-map-title {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.radar-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fef2f2;
  color: #ef4444;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}

.radar-live-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse 1.2s infinite;
}

.map-preview-canvas {
  width: 100%;
  height: 280px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Stylized interactive SVG radar map simulation */
.map-overlay-layers {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
  z-index: 2;
  pointer-events: none;
}

.map-overlay-layer-top {
  display: flex;
  justify-content: space-between;
}

.map-badge-tag {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-family: var(--font-mono);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.map-card-footer {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* ==========================================================================
   RESEARCH OBSERVATORY WINDOW (Interactive iframe container)
   ========================================================================== */
.observatory-section {
  padding: 3rem 0 4rem 0;
}

.observatory-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.observatory-toolbar {
  padding: 1rem 1.5rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.observatory-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.observatory-title-group h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.observatory-tabs {
  display: flex;
  gap: 0.35rem;
  background: var(--bg-surface);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.obs-tab {
  background: transparent;
  border: none;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.obs-tab:hover {
  color: var(--text-main);
}

.obs-tab.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.observatory-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.observatory-viewport {
  position: relative;
  width: 100%;
  height: 720px;
  background: var(--bg-surface);
}

.observatory-viewport iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Fallback loading placeholder when iframe takes time */
.iframe-meta-note {
  padding: 0.75rem 1.5rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-light);
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ==========================================================================
   SCIENTIFIC TOOL MATRIX (Categorized Architecture)
   ========================================================================== */
.tools-section {
  padding: 4.5rem 0;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 3.5rem auto;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
}

.tool-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.tool-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

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

.tool-card-top {
  margin-bottom: 1.5rem;
}

.tool-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.tool-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.tool-icon.cyan { background: var(--color-primary-light); color: var(--color-primary); }
.tool-icon.green { background: var(--color-forest-light); color: var(--color-forest); }
.tool-icon.blue { background: var(--color-sky-light); color: var(--color-sky); }
.tool-icon.amber { background: #fef3c7; color: #d97706; }
.tool-icon.purple { background: #f3e8ff; color: #7e22ce; }
.tool-icon.red { background: #fee2e2; color: #dc2626; }

.tool-type-badge {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.tool-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
  color: var(--text-main);
}

.tool-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.tool-card-features {
  list-style: none;
  margin: 1.25rem 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tool-card-features li {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tool-card-features li::before {
  content: '✓';
  color: var(--color-forest);
  font-weight: 700;
}

.tool-card-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

/* Flagship Featured Tool Card (e.g. T-PIE Digital Twin) */
.tool-card-featured {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 50%, #f8fafc 100%);
  border: 1.5px solid #0d9488;
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: 0 10px 25px -5px rgba(13, 148, 136, 0.1), 0 8px 10px -6px rgba(13, 148, 136, 0.05);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.tool-card-featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #0d9488, #06b6d4, #3b82f6);
}

.tool-card-featured:hover {
  box-shadow: 0 20px 30px -10px rgba(13, 148, 136, 0.18);
  border-color: #0f766e;
}

.tool-featured-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.tool-featured-tag-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.tool-flagship-badge {
  background: #ccfbf1;
  color: #0f766e;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid #99f6e4;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tool-featured-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tool-featured-desc {
  font-size: 0.94rem;
  color: #475569;
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.tool-featured-highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.tool-highlight-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #334155;
  line-height: 1.4;
}

.tool-highlight-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #ccfbf1;
  color: #0d9488;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
}

.tool-featured-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Right-side T-PIE visual telemetry simulation card */
.tpie-telemetry-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.tpie-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 1rem;
}

.tpie-box-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tpie-box-badge {
  font-size: 0.68rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #64748b;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

.tpie-contrib-row {
  margin-bottom: 0.85rem;
}

.tpie-contrib-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  margin-bottom: 0.35rem;
}

.tpie-contrib-label {
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tpie-contrib-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #0f172a;
}

.tpie-progress-bar {
  height: 6px;
  background: #f1f5f9;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.tpie-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s ease-in-out;
}

.tpie-why-metric-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid #f1f5f9;
}

.tpie-why-pill {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.5rem;
}

.tpie-why-pill span {
  display: block;
  font-size: 0.65rem;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

.tpie-why-pill strong {
  font-size: 0.84rem;
  color: #0f172a;
  font-family: var(--font-mono);
}

@media (max-width: 900px) {
  .tool-featured-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .tool-featured-highlights {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   9 NORTHERN PROVINCES LIVE AIR QUALITY MATRIX
   ========================================================================== */
.provinces-section {
  padding: 4.5rem 0;
}

.provinces-filter-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.search-input-wrapper {
  position: relative;
  min-width: 260px;
}

.search-input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  font-size: 0.88rem;
  color: var(--text-main);
  outline: none;
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--border-focus);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 0.85rem;
}

.province-sort-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.provinces-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.province-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.province-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-focus);
}

.province-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.province-name-wrap h4 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.15rem;
}

.province-name-wrap span {
  font-size: 0.78rem;
  color: var(--text-light);
}

.aqi-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.aqi-pill.good { background: var(--aqi-good); }
.aqi-pill.moderate { background: var(--aqi-moderate); }
.aqi-pill.sensitive { background: var(--aqi-sensitive); }
.aqi-pill.unhealthy { background: var(--aqi-unhealthy); }
.aqi-pill.hazardous { background: var(--aqi-hazardous); }

.province-reading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding: 0.85rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
}

.reading-main strong {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.reading-main span {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: 0.25rem;
}

.reading-secondary {
  text-align: right;
}

.reading-secondary strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: #ef4444;
}

.reading-secondary span {
  font-size: 0.72rem;
  color: var(--text-light);
}

.province-sparkline {
  height: 36px;
  width: 100%;
  margin-bottom: 1rem;
}

/* ==========================================================================
   RESEARCH, METHODOLOGY & OPEN SCIENCE HUB
   ========================================================================== */
.research-section {
  padding: 4.5rem 0;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
}

.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.pipeline-step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  position: relative;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.pipeline-step-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.pipeline-step-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.publications-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-sm);
}

.publications-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.publication-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
}

.publication-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pub-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.pub-authors {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.pub-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-light);
}

.pub-meta span {
  font-family: var(--font-mono);
}

.pub-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ==========================================================================
   CITATION MODAL & OPEN DATA CODE SANDBOX
   ========================================================================== */
.code-sandbox-box {
  margin-top: 2.5rem;
  background: #0f172a;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  color: #e2e8f0;
}

.sandbox-header {
  padding: 0.85rem 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sandbox-tabs {
  display: flex;
  gap: 0.5rem;
}

.sandbox-tab {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  cursor: pointer;
  padding: 0.2rem 0.5rem;
}

.sandbox-tab.active {
  color: #38bdf8;
  border-bottom: 2px solid #38bdf8;
}

.sandbox-content {
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  overflow-x: auto;
}

/* Modal for Citation Copy */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  max-width: 620px;
  width: 100%;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-light);
}

.modal-body {
  padding: 1.5rem;
}

.citation-pre {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  white-space: pre-wrap;
  word-break: break-all;
  margin-bottom: 1rem;
  max-height: 220px;
  overflow-y: auto;
}

/* ==========================================================================
   ACADEMIC & PARTNERS FOOTER
   ========================================================================== */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 4rem 0 2rem 0;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.footer-brand h4 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.footer-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.footer-col h5 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-links a {
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

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

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-light);
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLETS & MOBILE)
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-ref-grid,
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .portal-pillars-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .ribbon-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .portal-nav-links {
    display: none;
  }
  .mobile-nav-toggle {
    display: block;
  }
  .hero-ref-backdrop {
    width: 100%;
    height: 48%;
    top: auto;
    bottom: 0;
    border-bottom-left-radius: 0;
  }
  .telemetry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tool-category-grid, .pipeline-grid, .provinces-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .nav-links,
  .portal-nav-links {
    display: none;
  }
  .mobile-nav-toggle {
    display: block;
  }
  .portal-hero-title {
    font-size: 2.1rem;
  }
  .portal-quickbar {
    flex-direction: column;
    align-items: stretch;
  }
  .portal-quick-pill {
    justify-content: center;
  }
  .ribbon-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 2.1rem;
  }
  .tool-category-grid, .pipeline-grid, .provinces-grid {
    grid-template-columns: 1fr;
  }
  .footer-top {
    grid-template-columns: 1fr;
  }
  .telemetry-grid {
    grid-template-columns: 1fr;
  }
  .observatory-viewport {
    height: 540px;
  }
}

