/* ==========================================================================
   Total Ascend - Privacy Policy Design System & Styling
   ========================================================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* CSS Variables & Theme Definitions */
:root {
  /* Light Theme (Default) */
  --primary: #5046e6;
  --primary-hover: #4338ca;
  --primary-rgb: 80, 70, 230;
  
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-inverse: #ffffff;
  
  --border-color: #e2e8f0;
  --border-active: #5046e6;
  
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(80, 70, 230, 0.1);
  
  --hero-bg: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --accent-color: #3b82f6;
  --accent-bg-rgb: 59, 130, 246;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s ease;

  --header-height: 80px;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
  /* Dark Theme overrides */
  --primary: #818cf8;
  --primary-hover: #a5b4fc;
  --primary-rgb: 129, 140, 248;
  
  --bg-app: #080b11;
  --bg-card: #0f1524;
  --bg-sidebar: #0f1524;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;
  
  --border-color: #1e293b;
  --border-active: #818cf8;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 20px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(129, 140, 248, 0.15);
  
  --hero-bg: linear-gradient(135deg, #1e1b4b 0%, #311059 100%);
  --accent-color: #60a5fa;
  --accent-bg-rgb: 96, 165, 250;
}

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

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Typography elements */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
  transition: color var(--transition-normal);
}

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

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

p {
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ==========================================================================
   Layout & Containers
   ========================================================================== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header Styling */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background-color: rgba(var(--primary-rgb), 0.01);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.site-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: -1;
  background-color: var(--bg-app);
  opacity: 0.85;
  transition: background-color var(--transition-normal);
}

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

/* Brand Logo */
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
  color: #fff;
  font-weight: 800;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  position: relative;
  overflow: hidden;
}

.brand-icon::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
  transform: rotate(30deg);
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-main) 30%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Desktop Navigation Links */
.desktop-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
  margin-left: 2.5rem;
  margin-right: auto;
}

.desktop-nav .nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding: 0.5rem 0;
  transition: color var(--transition-fast);
}

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

.desktop-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-fast);
}

.desktop-nav .nav-link:hover::after,
.desktop-nav .nav-link.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Mobile Main Navigation Links */
.mobile-main-links {
  list-style: none;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
}

.mobile-main-link {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-main);
  display: block;
  transition: color var(--transition-fast);
}

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

/* Nav Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background-color: var(--bg-card);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.theme-toggle-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  transition: transform var(--transition-normal);
}

[data-theme="dark"] .theme-toggle-btn svg.sun-icon {
  display: block;
}
[data-theme="dark"] .theme-toggle-btn svg.moon-icon {
  display: none;
}
body:not([data-theme="dark"]) .theme-toggle-btn svg.sun-icon {
  display: none;
}
body:not([data-theme="dark"]) .theme-toggle-btn svg.moon-icon {
  display: block;
}

/* Call-to-action button */
.btn-cta {
  background: var(--hero-bg);
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 14px rgba(80, 70, 230, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(80, 70, 230, 0.35);
  color: #ffffff;
}

.btn-cta svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 0.5rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  position: relative;
  background: var(--hero-bg);
  color: var(--text-inverse);
  padding: 5rem 0 4.5rem;
  overflow: hidden;
  border-bottom-left-radius: 40px;
  border-bottom-right-radius: 40px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transition: background var(--transition-normal);
}

/* Background elements for Hero */
.hero-bg-shapes {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
}

.shape-1 {
  width: 350px;
  height: 350px;
  background-color: #38bdf8;
  top: -100px;
  left: 5%;
}

.shape-2 {
  width: 400px;
  height: 400px;
  background-color: #ec4899;
  bottom: -150px;
  right: 5%;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.badge {
  display: inline-block;
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 0.35rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  backdrop-filter: blur(4px);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  color: #ffffff;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 600px;
  margin: 0 auto 1.5rem;
  font-weight: 400;
}

.hero-meta {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-wrapper {
  margin-top: 3.5rem;
  margin-bottom: 6rem;
}

.layout-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 4rem;
  align-items: start;
}

/* Sticky Sidebar & Table of Contents */
.sidebar-wrapper {
  position: sticky;
  top: calc(var(--header-height) + 2rem);
  max-height: calc(100vh - var(--header-height) - 4rem);
  overflow-y: auto;
  padding-right: 1rem;
}

/* Custom Scrollbar for Sidebar */
.sidebar-wrapper::-webkit-scrollbar {
  width: 4px;
}
.sidebar-wrapper::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-wrapper::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.toc-heading {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-weight: 700;
}

.toc-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.toc-link {
  display: flex;
  align-items: center;
  padding: 0.65rem 1rem;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  border-left: 2px solid var(--border-color);
  transition: all var(--transition-fast);
}

.toc-link:hover {
  color: var(--primary);
  border-left-color: var(--primary);
  background-color: rgba(var(--primary-rgb), 0.03);
}

.toc-link.active {
  color: var(--primary);
  border-left-color: var(--border-active);
  font-weight: 600;
  background-color: rgba(var(--primary-rgb), 0.05);
}

/* Policy Content Sections */
.policy-content {
  display: flex;
  flex-direction: column;
  gap: 4.5rem;
}

.policy-section {
  scroll-margin-top: calc(var(--header-height) + 1.5rem);
}

.policy-section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.policy-section h2::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--hero-bg);
}

