:root {
  /* Colors - Antigravity Theme */
  --bg-deep: #ffffff;
  --bg-surface: #ffffff; /* Cleaner, less gray */
  --accent-primary: #121317; /* Dark Charcoal */
  --accent-glow: rgba(18, 19, 23, 0.1);
  --text-main: #121317;
  --text-muted: #5f6368;
  --text-heading: #121317;
  --border-light: rgba(0, 0, 0, 0.06);
  --glass: rgba(255, 255, 255, 0.9);
  --gradient-main: #121317; /* Solid charcoal for primary actions */

  /* Fonts */
  --font-heading: "Google Sans Flex", "Google Sans", "Product Sans", "Inter", sans-serif;
  --font-body: "Google Sans Text", "Google Sans", "Inter", sans-serif;

  /* Spacing */
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 32px; /* Increased from 24px */
  --spacing-lg: 64px; /* Increased from 40px */
  --spacing-xl: 120px; /* Increased from 60px */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden; /* Prevent horizontal scroll on the root only */
}

body {
  width: 100%;
  font-family: var(--font-body);
  background-color: var(--bg-deep);
  color: var(--text-main);
  line-height: 1.6;
  position: relative; /* Ensure stacking context */
}

/* Ensure content sits ABOVE the particles */
main,
footer {
  position: relative;
  z-index: 2;
}

h1,
h2,
h3,
h4,
.font-heading {
  font-family: var(--font-heading);
  color: var(--text-heading);
}

.text-gradient {
  background: linear-gradient(135deg, var(--text-main) 0%, #4a5568 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Ambient Background (Shared) */
/* Ambient Background (Removed) */
/* .ambient-glow and .grid-lines removed for solid background */

#particles-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none; /* Let clicks pass through */
  z-index: 0;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 48px;
}

/* =========================================
   HOME PAGE STYLES (.home-page)
   ========================================= */

/* Header */
.home-page header {
  padding: 12px 0; /* Reduced from 24px */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.9);
  transition: padding 0.3s ease;
  border-bottom: 1px solid var(--border-light);
}

.home-page header.scrolled {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.nav_content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1600px;
  margin: 0 auto;
  min-height: 52px; /* Adjust height to match button size for consistency */
}

.logo {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--text-main);
  border-radius: 8px;
  display: grid;
  place-items: center;
}

.logo-icon svg {
  width: 20px;
  height: 20px;
  stroke: white;
  stroke-width: 2;
}

.nav-btn {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-light);
  padding: 10px 20px;
  border-radius: 99px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400; /* Reduced from 500 */
  transition: all 0.3s ease;
}

.nav-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
}

.nav-link-secondary {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

/* Mobile Menu Elements (Dropdown Style) */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 101;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background-color: var(--text-main);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  transform: translateY(-4px) rotate(-45deg);
}

.mobile-menu {
  position: absolute; /* Dropdown from header */
  top: 100%;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05); /* Soft shadow */
  
  /* Animation properties */
  transform: translateY(-20px);
  opacity: 0;
  visibility: hidden; /* Use visibility for accessibility */
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: -1; /* Behind header content visually if overlapping, but header has bg */
  /* Actually, z-index -1 moves it behind the header background? 
     Header is parent. Header has background. 
     If header has background, z-index -1 puts it behind header background.
     That might be desired for "sliding out from under".
     But header background is semi-transparent blur. 
     If I want it to look like it slides OUT, -1 is good. */
}

.mobile-menu.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.mobile-menu-content {
  display: flex;
  flex-direction: column;
  align-items: center; /* Centered items as requested */
  gap: 16px; 
  padding: 0 24px;
  max-width: 100%;
  margin: 0 auto;
}

.mobile-nav-link {
  font-family: var(--font-body);
  font-size: 1.125rem;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  padding: 12px 24px; /* More padding for button-like touch area */
  border-bottom: none; /* Removed border for centered clean look */
  width: auto; /* Let it be auto width to center nicely */
  display: inline-block; /* Helps with centering */
  text-align: center;
  transition: all 0.2s;
  border-radius: 8px; /* Slight radius for hover effect */
}

