@import url("https://fonts.googleapis.com/css2?family=Source+Serif+4:wght@400;500;600;700&family=Source+Sans+3:wght@400;500;600&display=swap");

/* Paleta institucional y escalas */
:root {
  color-scheme: light;
  --blue-900: #0c1f33;
  --blue-800: #15314f;
  --blue-700: #1d3f63;
  --blue-500: #2c5a88;
  --blue-200: #c9d9ea;
  --gray-100: #f5f6f8;
  --gray-200: #e4e7ec;
  --gray-400: #b8c0cc;
  --text-dark: #1f2630;
  --text-light: #f7f8fa;
  --shadow-soft: 0 18px 40px rgba(10, 25, 41, 0.08);
  --radius-lg: 18px;
  --radius-sm: 10px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--text-dark);
  background-color: #fff;
  line-height: 1.6;
}

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

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

ul {
  list-style: none;
}

.container {
  width: min(1120px, 90%);
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  padding: 0.75rem 1rem;
  background: var(--blue-900);
  color: var(--text-light);
  border-radius: 8px;
  z-index: 100;
}

.skip-link:focus {
  top: 1rem;
}

/* Encabezado fijo con sombra sutil */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 0;
}

.logo {
  font-family: "Source Serif 4", "Georgia", serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--blue-900);
}

.primary-nav ul {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  font-weight: 500;
  color: var(--blue-700);
  position: relative;
  padding-bottom: 0.35rem;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--blue-700);
  transition: width 0.25s ease;
}

.nav-link:hover::after,
.nav-link.is-active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--blue-900);
  margin: 4px 0;
}

/* Hero con fondo institucional */
.hero {
  position: relative;
  background: linear-gradient(120deg, rgba(12, 31, 51, 0.9), rgba(12, 31, 51, 0.45)),
    url("https://images.unsplash.com/photo-1523580494863-6f3031224c94?auto=format&fit=crop&w=1600&q=80")
      center/cover no-repeat;
  color: var(--text-light);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, rgba(12, 31, 51, 0.8), rgba(12, 31, 51, 0.35));
}

.hero-content {
  position: relative;
  padding: 6.5rem 0 6rem;
  max-width: 640px;
}

.hero-tag {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blue-200);
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: "Source Serif 4", "Georgia", serif;
  font-size: clamp(2.3rem, 3.5vw, 3.4rem);
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.section {
  padding: 4.75rem 0;
}

.section.alt {
  background: var(--gray-100);
}

.section-header {
  margin-bottom: 2.5rem;
}

.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--blue-500);
  margin-bottom: 0.5rem;
}

.section h2 {
  font-family: "Source Serif 4", "Georgia", serif;
  font-size: clamp(1.8rem, 2.8vw, 2.6rem);
  color: var(--blue-900);
}

.grid-two,
.grid-three,
.grid-four {
  display: grid;
  gap: 1.8rem;
}

.grid-two {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-three {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.grid-four {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card,
.project-card,
.resource-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(15, 41, 66, 0.08);
}

.card-body {
  padding: 1.75rem;
}

.card-footer {
  padding: 0 1.75rem 1.75rem;
}

.project-card {
  padding: 1.8rem;
  background: linear-gradient(160deg, #fff, #f4f7fb);
}

.resource-card {
  display: block;
  padding: 1.8rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.resource-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 40px rgba(10, 25, 41, 0.12);
}

.card h3,
.project-card h3,
.resource-card h3 {
  font-size: 1.15rem;
  color: var(--blue-800);
  margin-bottom: 0.75rem;
}

.card p,
.project-card p,
.resource-card p {
  color: #4f5966;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.7rem 1.5rem;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--blue-700);
  color: var(--text-light);
  box-shadow: 0 10px 24px rgba(29, 63, 99, 0.25);
}

.btn-secondary {
  background: transparent;
  color: var(--blue-700);
  border-color: var(--blue-200);
}

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

.contact-info ul {
  display: grid;
  gap: 0.75rem;
  color: #4f5966;
}

.form-group {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
}

input,
textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  font: inherit;
  background: #fff;
}

input:focus,
textarea:focus {
  outline: 2px solid var(--blue-200);
  border-color: var(--blue-200);
}

.form-error {
  color: #b42318;
  font-size: 0.85rem;
  min-height: 1rem;
}

.form-status {
  margin-top: 1rem;
  color: var(--blue-700);
  font-weight: 600;
}

.site-footer {
  background: var(--blue-900);
  color: var(--text-light);
  padding: 2.8rem 0;
}

.footer-content {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.footer-title {
  font-family: "Source Serif 4", "Georgia", serif;
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
}

.footer-heading {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  margin-bottom: 0.7rem;
}

.footer-content a {
  color: var(--gray-200);
}

.footer-content a:hover {
  color: #fff;
}

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

/* Navegacion responsive */
@media (max-width: 880px) {
  .nav-toggle {
    display: inline-flex;
  }

  .primary-nav {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    width: min(280px, 90vw);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    padding: 1rem;
    border: 1px solid var(--gray-200);
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .primary-nav ul {
    flex-direction: column;
    gap: 0.85rem;
  }

  .primary-nav.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
  }

  .header-content {
    position: relative;
  }
}

@media (max-width: 600px) {
  .hero-content {
    padding: 5rem 0 4.5rem;
  }

  .btn {
    width: 100%;
  }
}

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