/* ==========================================================
   IMA — estilos
   CSS moderno: variables, clamp(), grid/bento, scroll-snap,
   view transitions, :has(), text-wrap, color-mix, svh.
   ========================================================== */

:root {
    --brand: #4a2090;
    --brand-dark: #32156f;
    --brand-soft: color-mix(in srgb, var(--brand) 10%, white);
    --navy: #0b1220;
    --ink: #151b26;
    --muted: #596273;
    --bg: #ffffff;
    --bg-alt: #f4f3f8;
    --line: #e2e0ea;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px -12px rgba(30, 14, 70, .25);
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-head: 'Sora', 'Inter', system-ui, sans-serif;
    --header-h: 72px;
}

@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.65; -webkit-font-smoothing: antialiased; }
img, video { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .6em; letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 5.2vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { text-wrap: pretty; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, white); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1180px, 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--brand); color: #fff; padding: 8px 14px; z-index: 100; border-radius: 6px; }

.ico { width: 40px; height: 40px; }
.ico-sm { width: 1.1em; height: 1.1em; vertical-align: -.17em; flex: none; }

/* ---------- Botones y enlaces ---------- */
.btn { display: inline-flex; align-items: center; gap: .55em; background: var(--brand); color: #fff; font-weight: 600; text-decoration: none;
       padding: .85em 1.6em; border-radius: 999px; border: 0; cursor: pointer; transition: transform .2s, background .2s, box-shadow .2s; }
