/* =========================================================
   Fundación Principio y Fin
   Paleta: verde selva profundo + oro sol + coral cálido
   Tipografía: Fraunces (display) + Work Sans (texto)
   ========================================================= */

:root{
  --ink:        #1C1A14;
  --cream:      #FBF3E2;
  --cream-soft: #F4EAD3;
  --green-900:  #123626;
  --green-700:  #1B4E38;
  --green-500:  #2C6E4E;
  --gold-500:   #F2A63D;
  --gold-300:   #F7CB80;
  --coral-500:  #E15038;
  --coral-700:  #B93B27;
  --white:      #FFFDF8;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Work Sans", "Segoe UI", sans-serif;

  --wrap: 1180px;
  --radius-lg: 26px;
  --radius-md: 16px;

  --shadow-soft: 0 18px 40px -22px rgba(18, 54, 38, 0.45);
}

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

html{ scroll-behavior: smooth; }

@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;
  }
}

body{
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3{
  font-family: var(--font-display);
  color: var(--green-900);
  line-height: 1.12;
  margin: 0 0 0.5em;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h2{ font-size: clamp(1.9rem, 3.2vw, 2.7rem); }
h3{ font-size: 1.3rem; }

p{ margin: 0 0 1em; max-width: 62ch; }

a{ color: inherit; }

.wrap{
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

.skip-link{
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--green-900);
  color: var(--white);
  padding: 12px 18px;
  border-radius: 8px;
  z-index: 999;
}
.skip-link:focus{ left: 20px; top: 20px; }

:focus-visible{
  outline: 3px solid var(--coral-500);
  outline-offset: 3px;
}

.tag{
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--coral-700);
  background: rgba(225, 80, 56, 0.1);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 18px;
}
.tag-on-dark{
  color: var(--gold-300);
  background: rgba(247, 203, 128, 0.14);
}

.section-lead{
  font-size: 1.08rem;
  color: #4A4638;
  max-width: 56ch;
}

/* ---------- Buttons ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  border: 2px solid transparent;
}
.btn-primary{
  background: var(--coral-500);
  color: var(--white);
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover{
  background: var(--coral-700);
  transform: translateY(-2px);
}
.btn-ghost{
  border-color: rgba(255,255,255,0.7);
  color: var(--white);
}
.btn-ghost:hover{
  background: rgba(255,255,255,0.14);
  transform: translateY(-2px);
}
.btn-block{ width: 100%; margin-top: 8px; }

.text-link{
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  color: var(--coral-700);
  text-decoration: none;
  border-bottom: 2px solid var(--coral-500);
  padding-bottom: 2px;
}

/* =========================================================
   Header
   ========================================================= */
.site-header{
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 243, 226, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(18, 54, 38, 0.08);
}
.header-inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  transition: padding 0.25s ease;
}
.site-header.is-scrolled{
  background: rgba(251, 243, 226, 0.97);
  box-shadow: 0 8px 24px -18px rgba(18,54,38,0.5);
}
.site-header.is-scrolled .header-inner{
  padding-top: 9px;
  padding-bottom: 9px;
}
.brand{
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--green-900);
}
.brand-mark{
  color: var(--coral-500);
  display: flex;
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(18,54,38,0.18);
}
.brand-mark img{ width: 100%; height: 100%; object-fit: cover; }
.brand-footer .brand-mark{ width: 40px; height: 40px; }
.brand-text{
  display: flex;
  flex-direction: column;
  font-size: 0.78rem;
  font-weight: 500;
  color: #5B5644;
  line-height: 1.2;
}
.brand-text strong{
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--green-900);
}

