/* Base styles and reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Layout utility helpers (replaces repeated inline styles) */
.w-full {
  width: 100%;
}

/* Inner pages: clear the fixed header */
.page-main {
  padding-top: 120px;
}

/* Skip link: hidden until focused via keyboard */
.skip-link {
  position: fixed;
  top: -100px;
  left: var(--space-md);
  z-index: 10000;
  padding: 10px 18px;
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-sm);
  box-shadow: var(--card-shadow);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-md);
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--text-base);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

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

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p {
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: var(--space-sm);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

/* Base Container & Grid layout helpers */
.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
  position: relative;
  z-index: 2;
}

@media (min-width: 768px) {
  .container {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
  }
}

.section {
  padding-top: var(--space-xxl);
  padding-bottom: var(--space-xxl);
  position: relative;
  overflow: hidden;
}

.section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--border-medium) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.2;
}

@media (min-width: 1024px) {
  .section {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--scroll-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
}

/* Accessibility Focus Ring */
*:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 4px;
}

body.no-scroll {
  overflow: hidden;
}

/* Screen reader only utility class */
.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;
}