.btn:hover { background: var(--brand-dark); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-sm { padding: .5em 1.15em; font-size: .92rem; }
.btn-light { background: #fff; color: var(--brand-dark); }
.btn-light:hover { background: #f0ebfb; }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.55); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255,255,255,.22); }
.link-arrow { display: inline-flex; align-items: center; gap: .4em; font-weight: 600; color: var(--brand); text-decoration: none; }
.link-arrow:hover { gap: .7em; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, #fff 82%, transparent);
               backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { height: 44px; width: auto; }
.brand-mark { font-family: var(--font-head); font-weight: 800; font-size: 1.5rem; color: var(--brand); letter-spacing: .04em; }
.brand-text { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; max-width: 140px; line-height: 1.25; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a:not(.btn) { text-decoration: none; font-weight: 500; font-size: .95rem; padding: .5em .9em; border-radius: 999px; transition: background .2s, color .2s; }
.nav a:not(.btn):hover { background: var(--brand-soft); color: var(--brand); }
.nav a[aria-current="page"]:not(.btn) { color: var(--brand); background: var(--brand-soft); }
.nav .btn { margin-left: 8px; }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero slider ---------- */
.hero { position: relative; background: var(--navy); color: #fff; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.slides::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; min-height: clamp(520px, calc(100svh - var(--header-h)), 820px); display: grid; align-items: center; overflow: hidden; }
.slide > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide::after { content: ""; position: absolute; inset: 0;
                background: linear-gradient(95deg, rgba(11,18,32,.92) 8%, rgba(30,14,70,.62) 50%, rgba(11,18,32,.18)); }
.slide-in { position: relative; z-index: 1; padding-block: 80px 110px; }
.slide-in > * { max-width: 680px; }
.slide .eyebrow, .slide h1, .slide .lead, .slide .cta { animation: rise .8s both; }
.slide h1 { animation-delay: .08s; } .slide .lead { animation-delay: .16s; } .slide .cta { animation-delay: .24s; }
.eyebrow { display: inline-block; text-transform: uppercase; letter-spacing: .16em; font-size: .78rem; font-weight: 600; color: #d6c6fa;
           background: rgba(255,255,255,.1); padding: .4em 1em; border-radius: 999px; margin: 0 0 1.2rem; backdrop-filter: blur(6px); }
.lead { font-size: clamp(1.02rem, 1.6vw, 1.2rem); color: rgba(255,255,255,.86); margin: 0 0 1.8rem; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.slider-ui { position: absolute; inset: auto 0 28px; display: flex; justify-content: space-between; align-items: center; z-index: 2; pointer-events: none; }
.slider-ui > * { pointer-events: auto; }
.dots { display: flex; gap: 8px; }
.dots button { width: 34px; height: 5px; border: 0; border-radius: 4px; background: rgba(255,255,255,.35); cursor: pointer; padding: 0; transition: background .3s, width .3s; }
.dots button[aria-selected="true"] { background: #fff; width: 56px; }
.arrows { display: flex; gap: 10px; }
.arrow { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.5); background: rgba(255,255,255,.1); backdrop-filter: blur(6px); cursor: pointer; display: grid; place-items: center; transition: background .2s; }
.arrow:hover { background: rgba(255,255,255,.28); }
.arrow svg { width: 20px; height: 20px; }

/* ---------- Cabecera de páginas internas ---------- */
.page-head { background: radial-gradient(900px 400px at 85% -20%, color-mix(in srgb, var(--brand) 70%, transparent), transparent), var(--navy);
             color: #fff; padding: clamp(56px, 9vw, 110px) 0 clamp(48px, 7vw, 84px); }
.page-head .kicker { color: #d6c6fa; }
.page-head h1 { max-width: 20ch; font-size: clamp(2rem, 4.6vw, 3.4rem); }
.page-head .lead { max-width: 60ch; margin: 0; }

/* ---------- Secciones ---------- */
.section { padding: clamp(60px, 8vw, 104px) 0; }
.section.alt { background: var(--bg-alt); }
.section.dark { background: var(--navy); color: #fff; }
.section.dark h2 { color: #fff; }
.section-head { margin-bottom: clamp(28px, 4vw, 48px); max-width: 760px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.row-head { max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.section-head.row-head h2 { margin: 0; }
.kicker { text-transform: uppercase; letter-spacing: .16em; font-size: .78rem; font-weight: 600; color: var(--brand); margin: 0 0 .8rem; }
.section.dark .kicker { color: #c3aef2; }
.section-lead { color: var(--muted); margin: 0; font-size: 1.05rem; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; transition: transform .25s, box-shadow .25s, border-color .25s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 30%, white); }
.card p { margin: 0 0 .75em; color: var(--muted); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }

/* Bento de servicios */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.bento .service:first-child { grid-column: span 2; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; border: 0; }
.bento-full .service:first-child { grid-column: auto; background: #fff; color: inherit; border: 1px solid var(--line); }
.service .ico { color: var(--brand); background: var(--brand-soft); padding: 9px; border-radius: 12px; width: 52px; height: 52px; margin-bottom: 18px; }
.bento:not(.bento-full) .service:first-child .ico { color: #fff; background: rgba(255,255,255,.16); }
.bento:not(.bento-full) .service:first-child li { color: rgba(255,255,255,.85); }
.service ul { margin: 0; padding: 0; list-style: none; color: var(--muted); }
.service li { position: relative; padding-left: 1.3em; margin-bottom: .5em; font-size: .95rem; }
.service li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .45; }

/* Proceso */
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.steps li { padding: 28px; border-radius: var(--radius); background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); }
.steps h3 { color: #fff; }
.steps p { margin: 0; color: rgba(255,255,255,.7); font-size: .95rem; }
.step-n { display: block; font-family: var(--font-head); font-weight: 800; font-size: 2.4rem; line-height: 1; margin-bottom: 18px;
          background: linear-gradient(135deg, #b79af0, #6c3fd0); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Vista previa en inicio */
.preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.preview a { display: block; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--navy); }
.preview a:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
.preview img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.preview a:hover img { transform: scale(1.06); }

/* Clientes */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; align-items: center; width: max-content; list-style: none; margin: 0; padding: 0; animation: marquee 36s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track li { flex: none; width: 190px; height: 76px; display: grid; place-items: center; margin-inline: 12px; }
.marquee-track img { width: 150px; height: 44px; object-fit: contain; filter: grayscale(1); opacity: .7; transition: filter .3s, opacity .3s; }
.marquee-track li:hover img { filter: none; opacity: 1; }
.marquee-track span { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; color: var(--muted); text-align: center; letter-spacing: -.01em; }
@keyframes marquee { to { transform: translateX(-25%); } }

/* CTA */
.cta-band { background: linear-gradient(120deg, var(--brand-dark), var(--brand) 60%, #6c3fd0); color: #fff; text-align: center; padding: clamp(56px, 8vw, 96px) 0; }
.cta-band h2 { margin-bottom: .4em; }
.cta-band p { margin: 0 auto 1.8rem; max-width: 52ch; color: rgba(255,255,255,.85); }

/* Nosotros */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.split-img { margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.split-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.mv { margin-bottom: 1.6rem; padding-left: 20px; border-left: 4px solid var(--brand); }
.mv h2 { font-size: 1.6rem; margin-bottom: .3em; }
.mv p { margin: 0; color: var(--muted); }
.founded { background: var(--brand-soft); color: var(--brand-dark); padding: .8em 1.2em; border-radius: var(--radius-sm); margin: 0; }
.values { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.values li { background: #fff; border: 1px solid var(--line); padding: .8em 1.5em; border-radius: 999px; font-weight: 600; display: flex; align-items: center; gap: .5em; }
.values .ico-sm { color: var(--brand); }
.role { text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; font-weight: 600; color: var(--brand) !important; }
.place { font-size: .9rem; }

/* Galería */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.chip { border: 1px solid var(--line); background: #fff; padding: .55em 1.1em; border-radius: 999px; cursor: pointer; font-weight: 500; font-size: .92rem; transition: .2s; }
.chip span { opacity: .55; margin-left: .3em; font-size: .85em; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.gallery { columns: 3; column-gap: 16px; }
.gallery figure { margin: 0 0 16px; break-inside: avoid; position: relative; border-radius: var(--radius); overflow: hidden; background: var(--navy); }
.gallery figure[hidden] { display: none; }
.gallery a { display: block; position: relative; }
.gallery img { width: 100%; height: auto; transition: transform .5s; }
.gallery figure:hover img { transform: scale(1.05); }
.gallery figcaption { position: absolute; inset: auto 0 0; padding: 36px 16px 14px; font-size: .86rem; color: #fff; pointer-events: none;
                      background: linear-gradient(transparent, rgba(11,18,32,.85)); transform: translateY(8px); opacity: 0; transition: .3s; }
.gallery figure:hover figcaption, .gallery figure:focus-within figcaption { opacity: 1; transform: none; }
.zoom { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.9); color: var(--brand-dark);
        display: grid; place-items: center; opacity: 0; transition: .3s; }
.zoom svg { width: 18px; height: 18px; }
.gallery figure:hover .zoom { opacity: 1; }

/* Lightbox */
.lb { position: fixed; inset: 0; z-index: 200; background: rgba(8,10,18,.94); display: grid; grid-template-rows: 1fr auto; padding: 20px; animation: fade .25s; }
.lb-stage { display: grid; place-items: center; min-height: 0; }
.lb-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 8px; }
.lb-cap { color: #fff; text-align: center; padding-top: 14px; font-size: .95rem; }
.lb-cap small { display: block; opacity: .6; margin-top: 2px; }
.lb button { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.4); background: rgba(255,255,255,.1); color: #fff; cursor: pointer; display: grid; place-items: center; }
.lb button:hover { background: rgba(255,255,255,.25); }
.lb button svg { width: 22px; height: 22px; }
.lb-close { top: 16px; right: 16px; } .lb-prev { left: 16px; top: 50%; } .lb-next { right: 16px; top: 50%; }

/* Contacto */
.grid-contact { display: grid; grid-template-columns: .8fr 1.4fr; gap: clamp(28px, 5vw, 56px); align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.contact-list li { display: flex; gap: 16px; padding: 22px; background: var(--bg-alt); border-radius: var(--radius); }
.contact-list .ico-sm { width: 44px; height: 44px; padding: 11px; background: var(--brand); color: #fff; border-radius: 12px; }
.contact-list strong { display: block; font-family: var(--font-head); margin-bottom: 2px; }
.contact-list a { display: block; color: var(--brand); text-decoration: none; font-weight: 500; }
.contact-list a:hover { text-decoration: underline; }
.form { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); padding: clamp(22px, 3vw, 36px); border-radius: var(--radius); display: grid; gap: 16px; }
.form label { display: grid; gap: 6px; font-weight: 500; font-size: .9rem; }
.form select, .form input, .form textarea { font: inherit; padding: .75em .9em; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff; width: 100%; transition: border-color .2s, box-shadow .2s; }
.form select:focus, .form input:focus, .form textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.form textarea { resize: vertical; }
.form .check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; font-size: .85rem; color: var(--muted); }
.form .check input { margin-top: .25em; width: auto; accent-color: var(--brand); }
.form .btn { justify-self: start; }
.form .btn:disabled { opacity: .6; cursor: wait; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hp { position: absolute; left: -9999px; }
.notice, .form-status { margin: 0; padding: .75em 1em; border-radius: var(--radius-sm); font-size: .95rem; }
.form-status:empty { display: none; }
.notice.ok, .form-status.ok { background: #e3f6e8; color: #17602b; }
.notice.err, .form-status.err { background: #fde8e8; color: #8a1c1c; }
.form:has(input:user-invalid, textarea:user-invalid, select:user-invalid) .btn { box-shadow: 0 0 0 3px #f3c2c2; }
input:user-invalid, textarea:user-invalid, select:user-invalid { border-color: #c44; }

/* Footer */
.site-footer { background: var(--navy); color: #b9c0cf; padding: 56px 0 0; }
.foot { display: grid; grid-template-columns: 1.4fr 1fr 1.3fr; gap: 32px; }
.foot h4 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: .94rem; }
.foot a { text-decoration: none; } .foot a:hover { color: #fff; text-decoration: underline; }
.foot-logo { height: 64px; width: auto; background: #fff; padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; }
.foot-brand .brand-mark { color: #fff; }
.foot-brand p { margin: 0; font-size: .9rem; }
.foot-bottom { margin-top: 40px; padding: 20px 0; border-top: 1px solid rgba(255,255,255,.1); font-size: .85rem; }
.foot-bottom p { margin: 0; }

/* Animaciones */
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s, transform .7s; }
.js .reveal.in { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 960px) {
    .bento { grid-template-columns: 1fr 1fr; }
    .bento .service:first-child { grid-column: span 2; }
    .gallery { columns: 2; }
    .split, .grid-contact { grid-template-columns: 1fr; }
    .foot { grid-template-columns: 1fr 1fr; }
    .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
    .nav-toggle { display: block; }
    .brand-text { display: none; }
    .nav { position: absolute; top: 100%; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; gap: 2px;
           padding: 10px 20px 20px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); display: none; }
    .nav.open { display: flex; }
    .nav .btn { margin: 8px 0 0; justify-content: center; }
    .slide-in { padding-block: 56px 120px; }
    .slide::after { background: linear-gradient(rgba(11,18,32,.55), rgba(11,18,32,.88)); }
    .arrows { display: none; }
    .bento, .row { grid-template-columns: 1fr; }
    .bento .service:first-child { grid-column: auto; }
    .preview { grid-template-columns: 1fr 1fr; }
    .preview a:first-child { grid-column: span 2; grid-row: auto; aspect-ratio: 16 / 10; }
    .gallery { columns: 1; }
    .foot { grid-template-columns: 1fr; }
    .lb-prev, .lb-next { top: auto; bottom: 70px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .js .reveal { opacity: 1; transform: none; }
    .marquee { overflow-x: auto; mask-image: none; -webkit-mask-image: none; }
}
