/* ============================================================
   BASE.CSS — Reset + Global Styles
   Google Fonts loaded in HTML:
   Inter 300,400,500,600,700,800 + JetBrains Mono 400,500
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--clr-text-primary);
  background-color: var(--clr-bg-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Typography resets ── */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--clr-text-primary);
}

p {
  color: var(--clr-text-secondary);
  line-height: var(--lh-relaxed);
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

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

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--clr-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--clr-border);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--clr-border-hover);
}

/* ── Selection ── */
::selection {
  background: rgba(59, 130, 246, 0.35);
  color: var(--clr-text-primary);
}

/* ── Focus visible ── */
:focus-visible {
  outline: 2px solid var(--clr-blue);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Utility: visually hidden ── */
.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;
}

/* ── Reveal animation base ── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

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

/* Stagger delays for grid children */
.reveal-stagger > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger > *:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger > *:nth-child(6) { transition-delay: 400ms; }
.reveal-stagger > *:nth-child(7) { transition-delay: 480ms; }
.reveal-stagger > *:nth-child(8) { transition-delay: 560ms; }

/* ── Code font ── */
code, pre, .mono {
  font-family: var(--font-mono);
}
