/* base.css — reset, body, root typography, focus */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  overflow-x: hidden;
  position: relative;
  transition: background-color var(--t-accent);
}

/* Ambient orb that follows current accent */
body::before {
  content: '';
  position: fixed;
  inset: -10vh -20vw auto auto;
  width: 75vw;
  height: 75vh;
  background:
    radial-gradient(50% 50% at 70% 30%, var(--accent-glow), transparent 70%);
  filter: blur(60px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
  transition: background var(--t-accent), opacity var(--t-accent);
}

body::after {
  content: '';
  position: fixed;
  inset: auto auto -20vh -10vw;
  width: 60vw;
  height: 60vh;
  background:
    radial-gradient(50% 50% at 30% 70%, var(--accent-soft), transparent 70%);
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  transition: background var(--t-accent), opacity var(--t-accent);
}

main, header, footer { position: relative; z-index: 1; }

/* Type defaults */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

h1 { font-size: var(--fs-1); }
h2 { font-size: var(--fs-2); line-height: var(--lh-snug); }
h3 { font-size: var(--fs-3); }

p { margin: 0; }

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

img, svg, picture { display: block; max-width: 100%; }

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* Focus outlines — brand-locked cyan, never accent-driven */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--brand-dim);
  color: var(--text);
}

/* Reduced motion: kill ambient transitions */
@media (prefers-reduced-motion: reduce) {
  body, body::before, body::after { transition: none !important; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
