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

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

body {
  background-color: var(--color-bg);
  background-image: radial-gradient(circle, var(--color-dot) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--color-text-secondary);
  font-family: var(--font-ui);
  font-size: var(--text-body-size);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul, ol {
  list-style: none;
}

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

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-text-primary);
}

h1 {
  font-size: var(--text-h1-size);
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-weight: 700;
}

h2 {
  font-size: var(--text-h2-size);
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 600;
}

h3 {
  font-size: var(--text-h3-size);
  line-height: 1.3;
  letter-spacing: -0.005em;
  font-weight: 600;
}

h4 {
  font-size: var(--text-h4-size);
  line-height: 1.4;
  letter-spacing: 0;
  font-weight: 500;
}

p {
  font-size: var(--text-body-size);
  line-height: 1.65;
  color: var(--color-text-secondary);
}

.caption {
  font-size: var(--text-caption-size);
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--color-text-tertiary);
}

.label {
  font-size: var(--text-label-size);
  line-height: 1.4;
  letter-spacing: 0.06em;
  font-weight: 500;
  font-family: var(--font-ui);
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Selection */
::selection {
  background: var(--color-accent-subtle);
  color: var(--color-text-primary);
}

/* Scroll reveal base state */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--duration-slow) var(--ease-decelerate),
              transform var(--duration-slow) var(--ease-decelerate);
}

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

/* Stagger delays */
.reveal:nth-child(2) { transition-delay: 60ms; }
.reveal:nth-child(3) { transition-delay: 120ms; }
.reveal:nth-child(4) { transition-delay: 180ms; }
.reveal:nth-child(5) { transition-delay: 240ms; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
