/*
 * THREEGLAU BASE STYLES
 * Resets, typography, utilities.
 * Requires: threeglau-tokens.css
 */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

body {
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ─── Noise overlay ─── */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  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.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

/* ─── Typography ─── */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }

h1 em, h2 em, h3 em {
  font-style: italic;
  color: var(--accent-orange);
}

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

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

/* ─── Layout ─── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: var(--space-section) 0;
}

/* ─── Labels ─── */
.label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.label--orange { color: var(--accent-orange); }
.label--blue { color: var(--accent-blue); }
.label--green { color: var(--accent-green); }

/* ─── Divider ─── */
.divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--border-subtle) 20%,
    var(--border-subtle) 80%,
    transparent
  );
  margin: 0 auto;
  max-width: var(--max-width);
}

/* ─── Scroll reveal ─── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-reveal), transform var(--transition-reveal);
}

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

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

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

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

::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 3px;
}

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

/* ─── Focus visible ─── */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-blue), 0 0 0 4px rgba(61, 124, 245, 0.15);
}

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