/* ===========================================================
   CECH — Estilos base
   Requiere variables.css cargado antes que este archivo.
   =========================================================== */

/* ---- Tipografías autoalojadas (WOFF2, sin dependencia de CDN externo) ---- */
@font-face {
  font-family: 'Alata';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/alata.woff2') format('woff2');
}

/* Public Sans se sirve como fuente variable: un solo archivo cubre 400/600/700 */
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/public-sans-variable.woff2') format('woff2');
}

@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/public-sans-variable.woff2') format('woff2');
}

@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/public-sans-variable.woff2') format('woff2');
}

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

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

body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

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

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

/* ---- Tipografía de cuerpo ---- */
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-regular);
  color: var(--color-heading);
  line-height: var(--leading-tight);
  text-wrap: balance;
}

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

p {
  max-width: 65ch;
}

a {
  color: var(--color-accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.15em;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-hover);
}

small,
.text-muted {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-text-muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Compensa el header fijo al saltar a anclas internas ---- */
[id] {
  scroll-margin-top: var(--header-height);
}

/* ---- Foco de teclado siempre visible ---- */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* ---- Selección de texto ---- */
::selection {
  background: var(--color-accent);
  color: var(--color-text-inverted);
}

/* ---- Aparición al hacer scroll (ver scroll-reveal.js) ---- */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: none;
}

/* ---- Aparición al cargar — contenido del hero ----
   El hero es lo primero que ve el usuario, visible antes de cualquier
   scroll, así que no puede depender de .reveal-on-scroll (pensado para
   secciones que entran en viewport más tarde). Es CSS puro (sin JS)
   con entrada escalonada: insignia → título → texto → botones → arte. */
@keyframes cech-hero-fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero .pill-badge,
.hero__title,
.hero__lede,
.hero .hero__actions,
.hero__art {
  animation: cech-hero-fade-up 0.7s ease both;
}

.hero .pill-badge {
  animation-delay: 0s;
}

.hero__title {
  animation-delay: 0.1s;
}

.hero__lede {
  animation-delay: 0.2s;
}

.hero .hero__actions {
  animation-delay: 0.3s;
}

.hero__art {
  animation-delay: 0.4s;
}

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