:root {
  --ink: #171717;
  --muted: #707070;
  --line: #e7e7e7;
  --soft: #fafafa;
  --accent: #df8194;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: Palatino, "Book Antiqua", Georgia, serif;
}

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


/* ==========================================
   ENCABEZADO Y NAVEGACIÓN
   ========================================== */

.site-header {
  height: 76px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(28px, calc((100% - 1180px) / 2));
  position: relative;
  z-index: 5;
  background: #fff;
}

.brand {
  font-size: 25px;
}

.brand span {
  color: var(--accent);
}

nav {
  display: flex;
  gap: 27px;
  font: 600 13px Arial, sans-serif;
}

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


/* ==========================================
   ESTRUCTURA GENERAL
   ========================================== */

.home,
.page {
  width: min(1180px, calc(100% - 40px));
  margin: auto;
}

.home {
  padding: 74px 0 85px;
}

.page {
  padding: 70px 0 90px;
}

section {
  margin-top: 82px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 28px;
}

h2 {
  font-size: 34px;
  margin: 0;
}

.updated {
  font: 12px Arial, sans-serif;
  color: #777;
}


/* ==========================================
   INICIO
   ========================================== */

.home-intro {
  padding: 25px 0 20px;
}

.eyebrow {
  color: var(--accent);
  font: 700 12px Arial, sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
  margin: 0;
}

.about-photo {
  margin-top: 20px;

  width: 180px;
  height: 180px;

  border-radius: 50%;

  background: var(--soft);

  display: grid;
  place-items: center;

  color: #999;
  font: 12px Arial, sans-serif;

  overflow: hidden;
}

.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home h1 {
  font-size: clamp(58px, 7vw, 92px);
  line-height: .96;
  letter-spacing: -.045em;
  margin: 15px 0 22px;
}

.home h1 em {
  font-weight: 400;
}

.lead {
  max-width: 720px;
  color: #666;
  font-size: 20px;
  line-height: 1.3;
  margin: 0;
}


/* ==========================================
   REDES SOCIALES
   ========================================== */

.home-social {
  display: flex;
  align-items: center;
  gap: 48px;
  margin: 40px 0 80px;
  justify-content: center;
}

.home-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #df8194;
  text-decoration: none;
}

.home-social svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-social a:hover {
  opacity: 0.7;
}


/* ==========================================
   BANNER DE INICIO
   ========================================== */

.home-banner {
  display: block;
  width: 100%;
  height: auto;
}

.home-hero {
  margin-top: -80px;
}


/* ==========================================
   TARJETAS DE PROYECTOS
   ========================================== */

.project-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 220px));
  justify-content: center;
  gap: 30px;
}

.home-projects {
  display: block;
  width: 100%;
}

.project-card {
  border: none;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  text-align: center;
  transition: transform .18s ease, box-shadow .18s ease;
}

.project-card:hover {
  transform: translateY(-3px);
}

.project-card h3 {
  font-weight: 400;
}

.project-card img,
.cover-placeholder {
  width: 100%;
  aspect-ratio: 2 / 3;
  display: block;
  object-fit: cover;
  box-shadow: none;
  filter: none;
}

.cover-placeholder {
  background: var(--soft);
  display: grid;
  place-items: center;
  color: #999;
  font: 12px Arial, sans-serif;
}

.card-body {
  padding: 14px 0 0;
}

