/**
 * ARENIX BASE STYLES
 * Reset, typography, layout wrappers, utilities, scroll reveals, and accessibility standards
 */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  selection-background-color: var(--accent-electric);
  selection-color: var(--text-primary);
}

::selection {
  background-color: rgba(37, 99, 235, 0.4);
  color: #ffffff;
}

/* Custom Minimal Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  transition: background var(--transition-fast);
}

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

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

h1 {
  font-size: var(--text-5xl);
}

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

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

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

p {
  color: var(--text-secondary);
  font-weight: 400;
  max-width: 68ch;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

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

/* Layout Containers */
.site-container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

.site-container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

.section-spacing {
  padding-top: var(--space-4xl);
  padding-bottom: var(--space-4xl);
  position: relative;
}

/* Accessible Focus Ring */
:focus-visible {
  outline: 2px solid var(--accent-electric-bright);
  outline-offset: 3px;
}

/* Section Header Structure */
.section-header {
  margin-bottom: var(--space-3xl);
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-electric-bright);
  margin-bottom: var(--space-sm);
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--accent-electric-bright);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
  animation: pulse-dot 3s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px rgba(56, 189, 248, 0.9); }
}

.section-title {
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  line-height: 1.12;
}

.section-description {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-top: var(--space-md);
  max-width: 54ch;
  line-height: 1.55;
}

/* ═══════════════════════════════════════════════════════════════
   GLOBAL SCROLL REVEAL SYSTEM (Precise, Subtle, GPU-Accelerated)
   ═══════════════════════════════════════════════════════════════ */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity var(--transition-reveal), transform var(--transition-reveal);
  will-change: opacity, transform;
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger Delays for child elements */
.delay-1 { transition-delay: 100ms; }
.delay-2 { transition-delay: 200ms; }
.delay-3 { transition-delay: 300ms; }
.delay-4 { transition-delay: 400ms; }
.delay-5 { transition-delay: 500ms; }

/* Utility Helpers */
.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;
}
