/* Global CSS Variables (Tokens) & Resets */
:root {
  --bg-primary: #0E1116;
  --bg-panel: #141821;
  --bg-card: #191E29;
  --text-primary: #F3F5F2;
  --text-secondary: rgba(243, 245, 242, 0.55);
  --text-muted: rgba(243, 245, 242, 0.35);
  --accent: #C7F23E;
  --border-subtle: rgba(243, 245, 242, 0.08);
  --border-hover: rgba(243, 245, 242, 0.16);
  --border-focus: rgba(199, 242, 62, 0.3);
  
  --font-sans: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  
  --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fade: opacity 0.2s ease-in-out;
  --transition-apple: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow-x: hidden;
  height: 100%;
}

body {
  min-height: 100%;
  position: relative;
  background-color: var(--bg-primary);
  background-image: radial-gradient(circle at 50% 50%, rgba(199, 242, 62, 0.018) 0%, rgba(14, 17, 22, 0) 70%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Base Selections */
::selection {
  background-color: var(--accent);
  color: var(--bg-primary);
}

/* Cinematic Grain Overlay */
.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  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.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.015;
  pointer-events: none;
  z-index: 9999;
}

/* Custom Cursor (Apple/Linear style) */
.custom-cursor {
  width: 8px;
  height: 8px;
  background-color: var(--accent);
  border-radius: 50%;
  position: fixed;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), width 0.3s ease, height 0.3s ease, background-color 0.3s ease, border 0.3s ease;
}

.custom-cursor.active {
  opacity: 1;
}

/* When hovering over interactive elements */
.custom-cursor.hovering {
  width: 28px;
  height: 28px;
  background-color: rgba(199, 242, 62, 0.1);
  border: 1px solid var(--accent);
  transform: translate(-50%, -50%) scale(1.1);
}

/* Accessibility Focus Outline styling */
button:focus-visible,
a:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* Hide cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
  .custom-cursor {
    display: none !important;
  }
}

/* Accessibility settings for users requesting reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-cursor {
    display: none !important;
  }
}
