/* ============================================================
   ATTENTION DYNAMICS — Base Styles
   ============================================================
   Reset, base typography, body background grid, scrollbar,
   accessibility utilities, and link base styles.
   
   Depends on: tokens.css
   ============================================================ */


/* --------------------------------------------------------
   1. RESET
   --------------------------------------------------------
   Minimal box-model reset. No opinionated resets on
   semantic elements — only structural normalization.
   -------------------------------------------------------- */

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


/* --------------------------------------------------------
   2. ROOT & HTML
   -------------------------------------------------------- */

html {
  scroll-behavior: smooth;
  background-color: var(--color-dark);
  color: var(--color-white);
  font-family: var(--font-secondary);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* --------------------------------------------------------
   3. BODY — Background Grid
   --------------------------------------------------------
   80px engineering grid at heavily reduced opacity (0.006)
   for a subtle coordinate-plane feel without visual noise.
   -------------------------------------------------------- */

body {
  overflow-x: hidden;
  position: relative;
  line-height: var(--leading-loose);
  background-image:
    linear-gradient(rgba(229, 231, 235, var(--grid-bg-opacity)) 1px, transparent 1px),
    linear-gradient(90deg, rgba(229, 231, 235, var(--grid-bg-opacity)) 1px, transparent 1px);
  background-size: var(--grid-bg-size) var(--grid-bg-size);
  background-position: center top;
}


/* --------------------------------------------------------
   4. TYPOGRAPHY — Base heading & paragraph styles
   -------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  color: var(--color-pure-white);
  font-weight: 500;
  letter-spacing: var(--tracking-snug);
}

h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-snug);
}

h3 {
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  line-height: 1.3;
  font-weight: 500;
}

h4 {
  font-size: 1rem;
  line-height: 1.4;
  font-weight: 500;
}

p {
  font-size: var(--text-lg);
  color: var(--color-gray-light);
  line-height: var(--leading-relaxed);
}


/* --------------------------------------------------------
   5. LINKS
   -------------------------------------------------------- */

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

a:focus-visible {
  outline: 2px solid var(--color-cyan);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}


/* --------------------------------------------------------
   6. CUSTOM SCROLLBAR
   --------------------------------------------------------
   Thin, unobtrusive scrollbar that matches the dark theme.
   -------------------------------------------------------- */

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

::-webkit-scrollbar-track {
  background: var(--color-dark);
}

::-webkit-scrollbar-thumb {
  background: rgba(229, 231, 235, 0.12);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-dark);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-cyan);
}

/* Firefox scrollbar */
@supports (scrollbar-color: auto) {
  * {
    scrollbar-width: thin;
    scrollbar-color: rgba(229, 231, 235, 0.12) var(--color-dark);
  }
}


/* --------------------------------------------------------
   7. ACCESSIBILITY — Visually Hidden Utility
   --------------------------------------------------------
   Content hidden visually but accessible to screen readers.
   -------------------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* --------------------------------------------------------
   8. SELECTION STYLES
   -------------------------------------------------------- */

::selection {
  background-color: rgba(0, 102, 255, 0.3);
  color: var(--color-pure-white);
}


/* --------------------------------------------------------
   9. AMBIENT GLOWS
   --------------------------------------------------------
   Background radial gradients that float subtly.
   Keep opacity extremely low for system-oriented feel.
   -------------------------------------------------------- */

.ambient-glow {
  position: absolute;
  width: 50vw;
  height: 50vw;
  border-radius: var(--radius-full);
  pointer-events: none;
  z-index: -1;
  filter: blur(140px);
  opacity: 0.018;
  mix-blend-mode: screen;
}

.glow-1 {
  background: radial-gradient(circle, var(--color-blue) 0%, transparent 70%);
  top: 5%;
  right: -10%;
}

.glow-2 {
  background: radial-gradient(circle, var(--color-cyan) 0%, transparent 70%);
  top: 60%;
  left: -10%;
}


/* --------------------------------------------------------
   10. COORDINATE PLANE OVERLAY
   --------------------------------------------------------
   Grid cross-hair markers for hero and section overlays.
   -------------------------------------------------------- */

.coordinate-plane {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: var(--z-base);
}

.grid-cross {
  position: absolute;
  width: 20px;
  height: 20px;
  opacity: 0.035;
}

.grid-cross::before,
.grid-cross::after {
  content: '';
  position: absolute;
  background-color: var(--color-white);
}

.grid-cross::before {
  top: 9px;
  left: 0;
  width: 100%;
  height: 1px;
}

.grid-cross::after {
  left: 9px;
  top: 0;
  width: 1px;
  height: 100%;
}

.gc-1 { top: 20%; left: 10%; }
.gc-2 { bottom: 20%; right: 10%; }
.gc-3 { top: 45%; right: 25%; }
