/* ==========================================================================
   SOFTKING Digital — Hoja de estilos principal
   Estructura: 1.Tokens 2.Base 3.Layout 4.Header 5.Botones 6.Hero
               7.Secciones 8.Tarjetas 9.Páginas internas 10.Formulario
               11.Legal 12.Footer 13.Utilidades/animación 14.Responsive
   ========================================================================== */

/* 1. TOKENS ---------------------------------------------------------------- */
:root {
    --bg: #070b16;
    --bg-2: #0b1222;
    --surface: rgba(255, 255, 255, 0.035);
    --surface-2: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(97, 218, 230, 0.35);
    --text: #e8eef6;
    --text-muted: #9aa8bd;
    --text-dim: #6b7a90;
    --brand: #1d59b8;
    --brand-2: #2f7de1;
    --accent: #61dae6;
    --success: #3ddc97;
    --grad: linear-gradient(135deg, #61dae6 0%, #2f7de1 55%, #1d59b8 100%);
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
    --container: 1200px;
    --header-h: 76px;
    --font-head: 'Sora', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

/* 2. BASE ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Fondo global sutil: retícula + halo de marca (sin imágenes pesadas) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(29, 89, 184, 0.22), transparent 60%),
        radial-gradient(700px 400px at -10% 30%, rgba(97, 218, 230, 0.07), transparent 60%),
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px) 0 0 / 56px 56px,
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px) 0 0 / 56px 56px,
        var(--bg);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 60%, rgba(0,0,0,.6) 100%);
            mask-image: linear-gradient(to bottom, #000 0%, #000 60%, rgba(0,0,0,.6) 100%);
}

main { flex: 1; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }

::selection { background: rgba(97, 218, 230, 0.3); color: #fff; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip-link {
    position: absolute; left: 1rem; top: -100px; z-index: 2000;
    background: var(--accent); color: #04121a; padding: .6rem 1rem; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* 3. LAYOUT ---------------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }

.section { padding: 6rem 0; position: relative; }
.section--tight { padding: 4rem 0; }
.section--alt { background: linear-gradient(180deg, transparent, rgba(11, 18, 34, 0.7) 15%, rgba(11, 18, 34, 0.7) 85%, transparent); }

.section-head { max-width: 680px; margin-bottom: 3rem; }
.section-head--center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin: .75rem 0 1rem; }
.section-head p { color: var(--text-muted); font-size: 1.05rem; }

.eyebrow {
    display: inline-flex; align-items: center; gap: .5rem;
    font-family: var(--font-mono); font-size: .78rem; font-weight: 500;
    letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; }

.text-gradient { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* 4. HEADER ---------------------------------------------------------------- */
.site-header {
    position: sticky; top: 0; z-index: 1000;
    height: var(--header-h);
    background: rgba(7, 11, 22, 0.72);
    -webkit-backdrop-filter: saturate(150%) blur(14px);
            backdrop-filter: saturate(150%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .3s, background .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--border); background: rgba(7, 11, 22, 0.88); }

.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }

.brand img { height: 54px; width: auto; }

.main-nav { display: flex; align-items: center; gap: 2rem; }
.main-nav ul { display: flex; gap: 1.75rem; }
.main-nav ul a {
    font-size: .93rem; font-weight: 500; color: var(--text-muted);
    position: relative; padding: .4rem 0; transition: color .2s;
}
.main-nav ul a::after {
    content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
    background: var(--grad); border-radius: 2px; transition: width .3s var(--ease);
}
.main-nav ul a:hover, .main-nav ul a[aria-current="page"] { color: var(--text); }
.main-nav ul a:hover::after, .main-nav ul a[aria-current="page"]::after { width: 100%; }

.nav-toggle {
    display: none; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface); cursor: pointer; position: relative;
}
.nav-toggle span { position: absolute; left: 11px; width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .3s var(--ease), opacity .2s; }
.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 20px; }
.nav-toggle span:nth-child(3) { top: 26px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* 5. BOTONES --------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    padding: .85rem 1.5rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
    border: 1px solid transparent; cursor: pointer; white-space: nowrap;
    transition: transform .2s var(--ease), box-shadow .3s, background .3s, border-color .3s, color .2s;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

.btn--primary { background: var(--grad); color: #04121a; box-shadow: 0 10px 30px -10px rgba(97, 218, 230, .55); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -12px rgba(97, 218, 230, .7); }

.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn--ghost:hover { border-color: var(--border-strong); background: var(--surface-2); }

.btn--sm { padding: .6rem 1.1rem; font-size: .88rem; }
.btn--block { width: 100%; }

.link-arrow { display: inline-flex; align-items: center; gap: .4rem; color: var(--accent); font-weight: 600; font-size: .92rem; }
.link-arrow .arrow { transition: transform .25s var(--ease); }
.link-arrow:hover .arrow { transform: translateX(4px); }

/* 6. HERO ------------------------------------------------------------------ */
.hero {
    position: relative; overflow: hidden;
    padding: 5.5rem 0 6rem;
    min-height: calc(100svh - var(--header-h));
    display: flex; align-items: center;
}
.hero-bg {
    position: absolute; inset: 0; z-index: -1;
    background-image: url('../img/hero-bg-1920.webp');
    background-size: cover; background-position: right center;
    opacity: .55;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 55%), linear-gradient(to top, transparent 0%, #000 30%);
    -webkit-mask-composite: source-in;
            mask-image: linear-gradient(90deg, transparent 0%, #000 55%), linear-gradient(to top, transparent 0%, #000 30%);
            mask-composite: intersect;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 4rem; align-items: center; }

.hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.2rem); margin: 1.25rem 0 1.5rem; font-weight: 800; }
.hero .lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--text-muted); max-width: 560px; }
.hero .lead strong { color: var(--text); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.25rem; }