.mobile-nav-link:last-child {
  border-bottom: none;
}

.mobile-nav-link:hover {
  color: var(--accent-primary);
  background: rgba(0,0,0,0.03); /* Subtle background instead of left movement */
  padding-left: 24px; /* Reset padding shift */
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 140px;
  padding-bottom: 120px;
  position: relative;
  overflow: hidden; /* Contains the .dashboard-scan element */
}

.hero .container {
    max-width: 1200px;
}

.hero h1 {
  font-size: clamp(3.5rem, 7vw, 6rem);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
  color: var(--text-main);
  background: none;
  -webkit-text-fill-color: initial;
  animation: fadeIn 0.8s ease-out 0.1s backwards;
}

.hero p {
  font-size: 1.5rem;
  color: var(--text-muted);
  margin: 0 auto 64px;
  animation: fadeIn 0.8s ease-out 0.2s backwards;
  font-weight: 400;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 16px;
  animation: fadeIn 0.8s ease-out 0.3s backwards;
}

.hero-cta .btn {
  width: 280px;
  justify-content: center;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px; /* Reduced from 18px 36px */
  border-radius: 9999px; /* Pill shape */
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  font-family: var(--font-heading);
  font-size: 1rem; /* Reduced from 1.125rem */
}

.btn-primary {
  background: var(--text-main);
  color: white;
  border: 1px solid var(--text-main);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background: #000000;
}

.btn-glass {
  background: white; /* Solid background */
  border: 1px solid var(--border-light);
  color: var(--text-main);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); /* Slight shadow for lift */
}

.btn-glass:hover {
  background: #f8fafc; /* Slightly darker white on hover */
  border-color: rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-btn {
  background: var(--text-main);
  color: white;
  padding: 10px 24px;
  border-radius: 9999px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.nav-btn:hover {
  background: #000000;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Decorative Elements */
/* Decorative Elements */
.dashboard-scan {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) perspective(1000px) rotateX(60deg) scale(2);
  width: 800px;
  height: 800px;
  border: 1px solid rgba(0, 0, 0, 0.03); /* Much more subtle */
  border-radius: 50%;
  z-index: -1;
  opacity: 0.3;
}

.dashboard-scan::after {
  content: "";
  position: absolute;
  inset: -100px;
  border: 1px dashed rgba(0, 0, 0, 0.04);
  border-radius: 50%;
  animation: pulse-ring 10s linear infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.8) rotate(0deg); opacity: 0; }
  50% { opacity: 0.5; }
  100% { transform: scale(1.2) rotate(180deg); opacity: 0; }
}

/* Features */
.section-title {
  text-align: center;
  margin-bottom: 100px;
}

.section-title h2 {
  font-size: 2.5rem;
  margin-top: 24px;
  margin-bottom: 24px;
  color: var(--text-main);
  background: none;
  -webkit-text-fill-color: initial;
}

.section-title p {
  color: var(--text-muted);
  max-width: 1100px;
  margin: 0 auto;
  font-size: 1.125rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Force 3 columns on large screens */
  gap: 40px;
  padding: 0;
  max-width: 1400px;
  width: 100%; /* Ensure it spans full width to center properly */
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-surface);
  /* border: 1px solid var(--border-light); */ /* Removed border for cleaner look */
  padding: 0; /* Minimal padding, let it breathe */
  border-radius: 0;
  position: relative;
  overflow: visible;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center; /* Centers items horizontally */
  text-align: center; /* Centers text */
  height: 100%; /* Ensures equal height if used in grid */
}

.feature-card:hover {
  border-color: transparent;
  transform: translateY(-2px);
  background: white;
  /* box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04); */ /* Removed shadow for simpler look */
}

/* Remove the top accent line */
.feature-card::before {
  display: none;
}

