/* ============================================================
   style.css — Sistema editorial "Cuaderno académico"
   Facultad de Ciencias de la Educación y Psicología · UCO
   ============================================================ */

/* ── Tipografía ───────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,400;1,9..144,500;1,9..144,600&family=Hanken+Grotesk:wght@400;500;600;700&display=swap');

/* ── Variables ────────────────────────────────────────────── */
:root {
  /* Papel y tinta */
  --color-bg:            #F4EFE3;   /* papel crema cálido */
  --color-bg-deep:       #ECE5D4;   /* papel más profundo (secciones alt) */
  --color-surface:       #FCFAF3;   /* superficie de tarjeta, blanco cálido */
  --color-border:        #DBD2BE;   /* filete de regla sobre papel */

  /* Verde tinta (identidad UCO, enriquecida) */
  --color-primary:       #1A5135;   /* verde bosque tinta */
  --color-primary-mid:   #2F7A4D;   /* verde medio */
  --color-primary-light: #E3EBDF;   /* verde-crema muy suave */
  --color-forest-deep:   #0E3320;   /* verde más oscuro, fondo del héroe */

  /* Acento ocre / terracota */
  --color-accent:        #C26A2B;   /* ocre cálido */
  --color-accent-deep:   #A4561F;
  --color-accent-light:  #F1E2CB;   /* ocre suave */
  --color-secondary:     #B14A33;   /* terracota */

  /* Texto */
  --color-text:          #1E2A22;   /* tinta verde-negra cálida */
  --color-text-muted:    #5C6358;   /* tinta apagada */
  --color-text-light:    #F4EFE3;   /* texto sobre fondos oscuros */

  /* Talleres (versiones apagadas y terrosas) */
  --taller-mates:        #2F7A4D;
  --taller-lectura:      #2E6F86;
  --taller-inclusion:    #7A5AA0;
  --taller-emocional:    #C26A2B;
  --taller-artes:        #B14A33;
  --taller-ciencias:     #5C8A39;

  /* Tipografía */
  --font-heading: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Hanken Grotesk', system-ui, -apple-system, sans-serif;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.5rem;
  --text-5xl:  3.5rem;
  --text-6xl:  4.5rem;

  /* Layout */
  --container-max: 1180px;
  --container-pad: clamp(1.15rem, 4vw, 2.25rem);
  --section-pad:   clamp(3.5rem, 7vw, 6.5rem);

  /* Forma */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  14px;
  --radius-xl:  22px;

  /* Sombras (cálidas, no negras puras) */
  --shadow-sm:  0 1px 2px rgba(40, 32, 12, 0.06);
  --shadow-md:  0 8px 24px rgba(40, 32, 12, 0.09);
  --shadow-lg:  0 18px 50px rgba(40, 32, 12, 0.14);

  --transition: 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);

  --header-h: 76px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}

/* Grano de papel sutil, fijo sobre todo el documento */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
em { font-style: italic; }

::selection { background: var(--color-accent); color: #fff; }

/* ── Contenedor ───────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* ── Tipografía base ──────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.08;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.015em;
  font-optical-sizing: auto;
}

h1 { font-size: clamp(2.4rem, 6vw, var(--text-6xl)); font-weight: 600; }
h2 { font-size: clamp(var(--text-3xl), 4.2vw, var(--text-5xl)); }
h3 { font-size: clamp(var(--text-xl), 2.5vw, var(--text-2xl)); }

p { max-width: 68ch; }

/* ── Sección base ─────────────────────────────────────────── */
.section { padding-block: var(--section-pad); position: relative; }

.section--alt { background: var(--color-bg-deep); }

/* Eyebrow numerado (índice editorial) */
.section__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.section__num {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.section__label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  white-space: nowrap;
}

.section__eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.section__heading { margin-bottom: 1.1rem; max-width: 18ch; }

.section__lead {
  font-size: clamp(var(--text-lg), 2vw, var(--text-xl));
  color: var(--color-text-muted);
  max-width: 60ch;
  margin-bottom: 3rem;
  line-height: 1.6;
}

/* ── Header / Nav ─────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 239, 227, 0.82);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.site-header.scrolled {
  border-color: var(--color-border);
  box-shadow: var(--shadow-sm);
  background: rgba(244, 239, 227, 0.94);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding-inline: var(--container-pad);
  max-width: var(--container-max);
  margin-inline: auto;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--color-primary);
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.header-brand-icon {
  width: 38px;
  height: 38px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 3px rgba(252, 250, 243, 0.15);
}

.main-nav { display: flex; align-items: center; }

.nav-list { display: flex; gap: 0.15rem; align-items: center; }

.nav-link {
  position: relative;
  padding: 0.45rem 0.85rem;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--transition);
  white-space: nowrap;
}

/* Subrayado de tinta animado */
.nav-link::after {
  content: '';
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.2rem;
  height: 1.5px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.nav-link:hover { color: var(--color-primary); }
.nav-link:hover::after,
.nav-link.is-active::after { transform: scaleX(1); }
.nav-link.is-active { color: var(--color-primary); }

.nav-link--cta {
  background: var(--color-primary);
  color: var(--color-text-light) !important;
  padding: 0.5rem 1.1rem;
  border-radius: 100px;
  margin-left: 0.4rem;
  transition: background var(--transition), transform var(--transition);
}
.nav-link--cta::after { display: none; }
.nav-link--cta:hover { background: var(--color-primary-mid) !important; transform: translateY(-1px); }
.nav-link--cta.is-active { color: var(--color-text-light); }

/* Hamburguesa */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  background:
    radial-gradient(120% 120% at 85% 10%, rgba(47, 122, 77, 0.35) 0%, transparent 55%),
    linear-gradient(160deg, var(--color-primary) 0%, var(--color-forest-deep) 100%);
  color: var(--color-text-light);
  padding-block: clamp(3.5rem, 9vw, 7rem);
  position: relative;
  overflow: hidden;
}

/* Filetes de regla horizontales muy sutiles (cuaderno) */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 37px,
    rgba(255, 255, 255, 0.035) 38px
  );
  pointer-events: none;
}

