/* Base Styles - Sigma Cap Pro (Modern Theme) */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-background);
  line-height: var(--leading-relaxed);
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  font-weight: var(--font-extrabold);
  line-height: var(--leading-tight);
  color: var(--color-text);
  letter-spacing: var(--tracking-tight);
}

h1 {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-6);
}

h2 {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-4);
}

h3 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-3);
}

h4 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

p {
  margin-bottom: var(--space-4);
  color: var(--color-text-muted);
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: var(--font-semibold);
  color: var(--color-text);
}

/* Gradient text utility */
.text-gradient {
  background: linear-gradient(135deg, var(--color-accent) 0%, #60a5fa 50%, var(--color-warm) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* Links */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* Lists */
ul, ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

li {
  margin-bottom: var(--space-2);
  color: var(--color-text-muted);
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* Main content padding for fixed header */
main {
  padding-top: var(--header-height);
  position: relative;
}

/* Section spacing */
section {
  padding: var(--space-12) 0;
}

@media (min-width: 768px) {
  section {
    padding: var(--space-16) 0;
  }
}

/* Section header styles */
.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-title {
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  font-weight: var(--font-extrabold);
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* Section tag badge */
.section-tag {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: rgba(37, 99, 235, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Tables */
table {
  width: 100%;
  margin-bottom: var(--space-6);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

th, td {
  padding: var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  background-color: var(--color-info-bg);
  font-weight: var(--font-semibold);
  color: var(--color-accent);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  color: var(--color-text-muted);
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background-color var(--transition-fast);
}

tbody tr:hover {
  background-color: var(--color-info-bg);
}

/* Form Elements */
input, textarea, select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  color: var(--color-text);
  font-family: var(--font-family);
  font-size: var(--text-base);
  transition: all var(--transition-fast);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

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

label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: var(--font-medium);
  color: var(--color-text);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* Utility - Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Selection color */
::selection {
  background-color: var(--color-accent);
  color: var(--color-text-inverse);
}

/* Responsive text sizes */
@media (min-width: 768px) {
  h1 {
    font-size: var(--text-5xl);
  }

  h2 {
    font-size: var(--text-4xl);
  }

  h3 {
    font-size: var(--text-3xl);
  }
}

/* ========== Performance & Accessibility ========== */

/* Fallback for browsers without backdrop-filter support */
@supports not (backdrop-filter: blur(1px)) {
  .header,
  .mobile-nav,
  .card,
  .roi-card,
  .step-card,
  .accordion,
  .trust-badge,
  .comparison-card,
  .calculator-section,
  .doc-nav,
  .stack-demo,
  .callout,
  table {
    background: rgba(255, 255, 255, 0.95);
  }

  input, textarea, select {
    background: rgba(255, 255, 255, 0.98);
  }

  .btn-secondary {
    background: rgba(255, 255, 255, 0.95);
  }
}

/* Reduce blur on mobile for better performance */
@media (max-width: 768px) {
  .card,
  .roi-card,
  .step-card,
  .comparison-card,
  .stack-demo,
  .calculator-section {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .card:hover,
  .roi-card:hover,
  .step-card:hover,
  .btn:hover,
  .trust-badge:hover {
    transform: none !important;
  }
}
