/* ACUSMED — hoja de estilos principal */
:root {
  --green: #8aa64a;
  --green-dark: #5f7a2a;
  --green-deep: #2f3d18;
  --green-light: #c5db8f;
  --green-pale: #eef4df;
  --ink: #1f261a;
  --muted: #5b6352;
  --bg: #ffffff;
  --bg-soft: #f6f8f0;
  --line: #dfe5d2;
  --radius: 14px;
  --maxw: 1160px;
  --font-head: "Outfit", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.075rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-dark); text-underline-offset: 3px; }
a:hover { color: var(--green-deep); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .6em; color: var(--green-deep); letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 600; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 600; }
h3 { font-size: 1.3rem; font-weight: 600; }
p { margin: 0 0 1em; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: #fff; padding: 8px 12px; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.brand img { height: 30px; width: auto; }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; cursor: pointer; color: var(--green-deep);
}
.nav-toggle svg { display: block; }
.main-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav li { position: relative; }
.main-nav a {
  display: block; padding: 10px 12px; border-radius: 8px;
  font-family: var(--font-head); font-weight: 500; font-size: .95rem;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--green-dark); background: var(--green-pale); }
.main-nav .sub {
  list-style: none; margin: 0; padding: 8px;
  position: absolute; top: 100%; left: 0; min-width: 260px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(31,38,26,.12);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .15s, transform .15s, visibility .15s;
}
.main-nav li:hover > .sub, .main-nav li:focus-within > .sub { opacity: 1; visibility: visible; transform: none; }
.main-nav .sub a { font-weight: 400; white-space: normal; }
.has-sub > a::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-3px) rotate(45deg); }

@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .main-nav { position: fixed; inset: 76px 0 0 0; background: #fff; overflow-y: auto; display: none; padding: 12px 20px 40px; }
  .main-nav.open { display: block; }
  .main-nav > ul { flex-direction: column; }
  .main-nav a { font-size: 1.1rem; padding: 12px 8px; }
  .main-nav .sub { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; border-left: 2px solid var(--green-light); border-radius: 0; margin-left: 10px; padding: 0 0 8px; min-width: 0; }
  .main-nav .sub a { font-size: 1rem; padding: 8px 12px; }
  .has-sub > a::after { display: none; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.hero-inner { position: relative; z-index: 1; padding: clamp(28px, 4vw, 52px) 0 clamp(28px, 3.5vw, 48px); max-width: 720px; }
.eyebrow { font-family: var(--font-head); font-weight: 500; text-transform: uppercase; letter-spacing: .14em; font-size: .82rem; color: var(--green-dark); margin-bottom: 16px; display: block; }
.hero p.lead { font-size: 1.25rem; color: var(--muted); max-width: 600px; }
.hero-waves { position: absolute; right: -120px; top: 50%; transform: translateY(-50%); width: 640px; height: 640px; color: var(--green); opacity: .9; pointer-events: none; }
.hero-waves circle { fill: none; stroke: currentColor; }
@media (max-width: 760px) { .hero-waves { right: -320px; opacity: .35; } }

.page-hero .hero-inner { padding: clamp(48px, 7vw, 88px) 0 clamp(40px, 6vw, 72px); }
.page-hero h1 { margin-bottom: .3em; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 0;
  background: var(--green-dark); color: #fff; text-decoration: none;
  font-family: var(--font-head); font-weight: 500; font-size: 1rem;
  transition: background .15s;
}
.btn:hover { background: var(--green-deep); color: #fff; }
.btn.ghost { background: transparent; color: var(--green-deep); border: 1.5px solid var(--green); }
.btn.ghost:hover { background: var(--green-pale); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- Secciones ---------- */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section.alt { background: var(--bg-soft); }
.section + .section:not(.alt) { border-top: 1px solid var(--line); }
.section-head { max-width: 760px; margin-bottom: 40px; }
.section-head p { color: var(--muted); font-size: 1.15rem; }
.prose { max-width: 760px; }
.prose ul { padding-left: 1.2em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--green); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.split.wide-left { grid-template-columns: 3fr 2fr; }
@media (max-width: 860px) { .split, .split.wide-left { grid-template-columns: 1fr; } }

/* Tarjetas */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; gap: 8px;
  text-decoration: none; color: inherit; transition: border-color .15s, transform .15s, box-shadow .15s;
}
a.card:hover { border-color: var(--green); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(31,38,26,.08); color: inherit; }
.card h3 { margin-bottom: 4px; }
.card p { color: var(--muted); margin: 0; }
.card .more { margin-top: auto; padding-top: 12px; font-family: var(--font-head); font-weight: 500; color: var(--green-dark); }
.icon { width: 48px; height: 48px; border-radius: 12px; background: var(--green-pale); color: var(--green-dark); display: grid; place-items: center; margin-bottom: 8px; }
.icon svg { width: 26px; height: 26px; }

/* Datos rápidos */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin: 32px 0 0; }
.fact { border-top: 3px solid var(--green); padding-top: 14px; }
.fact strong { display: block; font-family: var(--font-head); font-size: 2rem; font-weight: 600; color: var(--green-deep); line-height: 1.1; }
.fact span { color: var(--muted); }

/* Listas con marca */
.check-list { list-style: none; padding: 0; margin: 0 0 1.2em; display: grid; gap: 10px; }
.check-list li { position: relative; padding-left: 32px; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: .35em; width: 18px; height: 18px; border-radius: 50%;
  background: var(--green-pale) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f7a2a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/12px no-repeat;
}

/* Bloques VMV */
.vmv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .vmv { grid-template-columns: 1fr; } }
.vmv .card h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .12em; color: var(--green-dark); }
.vmv .card p { color: var(--ink); }

