/* ==========================================================================
   BASE & RESET STYLES — Executive Portfolio
   ========================================================================== */

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-void);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

/* Accessibility: Focus styles */
:focus-visible {
  outline: 2px solid var(--accent-crimson);
  outline-offset: 3px;
}

/* Screen reader only utility with accessible focus-visible state */
.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;
}

.sr-only:focus-visible {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 10001;
  width: auto;
  height: auto;
  padding: 0.75rem 1.5rem;
  margin: 0;
  clip: auto;
  overflow: visible;
  background-color: var(--bg-surface-elevated);
  border: 1.5px solid var(--accent-crimson);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 4px;
  box-shadow: 0 0 25px rgba(229, 9, 20, 0.5);
  text-decoration: none;
}

/* Top Viewport Scroll Progress Bar */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2.5px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-crimson) 0%, var(--accent-crimson-bright) 60%, var(--accent-cyan) 100%);
  box-shadow: 0 0 10px rgba(255, 30, 39, 0.85);
  z-index: 1002;
  pointer-events: none;
  transform-origin: left;
  will-change: width;
}

/* Smooth Anchor Navigation Offset (Compensates for fixed navbar) */
section[id] {
  scroll-margin-top: 5rem;
}

/* Selection highlight */
::selection {
  background-color: var(--accent-crimson);
  color: #ffffff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-void);
}
::-webkit-scrollbar-thumb {
  background: #1c2235;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-crimson);
}

/* Halftone & Grid Background Textures */
.bg-halftone {
  background-image: radial-gradient(rgba(255, 30, 39, 0.16) 1.5px, transparent 1.5px);
  background-size: 16px 16px;
}

.bg-grid-tech {
  background-size: 48px 48px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
}

/* Subtle Noise Texture */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Cursor Ambient Glow (Smooth Desktop Follow) */
.cursor-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 30, 39, 0.06) 0%, rgba(0, 240, 255, 0.02) 40%, transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 1;
  transition: opacity 0.4s ease;
  will-change: transform;
}

/* Chromatic Aberration Text Shadows */
.chromatic-text {
  text-shadow: 
    -2px 0 0 rgba(0, 240, 255, 0.75),
    2px 0 0 rgba(255, 30, 39, 0.85);
}

.chromatic-subtle {
  text-shadow: 
    -1px 0 0 rgba(0, 240, 255, 0.4),
    1px 0 0 rgba(255, 30, 39, 0.5);
}

/* Outlined Stroke Typography */
.text-stroke-white {
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.9);
  color: transparent;
}

.text-stroke-crimson {
  -webkit-text-stroke: 1.5px var(--accent-crimson);
  color: transparent;
}

/* Typography Base Classes */
.font-display {
  font-family: var(--font-display);
}

.font-heading {
  font-family: var(--font-heading);
}

.font-mono {
  font-family: var(--font-mono);
}

.font-quote {
  font-family: var(--font-quote);
}

/* Glassmorphism & Surface Elevation Utilities */
.glass-panel {
  background-color: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-hairline);
  border-top-color: var(--border-specular);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.08), var(--shadow-md);
}

/* Scroll-Driven Reveal Utilities */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.75s var(--ease-silk), transform 0.75s var(--ease-silk);
  will-change: opacity, transform;
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Accessibility: Strict Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .cursor-glow,
  .hero__ambient-light {
    display: none !important;
  }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