.main-nav{
  display: flex;
  align-items: center;
  gap: 30px;
}
.main-nav a{
  text-decoration: none;
  font-weight: 500;
  font-size: 0.96rem;
  color: var(--ink);
  position: relative;
}
.main-nav a:not(.nav-cta)::after{
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--coral-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.main-nav a:not(.nav-cta):hover::after{ transform: scaleX(1); }
.main-nav a.is-active:not(.nav-cta){ color: var(--coral-700); }
.main-nav a.is-active:not(.nav-cta)::after{ transform: scaleX(1); }
.nav-cta{
  background: var(--green-900);
  color: var(--white) !important;
  padding: 10px 20px;
  border-radius: 100px;
  font-weight: 600 !important;
}
.nav-cta:hover{ background: var(--coral-500); }

.nav-toggle{
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span{
  height: 2px;
  background: var(--green-900);
  border-radius: 2px;
}

/* =========================================================
   Hero
   ========================================================= */
.hero{
  position: relative;
  overflow: hidden;
  min-height: 88vh;
  display: flex;
  align-items: center;
  color: var(--white);
}
.hero-media{
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
}
.hero-media-tint{
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(18,54,38,0.94) 24%, rgba(18,54,38,0.62) 52%, rgba(18,54,38,0.25) 78%),
    linear-gradient(0deg, rgba(18,54,38,0.55), transparent 45%);
}
.hero-grid{
  position: relative;
  z-index: 1;
  padding-top: 90px;
  padding-bottom: 130px;
}
.hero-copy{ max-width: 640px; }
.hero-kicker{
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold-300);
  margin-bottom: 14px;
  font-size: 0.95rem;
}
.hero h1{
  color: var(--white);
  font-size: clamp(2.5rem, 5.4vw, 4.1rem);
  font-weight: 600;
}
.hero h1 em{
  font-style: italic;
  color: var(--gold-300);
}
.hero-lead{
  font-size: 1.18rem;
  color: rgba(255,253,248,0.88);
  max-width: 50ch;
}
.hero-actions{
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.edge{
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  width: 100%;
  height: 70px;
  z-index: 1;
}
.edge path{ fill: var(--cream); }

/* =========================================================
   Generic section rhythm
   ========================================================= */
.section{ padding: 100px 0; }

.two-col{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  align-items: center;
}

/* ---------- Nosotros ---------- */
.pinned-photo{
  position: relative;
  background: var(--white);
  padding: 14px 14px 46px;
  border-radius: 4px;
  box-shadow: var(--shadow-soft);
  transform: rotate(-3deg);
  max-width: 440px;
  margin: 0 auto;
}
.pinned-photo img{
  border-radius: 2px;
  aspect-ratio: 4/5;
  object-fit: cover;
}
.pinned-photo::before{
  content: "";
  position: absolute;
  top: -12px; left: 50%;
  width: 26px; height: 26px;
  background: var(--coral-500);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 6px 10px rgba(0,0,0,0.25);
}
.col-text h2{ margin-bottom: 0.45em; }

/* ---------- Mision / Vision ---------- */
.mv{
  background: var(--green-900);
  color: var(--cream);
  position: relative;
}
.mv-title{
  color: var(--white);
  max-width: 16ch;
  margin-bottom: 50px;
}
.mv-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px;
}
.mv-card{
  background: rgba(255,253,248,0.06);
  border: 1px solid rgba(247,203,128,0.22);
  border-radius: var(--radius-lg);
  padding: 40px;
}
.mv-icon{ width: 40px; height: 40px; color: var(--gold-500); margin-bottom: 18px; }
.mv-card h3{ color: var(--white); }
.mv-card p{ color: rgba(251,243,226,0.82); max-width: none; }

