/* BIOGASVAL · landing */

@font-face { font-family: "Sora"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/sora-400.woff2") format("woff2"); }
@font-face { font-family: "Wix Madefor Text"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/wix-madefor-text-400.woff2") format("woff2"); }
@font-face { font-family: "Wix Madefor Text"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/wix-madefor-text-500.woff2") format("woff2"); }
@font-face { font-family: "Wix Madefor Text"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/wix-madefor-text-600.woff2") format("woff2"); }

:root {
  --bv-color-surface: #fff;
  --bv-color-inverse: #fff;
  --bv-color-text: #1a1a1a;
  --bv-color-dark: #204938;
  --bv-color-secondary: #52665b;
  --bv-color-accent: #00c978;
  --bv-color-light: #9ce0bf;
  --bv-color-border: #d9e1db;
  --bv-color-soft: #f9f7f0;

  --bv-radius-24: 24px;
  --bv-radius-999: 999px;

  --font-display: "Sora", system-ui, sans-serif;
  --font-text: "Wix Madefor Text", system-ui, sans-serif;

  --container: 1248px;
  --gutter: clamp(20px, 6.67vw, 96px);
  --section-y: clamp(48px, 6vw, 64px);
  --header-h: 115px;
  --header-h-scrolled: 80px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-h-scrolled); }
body {
  margin: 0;
  /* The header is fixed, so its shrink on scroll never shifts the layout */
  padding-top: var(--header-h);
  background: var(--bv-color-surface);
  color: var(--bv-color-text);
  font: 400 16px/24px var(--font-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ol, ul, address { margin: 0; padding: 0; font-style: normal; }
ol, ul { list-style: none; }
a { color: inherit; text-decoration: none; }
hr.divider { border: 0; height: 1px; margin: 0; background: var(--bv-color-border); }

.container { width: min(var(--container), 100% - 2 * var(--gutter)); margin-inline: auto; }
.section { padding-block: var(--section-y); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 12px 20px; border-radius: var(--bv-radius-999); background: var(--bv-color-dark); color: #fff; transition: top .2s; }
.skip-link:focus { top: 16px; }
:focus-visible { outline: 2px solid var(--bv-color-accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- Type scale (Figma text styles) ---------- */
.label { font: 600 13px/20px var(--font-text); text-transform: uppercase; color: var(--bv-color-dark); }
.heading { font: 400 clamp(32px, 2.4vw + 12px, 42px)/1.238 var(--font-display); color: var(--bv-color-dark); }
.subheading { font: 400 clamp(22px, 1vw + 14px, 26px)/1.385 var(--font-display); color: var(--bv-color-dark); text-wrap: balance; }
.body { font-size: clamp(18px, .4vw + 15px, 20px); line-height: 1.5; color: var(--bv-color-text); }
.body--secondary, .small--secondary { color: var(--bv-color-secondary); }
.small { font-size: 16px; line-height: 24px; }
.amount { font: 400 clamp(36px, 2.6vw + 12px, 48px)/1.25 var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 16px 24px;
  border-radius: var(--bv-radius-999);
  font: 500 17px/24px var(--font-text);
  white-space: nowrap;
  transition: background-color .25s var(--ease), color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.btn__arrow, .link-arrow { display: inline-block; transition: transform .3s var(--ease); }
.btn:hover .btn__arrow, a:hover > .link-arrow { transform: translateX(4px); }
.btn:active { transform: scale(.97); }
.btn--accent { background: var(--bv-color-accent); color: var(--bv-color-text); }
.btn--accent:hover { background: var(--bv-color-light); }
.btn--light { background: var(--bv-color-surface); color: var(--bv-color-dark); }
.btn--light:hover { background: var(--bv-color-light); box-shadow: 0 12px 32px -12px rgb(6 23 17 / .5); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgb(255 255 255 / .9);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  transition: box-shadow .3s var(--ease);
}
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--bv-color-border), 0 8px 24px -16px rgb(32 73 56 / .35); }
.site-header__inner {
  display: flex; align-items: center; gap: 32px;
  height: var(--header-h);
  max-width: 1440px; margin-inline: auto;
  padding-inline: clamp(20px, 5.56vw, 80px);
  transition: height .3s var(--ease);
}
.site-header.is-scrolled .site-header__inner { height: var(--header-h-scrolled); }
.site-header__logo { margin-right: auto; flex-shrink: 0; }
.site-header__logo img { width: clamp(170px, 14vw + 40px, 244px); transition: width .3s var(--ease); }
.site-header.is-scrolled .site-header__logo img { width: clamp(150px, 10vw + 40px, 200px); }

.site-nav { display: flex; align-items: center; gap: 32px; font: 500 17px/24px var(--font-text); }
.site-nav__link { position: relative; padding-block: 16px; }
.site-nav__link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 10px; height: 2px;
  background: var(--bv-color-accent); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.site-nav__link:hover::after, .site-nav__link[aria-current="true"]::after { transform: scaleX(1); }

.nav-toggle { display: none; }

@media (max-width: 900px) {
  :root { --header-h: 76px; --header-h-scrolled: 64px; }
  .nav-toggle {
    display: grid; place-items: center;
    width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
    background: var(--bv-color-soft); color: var(--bv-color-dark); cursor: pointer;
  }
  .nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after {
    display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor;
    transition: transform .3s var(--ease), background-color .2s;
  }
  .nav-toggle__bar { position: relative; }
  .nav-toggle__bar::before, .nav-toggle__bar::after { content: ""; position: absolute; left: 0; }
  .nav-toggle__bar::before { transform: translateY(-6px); }
  .nav-toggle__bar::after { transform: translateY(6px); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar::after { transform: rotate(-45deg); }

  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px clamp(20px, 5.56vw, 80px) 24px;
    background: var(--bv-color-surface);
    box-shadow: 0 24px 32px -24px rgb(32 73 56 / .35);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility 0s .25s;
  }
  .site-nav.is-open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .site-nav__link { padding-block: 16px; border-bottom: 1px solid var(--bv-color-border); font-size: 20px; }
  .site-nav__link::after { display: none; }
  .site-nav .btn { margin-top: 20px; justify-content: center; }
}

/* ---------- Hero ---------- */
.hero { padding-inline: 24px; }
.hero__frame {
  position: relative; isolation: isolate; overflow: hidden;
  max-width: 1392px; min-height: 620px; margin-inline: auto;
  display: grid; place-items: center;
  border-radius: var(--bv-radius-24);
  background: var(--bv-color-dark);
}
.hero__img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.hero__frame::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgb(6 23 17 / .35); }
.hero__content {
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  padding: 64px clamp(20px, 5.56vw, 80px);
  color: var(--bv-color-inverse); text-align: center;
}
.hero__label { color: inherit; }
.hero__title {
  max-width: 1130px;
  font: 400 clamp(34px, 3.9vw + 8px, 64px)/1.1875 var(--font-display);
  letter-spacing: -.03em;
  text-wrap: balance;
}
.hero__lead { max-width: 820px; font-size: clamp(18px, .4vw + 15px, 20px); line-height: 1.5; }
.hero__caption { max-width: 1000px; opacity: .85; }

@media (max-width: 700px) {
  .hero { padding-inline: 12px; }
  .hero__frame { min-height: min(620px, 100svh - var(--header-h) - 12px); border-radius: 18px; }
  .hero__title br { display: none; }
  .hero__caption { font-size: 13px; line-height: 20px; }
}

/* ---------- Funding logos strip ---------- */
.funding-logos { padding-block: 32px; }
.funding-logos .container { display: flex; flex-direction: column; gap: 24px; }
.funding-logos__list { display: flex; align-items: center; gap: 48px; }
.funding-logos__list li { flex: 0 1 auto; min-width: 0; }
.funding-logos__biogas { padding: 8px 6px; }

@media (max-width: 1200px) {
  .funding-logos__list { flex-wrap: wrap; justify-content: center; gap: 28px 40px; }
  .funding-logos__list img { height: 48px; width: auto; }
  .funding-logos__biogas img { height: 40px; }
}
@media (max-width: 560px) {
  .funding-logos__list { gap: 24px 28px; }
  .funding-logos__list img { height: 40px; }
  .funding-logos__biogas img { height: 34px; }
}

/* ---------- El proyecto ---------- */
.project .container { display: flex; flex-direction: column; gap: 48px; }
.project__intro { display: grid; grid-template-columns: 520fr 648fr; gap: 80px; align-items: start; }
.project__heading { display: flex; flex-direction: column; gap: 16px; }
.project__text { display: flex; flex-direction: column; gap: 24px; }

.goals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.goal { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; position: relative; }
.goal::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, var(--bv-color-accent) 0 var(--line, 0%), var(--bv-color-border) var(--line, 0%));
  transition: --line .9s var(--ease);
}
.goal:hover { --line: 100%; }
.goal__num { color: var(--bv-color-dark); }
.goal .small { max-width: 366px; color: var(--bv-color-secondary); }

@property --line { syntax: "<percentage>"; inherits: true; initial-value: 0%; }

@media (max-width: 900px) {
  .project__intro { grid-template-columns: 1fr; gap: 24px; }
  .goals { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- Ayudas ---------- */
.funding { background: var(--bv-color-soft); }
.funding .container { display: flex; flex-direction: column; gap: 40px; }
.funding__head { display: grid; grid-template-columns: 680fr 520fr; gap: 48px; align-items: end; }

.grant {
  display: grid; grid-template-columns: 380fr 724fr; gap: 64px;
  padding: clamp(28px, 3vw, 40px);
  border-radius: var(--bv-radius-24);
  transition: translate .5s var(--ease), box-shadow .5s var(--ease);
}
.grant:hover { translate: 0 -4px; box-shadow: 0 24px 48px -28px rgb(32 73 56 / .45); }
.grant__amount, .grant__body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.grant--dark { background: var(--bv-color-dark); color: var(--bv-color-inverse); }
.grant--dark .subheading, .grant--dark .body { color: inherit; }
.grant--dark .grant__kicker, .grant--dark .grant__note { color: var(--bv-color-light); }
.grant--light { background: var(--bv-color-surface); }
.grant--light .amount { color: var(--bv-color-dark); }
.grant__logo { width: 260px; }

@media (max-width: 900px) {
  .funding__head { grid-template-columns: 1fr; gap: 16px; }
  .grant { grid-template-columns: 1fr; gap: 28px; }
  .grant__logo { width: 220px; }
}

/* ---------- Contacto ---------- */
.contact__inner { display: grid; grid-template-columns: 600fr 568fr; gap: 80px; align-items: center; }
.contact__heading { display: flex; flex-direction: column; gap: 16px; }
.contact__details { display: flex; flex-direction: column; gap: 16px; }
.contact__mail, .contact__phone { width: fit-content; color: var(--bv-color-dark); background: linear-gradient(var(--bv-color-accent), var(--bv-color-accent)) 0 100% / 0 2px no-repeat; transition: background-size .4s var(--ease); }
.contact__mail:hover, .contact__phone:hover { background-size: 100% 2px; }
.contact__mail { font: 400 clamp(21px, 1vw + 13px, 26px)/1.385 var(--font-display); overflow-wrap: anywhere; }
.contact__phone { font-size: 20px; line-height: 30px; }

@media (max-width: 900px) {
  .contact__inner { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- Footer ---------- */
.site-footer { padding-block: 32px; }
.site-footer .container { display: flex; flex-direction: column; gap: 24px; }
.site-footer__row { display: flex; align-items: center; gap: 48px; }
.site-footer__row img { margin-right: auto; }
.site-footer__link { font: 500 17px/24px var(--font-text); color: var(--bv-color-dark); }

@media (max-width: 700px) {
  .site-footer__row { flex-wrap: wrap; gap: 16px 32px; }
  .site-footer__row img { flex-basis: 100%; max-width: 200px; margin-bottom: 8px; }
}

@media (max-width: 1100px) { .br-desktop { display: none; } }

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes settle { from { transform: scale(1.12); } to { transform: scale(1); } }

@media (prefers-reduced-motion: no-preference) {
  .hero__img { animation: settle 2.4s var(--ease) both; }
  .hero [data-reveal] { animation: rise 1s var(--ease) both; }
  .hero [data-reveal]:nth-child(2) { animation-delay: .12s; }
  .hero [data-reveal]:nth-child(3) { animation-delay: .24s; }
  .hero [data-reveal]:nth-child(4) { animation-delay: .36s; }
  .hero [data-reveal]:nth-child(5) { animation-delay: .5s; }

  /* Scroll reveal: CSS scroll-driven animations where supported, no JS needed */
  @supports (animation-timeline: view()) {
    main > :not(.hero) [data-reveal] {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 70%;
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
