/* ============================================
   BASE — Reset, typography, global rules
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');
@import './tokens.css';

/* --- Reset --- */

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

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

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-text);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --- Typography --- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-weight: 800; }
h2 { font-size: var(--text-4xl);  font-weight: 700; letter-spacing: -0.025em; }
h3 { font-size: var(--text-2xl);  font-weight: 700; }
h4 { font-size: var(--text-xl);   font-weight: 600; }

p {
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: var(--container-text);
}

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

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

ul, ol { list-style: none; }

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

/* --- Utility --- */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-20);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: var(--space-4);
}

.section-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* --- Noise overlay (grain texture) --- */

body::after {
  content: '';
  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)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  opacity: 0.028;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: overlay;
}

/* --- Scroll animations --- */

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity var(--duration-slow) var(--ease-out-expo),
    transform var(--duration-slow) var(--ease-out-expo);
}

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

.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }
.reveal-delay-4 { transition-delay: 320ms; }

/* --- Reduced motion --- */

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

/* --- Responsive container --- */

@media (max-width: 1024px) {
  .container { padding-inline: var(--space-12); }
}

@media (max-width: 768px) {
  .container { padding-inline: var(--space-5); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-xl); }
}
/* ============================================
   CUSTOM SCROLLBAR
   Webkit (Chrome, Edge, Safari) + Firefox
   Consistent with design tokens
   ============================================ */

/* ─── WEBKIT ─── */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
  border-left: 1px solid var(--border-subtle);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  transition: background var(--duration-base);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.55);
}

::-webkit-scrollbar-thumb:active {
  background: rgba(59, 130, 246, 0.80);
}

::-webkit-scrollbar-corner {
  background: var(--bg-base);
}

/* ─── FIREFOX ─── */

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) var(--bg-base);
}
