/* ==========================================================================
   BASE & RESET STYLES
   Foundations, Micro-texture, Typography Defaults, & Accessibility
   ========================================================================== */

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

html {
  font-size: 16px;
  scroll-behavior: auto;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-obsidian);
}

body {
  min-height: 100vh;
  background-color: var(--bg-obsidian);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  position: relative;
}

/* --- KINETIC CANVAS & TEXTURE OVERLAYS --- */
#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: var(--z-bg-canvas);
  pointer-events: none;
}

/* Tactile Analog Film Grain Texture */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  content: "";
  opacity: 0.035;
  pointer-events: none;
  z-index: var(--z-noise);
  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.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Subtle Technical Ambient Spotlight */
.ambient-glow {
  position: fixed;
  top: -20vh;
  left: 30vw;
  width: 60vw;
  height: 60vh;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(229, 169, 60, 0.04) 0%, rgba(96, 165, 250, 0.018) 50%, transparent 70%);
  pointer-events: none;
  z-index: var(--z-bg-canvas);
  filter: blur(80px);
}

/* --- SCROLL-DRIVEN PARALLAX GHOST TYPOGRAPHY RAILS --- */
.ghost-typography-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: var(--z-bg-ghost);
}

.ghost-text-rail {
  position: absolute;
  white-space: nowrap;
  font-family: var(--font-syne);
  font-size: clamp(6rem, 16vw, 15rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.032);
  user-select: none;
  will-change: transform;
}

.ghost-rail-1 {
  top: 15vh;
  left: -10vw;
}

.ghost-rail-2 {
  top: 170vh;
  right: -20vw;
}

.ghost-rail-3 {
  top: 340vh;
  left: -15vw;
}

.ghost-rail-4 {
  top: 510vh;
  right: -10vw;
}

/* Floating Crosshairs & Technical Glyphs */
.parallax-glyph {
  position: absolute;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: rgba(229, 169, 60, 0.25);
  letter-spacing: 0.15em;
  pointer-events: none;
  user-select: none;
  will-change: transform;
  z-index: var(--z-bg-ghost);
}

/* --- SELECTION & SCROLLBAR --- */
::selection {
  background-color: rgba(229, 169, 60, 0.3);
  color: #ffffff;
}

::-webkit-scrollbar {
  width: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: #23232b;
  border-radius: var(--radius-full);
}

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

/* --- TYPOGRAPHY FOUNDATIONS --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.heading-syne {
  font-family: var(--font-syne);
  letter-spacing: -0.03em;
  font-weight: 700;
}

.heading-aquire {
  font-family: var(--font-aquire);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

em {
  font-family: var(--font-script);
  font-style: italic;
  font-size: 1.18em;
  color: var(--accent-gold);
  font-weight: 400;
  display: inline-block;
  padding: 0 4px;
}

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

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

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

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

ul, ol {
  list-style: none;
}

/* Technical Monospace Elements */
code, pre, .mono-tag, .telemetry-label, .tech-pill {
  font-family: var(--font-mono);
  font-feature-settings: "zero" 1;
}

/* --- LAYOUT UTILITIES --- */
.container {
  width: 100%;
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1.25rem, 4vw, 4rem);
  padding-right: clamp(1.25rem, 4vw, 4rem);
  position: relative;
  z-index: var(--z-content);
}

.section {
  position: relative;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: clamp(4.5rem, 8vh, 7rem);
  padding-bottom: clamp(3rem, 6vh, 5.5rem);
  border-bottom: 1px solid var(--border-subtle);
  z-index: var(--z-content);
  box-sizing: border-box;
  scroll-margin-top: clamp(75px, 10vh, 95px);
}

.hero,
#projects,
#contact,
#about,
#experience,
#skills,
#certifications,
#hobbies,
#home {
  scroll-margin-top: clamp(75px, 10vh, 95px);
}

.section.works-section {
  min-height: auto;
  display: block;
  padding-top: clamp(4rem, 7vh, 6rem);
  padding-bottom: clamp(3rem, 6vh, 5rem);
}

/* Section Index Header */
.section-header-editorial {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: clamp(1rem, 2.2vh, 1.75rem);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.section-index {
  font-family: var(--font-aquire);
  font-size: var(--text-xs);
  color: var(--accent-gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.section-index::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--accent-gold);
  border-radius: 50%;
}

.section-title-editorial {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* --- ACCESSIBILITY FOCUS RINGS --- */
:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 4px;
}

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

/* Reduced motion considerations */
@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;
  }

  .custom-cursor,
  .cursor-follower,
  #bgCanvas,
  .ghost-typography-container {
    display: none !important;
  }
}
