/* ==========================================================================
   KG Stables — Base Reset & Typography Utilities
   ========================================================================== */

@import 'tokens.css';

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--fg-on-light);
  background-color: var(--bg-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

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

ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

p {
  margin: 0;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
}

/* ── LAYOUT UTILITIES ─────────────────────────────────────────────────────── */

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.reading-col {
  max-width: 680px;
  margin: 0 auto;
}

/* ── TYPOGRAPHY UTILITIES ─────────────────────────────────────────────────── */

.kg-display {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: var(--fs-display);
  line-height: 1.05;
  letter-spacing: var(--tracking-display);
  margin: 0;
  text-wrap: balance;
}

.kg-h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: var(--fs-h1);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

.kg-h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: var(--fs-h2);
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

.kg-h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: var(--fs-h3);
  line-height: 1.25;
  margin: 0;
}

.kg-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: var(--fs-h3);
  line-height: 1.3;
  margin: 0;
}

.kg-eyebrow {
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--fg-accent);
  margin: 0 0 var(--space-4) 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.kg-eyebrow::before {
  content: '';
  display: inline-block;
  width: 22px;
  height: 1px;
  background: currentColor;
  flex-shrink: 0;
}

.kg-eyebrow.on-dark {
  color: var(--color-rule);
}

.kg-body-lg {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-body-lg);
  line-height: 1.65;
  margin: 0;
}

.kg-body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.65;
  margin: 0;
}

.kg-small {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-small);
  line-height: 1.5;
}

.kg-caption {
  font-family: var(--font-sans);
  font-style: italic;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--color-secondary);
  margin-top: var(--space-3);
}

/* ── SCROLL FADE-UP ANIMATION ─────────────────────────────────────────────── */

.fade-up {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.fade-up.visible {
  opacity: 1;
  transform: none;
}

/* ── REDUCED MOTION ───────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .fade-up {
    opacity: 1;
    transform: none;
    transition: none;
  }

  /* Hero video: hide and show poster fallback */
  video[autoplay] {
    display: none;
  }

  .hero-poster-fallback {
    display: block !important;
  }

  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── MOBILE BASE OVERRIDES ────────────────────────────────────────────────── */

@media (max-width: 767px) {
  .container {
    padding: 0 var(--space-5);
  }

  .kg-h1 {
    font-size: clamp(34px, 8vw, 56px);
  }

  .kg-h2 {
    font-size: clamp(26px, 6vw, 40px);
  }
}
