/* Perseverance AI Website Styles - Dark Theme Design System */

/* ============================================
   CSS VARIABLES - Design Tokens
   ============================================ */

:root {
  /* Backgrounds */
  --bg-primary: #0a0a0a;
  /* Deepest black - page background */
  --bg-secondary: #111111;
  /* Slightly lighter - cards, sections */
  --bg-tertiary: #1a1a1a;
  /* Elevated surfaces - hover states */

  /* Text */
  --text-primary: #fafafa;
  /* Primary text - headings, important */
  --text-secondary: #e5e7eb;
  /* Body text */
  --text-muted: #737373;
  /* Subtle text - captions, metadata */
  --text-code: #525252;
  /* Code braces, brackets */

  /* Borders & Dividers */
  --border-subtle: #1f1f1f;
  /* Subtle borders */
  --border-default: #2a2a2a;
  /* Default borders */
  --border-strong: #3a3a3a;
  /* Emphasized borders */

  /* Accents (use sparingly) */
  --accent-primary: #3b82f6;
  /* Blue - links, primary buttons */
  --accent-hover: #60a5fa;
  /* Blue hover state */
  --accent-success: #22c55e;
  /* Green - success states */
  --accent-warning: #f59e0b;
  /* Amber - warnings */
  --accent-error: #ef4444;
  /* Red - errors */

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Source Code Pro', 'SF Mono', Consolas, monospace;

  /* Spacing Scale */
  --space-xs: 0.25rem;
  /* 4px */
  --space-sm: 0.5rem;
  /* 8px */
  --space-md: 1rem;
  /* 16px */
  --space-lg: 1.5rem;
  /* 24px */
  --space-xl: 2rem;
  /* 32px */
  --space-2xl: 3rem;
  /* 48px */
  --space-3xl: 4rem;
  /* 64px */
  --space-4xl: 6rem;
  /* 96px */
}

/* ============================================
   BASE STYLES & RESET
   ============================================ */

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

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  /* Optional subtle grid background */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 50px 50px;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1 {
  font-family: var(--font-sans);
  font-size: 3rem;
  /* 48px */
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h2 {
  font-family: var(--font-sans);
  font-size: 2rem;
  /* 32px */
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

h3 {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  /* 20px */
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

p {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
}

.caption,
small {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  /* 14px */
  font-weight: 500;
  color: var(--text-muted);
}

code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
  font-weight: 400;
}

/* ============================================
   LAYOUT
   ============================================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
}

section {
  padding: var(--space-4xl) 0;
}

@media (max-width: 768px) {
  section {
    padding: var(--space-2xl) 0;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 1.75rem;
  }
}

/* ============================================
   NAVIGATION
   ============================================ */

header {
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 100;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}

/* Logo Styling */
.logo {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.logo:hover {
  opacity: 0.8;
}

.logo-brace {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-code);
}

.logo-p {
  font-family: var(--font-sans);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.logo-company {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-left: 0.75rem;
}

@media (max-width: 768px) {
  .logo-company {
    display: none;
  }
}

/* Navigation Links */
.nav-links {
  display: flex;
  list-style: none;
  gap: var(--space-lg);
}

.nav-links a {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  background: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:hover {
  background: var(--text-secondary);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  padding: calc(var(--space-4xl) + 80px) 0 var(--space-4xl);
  text-align: center;
}

.hero h1 {
  max-width: 800px;
  margin: 0 auto var(--space-lg);
}

.hero p {
  max-width: 600px;
  margin: 0 auto var(--space-2xl);
  font-size: 1.125rem;
  color: var(--text-muted);
}

.hero-buttons {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   SECTIONS
   ============================================ */

.section-title {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-title h2 {
  margin-bottom: var(--space-md);
}

.section-title p {
  max-width: 700px;
  margin: 0 auto;
  color: var(--text-muted);
}

/* Features Section */
.features {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
}

/* Feature Cards */
.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: var(--space-xl);
  transition: all 0.3s ease;
}

.feature-card:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-default);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: var(--space-md);
}

.feature-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

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

/* Benefits Section */
.benefits {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3xl);
}

.benefits-content {
  flex: 1;
  min-width: 300px;
  max-width: 800px;
  margin: 0 auto;
}

.benefits-content h2 {
  margin-bottom: var(--space-lg);
}

.benefits-list {
  list-style: none;
}

.benefits-list li {
  margin-bottom: var(--space-lg);
  padding-left: 30px;
  position: relative;
  color: var(--text-secondary);
}

.benefits-list li:before {
  content: "✓";
  color: var(--text-primary);
  position: absolute;
  left: 0;
  font-weight: bold;
  font-size: 1.2rem;
}

.benefits-list strong {
  color: var(--text-primary);
}

/* ============================================
   CONTACT FORM
   ============================================ */

#contact {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.contact-form {
  max-width: 500px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: var(--space-lg);
  position: relative;
}

.form-group label {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
  display: block;
}

.form-group input,
.form-group textarea {
  font-family: var(--font-sans);
  font-size: 1rem;
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: rgba(23, 23, 23, 0.8);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* User-invalid state for modern browsers */
.form-group input:user-invalid,
.form-group textarea:user-invalid {
  border-color: var(--accent-error);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.error-message {
  color: var(--accent-error);
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.25rem;
  display: none;
}

.form-group.has-error .error-message {
  display: block;
}

.form-group.has-error input,
.form-group.has-error textarea {
  border-color: var(--accent-error);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group textarea {
  resize: vertical;
  min-height: 150px;
}

/* Form Status Messages */
#form-status .success {
  background-color: rgba(34, 197, 94, 0.1);
  color: var(--accent-success);
  padding: var(--space-md);
  border-radius: 6px;
  margin-bottom: var(--space-md);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

#form-status .error {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--accent-error);
  padding: var(--space-md);
  border-radius: 6px;
  margin-bottom: var(--space-md);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

#form-status .loading {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--accent-primary);
  padding: var(--space-md);
  border-radius: 6px;
  margin-bottom: var(--space-md);
  border: 1px solid rgba(59, 130, 246, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

#form-status .loading::before {
  content: "";
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--accent-primary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   FOOTER
   ============================================ */

footer {
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  padding: var(--space-3xl) 0 var(--space-xl);
  text-align: center;
  border-top: 1px solid var(--border-subtle);
}

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

.footer-content .logo {
  margin-bottom: var(--space-lg);
}

.social-links {
  display: flex;
  gap: var(--space-xl);
  margin: var(--space-xl) 0;
  flex-wrap: wrap;
  justify-content: center;
}

.social-link {
  color: var(--text-muted);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 500;
}

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

.footer-bottom {
  margin-top: var(--space-xl);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center {
  text-align: center;
}

.mt-lg {
  margin-top: var(--space-lg);
}

.mt-xl {
  margin-top: var(--space-xl);
}