/* =============================================================
   Base — reset, document defaults, body, scrollbar, selection,
   focus styles, and skip-link.
   ============================================================= */

@layer base;
@layer base {

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

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(
      ellipse 1000px 600px at 85% -5%,
      rgba(59, 130, 246, 0.12) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse 800px 400px at 10% 100%,
      rgba(34, 211, 238, 0.08) 0%,
      transparent 55%
    ),
    var(--bg-primary);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  position: relative;
}

/* Subtle grid backdrop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.04) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
  -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 78%);
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 78%);
}

/* iOS Safari: cover the safe-area inset so the dark page bg
   reads as a single bar behind the Dynamic Island. */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: env(safe-area-inset-top);
  background: var(--bg-primary);
  z-index: 499;
  pointer-events: none;
}

section,
nav,
footer {
  position: relative;
  z-index: 1;
}

::selection {
  background: rgba(59, 130, 246, 0.35);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.3);
  border-radius: 10px;
  border: 2px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);
}

/* Focus indication for keyboard users (overrides the cursor: none on desktop). */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip-to-content link for keyboard / screen-reader users. */
.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--accent-blue);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font: 600 13px var(--font-body);
  text-decoration: none;
  z-index: 10000;
  transform: translateY(-150%);
  transition: transform 0.2s var(--ease-out);
}
.skip-link:focus-visible {
  transform: translateY(0);
}

}
