html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-body);
  color: var(--w);
  font-family: var(--font-body);
  overflow-x: hidden;
}

body.has-custom-cursor {
  cursor: none;
}

/* Grid background, global */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 52px 52px;
  z-index: var(--z-grid);
  pointer-events: none;
}

/* Top accent line */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--accent) 40%,
    var(--accent2) 100%
  );
  z-index: var(--z-accent-line);
}

main {
  position: relative;
  z-index: var(--z-content);
}

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

/* Skip-to-content link */
.skip-link {
  position: absolute;
  top: -48px;
  left: 12px;
  z-index: 10000;
  background: var(--accent);
  color: #020810;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 12px;
}

/* Visible focus states */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s,
    transform 0.7s;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes breathe {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.08);
  }
}

@keyframes scan {
  0% {
    top: 0%;
    opacity: 0.6;
  }
  95% {
    top: 100%;
    opacity: 0.6;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-9px);
  }
}

@property --pangle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes ringsweep {
  to {
    --pangle: 360deg;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  /* Only the attention-grabbing/vestibular-trigger effects are disabled —
     ambient background motion (orbs, scanline) stays, matching the original
     design. The custom cursor and staggered scroll-reveal are separately
     gated in JS (cursor.js, scroll-reveal.js). */
  .portrait-ring,
  .float-badge,
  .float-chip,
  .portrait-glow {
    animation: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
