:root {
  --primary: #000000;
  --primary-container: #3b3b3b;
  --accent-emerald: #2ecc71;
  --accent-emerald-dark: #27b765;
  --surface: #f9f9f9;
  --surface-low: #f3f3f4;
  --surface-lowest: #ffffff;
  --surface-high: #e8e8e8;
  --outline-variant: #c6c6c6;
  --on-surface: #1a1c1c;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--on-surface);
  background: #f3f3f3;
  overflow-x: hidden;
}

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

.hero-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.editorial-display {
  font-size: clamp(2.4rem, 4vw, 3.9rem);
  line-height: 0.96;
  letter-spacing: -0.02em;
}

.eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.brand-icon-wrap {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-icon-img {
  width: 2.05rem;
  height: 1.35rem;
  object-fit: contain;
}

.tonal-lift {
  background: var(--surface-lowest);
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-container));
  color: #ffffff;
  transition:
    transform 180ms ease,
    filter 180ms ease;
}

.primary-btn:hover {
  filter: brightness(1.12);
}

.primary-btn:active {
  transform: scale(0.97);
}

.secondary-btn {
  background: transparent;
  border: 1px solid rgba(119, 119, 119, 0.2);
  color: var(--on-surface);
  transition: background-color 180ms ease;
}

.secondary-btn:hover {
  background: var(--surface-high);
}

.tertiary-link {
  position: relative;
  text-decoration: none;
  font-weight: 700;
}

.tertiary-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--primary);
  transform: translateX(-50%);
  transition: width 200ms ease;
}

.tertiary-link:hover::after,
.tertiary-link:focus-visible::after {
  width: 100%;
}

.nav-link {
  position: relative;
  color: rgba(26, 28, 28, 0.72);
  transition: color 180ms ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: #000000;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.7rem;
  width: 0;
  height: 4px;
  border-radius: 999px;
  background: #000000;
  transform: translateX(-50%);
  transition: width 180ms ease;
}

.nav-link.is-active::after,
.nav-link:hover::after {
  width: 4px;
}

.bg-grain {
  position: relative;
}

.bg-grain::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    rgba(0, 0, 0, 0.03) 0.5px,
    transparent 0.5px
  );
  background-size: 3px 3px;
  pointer-events: none;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 480ms ease,
    transform 480ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger .reveal:nth-child(2) {
  transition-delay: 80ms;
}

.stagger .reveal:nth-child(3) {
  transition-delay: 140ms;
}

.stagger .reveal:nth-child(4) {
  transition-delay: 200ms;
}

.progress-bridge {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(198, 198, 198, 0.65) 0%,
    rgba(26, 28, 28, 0.2) 100%
  );
  overflow: hidden;
}

.progress-bridge::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 0;
  height: 1px;
  background: #000000;
  transform: translateY(-50%);
  transition:
    width 700ms ease,
    height 700ms ease;
}

.progress-bridge.is-active::before {
  width: 100%;
  height: 4px;
}

.story-modal[hidden] {
  display: none;
}

.story-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  padding: 1.25rem;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.48);
}

.story-modal-panel {
  width: min(700px, 95vw);
  max-height: 85vh;
  overflow: auto;
}

.modal-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(18px);
  color: #000000;
  border-radius: 0.25rem;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}

.modal-close-button:hover,
.modal-close-button:focus-visible {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
}

.modal-close-button:active {
  transform: scale(0.97);
}

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 260ms ease;
}

.mobile-panel.is-open {
  max-height: 320px;
}

.faq-item button[aria-expanded="true"] + .faq-answer {
  grid-template-rows: 1fr;
}

.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 220ms ease;
}

.faq-answer > div {
  overflow: hidden;
}

.site-header {
  transition:
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04);
}

[data-blur-target] {
  transition: filter 220ms ease, transform 220ms ease, opacity 220ms ease;
}

[data-blur-target].is-blurred {
  filter: blur(8px);
  transform: scale(0.995);
  pointer-events: none;
  user-select: none;
}

.footer-link-button {
  color: inherit;
  font: inherit;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.footer-link-button:hover,
.footer-link-button:focus-visible {
  text-decoration: underline;
}

.contact-input {
  border: 0;
  border-radius: 25px;
  color: #000000;
  outline: none;
}

.contact-input::placeholder {
  color: #757575;
  opacity: 1;
}

.contact-input:focus {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12);
}

.contact-submit {
  border-radius: 25px;
  background: #000000;
  color: #ffffff;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.contact-submit:hover {
  opacity: 0.92;
}

.contact-submit:active {
  transform: scale(0.98);
}

.cta-emerald {
  background: var(--accent-emerald) !important;
  color: #ffffff !important;
  border: 1px solid var(--accent-emerald) !important;
}

.cta-emerald:hover,
.cta-emerald:focus-visible {
  background: var(--accent-emerald-dark) !important;
  border-color: var(--accent-emerald-dark) !important;
  color: #ffffff !important;
}

.impact-accent {
  color: var(--accent-emerald) !important;
}

.bridge-icon {
  color: var(--accent-emerald);
}

input,
textarea,
select {
  border-radius: 25px;
  color: #000000;
}

button,
a.primary-btn,
a.secondary-btn,
a.contact-submit,
.primary-btn,
.secondary-btn,
.contact-submit,
.back-to-top,
[data-mobile-toggle],
[data-story-close] {
  border-radius: 25px !important;
}

@media (max-width: 1023px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .brand-icon-wrap {
    width: 2.1rem;
    height: 2.1rem;
  }

  .brand-icon-img {
    width: 1.8rem;
    height: 1.15rem;
  }

  .editorial-display {
    font-size: clamp(2rem, 8.5vw, 2.6rem);
    line-height: 1;
  }

  #inicio {
    min-height: auto;
    padding-top: 6.5rem;
    padding-bottom: 3.75rem;
  }

  .hero-grid {
    gap: 1.25rem;
  }

  #inicio .bg-grain > img {
    min-height: 270px !important;
  }

  #inicio .bg-grain > .glass {
    position: static;
    margin: 0.75rem;
    max-width: none;
  }

  #donar {
    display: grid;
    gap: 0.65rem;
  }

  #donar > a {
    width: 100%;
    text-align: center;
  }

  section[class*="py-24"] {
    padding-top: 3.5rem !important;
    padding-bottom: 3.5rem !important;
  }

  section h2.text-4xl {
    font-size: 1.8rem !important;
    line-height: 1.1;
  }

  #impacto .text-5xl {
    font-size: 2.15rem !important;
    line-height: 1.05;
  }

  #historias .min-h-\[240px\] {
    min-height: auto;
  }

  #historias .min-h-\[240px\] img {
    height: 220px;
    width: 100%;
  }

  #contacto .space-y-5 {
    gap: 0.9rem;
  }

  #contacto form,
  #contacto .bg-black {
    padding: 1.1rem;
  }

  .story-modal {
    padding: 0.85rem;
  }

  .story-modal-panel {
    width: 100%;
    max-height: 88vh;
    border-radius: 1rem;
  }

  .back-to-top {
    right: 0.75rem;
    bottom: 0.75rem;
  }
}

@media (max-width: 420px) {
  .eyebrow {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
  }

  #impacto .eyebrow {
    letter-spacing: 0.08em;
  }

  .modal-close-button {
    width: 2rem;
    height: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