/* ---------- Programas ---------- */
.programas .section-lead{ margin-bottom: 50px; }
.cards{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}
.card{
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.card-media{ aspect-ratio: 4/3; overflow: hidden; }
.card-media img{ width: 100%; height: 100%; object-fit: cover; }
.card h3, .card p{ padding-left: 26px; padding-right: 26px; }
.card h3{ margin-top: 24px; }
.card p{ margin-bottom: 26px; max-width: none; color: #57523F; }

/* ---------- Quote band ---------- */
.quote-band{
  background: var(--gold-300);
  padding: 80px 0;
  text-align: center;
}
.quote-text{
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--green-900);
  max-width: 22ch;
  margin: 0 auto 18px;
}
.quote-cite{
  font-weight: 600;
  color: var(--coral-700);
  margin: 0;
}

/* ---------- Galeria / corkboard ---------- */
.galeria{
  background:
    radial-gradient(circle at 1px 1px, rgba(18,54,38,0.07) 1.4px, transparent 0) 0 0/26px 26px,
    var(--cream-soft);
}
.corkboard{
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
  margin-top: 40px;
}
.pin{
  margin: 0;
  background: var(--white);
  padding: 10px 10px 34px;
  box-shadow: var(--shadow-soft);
  position: relative;
}
.pin img{ aspect-ratio: 3/4; object-fit: cover; }
.pin figcaption{
  position: absolute;
  bottom: 10px; left: 10px; right: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #6B6650;
  text-align: center;
}
.pin::before{
  content: "";
  position: absolute;
  top: -10px; left: 50%;
  width: 20px; height: 20px;
  background: var(--coral-500);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 5px 8px rgba(0,0,0,0.22);
}
.pin-1{ transform: rotate(-4deg); }
.pin-2{ transform: rotate(3deg); margin-top: 26px; }
.pin-3{ transform: rotate(-2deg); }
.pin-4{ transform: rotate(4deg); margin-top: 14px; }
.pin-5{ transform: rotate(-3deg); margin-top: 6px; }

/* ---------- Como ayudar ---------- */
.ayudar .section-lead{ margin-bottom: 50px; }
.help-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.help-card{
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 38px 32px;
  box-shadow: var(--shadow-soft);
}
.help-card-accent{
  background: var(--green-900);
  color: var(--cream);
}
.help-card-accent h3{ color: var(--white); }
.help-icon{ width: 38px; height: 38px; color: var(--coral-500); margin-bottom: 16px; }
.help-card-accent .help-icon{ color: var(--gold-500); }
.help-card p{ color: #57523F; }
.help-card-accent p{ color: rgba(251,243,226,0.85); }
.bank-detail{
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(247,203,128,0.3);
  font-size: 0.95rem;
  color: var(--gold-300) !important;
}
.bank-detail span{ font-weight: 700; letter-spacing: 0.02em; }

/* ---------- Videos ---------- */
.videos .section-lead{ margin-bottom: 40px; }
.video-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.video-frame{
  position: relative;
  padding-top: 56.25%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: var(--ink);
}
.video-frame iframe{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Contacto ---------- */
.contacto{
  background: var(--green-900);
  color: var(--cream);
}
.contacto h2{ color: var(--white); }
.contacto .col-text p{ color: rgba(251,243,226,0.82); }
.contact-grid{ align-items: start; }
.col-contact{
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.contact-row{
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255,253,248,0.06);
  border: 1px solid rgba(247,203,128,0.2);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  text-decoration: none;
  color: var(--cream);
  transition: background 0.18s ease, transform 0.18s ease;
}
.contact-row:hover{
  background: rgba(247,203,128,0.12);
  transform: translateX(4px);
}
.contact-row svg{ width: 24px; height: 24px; flex-shrink: 0; color: var(--gold-500); }
.contact-row span{ display: flex; flex-direction: column; font-size: 0.98rem; }
.contact-row strong{ font-size: 0.78rem; font-weight: 600; color: var(--gold-300); text-transform: none; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer{
  background: var(--ink);
  color: rgba(251,243,226,0.7);
  padding: 56px 0 34px;
}
.footer-inner{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.brand-footer .brand-mark{ color: var(--gold-500); }
.brand-footer .brand-text{ color: rgba(251,243,226,0.65); }
.brand-footer .brand-text strong{ color: var(--white); }
.footer-mission{ max-width: 46ch; font-size: 0.95rem; }
.footer-copy{ font-size: 0.85rem; margin: 0; color: rgba(251,243,226,0.45); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 980px){
  .two-col{ grid-template-columns: 1fr; gap: 44px; }
  .col-media{ order: -1; }
  .mv-grid, .cards, .help-grid{ grid-template-columns: 1fr 1fr; }
  .corkboard{ grid-template-columns: repeat(3, 1fr); }
  .pin{ margin-top: 0 !important; }
  .video-grid{ grid-template-columns: 1fr; }
}

/* =========================================================
   Interactividad: reveal on scroll
   ========================================================= */
[data-reveal]{
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  transition-delay: calc(var(--reveal-delay, 0) * 90ms);
}
[data-reveal="left"]{ transform: translateX(-32px); }
[data-reveal="right"]{ transform: translateX(32px); }
[data-reveal].is-visible{
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce){
  [data-reveal]{ opacity: 1; transform: none; transition: none; }
}

/* Clickable media affordance */
.lightbox-trigger{ cursor: zoom-in; position: relative; }
.lightbox-trigger:focus-visible{ outline-offset: 4px; }
.card-media.lightbox-trigger, .pinned-photo.lightbox-trigger, .pin.lightbox-trigger img{
  transition: transform 0.4s ease;
}
.card:hover .card-media img, .lightbox-trigger:hover img, .lightbox-trigger:focus-visible img{
  transform: scale(1.05);
}
.card-media img{ transition: transform 0.5s ease; }
.pin img{ transition: transform 0.35s ease; }
.pin:hover img, .pin:focus-visible img{ transform: scale(1.06); }
.card, .help-card, .mv-card{ transition: transform 0.3s ease, box-shadow 0.3s ease; }
.card:hover, .help-card:hover{
  transform: translateY(-6px);
  box-shadow: 0 26px 46px -22px rgba(18,54,38,0.5);
}

/* =========================================================
   Lightbox
   ========================================================= */
.lightbox{
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(18, 20, 15, 0.88);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.lightbox.is-open{ opacity: 1; visibility: visible; }
.lightbox-content{
  margin: 0;
  max-width: min(88vw, 780px);
  max-height: 84vh;
  transform: scale(0.92);
  transition: transform 0.25s ease;
}
.lightbox.is-open .lightbox-content{ transform: scale(1); }
.lightbox-content img{
  max-height: 74vh;
  width: auto;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
}
.lightbox-content figcaption{
  color: var(--cream);
  text-align: center;
  margin-top: 16px;
  font-weight: 500;
}
.lightbox-close{
  position: absolute;
  top: 24px; right: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,253,248,0.12);
  border: 1px solid rgba(255,253,248,0.3);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}
.lightbox-close:hover{ background: rgba(255,253,248,0.22); }

/* =========================================================
   Back to top
   ========================================================= */
.to-top{
  position: fixed;
  right: 24px; bottom: 24px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--green-900);
  color: var(--gold-300);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background 0.2s ease;
  z-index: 90;
}
.to-top.is-visible{ opacity: 1; visibility: visible; transform: none; }
.to-top:hover{ background: var(--coral-500); color: var(--white); }

/* =========================================================
   Scroll progress bar
   ========================================================= */
.progress-bar{
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--coral-500), var(--gold-500));
  z-index: 200;
  transition: width 0.1s linear;
}

@media (max-width: 760px){
  .main-nav{
    position: fixed;
    top: 72px; left: 0; right: 0;
    background: var(--cream);
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 18px 28px 28px;
    border-bottom: 1px solid rgba(18,54,38,0.1);
    transform: translateY(-140%);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }
  .main-nav.is-open{ transform: translateY(0); opacity: 1; }
  .main-nav a{ padding: 10px 0; width: 100%; }
  .nav-cta{ width: fit-content; margin-top: 8px; }
  .nav-toggle{ display: flex; }

  .section{ padding: 70px 0; }
  .mv-grid, .cards, .help-grid{ grid-template-columns: 1fr; }
  .corkboard{ grid-template-columns: repeat(2, 1fr); }
  .hero{ min-height: auto; }
  .hero-grid{ padding-top: 60px; padding-bottom: 90px; }
}
