﻿/* ============================================================
   BASE - Modern reset + global element styles
   ============================================================ */

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul,
ol {
  list-style: none;
}

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

/* Clean focus ring - visible to keyboard users, hidden on click */
:focus-visible {
  outline: 2px solid var(--color-brand-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Heading scale - fluid between mobile and desktop */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
}

h1 { font-size: clamp(var(--text-3xl), 5vw,   var(--text-5xl)); }
h2 { font-size: clamp(var(--text-2xl), 4vw,   var(--text-4xl)); }
h3 { font-size: clamp(var(--text-lg),  2.5vw, var(--text-2xl)); }
h4 { font-size: var(--text-lg); }

p {
  line-height: var(--leading-normal);
  color: var(--color-text-secondary);
}

/* Grain/noise overlay — tiled SVG feTurbulence, no external asset.
   Adds micro-texture to gradients so they feel tactile, not flat.
   Sits above all content (pointer-events: none so nothing is blocked). */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  opacity: 0.035;
  pointer-events: none;
  z-index: 9000;
}

/* Honour reduced motion at the platform level */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
