/* ==========================================================================
   Stoxi Design System & Style Guide - Main Stylesheet (Simplified)
   ========================================================================== */

/* 1. Imports & Core Variables */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* Fonts */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Typography Scale */
  --font-size-hero: 34px;
  --font-size-heading: 28px;
  --font-size-title: 20px;
  --font-size-body-large: 16px;
  --font-size-body: 14px;
  --font-size-caption: 12px;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;

  /* Border Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Subscription Tier Color Coding (Fixed Tokens) */
  --tier-free: #4ADE80;
  --tier-free-subtle: rgba(74, 222, 128, 0.12);
  --tier-plus: #007AFF;
  --tier-plus-subtle: rgba(0, 122, 255, 0.12);
  --tier-pro: #AF52DE;
  --tier-pro-subtle: rgba(175, 82, 222, 0.12);

  /* Theme-Dependent Variables (Default: Dark Mode) */
  --bg-color: #08090D;
  --surface-color: #16181F;
  --surface-light: rgba(255, 255, 255, 0.08);
  --accent-mint: #4ADE80;
  --accent-subtle: rgba(74, 222, 128, 0.12);
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --color-danger: #F87171;
  --color-danger-subtle: rgba(248, 113, 113, 0.12);
  --color-warning: #FBBF24;
  --color-warning-subtle: rgba(251, 191, 36, 0.12);

  /* Glow Opacity & Border Depth */
  --glow-opacity: 0.14;
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-focus: rgba(255, 255, 255, 0.2);
  --shadow-color: rgba(0, 0, 0, 0.5);

  /* Scrollbars */
  --scrollbar-thumb: rgba(255, 255, 255, 0.2);
  --scrollbar-track: rgba(255, 255, 255, 0.03);

  /* Transition timings */
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  
  color-scheme: dark light;
}

/* Light Mode Overrides */
[data-theme="light"] {
  --bg-color: #F4F6F9;
  --surface-color: #FFFFFF;
  --surface-light: rgba(0, 0, 0, 0.06);
  --accent-mint: #16A34A;
  --accent-subtle: rgba(22, 163, 74, 0.08);
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --color-danger: #DC2626;
  --color-danger-subtle: rgba(220, 38, 38, 0.08);
  --color-warning: #D97706;
  --color-warning-subtle: rgba(217, 119, 6, 0.08);

  --tier-free: #16A34A;
  --tier-free-subtle: rgba(22, 163, 74, 0.08);

  --glow-opacity: 0.08;
  --glass-border: rgba(0, 0, 0, 0.06);
  --glass-border-focus: rgba(0, 0, 0, 0.15);
  --shadow-color: rgba(15, 23, 42, 0.08);

  --scrollbar-thumb: rgba(0, 0, 0, 0.15);
  --scrollbar-track: rgba(0, 0, 0, 0.02);
}

/* 2. Reset & Global Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  color: var(--text-primary);
  background-color: var(--bg-color);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Global Custom Scrollbar */
@supports (scrollbar-color: auto) {
  * {
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
    scrollbar-width: thin;
  }
}

@supports not (scrollbar-color: auto) {
  *::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  *::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: var(--radius-full);
  }
  *::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
  }
}

/* 3. Helper Utilities & Layout Containers */
.container {
  width: 100%;
  max-width: 1050px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.grid {
  display: grid;
  gap: var(--space-lg);
}

/* Glassmorphism Containers */
.glass-panel {
  background: var(--surface-color);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px var(--shadow-color);
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-panel:hover {
  border-color: var(--glass-border-focus);
}

/* Radial Glowing Shapes behind layers */
.glow-orbs {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: var(--radius-full);
  filter: blur(120px);
  opacity: var(--glow-opacity);
  transition: opacity var(--transition-normal);
}

.glow-mint {
  background: #4ADE80;
  width: 400px;
  height: 400px;
  top: 5%;
  left: -150px;
}

.glow-blue {
  background: #007AFF;
  width: 500px;
  height: 500px;
  top: 35%;
  right: -200px;
}

.glow-purple {
  background: #AF52DE;
  width: 450px;
  height: 450px;
  bottom: 5%;
  left: -50px;
}

/* Typography Hierarchy classes */
.hero-title {
  font-family: var(--font-heading);
  font-size: 42px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.section-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-heading);
  font-weight: 700;
  line-height: 1.3;
}

.card-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-title);
  font-weight: 700;
}

.body-large {
  font-family: var(--font-body);
  font-size: var(--font-size-body-large);
  font-weight: 500;
}

.caption {
  font-family: var(--font-body);
  font-size: var(--font-size-caption);
  font-weight: 500;
  color: var(--text-secondary);
}

/* Buttons and Badge utilities */
.btn {
  font-family: var(--font-heading);
  font-size: var(--font-size-body-large);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition-normal), filter var(--transition-normal);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent-mint);
  color: var(--bg-color) !important;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--surface-light);
  color: var(--text-primary);
  border: 1.5px solid var(--glass-border);
}

