:root { --ink: #0d0e1d; --teal: #1da099; --grey: #f5f5f5; --wa: #25d366; --muted: rgba(13,14,29,.7); }
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body { font-family: Afacad, system-ui, sans-serif; color: var(--ink); line-height: 1.55; font-size: 18px; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.space { padding: 80px 0; }
.grey { background: var(--grey); }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; margin-bottom: 16px; }
.btn { display: inline-flex; gap: 10px; align-items: center; padding: 14px 24px; background: #fff; color: var(--ink); text-decoration: none; font-weight: 500; }
.btn:hover { background: var(--teal); color: #fff; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.dark:hover { background: var(--teal); }


/* hero */
.hero { position: relative; min-height: 100vh; min-height: 100svh; color: #fff; display: flex; align-items: center; overflow: hidden; background: var(--ink); }
.slide { position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.2s ease; will-change: opacity; }
/* La nueva imagen aparece encima mientras la anterior sigue visible debajo: sin oscurecer ni ver doble */
.slide.prev { opacity: 1; z-index: 1; transition: none; }
.slide.on { opacity: 1; z-index: 2; }
.slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(13,14,29,.8), rgba(13,14,29,.25)); }
.hero .wrap { position: relative; z-index: 2; padding-top: 120px; padding-bottom: 80px; }
.hero h1, .hero .h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.05; max-width: 14ch; margin: 0; }
.hero p { margin: 20px 0 32px; max-width: 52ch; font-size: 1.2rem; }

/* about */
.about { display: grid; gap: 48px; grid-template-columns: 1.1fr 1fr; align-items: center; }
.about img { width: 100%; height: clamp(320px, calc(100svh - 200px), 640px); object-fit: cover; object-position: center top; }
.mv { display: grid; gap: 20px; margin: 24px 0 32px; }
.mv h3 { color: var(--teal); }
.years { font-size: 4rem; font-weight: 700; color: var(--teal); line-height: 1; }

/* services */
.head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.svc { position: relative; height: clamp(280px, calc(100svh - 280px), 460px); overflow: hidden; color: #fff; text-decoration: none; display: flex; align-items: end; }
.svc img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.svc:hover img { transform: scale(1.05); }
.svc::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(13,14,29,.9)); }
.svc span { position: relative; z-index: 1; padding: 24px; font-size: 1.4rem; font-weight: 600; line-height: 1.15; }

/* funfacts */
.facts { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); text-align: center; }
.facts b { display: block; font-size: 3.6rem; color: var(--teal); line-height: 1; }
.facts h3 { margin: 8px 0; }
.facts p { color: var(--muted); }

