/* ============================================================
   css/base.css — Reset, body, typography, animations
   ============================================================ */

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Grain texture overlay */
.grain {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

/* Pages */
.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: var(--space-xl) var(--space-md);
}

.page[hidden] {
  display: none;
}

/* Footer */
.footer {
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
  margin-top: auto;
}

/* ---- Animations ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Staggered page-enter animation on direct children */
.page > * {
  animation: fadeUp 0.4s ease both;
}
.page > *:nth-child(1) { animation-delay: 0.00s; }
.page > *:nth-child(2) { animation-delay: 0.05s; }
.page > *:nth-child(3) { animation-delay: 0.10s; }
.page > *:nth-child(4) { animation-delay: 0.15s; }
.page > *:nth-child(5) { animation-delay: 0.20s; }
.page > *:nth-child(6) { animation-delay: 0.25s; }
.page > *:nth-child(7) { animation-delay: 0.30s; }

/* Typography utilities */
h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  text-align: center;
}

h1 em {
  font-style: normal;
  color: var(--accent);
}

code {
  font-family: var(--font-mono);
  background: #1a1a1a;
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
  font-size: 0.85em;
}

/* Responsive */
@media (max-width: 480px) {
  .page {
    padding: var(--space-xl) var(--space-sm);
  }
}
