/* Base, pattern, marquee, accordion and card helpers. Layout lives in Tailwind classes.
 * Tokens: Brandbook LTSM 2026 (red #B92C32, gray #757679, white base). Font: Figtree (Acumin substitute). */
:root {
  --brand: #b92c32;
  --mute: #757679;
  --line: rgb(117 118 121 / 0.25);
}

html { scroll-behavior: smooth; }
body {
  font-family: "Figtree", ui-sans-serif, system-ui, sans-serif;
  background: #fff;
  color: var(--mute);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  border-radius: 9999px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* Brand pattern: the official isotipo repeated, very low opacity, fading out toward the edges */
.iso-pattern { position: relative; isolation: isolate; }
.iso-pattern::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("../img/brand/pattern-isotipo.png");
  background-size: 176px 176px;
  opacity: 0.07;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
}

/* Hero */
.hero-title {
  font-size: clamp(2.75rem, 5vw, 5rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 700;
  text-wrap: balance;
}

/* Buttons: brand red solid, white solid; hover through brightness only */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.25rem;
  padding: 0.85rem 1.75rem;
  border-radius: 9999px;
  font-weight: 600;
  transition: filter 0.3s, transform 0.3s;
}
.btn:active { transform: scale(0.98); }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { filter: brightness(0.92); }
.btn-white { background: #fff; color: var(--brand); }
.btn-white:hover { filter: brightness(0.95); }
.btn-ghost { background: #fff; color: var(--brand); border: 1.5px solid var(--brand); }
.btn-ghost:hover { background: rgb(185 44 50 / 0.06); }

/* Marquee: the track holds two identical groups; -50% loops seamlessly */
.marquee {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 40s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 3.5rem;
  padding-right: 3.5rem;
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* Marquee band: top and bottom hairlines in brand red with a slow traveling highlight */
.marquee-band::before,
.marquee-band::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgb(185 44 50 / 0.2) 0%, rgb(185 44 50 / 0.2) 35%, var(--brand) 50%, rgb(185 44 50 / 0.2) 65%, rgb(185 44 50 / 0.2) 100%);
  background-size: 200% 100%;
  animation: band-line 9s linear infinite;
}
.marquee-band::before { top: 0; }
.marquee-band::after { bottom: 0; animation-direction: reverse; }
@keyframes band-line {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee-track { animation: none; width: auto; justify-content: center; }
  .marquee-group { flex-wrap: wrap; justify-content: center; row-gap: 1.5rem; padding-right: 0; }
  .marquee-group[aria-hidden="true"] { display: none; }
  .marquee-band::before, .marquee-band::after { animation: none; }
  html { scroll-behavior: auto; }
}

/* Horizontal accordion: stacked panels by default, horizontal from md */
.acc { display: flex; flex-direction: column; gap: 1rem; }
.acc-item {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 20rem;
  border-radius: 1.75rem;
  display: flex;
  align-items: flex-end;
  color: #fff;
  box-shadow: 0 12px 32px -14px rgb(0 0 0 / 0.18);
}
.acc-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.acc-item::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgb(185 44 50 / 0.95) 0%, rgb(185 44 50 / 0.7) 38%, rgb(185 44 50 / 0) 78%);
}
.acc-body { padding: 1.75rem; width: 100%; }
.acc-item:hover .acc-media,
.acc-item:focus-within .acc-media { transform: scale(1.05); }
@media (min-width: 768px) {
  .acc { flex-direction: row; height: 34rem; }
  .acc-item {
    flex: 1 1 0;
    min-height: 0;
    transition: flex-grow 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .acc-body { padding: 2rem; }
  .acc-text { min-width: 20rem; opacity: 0; transform: translateY(0.75rem); transition: opacity 0.5s 0.15s, transform 0.5s 0.15s; }
  /* First slice is open until the user hovers or focuses another one */
  .acc-item:hover,
  .acc-item:focus-within,
  .acc:not(:hover):not(:focus-within) .acc-item:first-child { flex-grow: 3; }
  .acc-item:hover .acc-text,
  .acc-item:focus-within .acc-text,
  .acc:not(:hover):not(:focus-within) .acc-item:first-child .acc-text { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .acc-item, .acc-media, .acc-text { transition: none; }
}

/* Chapters (Misión, Visión, Comunidad).
 * Default = plain stacked blocks, everything visible. main.js adds .is-pinned only when the
 * desktop pinned scene runs, and sets every initial animation state itself (never in CSS). */
.chapters { padding-block: 6rem; }
.chap-stage { display: flex; flex-direction: column; gap: 6rem; }
.chap-grid {
  display: grid;
  gap: 2rem;
  width: 100%;
  max-width: 80rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
  align-items: center;
}
@media (min-width: 640px) { .chap-grid { padding-inline: 2rem; } }
@media (min-width: 1024px) {
  .chap-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 4rem; }
}
.chap-title {
  font-size: clamp(3.5rem, 6vw, 6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--brand);
}
.chap-text {
  margin-top: 1.5rem;
  max-width: 36ch;
  font-size: 1.25rem;
  line-height: 1.6;
  font-weight: 300;
  color: var(--mute);
}
.chap-media {
  margin: 0;
  width: min(100%, 72vh * 1.6);
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 2rem;
  box-shadow: 0 12px 32px -14px rgb(0 0 0 / 0.18);
  justify-self: end;
}
.chap-frame { width: 100%; height: 100%; }
.chap-img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Split words: each word sits in its own mask so it can slide in and out */
.sw { display: inline-block; overflow: hidden; vertical-align: top; padding-block: 0.14em; margin-block: -0.14em; }
.swi { display: inline-block; will-change: transform; }

/* Progress indicator, only shown (hidden attribute removed) while pinned */
.chap-nav { position: absolute; z-index: 30; left: 0; right: 0; bottom: 2.5rem; pointer-events: none; }
.chap-nav-inner { max-width: 80rem; margin-inline: auto; padding-inline: 2rem; }
.chap-track { position: relative; width: min(100%, 26rem); height: 2px; background: var(--line); }
.chap-fill { position: absolute; inset: 0; background: var(--brand); transform-origin: left center; transform: scaleX(0); }
.chap-list { display: flex; gap: 2rem; margin-top: 0.75rem; }
.chap-link {
  pointer-events: auto;
  padding: 0.5rem 0;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--mute);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.4s;
}
.chap-link:hover { color: var(--brand); }
.chap-link.is-active { color: var(--brand); }

.chapters.is-pinned { height: 100svh; padding: 0; overflow: hidden; }
.chapters.is-pinned .chap-stage { display: block; position: relative; height: 100%; }
.chapters.is-pinned .chapter {
  position: absolute;
  inset: 0;
  padding-block: 6.5rem 6rem;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.chapters.is-pinned .chap-grid { height: 100%; }
.chapters.is-pinned .chapter:nth-child(2) { z-index: 2; }
.chapters.is-pinned .chapter:nth-child(3) { z-index: 3; }
.chapters.is-pinned .chap-media { will-change: clip-path; }

/* Bento feature card: blurred real photo under a red-tinted wash, white text on top.
 * Scaled up so the blur does not show soft transparent edges. */
.feature-photo { filter: blur(10px); transform: scale(1.12); }

/* Bento feature card: red-tinted wash over a real photo, white text on top */
.feature-wash {
  background: linear-gradient(to top, rgb(185 44 50 / 0.96) 0%, rgb(185 44 50 / 0.78) 45%, rgb(185 44 50 / 0.35) 100%);
}
