/* ==========================================================================
   BASE — reset, global element defaults
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto; /* JS-driven smooth scroll handles this; avoid double-smoothing */
  background: var(--c-abyss);
  scroll-snap-type: y proximity;
  cursor: none;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(
    180deg,
    var(--c-surface) 0%,
    var(--c-mid) 16%,
    var(--c-deep) 48%,
    var(--c-abyss) 76%,
    var(--c-abyss) 100%
  );
  color: var(--c-foam);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  cursor: none;
}

img, picture, svg, canvas, video { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
}

p { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { margin: 0; padding: 0; list-style: none; }

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

input, textarea {
  font-family: inherit;
  color: inherit;
}

::selection {
  background: var(--c-bio-cyan);
  color: var(--c-abyss);
}

/* Scrollbar — subtle, oceanic */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--c-abyss); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--c-bio-cyan), var(--c-mid));
  border-radius: var(--radius-pill);
}
html { scrollbar-color: var(--c-bio-cyan) var(--c-abyss); scrollbar-width: thin; }

/* Focus visibility — accessibility floor */
:focus-visible {
  outline: 2px solid var(--c-bio-cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Respect reduced motion globally */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.no-scroll { overflow: hidden; height: 100vh; }

/* Custom Cursor Styles */
.custom-cursor-dot {
  position: fixed;
  top: -4px;
  left: -4px;
  width: 8px;
  height: 8px;
  background: var(--c-bio-cyan);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transition: transform 0.15s ease-out, background 0.3s ease;
  will-change: transform;
}

.custom-cursor-glow {
  position: fixed;
  top: -24px;
  left: -24px;
  width: 48px;
  height: 48px;
  background: radial-gradient(circle, rgba(62,198,224,0.4) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.15s ease-out, width 0.3s, height 0.3s, top 0.3s, left 0.3s;
  will-change: transform;
}

.custom-cursor-dot.is-hovering {
  transform: scale(1.5);
  background: var(--c-bio-gold);
}

.custom-cursor-glow.is-hovering {
  width: 64px;
  height: 64px;
  top: -32px;
  left: -32px;
  background: radial-gradient(circle, rgba(255,215,106,0.3) 0%, transparent 60%);
}

/* Fallback for touch devices */
@media (hover: none) and (pointer: coarse) {
  html, body {
    cursor: auto;
    scroll-snap-type: none; /* Mobile scroll snap can be annoying sometimes, let's keep it clean */
  }
  .custom-cursor-dot, .custom-cursor-glow {
    display: none;
  }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}