/* ============================================================
   Design tokens + global reset, shared by every page/component.
   ============================================================ */

:root {
  --blue: #0660df;
  --blue-hover: #0551b8;
  --blue-dark: #03306e;
  --green: #ddf7b7;
  --black: #141414;
  --bg: #f4f7f1;
  --bg-alt: #f1f6ec;
  --white: #ffffff;
  --gray: #6f757f;
  --paper: #fbfbf7; /* empresa page's off-white editorial background */
  --flame: #f47a1c; /* empresa page's "la llama" symbol accent — used nowhere else on purpose */

  --max-width: 85.375rem; /* 1366px */
  --pad-x: clamp(1.25rem, 5vw, 5rem);
  --pad-y: clamp(5rem, 10vw, 10rem); /* empresa page's taller vertical rhythm */

  --fz-hero: clamp(4.5rem, 15vw, 15rem);
  --fz-h1: clamp(2.75rem, 7vw, 7.5rem);
  --fz-h2: clamp(2rem, 4.5vw, 4.5rem);
  --fz-h3: clamp(1.375rem, 2.2vw, 2rem);
  --fz-body: clamp(1rem, 1.15vw, 1.1875rem);
  --fz-lead: clamp(1.25rem, 1.8vw, 1.75rem);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Serif display font (empresa page only, loaded via $extraFontFamilies
     in head.php — see docs/structure.md). Every other page's type is
     Inter (the body font-family below), so this is the only place a
     second font family is needed. */
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  color: var(--black);
  background: var(--bg);
  overflow-x: hidden;
  line-height: 1.3;
}

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

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

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

p, li {
  text-wrap: pretty;
}

::selection {
  background: var(--green);
  color: var(--black);
}

/* Two-tone focus ring: readable on light, dark and blue backgrounds. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--black);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--green);
  border-radius: 2px;
}
:where(.nav, .footer):where(*):focus-visible,
.nav :focus-visible,
.footer :focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(6, 102, 223, 0.55);
}

/* Visually hidden but still readable by screen readers/assistive tech. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Scroll-reveal utility: add class="reveal" to any element and
   assets/js/reveal.js adds "is-in" once it scrolls into view. */
.reveal {
  opacity: 0;
  transform: translateY(1.875rem);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* Word-by-word reveal utility: add class="word-reveal" to any element
   and assets/js/word-reveal.js wraps + lights up its words as it
   scrolls through the viewport. */
.word-reveal {
  display: inline;
  white-space: normal;
}
.word-reveal .w {
  display: inline-block;
  opacity: 0.15;
  transform: translateY(0.25rem);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease), color 0.35s var(--ease);
  will-change: opacity, transform, color;
}
.word-reveal .w.is-on {
  opacity: 1;
  transform: translateY(0);
}
.word-reveal .w.hl.is-on {
  color: var(--green);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