.card-meta {
  color: var(--accent);
  font: 700 10px Arial, sans-serif;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.card-body h3 {
  font-size: 27px;
  line-height: 1.05;
  margin: 12px 0;
  text-align: center;
  font-weight: 400;
}

.card-body p:last-child {
  color: #666;
  line-height: 1.55;
}


/* ==========================================
   CARRUSELES DE INICIO
   ========================================== */

.home-section-title {
  text-align: center;
  margin-bottom: 38px;
}

.home-section-title h2 {
  margin: 0;
  font-size: 34px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.home-section-title span {
  display: block;
  width: 42px;
  height: 2px;
  background: var(--accent);
  margin: 14px auto 0;
}

.home-carousel {
  width: 100%;
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.home-carousel::-webkit-scrollbar {
  display: none;
}

.carousel-track {
  display: flex;
  gap: 24px;
  width: max-content;
}

.carousel-track .project-card {
  flex: 0 0 260px;
}

.carousel-track.is-centered {
  width: 100%;
  justify-content: center;
}

.carousel-track.is-carousel {
  justify-content: flex-start;
}

.carousel-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.carousel-button {
  width: 38px;
  height: 38px;
  border: 1px solid #ddd;
  border-radius: 50%;
  background: #fff;
  color: #171717;
  font: 18px Arial, sans-serif;
  cursor: pointer;
  transition: .15s;
}

.carousel-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.carousel-hint {
  margin: 28px 0 0;
  text-align: center;
  color: #777;
  font: 12px Arial, sans-serif;
  letter-spacing: .04em;
}


/* ==========================================
   FICHA DE PROYECTO
   ========================================== */

.project-hero {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(520px, 1.1fr);
  gap: 72px;
  align-items: center;
  margin-top: 12px;
}

.project-cover img {
  width: 80%;
  max-height: 600px;
  object-fit: cover;
  object-position: top;
  border-radius: 7px;
  box-shadow: 0 22px 38px rgba(0, 0, 0, .13);
}

.project-hero .cover-placeholder {
  width: 80%;
  max-width: 600px;
  aspect-ratio: 2 / 3;
  margin: 0 auto;
}

.project-card .project-cover img {
  width: 100%;
  max-height: none;
  box-shadow: none;
}

.project-copy {
  padding-right: 25px;
    transform: translateX(-90px);
}

.project-copy h1 {
  font-size: clamp(54px, 6vw, 82px);
  line-height: .98;
  letter-spacing: -.045em;
  margin: 15px 0 25px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 25px;
}

.tag {
  border: 1px solid #ddd;
  border-radius: 999px;
  padding: 8px 15px;
  color: #666;
  font: 13px Arial, sans-serif;
}

.buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font: 700 13px Arial, sans-serif;
}

.button.primary {
  background: #171717;
  color: #fff;
  border-color: #171717;
}

.info {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.info-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  font-size: 17px;
}

.info-card b {
  display: block;
  color: var(--accent);
  font: 700 10px Arial, sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.synopsis {
  max-width: 900px;
  font-size: 20px;
  line-height: 1.4;
  color: #444;
}

.chapter-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chapter-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: .15s;
}

.chapter-item:hover {
  border-color: #ccc;
  background: var(--soft);
}

.chapter-item small {
  display: block;
  color: var(--accent);
  font: 700 10px Arial, sans-serif;
  letter-spacing: .12em;
  margin-bottom: 7px;
  text-transform: uppercase;
}

.chapter-item strong {
  font-size: 20px;
  font-weight: 400;
}

.chapter-item b {
  color: var(--accent);
  font: 20px Arial, sans-serif;
}

.all-chapters {
  margin-top: 18px;
}


/* ==========================================
   PIE DE PÁGINA
   ========================================== */

footer {
  border-top: 1px solid var(--line);
  padding: 35px 20px 50px;
  text-align: center;
  color: #777;
  font: 12px Arial, sans-serif;
}


/* ==========================================
   TABLET
   ========================================== */

@media (max-width: 850px) {

  nav {
    gap: 15px;
  }

  .project-hero {
    grid-template-columns: 1fr;
    gap: 45px;
  }

  .project-copy {
    padding-right: 0;
  }

  .project-cover {
    max-width: 540px;
    margin: auto;
  }

  .info {
    grid-template-columns: 1fr 1fr;
  }

  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .home .project-grid {
    grid-template-columns: 1fr;
  }
}


/* ==========================================
   MÓVIL
   ========================================== */

@media (max-width: 600px) {

  .site-header {
    height: auto;
    min-height: 70px;
    padding: 17px 20px;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .brand {
    font-size: 22px;
  }

  nav {
    display: flex;
    width: 100%;
    gap: 22px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 3px;
    scrollbar-width: none;
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  .home,
  .page {
    width: calc(100% - 34px);
    padding-top: 45px;
  }

  .home h1 {
    font-size: clamp(48px, 14vw, 68px);
  }

    .project-grid {

    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 14px;

  }

  .project-hero {
    margin-top: 0;
  }

  .project-cover img {
  width: 68%;
  max-height: none;
  display: block;
  margin: 0 auto;
}

.project-copy {
  margin-left: 0;
  transform: none;
  text-align: center;

}

  .project-copy h1 {
    font-size: 52px;
  }

  .project-copy {
  text-align: center;
  padding-right: 0;
}

.project-copy .tags {
  justify-content: center;
}

.project-copy .buttons {
  justify-content: center;
}

  .info {
  grid-template-columns: repeat(2, 1fr);
}

.project-copy .lead {
  line-height: 1.2;
}

  .synopsis {
    font-size: 18px;
    line-height: 1.3;
  }

  .arc-title {
  font-size: 16px;
}

  .section-head {
    gap: 15px;
    align-items: center;
  }


  /* Carrusel */

  .carousel-track {
    gap: 16px;
    padding-left: 17px;
  }

  .carousel-track .project-card {
    flex: 0 0 34vw;
    max-width: 170px;
  }

  .carousel-track.is-centered {
    width: max-content;
    min-width: 100%;
    justify-content: center;
  }

  .carousel-track.is-carousel {
    width: max-content;
    justify-content: flex-start;
  }

  .home-carousel {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-left: 0;
    padding-right: 20px;
  }

  .carousel-hint {
    font-size: 11px;
  }


  /* Redes sociales */

  .home-social {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 24px;
    width: 100%;
    justify-content: center;
  }


    /* Banner en móvil */

  .home-hero {

    margin-top: 0;

  }
}

/* ==========================================
   CAPÍTULOS · ARCOS
   ========================================== */

.chapters-section .section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.chapter-count {
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}

.chapter-arc {
  margin-top: 44px;
}

.arc-title {
  margin: 0 0 16px;

  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;

  color: var(--accent);
}

.chapters-empty {
  margin-top: 24px;
  color: var(--muted);
}


/* ------------------------------------------
   LISTADO DE CAPÍTULOS
   ------------------------------------------ */

.chapter-list {
  display: flex;
  flex-direction: column;
}

.chapter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  padding: 20px 22px;

  border: 1px solid var(--line);
  border-radius: 8px;

  background: #fff;

  color: var(--ink);
  text-decoration: none;

  transition:
    background-color .18s ease,
    border-color .18s ease;
}

.chapter-item:hover {
  background: #f9e8ed;
  border-color: var(--accent);
}

.chapter-item:hover strong {
  color: var(--accent);
}

.chapter-item > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.chapter-item > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.chapter-item strong {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.chapter-item > b {
  font-size: 18px;
  font-weight: 400;
  color: var(--accent);
  flex-shrink: 0;
}

.chapter-item:hover strong {
  color: var(--ink);
}


/* ------------------------------------------
   MÓVIL
   ------------------------------------------ */

@media (max-width: 600px) {

  .chapters-section .section-head {
    gap: 12px;
  }

  .chapter-count {
    font-size: 13px;
  }

  .arc-title {
  font-size: 10px;
  letter-spacing: 1.1px;
}

  .chapter-item {
    padding: 14px 16px;
  }

  .chapter-item strong {
    font-size: 16px;
  }

}

.about-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 72px;
  align-items: start;
  margin-top: 28px;
}

.about-intro {
  text-align: center;
}

.about-intro .about-photo {
  margin: 0 auto 20px;
}

.about-text {
  max-width: 720px;
  font-size: 18px;
  line-height: 1.75;
  color: #444;
}

@media (max-width: 600px) {
  .about-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-text {
    max-width: none;
  }
}

.donation .button {
  margin-top: 24px;
}

/* =========================================
   ACTUALIZACIONES — CARRUSEL
   ========================================= */

.updates-section {
  width: 100%;
  margin: 40px 0;
}

.updates-carousel {
  position: relative;
  width: 100%;
}

.updates-track {
  position: relative;
  width: 100%;
  aspect-ratio: 8 / 3;
  overflow: hidden;
}

.updates-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease;
  z-index: 1;
}

.updates-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.updates-slide a {
  display: block;
  width: 100%;
  height: 100%;
}

.updates-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Flechas */

.updates-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;

  width: 42px;
  height: 42px;

  border: none;
  border-radius: 50%;

  background: rgba(255, 255, 255, 0.75);
  color: #000;

  font-size: 24px;
  line-height: 1;

  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transition:
    background 0.2s ease,
    transform 0.2s ease,
    opacity 0.2s ease;

  opacity: 0.75;
}

.updates-button:hover {
  background: rgba(255, 255, 255, 0.95);
  opacity: 1;
}

.updates-button:active {
  transform: translateY(-50%) scale(0.94);
}

.updates-prev {
  left: 15px;
}

.updates-next {
  right: 15px;
}

/* Indicadores */

.updates-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;

  margin-top: 14px;
}

.updates-dot {
  width: 8px;
  height: 8px;

  padding: 0;
  border: none;
  border-radius: 50%;

  background: #bbb;

  cursor: pointer;

  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.updates-dot:hover {
  transform: scale(1.2);
}

.updates-dot.is-active {
  background: #e9a0bd;
  transform: scale(1.15);
}

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 700px) {

  .updates-section {
    margin: 30px 0;
  }

  .updates-button {
    width: 34px;
    height: 34px;
    font-size: 19px;
  }

  .updates-prev {
    left: 8px;
  }

  .updates-next {
    right: 8px;
  }

  .updates-dots {
    margin-top: 10px;
    gap: 6px;
  }

  .updates-dot {
    width: 7px;
    height: 7px;
  }
}