/* ============================================================
   GEMINI 3.7 FLASH · UNDERSTATED LUXURY OBSIDIAN & TITANIUM
   Clean, Editorial, Low-Saturation & Mobile-First Design System
   ============================================================ */

:root {
  /* Understated Luxury Dark Palette */
  --bg-base: #08090d;
  --bg-surface: #0e1017;
  --bg-elevated: #141722;
  --bg-card: rgba(20, 24, 36, 0.75);
  
  /* Micro-Borders & Subtle Highlights */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-focus: rgba(226, 232, 240, 0.4);
  
  /* Refined Editorial Accents (Muted & Elegant) */
  --accent-titanium: #f1f5f9;
  --accent-ice: #38bdf8;
  --accent-gold: #d4a359;
  --accent-muted: #64748b;
  --accent-sub: #475569;
  
  /* Text Hierarchy */
  --text-pure: #ffffff;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  
  /* Fonts */
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Noto Sans SC', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  --font-display: 'Plus Jakarta Sans', -apple-system, sans-serif;
  
  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-elevated: 0 12px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow-ice: 0 0 25px rgba(56, 189, 248, 0.12);
  
  /* Animation Timing */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  min-height: 100vh;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background Ambient Grain / Star Canvas */
#bgCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.85;
}

/* App Wrapper */
.app-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* Responsive Sticky Navigation */
.navbar {
  position: sticky;
  top: 14px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  margin-top: 14px;
  margin-bottom: 30px;
  background: rgba(14, 16, 23, 0.88);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-subtle);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.brand-icon svg {
  width: 18px;
  height: 18px;
  fill: var(--accent-titanium);
}

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

.brand-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-pure);
}

.brand-sub {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--accent-muted);
  text-transform: uppercase;
}

/* Scrollable Horizontal Tabs */
.nav-tabs-wrapper {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 0;
}

.nav-tabs-wrapper::-webkit-scrollbar {
  display: none;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(8, 9, 13, 0.7);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s var(--ease-spring);
}

.nav-tab:hover {
  color: var(--text-pure);
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: #0f172a;
  background: var(--accent-titanium);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.15);
}

.nav-tab .badge {
  font-size: 9.5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
  color: inherit;
  font-weight: 700;
}

.nav-tab.active .badge {
  background: rgba(15, 23, 42, 0.15);
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s var(--ease-spring);
}

.icon-btn:hover {
  color: var(--text-pure);
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-medium);
  transform: scale(1.05);
}

.icon-btn.active {
  color: var(--accent-ice);
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
}

.home-link {
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.2s var(--ease-spring);
  white-space: nowrap;
}

.home-link:hover {
  color: var(--text-pure);
  background: rgba(255, 255, 255, 0.08);
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 30px 10px 48px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 15px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

.hero-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-ice);
  box-shadow: 0 0 8px var(--accent-ice);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 5.5vw, 62px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-pure);
  margin-bottom: 16px;
}

.hero-title .highlight {
  background: linear-gradient(180deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-desc {
  max-width: 740px;
  margin: 0 auto 34px;
  font-size: clamp(14px, 1.8vw, 17px);
  color: var(--text-secondary);
  line-height: 1.65;
  font-weight: 400;
}

.hero-desc strong {
  color: var(--text-pure);
  font-weight: 600;
}

/* Metric Cards (Mobile-First 2x2 on Mobile, 4-col on Desktop) */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 860px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease-spring), border-color 0.25s var(--ease-spring), box-shadow 0.25s var(--ease-spring);
  cursor: default;
}

.metric-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-subtle);
}

.metric-value {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.5vw, 36px);
  font-weight: 800;
  color: var(--text-pure);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.metric-value .unit {
  font-size: 15px;
  color: var(--accent-muted);
  font-weight: 600;
  margin-left: 2px;
}

.metric-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.metric-sub {
  font-size: 10.5px;
  color: var(--accent-muted);
  line-height: 1.4;
}

/* Tab Content Sections */
.tab-section {
  display: none;
  animation: fadeSlideUp 0.35s var(--ease-spring) forwards;
}

.tab-section.active {
  display: block;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Frosted Luxury Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-subtle);
}

@media (max-width: 640px) {
  .glass-panel {
    padding: 18px 14px;
    border-radius: var(--radius-md);
  }
}

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

.panel-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-pure);
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 640px;
  margin-top: 4px;
}

/* Minimal Luxury Button Component */
.btn-luxury {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s var(--ease-spring);
  border: 1px solid transparent;
}

.btn-luxury.primary {
  background: var(--accent-titanium);
  color: #090a0f;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.12);
}

.btn-luxury.primary:hover {
  transform: translateY(-2px);
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
}

.btn-luxury.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-luxury.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-medium);
  color: var(--text-pure);
}

/* Toast */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

@media (max-width: 640px) {
  #toastContainer {
    bottom: 16px;
    right: 16px;
    left: 16px;
  }
}

.toast {
  background: rgba(20, 24, 36, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  color: var(--text-pure);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-elevated);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.25s var(--ease-spring), toastOut 0.3s ease 2.7s forwards;
  pointer-events: auto;
}

@keyframes toastIn {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-8px); }
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 40px 0 16px;
  color: var(--accent-muted);
  font-size: 12.5px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 50px;
}

.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text-pure);
  text-decoration: underline;
}

/* Mobile specific styling */
@media (max-width: 768px) {
  .app-container {
    padding: 0 12px 60px;
  }

  .navbar {
    padding: 8px 12px;
    margin-top: 8px;
    margin-bottom: 20px;
  }

  .brand-sub {
    display: none;
  }

  .nav-tab {
    padding: 6px 12px;
    font-size: 12px;
  }
}
