/* ═══════════════════════════════════════════════════════════
   PERAVIX — Design System: Base (Ultra-Premium SaaS)
   Tokens · Reset · Typography · Header · Buttons · Hero
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Brand Colors - Modern Enterprise (Indigo/Purple & Cyan) */
  --brand-primary:   #6366f1; /* Indigo */
  --brand-secondary: #8b5cf6; /* Violet */
  --brand-tertiary:  #0ea5e9; /* Light Blue */
  --brand-glow:      rgba(99, 102, 241, 0.15);

  /* Light Theme (Main Body) */
  --bg-main:         #ffffff;
  --bg-alt:          #f8fafc; /* Slate 50 */
  --bg-surface:      #ffffff;
  --text-main:       #0f172a; /* Slate 900 */
  --text-muted:      #475569; /* Slate 600 */
  --text-light:      #94a3b8; /* Slate 400 */
  
  /* Dark Theme (Hero, Footer) */
  --dark-main:       #020617; /* Slate 950 */
  --dark-surface:    #0f172a; /* Slate 900 */
  --dark-surface-2:  #1e293b; /* Slate 800 */
  --dark-text:       #f8fafc;
  --dark-text-muted: #94a3b8;

  /* UI Elements */
  --border-light:    rgba(15, 23, 42, 0.08);
  --border-dark:     rgba(255, 255, 255, 0.1);
  --radius-sm:       8px;
  --radius-md:       12px;
  --radius-lg:       20px;
  --radius-xl:       32px;

  /* Shadows - Smooth & Diffuse */
  --shadow-sm:       0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md:       0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg:       0 20px 40px rgba(15, 23, 42, 0.08);
  --shadow-glow:     0 0 32px rgba(99, 102, 241, 0.2);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { 
  scroll-behavior: smooth;
  scroll-padding-top: 120px; /* Accounts for fixed header */
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word; /* Prevents text overflow */
}

a { color: inherit; text-decoration: none; }
img { 
  display: block; 
  max-width: 100%; 
  height: auto; /* Maintains aspect ratio, prevents CLS */
}

/* ── HEADER (Floating Glass Pill) ── */
header {
  position: fixed;
  top: 20px; left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 1200px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 100px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

header.scrolled {
  top: 10px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  border-color: rgba(15, 23, 42, 0.05);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 16px 0 24px;
}

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

/* Adjust logo color to dark since header is light */
.logo img { height: 32px; width: auto; }

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-group { position: relative; }

.nav-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 100px;
  transition: all 0.2s ease;
}

.nav-toggle:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text-main);
}

.nav-arrow {
  font-size: 10px;
  opacity: 0.5;
  transition: transform 0.2s ease;
  margin-top: 2px;
}

.nav-group:hover .nav-arrow { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  min-width: 280px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 8px;
}

.nav-group:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown a {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.nav-dropdown a:hover {
  background: var(--bg-alt);
  color: var(--brand-primary);
  padding-left: 20px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── BUTTONS ── */
.btn {
  padding: 10px 20px;
  border-radius: 100px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text-main);
}

.btn-primary {
  background: var(--text-main);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.btn-primary:hover {
  background: var(--brand-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-glow {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: white;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}
.btn-glow:hover {
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
}

/* ── MOBILE MENU ── */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--text-main);
  font-size: 24px;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 90px; left: 20px; right: 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: var(--radius-lg);
  z-index: 999;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.mobile-menu.open { display: block; animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1); }

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

.mobile-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 20px 0 8px;
}

.mobile-menu a {
  display: block;
  padding: 12px 0;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  border-bottom: 1px solid var(--border-light);
}

.mobile-menu a:hover { color: var(--brand-primary); }

.mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 24px;
}

/* ── HERO (Ultra-Dark SaaS Aesthetic) ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: var(--dark-main);
  color: var(--dark-text);
  padding-top: 80px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15), transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(14, 165, 233, 0.15), transparent 40%);
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 100%);
  pointer-events: none;
}

.hero-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
}

.hero-content { min-width: 0; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--dark-text-muted);
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.eyebrow-dot {
  width: 8px; height: 8px;
  background: var(--brand-primary);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--brand-primary);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.8); }
}

.hero-content h1 {
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 800;
  line-height: 1.05;
  color: #ffffff;
  margin-bottom: 24px;
  letter-spacing: -0.03em;
}

.hero-content h1 .highlight {
  background: linear-gradient(135deg, #a78bfa 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

#typing-text {
  display: inline-block;
  width: 15ch;
  min-width: 15ch;
  white-space: nowrap;
  overflow: hidden;
}

#cursor {
  display: inline-block;
  width: 4px;
  height: 0.8em;
  background: var(--brand-tertiary);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
  border-radius: 2px;
  vertical-align: text-bottom;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.hero-content p {
  font-size: 18px;
  color: var(--dark-text-muted);
  margin-bottom: 40px;
  line-height: 1.7;
  max-width: 540px;
}

.hero-stats {
  display: flex;
  margin-bottom: 48px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  max-width: 500px;
}

.stat {
  flex: 1;
  padding: 16px;
  text-align: center;
  border-right: 1px solid var(--border-dark);
}

.stat:last-child { border-right: none; }

.stat-number {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  display: block;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 11px;
  color: var(--dark-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Hero Visual (Floating Glass Card) */
.hero-visual { position: relative; }

.hero-card-stack {
  position: relative;
  height: 540px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
  transform: perspective(1000px) rotateY(-5deg) rotateX(2deg);
  transition: transform 0.5s ease;
}

.hero-card-stack:hover {
  transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.hero-main-card {
  position: absolute;
  inset: 0;
  background: var(--dark-surface);
}

.hero-main-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.6;
}

.hero-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--dark-main) 0%, transparent 60%);
}

.hero-badge {
  position: absolute;
  bottom: 32px; left: 32px; right: 32px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-badge-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.hero-badge-text strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 2px;
}

.hero-badge-text span {
  font-size: 13px;
  color: var(--dark-text-muted);
}

/* ── PAGE HERO (Inner Pages) ── */
.page-hero {
  padding: 160px 32px 100px;
  background: var(--dark-main);
  color: var(--dark-text);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.page-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 0%, black 10%, transparent 80%);
  pointer-events: none;
}

.page-hero-inner {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-hero-inner h1 {
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 16px 0 24px;
}

.page-hero-inner h1 .highlight {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-tertiary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-hero-inner p {
  font-size: 18px;
  color: var(--dark-text-muted);
  line-height: 1.7;
  margin-bottom: 40px;
}
