/* main.css — global resets, typography scale, shared utilities.
   Mobile-first. All values reference tokens from theme.css. */

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

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

body {
  background-color: var(--background);
  color: var(--bodyTextColor);
  font-family: var(--fontBody);
  font-size: 1rem;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

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

input, textarea {
  font-family: inherit;
  font-size: 1rem;
}

/* ---------- Typography scale ---------- */
h1, h2, h3, h4 {
  font-family: var(--fontDisplay);
  color: var(--bodyTextColorWhite);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.015em;
  /* Fraunces optical + soft retro character */
  font-variation-settings: 'opsz' 144, 'SOFT' 60, 'WONK' 1;
}

h1 { font-size: clamp(3rem, 11vw, 7.5rem); font-weight: 600; }
h2 { font-size: clamp(2.25rem, 6vw, 4rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }

p { font-size: clamp(1rem, 1.6vw, 1.125rem); }

em { font-style: italic; color: var(--cream); }

/* ---------- Shared utilities ---------- */
.cs-container {
  width: 92%;
  max-width: 80rem;
  margin: 0 auto;
}

/* Mono eyebrow / label */
.cs-label {
  font-family: var(--fontMono);
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--heat);
  display: inline-block;
}

/* Section vertical rhythm — generous whitespace */
.cs-section { padding: clamp(4rem, 10vw, 9rem) 0; }

/* Primary CTA — square corners, brass fill, warm hover glow */
.cs-button {
  display: inline-block;
  font-family: var(--fontMono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--background);
  background-color: var(--primary);
  padding: 1.1rem 2.5rem;
  border: 1px solid var(--primary);
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.cs-button:hover {
  background-color: var(--primaryLight);
  border-color: var(--primaryLight);
  box-shadow: 0 0 28px var(--heatGlow);
}

.cs-button-ghost {
  display: inline-block;
  font-family: var(--fontMono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
  background-color: transparent;
  padding: 1.1rem 2.5rem;
  border: 1px solid var(--border);
  transition: border-color 0.3s ease, color 0.3s ease;
}

.cs-button-ghost:hover { border-color: var(--heat); color: var(--cream); }

/* Heat-glow text accent for select display words */
.cs-glow {
  color: var(--heat);
  text-shadow: 0 0 24px var(--heatGlow);
  font-style: italic;
}

/* Vintage film-grain overlay — sits above everything, ignores pointer */
.cs-grain {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Accessible focus state */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--heat);
  outline-offset: 3px;
}