.btn-secondary:hover {
  background: var(--surface-color);
  border-color: var(--glass-border-focus);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-body);
  border-radius: var(--radius-sm);
}

.badge {
  font-family: var(--font-heading);
  font-size: var(--font-size-caption);
  font-weight: 600;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Main Navigation Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(8, 9, 13, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1.5px solid var(--glass-border);
  height: 72px;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

[data-theme="light"] header {
  background: rgba(244, 246, 249, 0.7);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--font-size-title);
}

.logo-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--glass-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  overflow: hidden;
}

[data-theme="light"] .logo-icon-wrapper {
  background: rgba(0, 0, 0, 0.03);
}

.logo-group:hover .logo-icon-wrapper {
  transform: translateY(-1px) scale(1.05);
  border-color: var(--glass-border-focus);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
}

.logo-icon-svg {
  width: 28px;
  height: 28px;
  display: block;
}

.nav-links {
  display: flex;
  gap: var(--space-lg);
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--font-size-body);
  transition: color var(--transition-normal);
}

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

.nav-right-group {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Theme Selector Control (Toggle style) */
.theme-switch-btn {
  background: var(--surface-light);
  border: 1.5px solid var(--glass-border);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--transition-normal), background-color var(--transition-normal);
}

.theme-switch-btn:hover {
  border-color: var(--glass-border-focus);
}

.theme-switch-btn .sun-icon {
  display: none;
}

[data-theme="light"] .theme-switch-btn .moon-icon {
  display: none;
}

[data-theme="light"] .theme-switch-btn .sun-icon {
  display: block;
}

/* Mobile Nav Drawer controls */
.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
}

.mobile-nav-drawer {
  position: fixed;
  top: 72px;
  right: -100%;
  width: 260px;
  bottom: 0;
  background: var(--surface-color);
  border-left: 1.5px solid var(--glass-border);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  z-index: 99;
  box-shadow: -8px 0 32px var(--shadow-color);
  transition: right var(--transition-normal);
}

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

.mobile-nav-drawer .nav-link {
  font-size: var(--font-size-title);
  padding: var(--space-sm) 0;
}

/* 4. Page Content Views */
main {
  margin-top: 72px;
  position: relative;
  min-height: calc(100vh - 72px);
}

.route-view {
  display: none;
}

.route-view.active {
  display: block;
  animation: fadeIn var(--transition-normal);
}

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

/* --- HOME VIEW (Landing Page) --- */

/* Hero Section */
.hero-sec {
  position: relative;
  padding: var(--space-xxl) 0;
}

.hero-grid {
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: var(--space-xxl);
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.hero-badge {
  background: var(--accent-subtle);
  color: var(--accent-mint);
  border: 1px solid rgba(74, 222, 128, 0.2);
  align-self: flex-start;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-mint) 0%, #007AFF 50%, #AF52DE 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: var(--font-size-body-large);
  color: var(--text-secondary);
}

/* App Download Links */
.download-group {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}

.store-badge {
  width: 140px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: #000000;
  border: 1.5px solid var(--glass-border);
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.store-badge:hover {
  border-color: var(--glass-border-focus);
  transform: translateY(-2px);
}

.store-badge svg {
  width: 100%;
  height: 100%;
}

/* Hero Stats Section */
.hero-stats {
  display: flex;
  gap: var(--space-lg);
  margin-top: var(--space-md);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-val {
  font-family: var(--font-heading);
  font-size: var(--font-size-title);
  font-weight: 800;
  color: var(--accent-mint);
}

.stat-lbl {
  font-size: var(--font-size-caption);
  color: var(--text-secondary);
}

/* Hero Visual Column (Main mockup) */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.phone-aura-glow {
  position: absolute;
  width: 280px;
  height: 400px;
  background: radial-gradient(circle, rgba(74, 222, 128, 0.25) 0%, rgba(0, 122, 255, 0.15) 50%, transparent 80%);
  filter: blur(40px);
  z-index: 1;
}

/* Screenshot mockup display */
.phone-mockup-wrapper {
  width: 270px;
  border-radius: 36px;
  border: 8px solid #2d2d2d;
  background: #000000;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  position: relative;
  z-index: 2;
  transition: transform var(--transition-normal);
}

.phone-mockup-wrapper:hover {
  transform: translateY(-4px) scale(1.01);
}

.phone-mockup-wrapper img {
  width: 100%;
  height: auto;
  display: block;
}

/* --- APP SCREENSHOT SHOWCASE GRID SECTION --- */
.showcase-sec {
  padding: var(--space-xxl) 0;
  position: relative;
}

.section-head {
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-xxl);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.section-subtitle {
  font-size: var(--font-size-body-large);
  color: var(--text-secondary);
}

/* Interactive Tabs Showcase Component */
.tabs-container {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-top: var(--space-xl);
}

.tabs-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: var(--space-md);
  border-bottom: 1.5px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
  justify-content: center;
}

[data-theme="light"] .tabs-list {
  background: rgba(0, 0, 0, 0.01);
}

.tab-btn {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--font-size-body);
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.tab-btn i, .tab-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--surface-light);
}