.feature-icon {
  width: 56px;
  height: 56px;
  background: #f1f3f4; /* Light gray circle */
  border: none;
  border-radius: 50%; /* Circle */
  display: grid;
  place-items: center;
  margin-bottom: 32px;
  color: var(--text-main);
}

.feature-card h3 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: var(--text-main);
  font-weight: 500;
}

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

/* Download Section */
.download-section {
  background: var(--bg-deep); /* Keep it white/clean */
  padding-top: 160px;
  border-top: none;
  text-align: center;
}

.os-grid {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 80px;
  flex-wrap: wrap;
}

.os-card {
  background: #f8fafc; /* Very subtle grey */
  border: none;
  border-radius: 32px;
  padding: 48px 40px;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 280px;
}

.os-card:hover {
  background: #f1f5f9;
  transform: translateY(-4px);
  /* No heavy shadow or border color change */
}

.os-card .os-icon-lg {
  font-size: 3.5rem;
  margin-bottom: 24px;
  color: var(--text-main);
}

.os-card:hover .os-icon-lg {
  transform: scale(1.05); /* Subtle scale */
}

.os-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.os-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Footer (Shared/Home) */
footer {
  border-top: none;
  padding: 80px 0 60px;
  background: var(--bg-deep);
  color: var(--text-muted);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
  font-weight: 500;
}

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

/* =========================================
   LEGAL PAGE STYLES (.legal-page)
   ========================================= */

.legal-page .page-wrapper {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Legal Header (Sticky to match feel but keep sticky behavior) */
.legal-page header {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: padding 0.3s ease;
}

.legal-page .logo,
.legal-page .logo:hover {
  text-decoration: none;
  color: var(--text-main);
}

/* Use .container .nav_content structure like home */
.legal-page .nav_content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.legal-page .back-btn {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px; /* Matches home nav-btn padding exactly */
  border-radius: 999px;
  border: 1px solid var(--border-light);
  transition: all 0.2s;
  background: rgba(0, 0, 0, 0.03); /* Match home nav-btn background */
  text-decoration: none;
}

.legal-page .back-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text-main);
  text-decoration: none;
}

/* Legal Content */
.legal-page main {
  flex: 1;
  padding: var(--spacing-xl) 0;
}

/* Legal Container Override */
.legal-page main .container {
  max-width: 1100px; /* Keep narrower for text readability in MAIN */
}

/* Generic Text Styles Scoped to Legal */
.legal-page h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: var(--spacing-lg);
  background: linear-gradient(to right, #0f172a, #475569);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
  text-align: left; /* Home usually centers */
}

.legal-page h2 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--border-light);
  color: #1e293b;
  text-align: left;
}

.legal-page p,
.legal-page ul,
.legal-page ol {
  color: var(--text-muted);
  margin-bottom: var(--spacing-sm);
  font-size: 1.05rem;
  text-align: left;
}

.legal-page strong {
  color: #0f172a;
  font-weight: 600;
}

.legal-page ul,
.legal-page ol {
  padding-left: 24px;
}

.legal-page li {
  margin-bottom: var(--spacing-xs);
}

.legal-page a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s;
}

.legal-page a:hover {
  color: var(--accent-glow);
  text-decoration: underline;
}

/* Important Clause Box */
.important-clause {
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-left: 4px solid var(--accent-primary);
  padding: var(--spacing-md);
  border-radius: 8px;
  margin: var(--spacing-md) 0;
}

.important-clause p:last-child {
  margin-bottom: 0;
}

.important-clause strong {
  color: var(--accent-primary);
}

/* Legal Footer Specifics */
.legal-page footer {
  padding: 60px 0 40px;
  margin-top: auto;
  text-align: center;
}

.legal-page footer p {
  text-align: center;
}

/* Override general legal page link styles for footer */
.legal-page .footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.legal-page .footer-links a:hover {
  color: var(--text-main);
  text-decoration: none;
}