.policy-section h3 {
  font-size: 1.3rem;
  margin: 2rem 0 1rem 0;
  font-weight: 600;
}

.policy-section-intro {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-main);
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   Special Layout Components (Cards/Lists/Grids)
   ========================================================================== */

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.card-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
}

.card-item:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.card-icon {
  width: 46px;
  height: 46px;
  background-color: rgba(var(--primary-rgb), 0.08);
  border-radius: 12px;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  transition: all var(--transition-fast);
}

.card-item:hover .card-icon {
  background-color: var(--primary);
  color: #ffffff;
}

.card-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
}

.card-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0;
}

/* List with checks or custom design */
.premium-list {
  list-style: none;
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.premium-list-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 1rem;
}

.premium-list-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.premium-list-icon svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.premium-list-content strong {
  color: var(--text-main);
  font-weight: 600;
  display: block;
  margin-bottom: 0.15rem;
}

/* Info Box / Callout Box */
.info-callout {
  background-color: rgba(var(--accent-bg-rgb), 0.06);
  border-left: 4px solid var(--accent-color);
  border-radius: 0 16px 16px 0;
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 1rem;
}

.info-callout-icon {
  color: var(--accent-color);
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.info-callout-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.info-callout-content p {
  margin-bottom: 0;
  color: var(--text-main);
  font-size: 0.98rem;
  line-height: 1.6;
}

.info-callout-content strong {
  font-weight: 600;
  color: var(--text-main);
}

/* Contact Card Card Design */
.contact-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2.5rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-tag {
  display: inline-block;
  background-color: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  align-self: flex-start;
}

.contact-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.contact-text {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-btn {
  background-color: var(--bg-app);
  border: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition-fast);
  width: 100%;
}

.contact-btn:hover {
  border-color: var(--primary);
  background-color: var(--bg-card);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.contact-btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background-color: rgba(var(--primary-rgb), 0.08);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-btn-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.contact-btn-text {
  text-align: left;
}

.contact-btn-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.contact-btn-value {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

/* ==========================================================================
   Footer Section
   ========================================================================== */
.site-footer {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 3rem 0;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.footer-link {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

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

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

/* ==========================================================================
   Mobile Nav Menu Drawer
   ========================================================================== */
.mobile-nav-panel {
  position: fixed;
  top: 0; right: -100%;
  width: 320px;
  height: 100vh;
  background-color: var(--bg-sidebar);
  z-index: 1000;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  padding: 2rem;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.close-panel-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 0.5rem;
}

.close-panel-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.mobile-nav-content {
  flex-grow: 1;
  overflow-y: auto;
}

.mobile-nav-panel .toc-link {
  border-left: none;
  border-right: 3px solid transparent;
  padding: 0.8rem 0;
  font-size: 1.05rem;
}

.mobile-nav-panel .toc-link.active {
  border-right-color: var(--border-active);
  background-color: transparent;
}

.mobile-nav-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}

.mobile-nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Up to Tablet Width */
@media (max-width: 1024px) {
  .desktop-nav {
    display: none;
  }

  .layout-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .sidebar-wrapper {
    display: none; /* Sidebar hidden, accessed via mobile menu trigger */
  }

  .mobile-nav-toggle {
    display: block; /* Show menu trigger button */
  }

  .hero-title {
    font-size: 2.75rem;
  }
}

/* Tablet to Mobile landscape */
@media (max-width: 768px) {
  .hero-section {
    padding: 4rem 0 3.5rem;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
  }

  .hero-title {
    font-size: 2.25rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .contact-card {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem;
  }

  .site-header {
    height: 70px;
  }

  .header-actions {
    gap: 0.75rem;
  }

  .btn-cta span {
    display: none; /* Hide button text on mobile, keep App Store icon */
  }

  .btn-cta {
    padding: 0.65rem;
    border-radius: 10px;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .container {
    padding: 0 1.25rem;
  }

  .hero-title {
    font-size: 1.85rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .policy-section h2 {
    font-size: 1.5rem;
  }

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

  .footer-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-links {
    flex-direction: column;
    gap: 1rem;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}