.hero-badges { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 1.25rem 1.75rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.hero-badge { display: flex; align-items: center; gap: .7rem; font-size: .88rem; color: var(--text-muted); }
.hero-badge svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; }
.hero-badge b { color: var(--text); font-weight: 600; }

/* Terminal */
.terminal {
    background: rgba(5, 9, 18, 0.82);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow), 0 0 0 1px rgba(97,218,230,.05), 0 0 80px -30px rgba(97,218,230,.35);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    overflow: hidden; font-family: var(--font-mono); font-size: .84rem;
}
.terminal-bar { display: flex; align-items: center; gap: .5rem; padding: .8rem 1rem; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.02); }
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a4456; }
.terminal-bar i:nth-child(1) { background: #ff5f57; }
.terminal-bar i:nth-child(2) { background: #febc2e; }
.terminal-bar i:nth-child(3) { background: #28c840; }
.terminal-bar span { margin-left: auto; margin-right: auto; color: var(--text-dim); font-size: .76rem; transform: translateX(-20px); }
.terminal-body { padding: 1.25rem 1.4rem 1.5rem; min-height: 300px; line-height: 1.85; }
.terminal-body p { white-space: pre-wrap; word-break: break-word; }
.t-prompt { color: var(--accent); }
.t-path { color: #7aa2f7; }
.t-ok { color: var(--success); }
.t-key { color: #c3cfe0; }
.t-dim { color: var(--text-dim); }
.t-cursor { display: inline-block; width: 8px; height: 1.05em; background: var(--accent); vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* 7. FRANJA DE TECNOLOGÍAS ------------------------------------------------- */
.tech-strip { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 1.6rem 0; background: rgba(255,255,255,.012); }
.tech-strip-inner { display: flex; align-items: center; gap: 2.5rem; }
.tech-strip-label { font-family: var(--font-mono); font-size: .75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.marquee { overflow: hidden; flex: 1; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee-group { display: flex; gap: 2.75rem; padding-right: 2.75rem; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font-family: var(--font-head); font-weight: 600; color: var(--text-muted); font-size: 1rem; white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* 8. TARJETAS -------------------------------------------------------------- */
.card {
    position: relative; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 2rem;
    transition: transform .35s var(--ease), border-color .35s, background .35s;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); background: var(--surface-2); }
.card h3 { font-size: 1.2rem; margin-bottom: .75rem; }
.card p { color: var(--text-muted); font-size: .96rem; }

.icon-box {
    width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
    background: linear-gradient(135deg, rgba(97,218,230,.15), rgba(29,89,184,.15));
    border: 1px solid rgba(97,218,230,.2); color: var(--accent); margin-bottom: 1.5rem;
}
.icon-box svg { width: 24px; height: 24px; }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Servicios (home) */
.service-card { display: flex; flex-direction: column; }
.service-card ul { margin: 1.25rem 0 1.5rem; display: grid; gap: .5rem; }
.service-card li { display: flex; gap: .6rem; font-size: .92rem; color: var(--text-muted); }
.service-card li::before { content: ""; width: 6px; height: 6px; margin-top: .6rem; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.service-card .link-arrow { margin-top: auto; }

.tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tags span {
    font-family: var(--font-mono); font-size: .74rem; color: #bfe9ee;
    background: rgba(97, 218, 230, .07); border: 1px solid rgba(97, 218, 230, .16);
    padding: .3rem .65rem; border-radius: 6px;
}

/* Proyectos */
.project-card { display: flex; flex-direction: column; gap: 1rem; padding: 0; overflow: hidden; }
.project-top {
    height: 6px; background: var(--grad); opacity: .8;
}
.project-body { padding: 1.75rem 2rem 0; display: flex; flex-direction: column; gap: 1rem; flex: 1; }
.project-meta { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.project-cat { font-family: var(--font-mono); font-size: .74rem; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.project-status { font-size: .74rem; color: var(--success); display: inline-flex; align-items: center; gap: .4rem; }
.project-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.project-status--wip { color: #f5b942; }
/* Proyectos confidenciales */
.teaser-stack { gap: 1.5rem; grid-auto-rows: 1fr; }
.teaser {
    display: flex; flex-direction: column; gap: 1rem; overflow: hidden;
    border-style: dashed; border-color: rgba(97, 218, 230, .22);
    background: radial-gradient(420px 200px at 100% 0%, rgba(97, 218, 230, .08), transparent 70%), var(--surface);
}
.teaser h3 { font-size: 1.6rem; letter-spacing: .02em; margin: 0; }
.teaser .link-arrow { margin-top: auto; }
.teaser-lock { display: inline-flex; align-items: center; gap: .45rem; font-family: var(--font-mono); font-size: .74rem; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.teaser-lock svg { width: 14px; height: 14px; }
.product-features { display: grid; gap: .45rem; }
.product-features li { display: flex; gap: .6rem; font-size: .92rem; color: var(--text-muted); }
.product-features li::before { content: ""; width: 6px; height: 6px; margin-top: .6rem; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.project-card h3 { font-size: 1.25rem; margin: 0; }
.project-actions { display: flex; flex-wrap: wrap; gap: .75rem; padding: 0 2rem 2rem; margin-top: auto; }

/* Stats / credenciales */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.stat { padding: 2rem 1.75rem; border-right: 1px solid var(--border); }
.stat:last-child { border-right: 0; }
.stat strong { display: block; font-family: var(--font-head); font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.1; margin-bottom: .5rem; }
.stat span { color: var(--text-muted); font-size: .9rem; }

/* Metodología */
.steps { counter-reset: step; }
.step { padding-top: 2.25rem; }
.step::before {
    counter-increment: step; content: "0" counter(step);
    position: absolute; top: 1.5rem; right: 1.75rem;
    font-family: var(--font-mono); font-size: .85rem; color: var(--text-dim);
}
.step .icon-box { margin-bottom: 1.25rem; }

/* Diferenciadores */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.check-list { display: grid; gap: 1.25rem; }
.check-list li { display: flex; gap: 1rem; }
.check-list svg { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; margin-top: .15rem; }
.check-list h3 { font-size: 1.02rem; margin-bottom: .2rem; }
.check-list p { color: var(--text-muted); font-size: .94rem; }

/* CTA */
.cta {
    position: relative; overflow: hidden; border-radius: 24px; padding: 4rem 3rem; text-align: center;
    background: radial-gradient(600px 300px at 50% 0%, rgba(97,218,230,.18), transparent 70%), linear-gradient(135deg, #0d1a33, #0a1226);
    border: 1px solid rgba(97,218,230,.18);
}
.cta h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom: 1rem; }
.cta p { color: var(--text-muted); max-width: 560px; margin: 0 auto 2rem; font-size: 1.05rem; }
.cta .hero-actions { justify-content: center; margin-top: 0; }

/* 9. PÁGINAS INTERNAS ------------------------------------------------------ */
.page-hero { padding: 5rem 0 3.5rem; }
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); margin: 1rem 0 1.25rem; font-weight: 800; }
.page-hero p { color: var(--text-muted); font-size: 1.12rem; max-width: 640px; }

.service-detail { display: grid; grid-template-columns: 64px 1fr; gap: 1.75rem; }
.service-detail .icon-box { margin: 0; width: 64px; height: 64px; }
.service-detail .icon-box svg { width: 28px; height: 28px; }
.service-detail h2 { font-size: 1.4rem; margin-bottom: .75rem; }
.service-detail > div > p { color: var(--text-muted); margin-bottom: 1.25rem; }
.service-detail ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem 1.5rem; margin-bottom: 1.5rem; }
.service-detail li { display: flex; gap: .6rem; font-size: .93rem; color: var(--text-muted); }
.service-detail li::before { content: "→"; color: var(--accent); font-family: var(--font-mono); }
.service-detail .tags { margin-bottom: 1.5rem; }

/* Timeline (experiencia) */
.timeline { position: relative; max-width: 860px; margin: 0 auto; padding-left: 2.5rem; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--accent), rgba(29,89,184,.2)); border-radius: 2px; }
.timeline-item { position: relative; margin-bottom: 2rem; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: calc(-2.5rem + 2px); top: 2.1rem; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); box-shadow: 0 0 14px rgba(97,218,230,.6); }
.timeline-item .card h3 { font-size: 1.3rem; }
.timeline-sub { color: var(--accent); font-size: .92rem; font-weight: 500; margin: -.25rem 0 1rem; }
.timeline-item .card > p { margin-bottom: 1.25rem; }

/* 10. FORMULARIO ----------------------------------------------------------- */
.quote-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 2rem; align-items: start; }
.form { display: grid; gap: 1.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.field { display: grid; gap: .5rem; }
.field label, .field legend { font-size: .9rem; font-weight: 600; }
.field .req { color: var(--accent); }
.field input, .field textarea, .field select {
    width: 100%; padding: .85rem 1rem; border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, .3); border: 1px solid var(--border); color: var(--text);
    transition: border-color .2s, box-shadow .2s;
}
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.field select option { background: var(--bg-2); }
.field textarea { resize: vertical; min-height: 140px; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-dim); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(97,218,230,.15); }
.field.has-error input, .field.has-error textarea { border-color: #ff6b81; }
.field.has-error .options { outline: 1px solid #ff6b81; outline-offset: 6px; }
.field-error { color: #ff8c9e; font-size: .82rem; min-height: 1em; }
.field-hint { color: var(--text-dim); font-size: .82rem; }
fieldset.field { border: 0; }

.options { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; border-radius: var(--radius-sm); }
.option { position: relative; cursor: pointer; }
.option input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.option span {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .55rem; text-align: center;
    min-height: 100px; padding: 1rem .75rem; border-radius: var(--radius-sm); font-size: .86rem; font-weight: 500; color: var(--text-muted);
    background: rgba(0,0,0,.25); border: 1px solid var(--border); transition: all .2s;
}
.option svg { width: 24px; height: 24px; }
.option:hover span { border-color: rgba(97,218,230,.3); color: var(--text); }
.option input:checked + span { border-color: var(--accent); color: var(--text); background: rgba(97,218,230,.08); box-shadow: 0 0 0 1px var(--accent) inset; }
.option input:checked + span svg { color: var(--accent); }
.option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.form-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.form-note { font-size: .82rem; color: var(--text-dim); }
.form-note a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.contact-aside { display: grid; gap: 1.5rem; position: sticky; top: calc(var(--header-h) + 1.5rem); }
.contact-item { display: flex; gap: 1rem; align-items: flex-start; }
.contact-item .icon-box { margin: 0; width: 44px; height: 44px; border-radius: 12px; }
.contact-item .icon-box svg { width: 20px; height: 20px; }
.contact-item small { display: block; color: var(--text-dim); font-size: .8rem; }
.contact-item a, .contact-item b { font-weight: 600; word-break: break-word; }
.contact-item a:hover { color: var(--accent); }

/* 11. LEGAL ---------------------------------------------------------------- */
.legal { max-width: 820px; margin: 0 auto; }
.legal .card:hover { transform: none; }
.legal h2 { font-size: 1.2rem; margin: 2.25rem 0 .75rem; }
.legal h2:first-child { margin-top: 0; }
.legal p, .legal li { color: var(--text-muted); font-size: .97rem; }
.legal p + p { margin-top: .75rem; }
.legal ul { list-style: disc; padding-left: 1.4rem; margin-top: .75rem; display: grid; gap: .5rem; }
.legal strong { color: var(--text); }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* 404 */
.error-page { text-align: center; padding: 8rem 0; }
.error-page .code { font-family: var(--font-mono); font-size: clamp(4rem, 14vw, 8rem); font-weight: 700; line-height: 1; }
.error-page p { color: var(--text-muted); margin: 1rem auto 2rem; max-width: 460px; }
.error-page .hero-actions { justify-content: center; }

/* 12. FOOTER --------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); background: rgba(5, 8, 16, 0.85); padding: 4.5rem 0 0; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 3rem; padding-bottom: 3.5rem; }
.footer-brand img { height: 52px; width: auto; margin-bottom: 1.25rem; }
.footer-brand p { color: var(--text-muted); font-size: .92rem; max-width: 320px; }
.footer-col h4 { font-size: .8rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); margin-bottom: 1.25rem; font-weight: 500; }
.footer-col ul { display: grid; gap: .7rem; }
.footer-col a, .footer-col li { color: var(--text-muted); font-size: .93rem; transition: color .2s; }
.footer-col a:hover { color: var(--accent); }
.footer-contact li { display: flex; gap: .65rem; align-items: flex-start; }
.footer-contact svg { width: 17px; height: 17px; margin-top: .25rem; color: var(--accent); flex-shrink: 0; }

.social { display: flex; gap: .75rem; margin-top: 1.5rem; }
.social a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); transition: all .2s; }
.social a:hover { color: var(--accent); border-color: var(--border-strong); transform: translateY(-2px); }
.social svg { width: 18px; height: 18px; }

.footer-bottom { border-top: 1px solid var(--border); padding: 1.5rem 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--text-dim); }
.footer-bottom nav { display: flex; gap: 1.5rem; }
.footer-bottom a:hover { color: var(--accent); }

/* WhatsApp flotante */
.wa-float {
    position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 900;
    width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
    background: #25d366; color: #fff; box-shadow: 0 10px 30px -6px rgba(37, 211, 102, .55);
    transition: transform .25s var(--ease), box-shadow .25s;
}
.wa-float svg { width: 30px; height: 30px; }
.wa-float:hover { transform: scale(1.08); box-shadow: 0 14px 36px -6px rgba(37, 211, 102, .75); }

/* 13. ANIMACIONES DE ENTRADA ----------------------------------------------
   Sólo se ocultan si JS está activo (clase .js en <html>), así el contenido
   nunca queda invisible si el script falla o está bloqueado. */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .js .reveal { opacity: 1; transform: none; }
    .marquee-track { animation: none; }
}

/* 14. RESPONSIVE ----------------------------------------------------------- */
@media (max-width: 1080px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .hero-grid { grid-template-columns: 1fr; gap: 3rem; }
    .hero { min-height: auto; padding-top: 4rem; }
    .terminal { max-width: 620px; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .stat:nth-child(2) { border-right: 0; }
    .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
    .quote-layout { grid-template-columns: 1fr; }
    .contact-aside { position: static; }
}

@media (max-width: 860px) {
    :root { --header-h: 68px; }
    .brand img { height: 40px; }
    .nav-toggle { display: block; }
    .main-nav {
        position: fixed; top: var(--header-h); left: 0; right: 0; height: calc(100dvh - var(--header-h));
        flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 2rem;
        padding: 2rem 1.5rem; background: var(--bg);
        opacity: 0; visibility: hidden; transform: translateY(-8px);
        transition: opacity .25s, transform .25s var(--ease), visibility .25s;
    }
    .main-nav.is-open { opacity: 1; visibility: visible; transform: none; }
    .main-nav ul { flex-direction: column; gap: 0; }
    .main-nav ul a { display: block; font-size: 1.25rem; font-family: var(--font-head); color: var(--text); padding: 1rem 0; border-bottom: 1px solid var(--border); }
    .main-nav ul a::after { display: none; }
    .main-nav ul a[aria-current="page"] { color: var(--accent); }
    .main-nav .btn { width: 100%; }
    body.nav-open { overflow: hidden; }

    .section { padding: 4.5rem 0; }
    .grid-2, .grid-3, .split { grid-template-columns: 1fr; }
    .split { gap: 2.5rem; }
    .tech-strip-inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .tech-strip-inner .marquee { width: 100%; }
    .service-detail { grid-template-columns: 1fr; gap: 1.25rem; }
    .service-detail ul { grid-template-columns: 1fr; }
    .options { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .container { padding: 0 1rem; }
    .grid-4, .footer-grid { grid-template-columns: 1fr; }
    .footer-grid { gap: 2.25rem; }
    .stats { grid-template-columns: 1fr; }
    .stat { border-right: 0; border-bottom: 1px solid var(--border); }
    .stat:last-child { border-bottom: 0; }
    .card { padding: 1.5rem; }
    .project-body { padding: 1.5rem 1.5rem 0; }
    .project-actions { padding: 0 1.5rem 1.5rem; }
    .project-actions .btn { flex: 1; }
    .hero-actions .btn { flex: 1 1 100%; }
    .form-row { grid-template-columns: 1fr; }
    .hero-badges { grid-template-columns: 1fr; }
    .cta { padding: 3rem 1.25rem; }
    .terminal { font-size: .76rem; }
    .terminal-body { padding: 1rem; min-height: 0; }
    /* Footer centrado en móvil */
    .footer-grid { text-align: center; }
    .footer-brand img { margin-left: auto; margin-right: auto; }
    .footer-brand p { margin: 0 auto; }
    .social { justify-content: center; }
    .footer-col ul { justify-items: center; }
    .footer-contact li { justify-content: center; text-align: left; }
    .footer-bottom { flex-direction: column; align-items: center; text-align: center; padding-bottom: 5.5rem; }
    .footer-bottom nav { justify-content: center; flex-wrap: wrap; gap: .75rem 1.5rem; }
    .wa-float { right: 1rem; bottom: 1rem; width: 54px; height: 54px; }
    .hero-bg { background-image: url('../img/hero-bg-960.webp'); opacity: .35; }
}