/* cta */
.cta { position: relative; color: #fff; text-align: center; background: var(--ink) center/cover; }
.cta::before { content: ""; position: absolute; inset: 0; background: rgba(13,14,29,.7); }
.cta .wrap { position: relative; }
.cta p { max-width: 56ch; margin: 0 auto 28px; }

/* clients */
.marquee { overflow: hidden; margin-top: 48px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.track { display: flex; align-items: center; gap: 64px; width: max-content; animation: scroll 45s linear infinite; }
.marquee:hover .track { animation-play-state: paused; }
.track img { height: 72px; width: auto; max-width: 180px; object-fit: contain; filter: grayscale(1); opacity: .8; transition: filter .3s, opacity .3s; }
.track img:hover { filter: none; opacity: 1; }
@keyframes scroll { to { transform: translateX(calc(-50% - 32px)); } }
@media (prefers-reduced-motion: reduce) { .track { animation: none; } .marquee { overflow-x: auto; } }

/* projects */
.proj { position: relative; display: block; height: clamp(220px, calc(100svh - 360px), 340px); overflow: hidden; color: #fff; text-decoration: none; transition: transform .35s ease, box-shadow .35s ease; }
.proj img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.proj .tag { position: absolute; left: 0; bottom: 0; background: var(--teal); color: #fff; padding: 8px 16px; font-weight: 600; transition: transform .35s ease, opacity .35s ease; }
.proj .pov { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 22px; background: linear-gradient(transparent 20%, rgba(13,14,29,.92)); opacity: 0; transform: translateY(24px); transition: opacity .4s ease, transform .4s ease; }
.proj .pov b { font-size: 1.3rem; line-height: 1.15; }
.proj .pov p { font-size: .95rem; opacity: .9; }
.proj .pov em { font-style: normal; font-weight: 600; color: var(--teal); }
.proj:hover, .proj:focus-visible { transform: translateY(-6px); box-shadow: 0 18px 36px rgba(13,14,29,.28); }
.proj:hover img { transform: scale(1.1); }
.proj:hover .pov, .proj:focus-visible .pov { opacity: 1; transform: none; }
.proj:hover .tag { transform: translateY(100%); opacity: 0; }
.js .proj.reveal.in { transition: opacity .6s ease var(--d, 0s), transform .35s ease, box-shadow .35s ease; }

/* testimonial */
.quote { display: grid; grid-template-columns: 160px 1fr; gap: 32px; align-items: center; max-width: 860px; }
.quote img { width: 160px; height: 160px; object-fit: cover; border-radius: 50%; }
.quote blockquote { font-size: 1.5rem; line-height: 1.3; }
.quote cite { display: block; margin-top: 16px; font-style: normal; color: var(--muted); }

/* blog */
.post { background: #fff; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.post small { color: var(--teal); font-weight: 600; }
.post time { color: var(--muted); font-size: .9rem; }
.post h3 { font-size: 1.15rem; line-height: 1.3; }

/* contact */
.contact { display: grid; gap: 48px; grid-template-columns: 1fr 1fr; }
.contact dl { display: grid; gap: 4px; margin: 24px 0; }
.contact dt { font-weight: 700; margin-top: 12px; }
form { display: grid; gap: 14px; }
input, textarea { font: inherit; padding: 12px 14px; border: 1px solid #cfd2d8; background: #fff; width: 100%; }
textarea { min-height: 130px; resize: vertical; }
button.btn { border: 0; cursor: pointer; font: inherit; font-weight: 500; justify-self: start; }

footer { background: var(--ink); color: rgba(255,255,255,.75); padding: 28px 0; font-size: .95rem; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a { text-decoration: none; margin-left: 16px; }
footer a:hover { color: var(--teal); }

.wa { position: fixed; right: 20px; bottom: 20px; width: 56px; height: 56px; border-radius: 50%; background: var(--wa); display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0,0,0,.3); z-index: 30; }
.wa svg { width: 30px; height: 30px; fill: #fff; }

/* Scroll de sección en sección (solo pantallas grandes, donde cada sección cabe completa) */
@media (min-width: 801px) and (min-height: 760px) {
  html { scroll-snap-type: y mandatory; }
  main > section.page-hero { min-height: 100svh; justify-content: end; }
  main > section { min-height: 100svh; scroll-snap-align: start; display: flex; flex-direction: column; justify-content: center; }
  main > section > .wrap { width: 100%; }
  footer { scroll-snap-align: end; }
}
@media (max-width: 800px) {
  html { scroll-snap-type: y proximity; }
  main > section { scroll-snap-align: start; }
  .about img { height: 360px; }
  .svc { height: 320px; }
  .space { padding: 56px 0; }
  .about, .contact { grid-template-columns: 1fr; }
  .quote { grid-template-columns: 1fr; }
  .hero .wrap { padding-top: 110px; padding-bottom: 64px; }
}

/* Páginas interiores */
.page-hero { position: relative; min-height: 60svh; display: flex; align-items: end; color: #fff; background: var(--ink) center/cover; }
.page-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(13,14,29,.85), rgba(13,14,29,.35)); }
.page-hero .wrap { position: relative; padding-top: 140px; padding-bottom: 56px; width: 100%; }
.page-hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.05; }
.crumbs { margin-top: 12px; display: flex; gap: 8px; opacity: .9; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--teal); }
.badge { position: absolute; left: -16px; bottom: 32px; background: var(--teal); color: #fff; padding: 14px 20px; font-weight: 600; }
.badge b { font-size: 2rem; margin-right: 6px; }
.imgbox { position: relative; }
.checks { list-style: none; padding: 0; display: grid; gap: 12px; margin: 24px 0 32px; }
.checks li { padding-left: 32px; position: relative; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; display: grid; place-items: center; background: var(--teal); color: #fff; font-size: .8rem; border-radius: 50%; }

.pgrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 28px; }
.pcard { position: relative; background: #fff; display: flex; flex-direction: column; overflow: hidden; border: 1px solid #e6e8ec; cursor: pointer; transition: transform .3s ease, box-shadow .3s ease, border-color .3s; }
.grey .pcard { border-color: transparent; }
.pcard::after { content: ""; position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: var(--teal); transform: scaleX(0); transform-origin: left; transition: transform .35s ease; }
.pcard .pimg { position: relative; overflow: hidden; }
.pcard img { width: 100%; height: clamp(90px, 15svh, 140px); object-fit: cover; transition: transform .6s ease, filter .3s; }
.pcard .body { padding: 16px 18px 20px; }
.pcard small { color: var(--teal); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.pcard h3 { font-size: 1rem; line-height: 1.3; margin-top: 4px; min-height: 3.9em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; transition: color .3s; }
.pcard:hover, .pcard:focus-within { transform: translateY(-6px); box-shadow: 0 16px 32px rgba(13,14,29,.18); }
.pcard:hover::after, .pcard:focus-within::after { transform: scaleX(1); }
.pcard:hover img { transform: scale(1.08); }
.pcard:hover h3 { color: var(--teal); }
.pcard .full { position: absolute; inset: 0; background: rgba(13,14,29,.94); color: #fff; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .35s ease, transform .35s ease; }
.pcard .full small { color: var(--teal); }
.pcard .full p { font-size: .88rem; line-height: 1.3; }
.pcard .full span { margin-top: auto; color: var(--teal); font-weight: 600; }
.pcard:hover .full, .pcard:focus-within .full { opacity: 1; transform: none; }
.pcard .stretch { position: absolute; inset: 0; z-index: 1; }

/* Aparición al hacer scroll */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }
.js .pcard.reveal.in { transition: opacity .6s ease var(--d, 0s), transform .3s ease, box-shadow .3s ease, border-color .3s; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } .pcard, .pcard img { transition: none; } }


/* Contacto: tarjetas con mapa integrado */
.chead { text-align: center; max-width: 60ch; margin: 0 auto 28px; }
.chead p { color: var(--muted); }
.cgrid { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; align-items: stretch; }
.ccol { display: grid; gap: 20px; grid-template-rows: 1fr auto; }
.ccard { background: #fff; border-top: 4px solid var(--teal); box-shadow: 0 6px 20px rgba(13,14,29,.07); transition: box-shadow .3s ease, transform .3s ease; }
.ccard:hover { box-shadow: 0 14px 32px rgba(13,14,29,.14); transform: translateY(-3px); }
.js .ccard.reveal.in { transition: opacity .6s ease var(--d, 0s), transform .3s ease, box-shadow .3s ease; }
.ico { width: 42px; height: 42px; flex: none; display: grid; place-items: center; background: #e8f5f4; border-radius: 50%; transition: background .3s, transform .3s; }
.ccard small { display: block; color: var(--teal); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: .78rem; }
.ccard p { margin: 0; }
.place { display: flex; flex-direction: column; overflow: hidden; }
.addr { display: flex; align-items: center; gap: 14px; padding: 18px 20px; text-decoration: none; transition: background .3s; }
.addr:hover { background: #f3fbfa; }
.addr:hover .ico, .row:hover .ico { background: var(--teal); transform: scale(1.1); }
.addr .go { margin-left: auto; white-space: nowrap; color: var(--teal); font-weight: 600; transition: transform .3s; }
.addr:hover .go { transform: translateX(4px); }
.place iframe { width: 100%; flex: 1; min-height: 200px; border: 0; display: block; filter: grayscale(.85) contrast(1.05); transition: filter .5s ease; }
.place:hover iframe { filter: none; }
.rows { padding: 8px 20px; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 0; text-decoration: none; }
.row + .row { border-top: 1px solid #eef0f3; }
a.row:hover p { color: var(--teal); }
.soc { display: flex; gap: 16px; flex-wrap: wrap; }
.soc a { text-decoration: none; }
.soc a:hover { color: var(--teal); text-decoration: underline; }
.form { padding: 24px 26px; display: flex; flex-direction: column; }
.form .sub { color: var(--muted); margin: 4px 0 16px; }
.form form { gap: 14px; flex: 1; align-content: start; }
.form label { display: grid; gap: 6px; font-weight: 500; font-size: .95rem; }
.form textarea { min-height: 110px; }
input, textarea { transition: border-color .25s, box-shadow .25s; }
input:hover, textarea:hover { border-color: var(--ink); }
input:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(29,160,153,.25); }
@media (max-width: 800px) { .cgrid { grid-template-columns: 1fr; } .addr { flex-wrap: wrap; } .addr .go { margin-left: 56px; } .place iframe { min-height: 240px; } }
.tight { padding: 40px 0; }
.tight .chead { margin-bottom: 20px; }
.tight .chead h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 8px; }
.tight .cgrid, .tight .ccol { gap: 16px; }
.tight .row { padding: 9px 0; }
.tight .form { padding: 20px 24px; }
.tight .form textarea { min-height: 90px; }

/* Blog */
.chips { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 20px; }
.chip { font: inherit; font-weight: 500; padding: 8px 16px; background: #fff; border: 1px solid #d9dde3; color: var(--ink); cursor: pointer; transition: background .25s, color .25s, border-color .25s, transform .25s; }
.chip b { margin-left: 6px; font-size: .8em; opacity: .65; }
.chip:hover { border-color: var(--teal); color: var(--teal); transform: translateY(-2px); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.on:hover { color: #fff; }
.bgrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.bcard { position: relative; background: #fff; display: flex; flex-direction: column; overflow: hidden; cursor: pointer; box-shadow: 0 4px 16px rgba(13,14,29,.06); transition: transform .3s ease, box-shadow .3s ease; }
.bcard[hidden] { display: none; }
.bcard.show { animation: bin .5s ease both; animation-delay: calc(var(--i, 0) * .07s); }
@keyframes bin { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.bcard::after { content: ""; position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: var(--teal); transform: scaleX(0); transform-origin: left; transition: transform .35s ease; }
.bcard:hover, .bcard:focus-within { transform: translateY(-6px); box-shadow: 0 16px 32px rgba(13,14,29,.18); }
.bcard:hover::after, .bcard:focus-within::after { transform: scaleX(1); }
.bimg { overflow: hidden; }
.bimg img { width: 100%; height: clamp(56px, 8svh, 76px); object-fit: cover; transition: transform .6s ease; }
.bcard:hover .bimg img { transform: scale(1.08); }
.bcard .body { padding: 14px 18px 18px; display: grid; gap: 4px; align-content: start; flex: 1; }
.bcard small { color: var(--teal); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: .78rem; }
.bcard time { color: var(--muted); font-size: .88rem; }
.bcard h3 { font-size: 1rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.9em; transition: color .3s; }
.bcard:hover h3 { color: var(--teal); }
.bcard .more { margin-top: 6px; color: var(--teal); font-weight: 600; opacity: 0; transform: translateX(-8px); transition: opacity .3s, transform .3s; }
.bcard:hover .more, .bcard:focus-within .more { opacity: 1; transform: none; }
.bcard .stretch { position: absolute; inset: 0; z-index: 1; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 20px; }
.pager[hidden] { display: none; }
.pager button { font: inherit; width: 40px; height: 40px; background: #fff; border: 1px solid #d9dde3; cursor: pointer; transition: background .25s, color .25s, transform .25s; }
.pager button:hover { border-color: var(--teal); color: var(--teal); transform: translateY(-2px); }
.pager button.on { background: var(--teal); border-color: var(--teal); color: #fff; }
@media (prefers-reduced-motion: reduce) { .bcard.show { animation: none; } }

/* Menú desplegable */
.dd { position: relative; }
.dd > a { display: inline-flex; gap: 6px; align-items: center; }
.dd .caret { font-size: .7em; transition: transform .25s; }
.dd-menu { position: absolute; top: 100%; left: -16px; min-width: 280px; padding: 10px 0; background: #fff; box-shadow: 0 14px 32px rgba(13,14,29,.2); border-top: 3px solid var(--teal); opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .25s, transform .25s, visibility .25s; z-index: 40; }
.dd-menu a { display: block; padding: 10px 20px; color: var(--ink); white-space: nowrap; transition: background .2s, color .2s, padding-left .2s; }
.dd-menu a:hover, .dd-menu a.cur { background: #f3fbfa; color: var(--teal); padding-left: 26px; }
.dd:hover .dd-menu, .dd:focus-within .dd-menu { opacity: 1; visibility: visible; transform: none; }
.dd:hover .caret, .dd:focus-within .caret { transform: rotate(180deg); }
.dd.on > a { color: var(--teal); }
@media (max-width: 800px) { .dd-menu { position: fixed; left: 16px; right: 16px; top: auto; min-width: 0; } }

/* Páginas de servicio */
.obj { max-width: 860px; margin-bottom: 24px; }
.obj p { color: var(--muted); }
.sub-h { font-size: 1.3rem; color: var(--teal); margin-bottom: 14px; }
.slist { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.sitem { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: #fff; text-decoration: none; overflow: hidden; box-shadow: 0 4px 14px rgba(13,14,29,.06); transition: transform .3s ease, box-shadow .3s ease; }
.sitem::before { content: ""; position: absolute; inset: 0; background: var(--ink); transform: translateX(-101%); transition: transform .35s ease; }
.sitem > * { position: relative; }
.sitem .num { color: var(--teal); font-weight: 700; font-size: 1.1rem; transition: color .3s; }
.sitem .nm { flex: 1; font-weight: 500; line-height: 1.25; transition: color .3s; }
.sitem .arr { color: var(--teal); opacity: 0; transform: translate(-6px, 6px); transition: opacity .3s, transform .3s; }
.sitem:hover, .sitem:focus-visible { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(13,14,29,.18); }
.sitem:hover::before, .sitem:focus-visible::before { transform: none; }
.sitem:hover .nm { color: #fff; }
.sitem:hover .arr { opacity: 1; transform: none; }
.js .sitem.reveal.in { transition: opacity .6s ease var(--d, 0s), transform .3s ease, box-shadow .3s ease; }
.imgbox img { width: 100%; height: clamp(260px, 52svh, 460px); object-fit: cover; }

/* Botón de WhatsApp: vibra y emite un pulso cada cierto tiempo */
.wa { animation: wa-shake 6s ease-in-out 2s infinite; }
.wa::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--wa); z-index: -1; animation: wa-ring 6s ease-out 2s infinite; }
.wa { transition: transform .25s ease, box-shadow .25s ease, background .25s ease; }
.wa svg { transition: transform .3s ease; }
/* Al pasar el mouse: se detiene la vibración, crece, se oscurece y muestra una etiqueta */
.wa:hover, .wa:focus-visible { animation: none; transform: scale(1.12); background: #1ebe5a; box-shadow: 0 10px 26px rgba(37,211,102,.45); outline: none; }
.wa:hover::before, .wa:focus-visible::before { animation: none; opacity: 0; }
.wa:hover svg, .wa:focus-visible svg { transform: rotate(-12deg); }
.wa:active { transform: scale(.96); }
.wa::after { content: "¿Hablamos? Escríbenos"; position: absolute; right: calc(100% + 14px); top: 50%; transform: translate(10px, -50%); white-space: nowrap; background: #fff; color: var(--ink); font-size: .92rem; font-weight: 600; padding: 9px 14px; box-shadow: 0 8px 22px rgba(13,14,29,.18); border-left: 3px solid var(--wa); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s ease, transform .25s ease, visibility .25s; }
.wa:hover::after, .wa:focus-visible::after { opacity: 1; visibility: visible; transform: translate(0, -50%); }
@media (hover: none) { .wa::after { display: none; } }
@keyframes wa-shake {
  0%, 14%, 100% { transform: rotate(0) scale(1); }
  2% { transform: rotate(-14deg) scale(1.1); }
  4% { transform: rotate(12deg) scale(1.1); }
  6% { transform: rotate(-10deg) scale(1.1); }
  8% { transform: rotate(8deg) scale(1.1); }
  10% { transform: rotate(-5deg) scale(1.05); }
  12% { transform: rotate(3deg) scale(1.02); }
}
@keyframes wa-ring { 0%, 1% { transform: scale(1); opacity: .55; } 16% { transform: scale(1.9); opacity: 0; } 100% { transform: scale(1.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .wa, .wa::before { animation: none; } }

.bgrid.big .bimg img { height: clamp(130px, 24svh, 210px); }
.bgrid.big .bcard .body { padding: 18px 20px 22px; }
.bgrid.big .bcard h3 { font-size: 1.1rem; min-height: 0; -webkit-line-clamp: 4; }
.bcard.reveal { opacity: 1; }
.js .bcard.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease var(--d, 0s), transform .6s ease var(--d, 0s); }
.js .bcard.reveal.in { opacity: 1; transform: none; transition: opacity .6s ease var(--d, 0s), transform .3s ease, box-shadow .3s ease; }

/* Pantalla de carga */
#loader { position: fixed; inset: 0; z-index: 100; background: #fff; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 22px; transition: opacity .5s ease, visibility .5s; }
.loading #loader { display: flex; }
.loading { overflow: hidden; }
#loader.out { opacity: 0; visibility: hidden; }
#loader img { width: 170px; height: auto; animation: ld-pulse 1.4s ease-in-out infinite; }
#loader .bar { position: relative; width: 120px; height: 3px; background: #e3e7ec; overflow: hidden; }
#loader .bar::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--teal); animation: ld-bar 1.1s ease-in-out infinite; }
@keyframes ld-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: .8; } }
@keyframes ld-bar { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) { #loader img, #loader .bar::after { animation: none; } }

/* Header moderno: transparente sobre el hero, vidrio al hacer scroll */
#hdr { position: fixed; inset: 0 0 auto 0; z-index: 50; color: #fff; transition: transform .35s ease, background .3s ease, box-shadow .3s ease, color .3s ease; }
#hdr .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
#hdr a { text-decoration: none; }
.topbar { font-size: .9rem; border-bottom: 1px solid rgba(255,255,255,.18); max-height: 44px; overflow: hidden; transition: max-height .3s ease, opacity .3s ease, border-color .3s; }
.topbar .wrap { min-height: 40px; }
.tb-left, .tb-right { display: flex; align-items: center; gap: 22px; }
.topbar a, .topbar .hours { display: inline-flex; align-items: center; gap: 8px; opacity: .92; transition: color .25s, opacity .25s; }
.topbar a:hover { color: var(--teal); opacity: 1; }
.topbar svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.tb-right { gap: 18px; }
.tb-right .hours { margin-right: 8px; }
.mainbar .wrap { min-height: 76px; transition: min-height .3s ease; }
.logo img { height: 40px; width: auto; display: block; filter: brightness(0) invert(1); transition: filter .3s, height .3s; }
#menu { display: flex; align-items: center; gap: 30px; }
#menu > a, #menu > .dd > a { position: relative; font-weight: 500; padding: 6px 0; }
#menu > a::after, #menu > .dd > a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--teal); transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
#menu > a:hover::after, #menu > a.cur::after, #menu > .dd:hover > a::after, #menu > .dd.cur > a::after { transform: scaleX(1); }
#menu > a:hover, #menu > .dd:hover > a { color: var(--teal); }
#menu > a.cur, #menu > .dd.cur > a { color: #fff; }
.wabtn { display: inline-flex; align-items: center; gap: 8px; margin-top: 0 !important; padding: 11px 20px !important; background: var(--teal) !important; color: #fff !important; font-weight: 600; transition: transform .25s, box-shadow .25s, background .25s; }
.wabtn::after { display: none !important; }
.wabtn svg { width: 18px; height: 18px; fill: currentColor; }
.wabtn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(29,160,153,.45); background: #178a84 !important; color: #fff !important; }
.burger { display: none; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; padding: 10px; flex-direction: column; justify-content: center; gap: 6px; }
.burger span { display: block; height: 2px; background: currentColor; transition: transform .3s, opacity .3s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Estado con scroll: vidrio, compacto, sin barra superior */
#hdr.scrolled { background: rgba(255,255,255,.82); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 6px 24px rgba(13,14,29,.1); color: var(--ink); }
#hdr.scrolled .topbar { max-height: 0; opacity: 0; border-width: 0; }
#hdr.scrolled .mainbar .wrap { min-height: 64px; }
#hdr.scrolled .logo img, #hdr.open .logo img { filter: none; height: 34px; }
#hdr.scrolled #menu > a.cur, #hdr.scrolled #menu > .dd.cur > a { color: var(--teal); }
#hdr.hide { transform: translateY(-100%); }

/* Móvil: menú a pantalla completa */
@media (max-width: 900px) {
  .topbar { display: none; }
  .burger { display: flex; }
  #hdr.open { background: #fff; color: var(--ink); }
  #hdr.open .logo img { filter: none; }
  #menu { position: fixed; inset: 0; top: 0; padding: 96px 24px 32px; flex-direction: column; align-items: flex-start; gap: 6px; background: #fff; color: var(--ink); overflow-y: auto; opacity: 0; visibility: hidden; transform: translateY(-12px); transition: opacity .3s, transform .3s, visibility .3s; z-index: -1; }
  #hdr.open #menu { opacity: 1; visibility: visible; transform: none; }
  #menu > a, #menu > .dd > a { font-size: 1.5rem; padding: 10px 0; }
  #menu > a.cur, #menu > .dd.cur > a { color: var(--teal); }
  #menu .dd { width: 100%; }
  #menu .dd-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border-top: 0; min-width: 0; padding: 0 0 6px 14px; }
  #menu .dd-menu a { font-size: 1.05rem; padding: 8px 0; white-space: normal; }
  #menu .caret { display: none; }
  .wabtn { margin-top: 18px !important; font-size: 1.1rem; justify-content: center; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { #hdr, .topbar, .mainbar .wrap { transition: none; } }

/* Sellos ISO en el pie */
footer .iso { height: 48px; width: auto; filter: drop-shadow(0 0 1px rgba(255,255,255,.9)); }
footer .wrap { align-items: center; }

/* Franja superior legible sobre fotos claras */
.topbar { background: linear-gradient(rgba(13,14,29,.6), rgba(13,14,29,.3)); }
.topbar a.sn { width: 30px; height: 30px; justify-content: center; border-radius: 50%; background: rgba(255,255,255,.16); opacity: 1; transition: background .25s, transform .25s, color .25s; }
.topbar a.sn:hover { background: var(--teal); color: #fff; transform: translateY(-2px); }
.topbar a.sn svg { width: 16px; height: 16px; }
.topbar a.sn svg[stroke] { stroke-width: 2.4; }

/* Sello ISO integrado en el header */
.brand { display: flex; align-items: center; gap: 18px; }
.brand::after { content: none; }
.iso-h { height: 48px; width: auto; margin-left: 4px; filter: drop-shadow(0 0 1px rgba(255,255,255,.9)) drop-shadow(0 2px 6px rgba(0,0,0,.35)); transition: height .3s, filter .3s; }
#hdr.scrolled .iso-h { height: 42px; filter: none; }
@media (max-width: 1180px) { .iso-h { display: none; } }

/* Separador vertical sutil entre el logo y el sello ISO */
.logo { position: relative; }
.logo::after { content: ""; position: absolute; right: -10px; top: 50%; height: 44px; width: 1px; transform: translateY(-50%); background: rgba(255,255,255,.4); transition: background .3s, height .3s; }
#hdr.scrolled .logo::after { background: rgba(13,14,29,.18); height: 38px; }
@media (max-width: 1180px) { .logo::after { display: none; } }

/* Sección oscura para separar bloques consecutivos */
section.dark { background: var(--ink); color: #fff; position: relative; overflow: hidden; }
section.dark::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 80% at 85% 0%, rgba(29,160,153,.28), transparent 70%); pointer-events: none; }
section.dark .wrap { position: relative; }
.dark .facts p { color: rgba(255,255,255,.72); }
.dark .facts > div { padding: 8px 12px; border-left: 2px solid rgba(29,160,153,.45); transition: border-color .3s, transform .3s; }
.dark .facts > div:hover { border-color: var(--teal); transform: translateY(-4px); }

/* Contacto: ajustado a la pantalla sin quedar bajo el header fijo */
.chead p { font-size: .98rem; }
@media (min-width: 801px) and (min-height: 760px) {
  .tight { padding-top: 88px; padding-bottom: 24px; }
  #contacto.tight > .wrap { display: flex; flex-direction: column; justify-content: center; height: calc(100svh - 112px); }
  #contacto .cgrid { flex: 1; min-height: 0; }
  #contacto .ccol { min-height: 0; grid-template-rows: minmax(0, 1fr) auto; }
  #contacto .place { min-height: 0; }
  #contacto .place iframe { min-height: 100px; }
  #contacto .form form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
  #contacto .form label:has(textarea) { flex: 1; min-height: 0; }
  #contacto .form textarea { height: 100%; min-height: 60px; }
  #contacto .form button { align-self: flex-start; }
}

/* Pantallas bajas (760–820 px de alto): espaciado más compacto */
@media (min-width: 801px) and (min-height: 760px) and (max-height: 820px) {
  .tight { padding-top: 84px; padding-bottom: 16px; }
  #contacto.tight > .wrap { height: calc(100svh - 100px); }
  .chead { margin-bottom: 12px; }
  .chead h2 { font-size: 1.6rem; margin-bottom: 4px; }
  .chead p { font-size: .92rem; line-height: 1.35; }
  .tight .row { padding: 6px 0; }
  .tight .form { padding: 16px 22px; }
  .tight .form .sub { margin-bottom: 10px; }
  .bimg img { height: 48px !important; }
  .bcard .body { padding: 10px 16px 12px; }
  .chips { margin-bottom: 12px; }
  .pager { margin-top: 12px; }
  .pager button { height: 36px; width: 36px; }
}

/* Íconos de trazo (correo, reloj, Instagram): sin relleno para que se lean como línea */
.topbar svg[stroke] { fill: none; stroke: currentColor; }
.topbar svg[stroke] circle[fill] { fill: currentColor; stroke: none; }

/* Artículo del blog */
.no-snap { scroll-snap-type: none !important; }
.no-snap main > section { min-height: 0 !important; scroll-snap-align: none !important; display: block !important; }
.readbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; background: transparent; pointer-events: none; }
.readbar span { display: block; height: 100%; width: 0; background: var(--teal); transition: width .1s linear; }
.art-hero { min-height: 0 !important; }
.art-hero .wrap { padding-top: 150px; padding-bottom: 48px; }
.art-hero h1 { font-size: clamp(1.7rem, 3.6vw, 2.7rem); line-height: 1.15; max-width: 22ch; margin-top: 14px; }
.art-hero .crumbs { margin: 0 0 18px; font-size: .92rem; }
.chip-cat { display: inline-block; background: var(--teal); color: #fff; font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 5px 12px; transition: background .25s; }
.chip-cat:hover { background: #178a84; }
.art-meta { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 18px; font-size: .95rem; opacity: .92; }
.art-meta span { display: inline-flex; align-items: center; gap: 8px; }
.art-meta svg { width: 17px; height: 17px; }
.art-section { padding-top: 56px; }
.art-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; align-items: start; }
.art { max-width: 760px; font-size: 1.08rem; line-height: 1.7; }
.art .lead { font-size: 1.3rem; line-height: 1.4; color: var(--ink); font-weight: 500; padding-left: 20px; border-left: 4px solid var(--teal); margin-bottom: 32px; }
.art h2 { font-size: 1.55rem; line-height: 1.2; margin: 44px 0 14px; scroll-margin-top: 100px; position: relative; padding-top: 14px; }
.art h2::before { content: ""; position: absolute; top: 0; left: 0; width: 44px; height: 3px; background: var(--teal); }
.art h3 { font-size: 1.2rem; margin: 28px 0 10px; }
.art p { margin: 0 0 18px; color: #2a333d; }
.art strong { color: var(--ink); }
.art ul, .art ol { margin: 0 0 22px; padding-left: 0; list-style: none; display: grid; gap: 10px; }
.art li { position: relative; padding-left: 28px; color: #2a333d; }
.art ul li::before { content: ""; position: absolute; left: 4px; top: .65em; width: 9px; height: 9px; background: var(--teal); transform: rotate(45deg); }
.art ol { counter-reset: n; }
.art ol li::before { counter-increment: n; content: counter(n, decimal-leading-zero); position: absolute; left: 0; top: 0; color: var(--teal); font-weight: 700; font-size: .95rem; }
.art blockquote { margin: 28px 0; padding: 18px 24px; background: var(--grey); border-left: 4px solid var(--teal); font-style: italic; }
.art a { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.art figure { margin: 28px 0; }
.art figure img { width: 100%; }
.art table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: .95rem; }
.art th, .art td { border: 1px solid #e3e7ec; padding: 10px 12px; text-align: left; vertical-align: top; }
.art th { background: var(--grey); }
.art-share { margin-top: 48px; padding-top: 24px; border-top: 1px solid #e3e7ec; }
.art-share > b { display: block; margin-bottom: 12px; }
.share-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.sh { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; background: #fff; border: 1px solid #d9dde3; color: var(--ink); font: inherit; font-size: .95rem; font-weight: 500; text-decoration: none !important; cursor: pointer; transition: background .25s, color .25s, border-color .25s, transform .25s; }
.sh svg { width: 18px; height: 18px; fill: currentColor; }
.sh:hover { transform: translateY(-2px); border-color: var(--teal); color: var(--teal); }
.sh.sh-cp.ok { background: var(--teal); border-color: var(--teal); color: #fff; }
.art-author { display: flex; gap: 20px; align-items: center; margin-top: 32px; padding: 22px 24px; background: var(--grey); border-left: 4px solid var(--teal); }
.art-author img { width: 110px; height: auto; flex: none; }
.art-author b { display: block; margin-bottom: 4px; }
.art-author p { margin: 0; font-size: .95rem; color: var(--muted); }
.art-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.art-nav a { display: grid; gap: 6px; padding: 16px 18px; background: #fff; border: 1px solid #e3e7ec; text-decoration: none !important; color: var(--ink) !important; transition: border-color .25s, transform .25s, box-shadow .25s; }
.art-nav a:hover { border-color: var(--teal); transform: translateY(-3px); box-shadow: 0 10px 24px rgba(13,14,29,.1); }
.art-nav small { color: var(--teal); font-weight: 600; }
.art-nav span { font-size: .95rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.art-nav .next { text-align: right; }
.art-aside { position: sticky; top: 90px; display: grid; gap: 20px; }
.aside-box { background: #fff; border: 1px solid #e3e7ec; border-top: 3px solid var(--teal); padding: 20px 22px; }
.aside-box > b { display: block; margin-bottom: 12px; font-size: 1.05rem; }
.toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; counter-reset: t; }
.toc li a { display: block; padding: 7px 0 7px 14px; font-size: .93rem; line-height: 1.3; color: var(--muted); text-decoration: none; border-left: 2px solid #e3e7ec; transition: color .2s, border-color .2s, padding-left .2s; }
.toc li a:hover, .toc li a.on { color: var(--teal); border-left-color: var(--teal); padding-left: 18px; }
.aside-cats { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.aside-cats a { display: flex; justify-content: space-between; padding: 8px 10px; text-decoration: none; color: var(--ink); transition: background .2s, color .2s; }
.aside-cats a:hover, .aside-cats a.cur { background: #f3fbfa; color: var(--teal); }
.aside-cats span { color: var(--muted); font-size: .85rem; }
.aside-cta { background: var(--ink); color: #fff; border-top-color: var(--teal); }
.aside-cta p { color: rgba(255,255,255,.75); font-size: .95rem; margin: 0 0 14px; }
.aside-cta .btn { margin-top: 0; }
@media (max-width: 1000px) { .art-grid { grid-template-columns: 1fr; gap: 36px; } .art-aside { position: static; } .toc { display: none; } }
@media (max-width: 600px) { .art { font-size: 1rem; } .art-nav { grid-template-columns: 1fr; } .art-nav .next { text-align: left; } .art-author { flex-direction: column; align-items: flex-start; } .art-hero .wrap { padding-top: 110px; } }

/* Hero: los textos del carrusel se apilan en la misma celda, así el bloque no salta al cambiar de diapositiva */
#slides-text { display: grid; }
#slides-text > [data-slide] { grid-area: 1 / 1; align-self: center; transition: opacity .6s ease .45s, visibility 0s linear .45s; }
/* El texto saliente se desvanece primero y el entrante aparece después, sin superponerse ni moverse */
#slides-text > [data-slide][hidden] { display: block; visibility: hidden; opacity: 0; transition: opacity .4s ease, visibility 0s linear .4s; }

/* Hero y portadas en móvil: títulos proporcionados a la pantalla */
@media (max-width: 600px) {
  .hero h1, .hero .h1 { font-size: clamp(1.85rem, 8vw, 2.3rem); line-height: 1.1; max-width: 16ch; }
  .hero p { font-size: 1.02rem; line-height: 1.5; margin: 14px 0 24px; }
  .hero .btn { padding: 12px 20px; font-size: .98rem; }
  .page-hero .wrap { padding-top: 110px; padding-bottom: 40px; }
  .page-hero h1 { font-size: clamp(2rem, 9vw, 2.5rem); }
  .art-hero h1 { font-size: clamp(1.45rem, 6.4vw, 1.8rem); }
}

/* Página 404 */
.nf-hero { min-height: 100svh !important; align-items: center !important; }
.nf-hero .wrap { padding-top: 140px; padding-bottom: 80px; }
.nf-code { display: block; font-size: clamp(5rem, 16vw, 9rem); font-weight: 700; line-height: 1; color: var(--teal); }
.nf-hero h1 { margin-top: 8px; }
.nf-hero p { max-width: 52ch; margin: 16px 0 28px; font-size: 1.1rem; opacity: .9; }
.nf-links { display: flex; gap: 12px; flex-wrap: wrap; }
.btn.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); }
.btn.ghost:hover { background: #fff; color: var(--ink); }

/* Formulario de contacto: estados de envío */
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.campo-error { color: #c0392b; font-size: .85rem; font-weight: 500; }
[aria-invalid="true"] { border-color: #c0392b !important; box-shadow: 0 0 0 3px rgba(192,57,43,.15) !important; }
.form-estado:empty { display: none; }
.form-estado { margin: 4px 0 0; font-size: .92rem; }
.form-estado.error { color: #c0392b; }
.form-estado a { color: var(--teal); font-weight: 600; }
form.enviando button[type="submit"] { opacity: .7; cursor: progress; }
.form-ok { display: grid; justify-items: start; gap: 8px; padding: 28px 4px; outline: none; animation: bin .5s ease both; }
.form-ok .ico { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--teal); color: #fff; font-size: 1.6rem; }
.form-ok b { font-size: 1.3rem; }
.form-ok p { margin: 0; color: var(--muted); }
