/**
 * =========================================================================
 * BASE & GLOBAL STYLES - AESTHETIC WINTER BREEZE EDITION
 * =========================================================================
 */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color var(--trans-smooth), color var(--trans-smooth);
  overflow-x: hidden;
  width: 100%;
}

[data-theme="dark"] html,
html[data-theme="dark"] {
  background-color: #06021a;
}

[data-theme="light"] html,
html[data-theme="light"] {
  background-color: #fff6f8;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.65;
  color: var(--text-secondary);
  background-color: transparent;
  position: relative;
  overflow-x: hidden;
  transition: color var(--trans-smooth);
}

::selection {
  background-color: rgba(99, 102, 241, 0.35);
  color: #ffffff;
}

[data-theme="light"] ::selection {
  background-color: rgba(236, 72, 153, 0.35);
  color: #241424;
}

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

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

::-webkit-scrollbar-thumb {
  background: rgba(129, 140, 248, 0.25);
  border-radius: 4px;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(236, 72, 153, 0.25);
}

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

/* ================= AESTHETIC RICH BACKGROUND LAYERS (NEVER PLAIN WHITE OR BLACK) ================= */
.aesthetic-bg-layer {
  position: fixed;
  inset: -20px;
  background-image: 
    linear-gradient(180deg, rgba(6, 2, 18, 0.62) 0%, rgba(30, 8, 55, 0.55) 40%, rgba(6, 2, 18, 0.80) 100%),
    url('../assets/images/aesthetic-cyber-neon.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: blur(16px) brightness(0.78) saturate(1.6) hue-rotate(10deg);
  opacity: 0.95;
  pointer-events: none;
  z-index: -3;
  transform: scale(1.06);
  animation: atmospheric-drift 30s ease-in-out infinite alternate;
  transition: background-image 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity var(--trans-smooth), filter var(--trans-smooth);
}

/* Light Theme: Dreamy Pastel Cherry Blossom Landscape */
[data-theme="light"] .aesthetic-bg-layer {
  background-image: 
    linear-gradient(180deg, rgba(255, 245, 248, 0.58) 0%, rgba(255, 242, 246, 0.72) 45%, rgba(254, 238, 244, 0.85) 100%),
    url('../assets/images/aesthetic-pastel.jpg');
  background-position: center 30%;
  filter: blur(12px) brightness(1.03) saturate(1.15);
  opacity: 0.92;
}

@keyframes atmospheric-drift {
  0% {
    transform: scale(1.03) translate(0, 0);
  }
  50% {
    transform: scale(1.07) translate(-15px, 10px);
  }
  100% {
    transform: scale(1.04) translate(12px, -8px);
  }
}

#winterCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  width: 100%;
  height: 100%;
}

/* Ambient Radial Glow */
.ambient-glow-top {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1100px;
  height: 600px;
  background: var(--grad-hero-glow);
  pointer-events: none;
  z-index: -1;
  transition: background var(--trans-smooth);
}

.grid-background-overlay {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  z-index: -1;
  opacity: 0.45;
}

[data-theme="light"] .grid-background-overlay {
  background-image: 
    linear-gradient(rgba(236, 72, 153, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 72, 153, 0.035) 1px, transparent 1px);
  opacity: 0.4;
}

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

h1 {
  font-size: clamp(2.5rem, 5.5vw, 4.4rem);
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.85rem, 3.8vw, 2.75rem);
  letter-spacing: -0.03em;
}

h3 {
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  letter-spacing: -0.02em;
}

p {
  color: var(--text-secondary);
  font-size: 1.025rem;
  line-height: 1.7;
  transition: color var(--trans-base);
}

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

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

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

:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
  position: relative;
  z-index: 1;
}

.container-narrow {
  max-width: var(--container-narrow);
}

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

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

.section-header {
  margin-bottom: var(--space-3xl);
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-primary-light);
  margin-bottom: 0.75rem;
}

[data-theme="light"] .section-eyebrow {
  color: var(--accent-primary);
}

.section-eyebrow::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-warm);
  box-shadow: 0 0 10px var(--accent-warm);
}

.section-title {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.section-subtitle {
  max-width: 680px;
  color: var(--text-muted);
  font-size: 1.08rem;
}

/* Custom Magnetic Cursor (Desktop) */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: var(--z-cursor);
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  opacity: 0;
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .custom-cursor {
    display: block;
  }
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-warm);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease-out;
  box-shadow: 0 0 10px var(--accent-warm);
}

.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease-out, height 0.25s ease-out, border-color 0.25s ease-out, background-color 0.25s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cursor-text {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffffff;
  opacity: 0;
  text-transform: uppercase;
  transition: opacity 0.2s ease;
}

body.cursor-active .cursor-ring {
  width: 64px;
  height: 64px;
  border-color: var(--accent-warm);
  background-color: var(--accent-warm-faint);
  backdrop-filter: blur(2px);
}

body.cursor-active .cursor-text {
  opacity: 1;
}

body.cursor-active .cursor-dot {
  transform: translate(-50%, -50%) scale(0);
}

/* Reduced Motion */
@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,
  .aesthetic-bg-layer {
    animation: none !important;
  }
}