.tab-btn.active {
  color: var(--accent-mint);
  background: var(--accent-subtle);
  border-color: rgba(74, 222, 128, 0.2);
}

.tab-content-wrapper {
  padding: var(--space-xl);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: tabFadeIn var(--transition-slow);
}

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

.tab-panel-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--space-xl);
  align-items: center;
}

.panel-media {
  display: flex;
  justify-content: center;
  position: relative;
}

.panel-media::before {
  content: '';
  position: absolute;
  width: 220px;
  height: 340px;
  background: radial-gradient(circle, var(--accent-mint) 0%, transparent 70%);
  opacity: 0.25;
  filter: blur(40px);
  z-index: 1;
  pointer-events: none;
}

.panel-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.panel-title {
  font-family: var(--font-heading);
  font-size: var(--font-size-heading);
  font-weight: 800;
  color: var(--text-primary);
}

.panel-desc {
  font-size: var(--font-size-body-large);
  color: var(--text-secondary);
  line-height: 1.6;
}

.panel-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}

.panel-bullets li {
  display: flex;
  gap: var(--space-sm);
  font-size: var(--font-size-body);
  align-items: flex-start;
  line-height: 1.5;
}

.panel-bullets li svg, .panel-bullets li i {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--accent-mint);
  margin-top: 2px;
}

.panel-bullets li strong {
  color: var(--text-primary);
}



/* --- SPA LEGAL PAGES VIEWS --- */
.legal-sec {
  padding: var(--space-xxl) 0;
}

.legal-box {
  background: var(--surface-color);
  border: 1.5px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  text-decoration: none;
  color: var(--accent-mint);
  font-family: var(--font-heading);
  font-weight: 600;
  margin-bottom: var(--space-lg);
  transition: transform var(--transition-normal);
}

.back-link:hover {
  transform: translateX(-4px);
}

.legal-box h1 {
  font-family: var(--font-heading);
  font-size: var(--font-size-hero);
  margin-bottom: var(--space-sm);
}

.legal-meta {
  color: var(--text-secondary);
  font-size: var(--font-size-caption);
  margin-bottom: var(--space-lg);
}

.legal-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  line-height: 1.6;
  color: var(--text-secondary);
}

.legal-text h2 {
  font-family: var(--font-heading);
  font-size: var(--font-size-title);
  color: var(--text-primary);
  margin-top: var(--space-lg);
  border-bottom: 1.5px solid var(--glass-border);
  padding-bottom: var(--space-xs);
}

.legal-text h3 {
  font-family: var(--font-heading);
  font-size: var(--font-size-body-large);
  font-weight: 700;
  color: var(--text-primary);
  margin-top: var(--space-md);
}

.legal-text code {
  font-family: monospace;
  background: var(--surface-light);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.9em;
}

.legal-text blockquote {
  background: var(--surface-light);
  border-left: 4px solid var(--accent-mint);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  margin: var(--space-md) 0;
}

.legal-text blockquote.note {
  border-left-color: var(--accent-mint);
  background: var(--accent-subtle);
}

.legal-text blockquote.warning {
  border-left-color: var(--color-warning);
  background: var(--color-warning-subtle);
}

.legal-text blockquote.danger {
  border-left-color: var(--color-danger);
  background: var(--color-danger-subtle);
}

/* 5. Footer Layout */
footer {
  background: var(--surface-color);
  border-top: 1.5px solid var(--glass-border);
  padding: var(--space-xxl) 0 var(--space-lg);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.footer-grid {
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.footer-desc {
  color: var(--text-secondary);
  font-size: var(--font-size-body);
  max-width: 260px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-col h5 {
  font-family: var(--font-heading);
  font-size: var(--font-size-body-large);
  font-weight: 700;
}

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

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

.footer-bottom {
  border-top: 1.5px solid var(--surface-light);
  padding-top: var(--space-lg);
  text-align: center;
  font-size: var(--font-size-caption);
  color: var(--text-secondary);
}

/* 6. Responsive Queries */
@media (max-width: 900px) {
  :root {
    --font-size-hero: 30px;
    --font-size-heading: 24px;
    --font-size-title: 18px;
  }
  
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  
  .hero-visual {
    order: -1;
  }

  .tab-panel-grid {
    grid-template-columns: 1fr !important;
    gap: var(--space-xl);
    text-align: center;
  }

  .panel-media {
    order: -1 !important;
  }

  .panel-bullets li {
    justify-content: flex-start;
  }


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

@media (max-width: 600px) {
  header {
    height: 60px;
  }
  
  main {
    margin-top: 60px;
    min-height: calc(100vh - 60px);
  }

  .mobile-toggle {
    display: block;
  }

  .nav-links {
    display: none;
  }
  
  .nav-actions .btn {
    display: none;
  }

  .hero-stats {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .download-group {
    flex-direction: column;
    align-items: flex-start;
  }

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

/* Reduced Motion Safety */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-delay: -1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    background-attachment: initial !important;
    scroll-behavior: auto !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
  }
}