/* Sello ocre decorativo difuminado */
.hero::after {
  content: '';
  position: absolute;
  width: 380px;
  height: 380px;
  right: -120px;
  bottom: -160px;
  background: radial-gradient(circle, rgba(194, 106, 43, 0.30) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 100px;
  padding: 0.4rem 1rem 0.4rem 0.85rem;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 1.75rem;
  backdrop-filter: blur(4px);
  color: rgba(244, 239, 227, 0.92);
}

.hero-badge svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--color-accent-light); }

.hero h1 {
  color: #fff;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--color-accent-light);
}

.hero-subtitle {
  font-size: clamp(var(--text-base), 1.8vw, var(--text-lg));
  color: rgba(244, 239, 227, 0.78);
  max-width: 52ch;
  line-height: 1.75;
  margin-bottom: 2.25rem;
}

.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; }

/* Lámina de imagen enmarcada con leyenda */
.hero-figure {
  position: relative;
  margin-inline: auto;
}

.hero-image-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
  position: relative;
  z-index: 1;
}

.hero-image-wrap img { width: 100%; height: 100%; object-fit: cover; }

/* Marco offset detrás de la imagen */
.hero-figure::before {
  content: '';
  position: absolute;
  inset: 16px -16px -16px 16px;
  border: 1px solid var(--color-accent-light);
  border-radius: var(--radius-md);
  opacity: 0.4;
  z-index: 0;
}

.hero-figure-caption {
  position: absolute;
  bottom: -14px;
  left: -14px;
  z-index: 2;
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.45rem 0.9rem;
  border-radius: 100px;
  box-shadow: var(--shadow-md);
}

/* ── Botones ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  border-radius: 100px;
  font-size: var(--text-base);
  font-weight: 600;
  font-family: var(--font-body);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--color-accent); color: #fff; box-shadow: 0 6px 18px rgba(194, 106, 43, 0.35); }
.btn--primary:hover { background: var(--color-accent-deep); box-shadow: 0 10px 26px rgba(194, 106, 43, 0.42); }

.btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(4px);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.16); }

.btn--outline {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
}
.btn--outline:hover { background: var(--color-primary); color: var(--color-text-light); }

.btn--sm { padding: 0.55rem 1.15rem; font-size: var(--text-sm); }

.btn .arrow { transition: transform var(--transition); }
.btn:hover .arrow { transform: translateX(3px); }

/* ── Reveal animation ─────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.reveal.is-visible { opacity: 1; transform: none; }

.reveal--delay-1 { transition-delay: 0.08s; }
.reveal--delay-2 { transition-delay: 0.16s; }
.reveal--delay-3 { transition-delay: 0.24s; }
.reveal--delay-4 { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ── Stats bar ────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  background: var(--color-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 3.5rem;
  box-shadow: var(--shadow-lg);
}

.stat-item {
  flex: 1;
  padding: 2rem 1.4rem;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  transition: background var(--transition);
}

.stat-item:last-child { border-right: none; }
.stat-item:hover { background: var(--color-forest-deep); }

.stat-number {
  font-family: var(--font-heading);
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  font-weight: 600;
  color: var(--color-accent-light);
  display: block;
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: var(--text-sm);
  color: rgba(244, 239, 227, 0.72);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  background: var(--color-forest-deep);
  color: rgba(244, 239, 227, 0.66);
  padding-block: 3.5rem 2rem;
  position: relative;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.25rem;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.footer-brand-name {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: #fff;
  font-weight: 600;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.footer-brand p { font-size: var(--text-sm); max-width: 32ch; line-height: 1.7; }

.footer-nav-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-accent-light);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 1rem;
}

.footer-nav-list { display: flex; flex-direction: column; gap: 0.55rem; }

.footer-nav-list a {
  font-size: var(--text-sm);
  color: rgba(244, 239, 227, 0.6);
  transition: color var(--transition), padding-left var(--transition);
}
.footer-nav-list a:hover { color: #fff; padding-left: 4px; }

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: rgba(244, 239, 227, 0.4);
  letter-spacing: 0.02em;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (min-width: 640px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  .hero-inner { grid-template-columns: 1.05fr 0.95fr; gap: 4.5rem; }
  .hero-figure { max-width: 420px; }
  .footer-inner { grid-template-columns: 2fr 1fr 1fr; }
  .stats-bar { flex-direction: row; }
}

@media (max-width: 899px) {
  .stats-bar { flex-direction: column; }
  .stat-item { border-right: none; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
  .stat-item:last-child { border-bottom: none; }

  .nav-toggle { display: flex; }

  .main-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    box-shadow: var(--shadow-md);
  }

  .main-nav.is-open { max-height: 460px; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    padding: 0.85rem var(--container-pad) 1.25rem;
    gap: 0.15rem;
  }

  .nav-link { padding: 0.7rem 0.5rem; }
  .nav-link::after { display: none; }
  .nav-link--cta { margin-left: 0; margin-top: 0.5rem; text-align: center; }
}