.tagline {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.subtitle {
  color: #64748b;
  font-size: 0.9rem;
  margin-top: 8px;
}

/* Responsive */
@media (max-width: 1440px) {
  .home-page header,
  .legal-page header {
    padding: 12px 0;
  }
  
  .hero {
    min-height: 100vh; /* Restore full height for centering */
    padding-top: 80px; /* Balance for fixed header */
    padding-bottom: 80px;
  }

  /* Specific fix for Laptop Font Size */
  .hero h1 {
    font-size: 3.5rem; /* Fixed size for standard laptops, override dynamic clamp */
    line-height: 1.1;
    margin-bottom: 24px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
  }

  .hero p {
    font-size: 1.25rem;
    margin-bottom: 40px;
  }

  .feature-card {
    padding: 32px; /* Reduce padding to save space */
  }

  .os-card {
    padding: 32px 24px;
  }

  /* Legal page adjustments for laptops */
  .legal-page h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 1024px) {
  .download-section {
    display: none !important;
  }
  
  /* Hide Desktop Nav */
  .desktop-nav {
    display: none !important;
  }
  
  /* Show Mobile Menu Toggle */
  .menu-toggle {
    display: flex;
  }
  
  /* Hide particles on tablet/mobile */
  #particles-canvas {
    display: none !important;
  }
  
  /* Intermediate Header Scaling during resize */
  .logo {
    font-size: 1.25rem;
    gap: 10px;
  }
  
  .logo-icon {
    width: 28px;
    height: 28px;
  }
  
  .logo-icon svg {
    width: 18px;
    height: 18px;
  }

  /* Hide hero download button on mobile/tablet */
  .hero-cta .btn-primary {
    display: none;
  }
}

/* Tablet / Small Laptop Grid Fix */
@media (max-width: 1200px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 900px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  /* Home Responsive */
  .logo {
    font-size: 1rem; /* Slightly larger than 0.8rem for readability, but smaller than desktop */
    gap: 8px;
  }
  
  .logo-icon {
    width: 24px; 
    height: 24px;
    border-radius: 6px;
  }
  
  .logo-icon svg {
    width: 14px;
    height: 14px;
  }
  
  .nav-link-secondary {
    font-size: 0.8rem;
  }
  
  .nav-btn,
  .back-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .nav-btn,
  .back-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  /* Make QCManager link look like a button on mobile to match style/height of Legal text button */
  /* This block removed as part of moving QCManager to menu */

  .dashboard-scan {
    display: none;
  }

  .container {
    padding: 0 24px;
  }

  .hero h1 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    margin-bottom: 16px;
    max-width: 95%;
  }

  .hero p {
    font-size: 1.125rem;
    padding: 0 20px;
    margin-bottom: 32px;
  }

  .hero-brand span {
    font-size: 1.5rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    padding: 60px 0;
  }

  .section-title h2 {
    margin-top: 0px;
    font-size: 1.75rem; /* Reduced from 2rem to maintain hierarchy with Hero H1 */
  }

  .section-title p {
    padding: 0 20px;
    font-size: 1rem;
  }

  .feature-card {
    padding: 24px;
  }

  /* Added to maintain hierarchy: H1 > H2 > H3 */
  .feature-card h3 {
    font-size: 1.25rem; 
  }

  .os-grid {
    grid-template-columns: 1fr;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .btn {
    width: 100%;
    justify-content: center;
    max-width: 320px;
  }

  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  /* Legal Responsive */
  .legal-page h1 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 1rem;
    padding: 0 10px;
  }

  .section-title h2 {
    margin-top: 0px;
    font-size: 1.35rem; /* Reduced from 1.75rem to be strictly smaller than Hero H1 (1.75rem) */
  }

  /* Added to maintain hierarchy: H1 (1.75) > H2 (1.35) > H3 (1.15) */
  .feature-card h3 {
    font-size: 1.15rem;
  }
}
