/* ==========================================================================
   ScanFix Base Styles & Layout
   ========================================================================== */

/* Modern CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-secondary);
  background-color: var(--bg-body);
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(6, 182, 212, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 90% 40%, rgba(16, 185, 129, 0.06), transparent),
    linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  position: relative;
}

/* Ensure no block-level section escapes viewport width */
main, section, header, footer {
  max-width: 100%;
  overflow-x: clip;
}

/* Background Atmosphere Glows */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  max-width: 100vw;
  height: 600px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.09) 0%, rgba(16, 185, 129, 0.04) 40%, transparent 70%);
  pointer-events: none;
  z-index: var(--z-negative);
  overflow: hidden;
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h1 {
  font-size: var(--text-hero);
  font-weight: 800;
  letter-spacing: -0.035em;
}

h2 {
  font-size: var(--text-4xl);
  letter-spacing: -0.03em;
}

h3 {
  font-size: var(--text-2xl);
  font-weight: 600;
}

h4 {
  font-size: var(--text-xl);
  font-weight: 600;
}

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

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

a {
  color: var(--cyan-400);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--cyan-300);
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* Accessible Focus States */
:focus-visible {
  outline: 2px solid var(--cyan-400);
  outline-offset: 3px;
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

@media (max-width: 640px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

.container-sm {
  max-width: 860px;
}

.container-wide {
  max-width: 1360px;
}

/* Section Wrapper Spacing */
.section {
  padding-top: var(--space-20);
  padding-bottom: var(--space-20);
  position: relative;
}

@media (max-width: 768px) {
  .section {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
  }
}

/* Section Header Typography */
.section-header {
  text-align: center;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-12);
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cyan-400);
  margin-bottom: var(--space-3);
  padding: var(--space-1) var(--space-3);
  background: var(--cyan-subtle);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: var(--radius-full);
}

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

.section-desc {
  font-size: var(--text-lg);
  color: var(--text-muted);
  line-height: 1.65;
}

/* Text Gradient Utilities */
.text-gradient {
  background: linear-gradient(135deg, #ffffff 30%, var(--cyan-300) 80%, var(--emerald-400) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-cyan {
  background: linear-gradient(135deg, #38bdf8 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-emerald {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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