/* Acreditaciones */
.accred { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.accred li { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; }
.accred li strong { color: var(--green-deep); }
.accred .dl { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; font-weight: 600; white-space: nowrap; }

/* Premios */
.awards { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.awards li { display: grid; grid-template-columns: 72px 1fr; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.awards li:first-child { border-top: 1px solid var(--line); }
.awards .year { font-family: var(--font-head); font-weight: 600; font-size: 1.25rem; color: var(--green); }
.awards strong { display: block; color: var(--green-deep); }
.awards span { color: var(--muted); }

.feature {
  border-radius: var(--radius); overflow: hidden; background: var(--green-deep); color: #e8f0d5;
  display: grid; grid-template-columns: 1.1fr 1fr;
}
.feature img { width: 100%; height: 100%; object-fit: cover; min-height: 260px; }
.feature .body { padding: clamp(28px, 4vw, 48px); }
.feature h2, .feature h3 { color: #fff; }
.feature .eyebrow { color: var(--green-light); }
.feature .btn { background: var(--green-light); color: var(--green-deep); }
.feature .btn:hover { background: #fff; }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; } }

/* Proceso (Acústica) */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; counter-reset: s; }
.steps li { counter-increment: s; position: relative; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px 18px; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--green); color: #fff; font-family: var(--font-head); font-weight: 600; margin-bottom: 12px; }
.steps strong { display: block; font-family: var(--font-head); color: var(--green-deep); line-height: 1.25; }
.steps span { color: var(--muted); font-size: .95rem; }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* Sub‑navegación de sección */
.subnav { position: sticky; top: 76px; z-index: 40; background: #fff; border-bottom: 1px solid var(--line); }
.subnav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.subnav ul::-webkit-scrollbar { display: none; }
.subnav a { display: block; padding: 14px 14px; white-space: nowrap; text-decoration: none; color: var(--muted); font-family: var(--font-head); font-size: .95rem; border-bottom: 2px solid transparent; }
.subnav a:hover, .subnav a.active { color: var(--green-deep); border-bottom-color: var(--green); }

/* Noticias */
.news-card { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.news-card img { width: 100%; height: 100%; object-fit: cover; }
.news-card .body { padding: clamp(24px, 4vw, 44px); }
.news-card time { color: var(--green-dark); font-family: var(--font-head); font-weight: 500; font-size: .9rem; }
.news-card + .news-card { margin-top: 32px; }
@media (max-width: 860px) { .news-card { grid-template-columns: 1fr; } }

/* Contacto */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-item { display: flex; gap: 16px; align-items: flex-start; padding: 20px 0; border-bottom: 1px solid var(--line); }
.contact-item .icon { margin: 0; flex: none; }
.contact-item h3 { font-size: 1rem; margin: 0 0 2px; }
.contact-item p { margin: 0; }
.map { border: 0; width: 100%; height: 100%; min-height: 360px; border-radius: var(--radius); background: var(--bg-soft); }

/* Placeholder pendiente */
.pending { border: 1.5px dashed var(--green); border-radius: 12px; padding: 18px 20px; background: var(--green-pale); color: var(--green-deep); font-size: .98rem; }

/* CTA */
.cta { background: var(--green-deep); color: #e8f0d5; border-radius: var(--radius); padding: clamp(32px, 5vw, 56px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.cta h2 { color: #fff; margin: 0; }
.cta p { margin: 6px 0 0; }
.cta .btn { background: var(--green-light); color: var(--green-deep); }
.cta .btn:hover { background: #fff; }

/* ---------- Pie ---------- */
.site-footer { background: #1b2312; color: #c9d3b8; padding: 64px 0 28px; margin-top: 0; font-size: .98rem; }
.site-footer a { color: #e3ecd0; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-logo { height: 26px; width: auto; margin-bottom: 16px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 48px; padding-top: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .88rem; color: #9aa68a; }

/* ---------- Animaciones de scroll (activadas por main.js) ---------- */
:root { --ease-out: cubic-bezier(.16, 1, .3, 1); }
.w { display: inline-block; overflow: hidden; vertical-align: bottom; padding: 0 .1em .14em .02em; margin: 0 -.1em -.14em -.02em; }
.w > span { display: inline-block; }

/* Bloques: suben, se enfocan y aparecen */
.anim .reveal {
  opacity: 0;
  transform: translate3d(0, 44px, 0);
  filter: blur(8px);
  transition: opacity 1s var(--ease-out), transform 1.2s var(--ease-out), filter 1s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.anim .reveal.in { opacity: 1; transform: none; filter: none; }

/* Titulares: cada palabra sube desde una máscara */
.anim .hero h1:not(.split-words) { opacity: 0; }
.anim .split-words .w > span {
  transform: translate3d(0, 110%, 0);
  transition: transform 1.1s var(--ease-out);
  transition-delay: calc(var(--wi) * 55ms + var(--d, 0s));
}
.anim .split-words.in .w > span { transform: none; }

/* Cabecera: el texto se aleja y las ondas crecen al hacer scroll */
.anim .hero .hero-inner {
  opacity: calc(1 - var(--h, 0) * 1.4);
  transform: translate3d(0, calc(var(--h, 0) * -80px), 0) scale(calc(1 - var(--h, 0) * .05));
  transform-origin: left center;
}
.anim .hero .hero-waves { transform: translateY(-50%) scale(calc(1 + var(--h, 0) * .35)) rotate(calc(var(--h, 0) * 12deg)); }

/* Imágenes destacadas: zoom de acercamiento ligado al scroll */
.anim [data-scroll="zoom"] { overflow: hidden; }
.anim [data-scroll="zoom"] img { transform: scale(calc(1.25 - var(--p, 1) * .25)); transform-origin: center; }
.anim [data-scroll="zoom"] .body { opacity: calc(var(--p, 1) * 1.6 - .3); transform: translate3d(0, calc((1 - var(--p, 1)) * 40px), 0); }

/* Bloque de contacto final: crece desde el centro */
.anim [data-scroll="grow"] {
  transform: scale(calc(.86 + var(--p, 1) * .14));
  opacity: calc(.2 + var(--p, 1) * .8);
  border-radius: calc(48px - var(--p, 1) * 34px);
}

/* Evita que imágenes o textos largos ensanchen las rejillas en móvil */
.split > *, .feature > *, .news-card > *, .contact-grid > *, .cards > *, .vmv > *, .facts > * { min-width: 0; }
html, body { overflow-x: clip; }

/* ---------- Ondas animadas (portada) ---------- */
.hero-waves .core { fill: currentColor; stroke: none; opacity: 0; }
.hero-waves .pulse { opacity: 0; stroke: var(--green-dark); }
@media (prefers-reduced-motion: no-preference) {
  .hero-waves.live .pulse {
    transform-box: fill-box; transform-origin: center;
    animation: wave-pulse 6s linear infinite;
    animation-delay: calc(var(--p) * -3s);
  }
  .hero-waves.live .ring {
    animation: wave-ring 3s ease-out infinite;
    animation-delay: calc(var(--i) * .578s);
  }
  .hero-waves.live .core {
    transform-box: fill-box; transform-origin: center;
    animation: wave-core 3s ease-in-out infinite;
  }
}
@keyframes wave-pulse {
  0%   { transform: scale(1);  opacity: 1; }
  70%  { opacity: .45; }
  100% { transform: scale(10); opacity: 0; }
}
@keyframes wave-ring {
  0%, 100% { stroke-opacity: .45; }
  6%       { stroke-opacity: 1; stroke: var(--green-dark); stroke-width: 3.5; }
  35%      { stroke-opacity: .45; }
}
@keyframes wave-core {
  0%, 100% { transform: scale(.7); opacity: .5; }
  6%       { transform: scale(1.5); opacity: 1; }
  40%      { transform: scale(.8); opacity: .6; }
}
.hero-waves { overflow: visible; }
.hero-inner { position: relative; z-index: 1; }
