/* ==========================================================================
   MacalTech Holding — hoja de estilos compartida
   Usada por: index.html, aviso-legal.html,
              politica-privacidad.html, politica-cookies.html

   Índice
   ------
   01. Tokens
   02. Reset y base
   03. Utilidades
   04. Cabecera y navegación
   05. Controles (idioma / tema)
   06. Hero de portada
   07. Cabecera de páginas interiores
   08. Secciones
   09. Rejillas y tarjetas
   10. Portfolio
   11. Llamada a la acción y cifras
   12. Contacto
   13. Páginas legales
   14. Pie
   15. Revelado al hacer scroll
   16. Adaptación a pantallas pequeñas
   17. Preferencias del sistema e impresión
   ========================================================================== */


/* 01. Tokens ============================================================== */

:root {
    --gold: #F5A623;
    --gold-dark: #d99420;
    --gold-grad: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    --gold-wash: linear-gradient(135deg, rgba(245, 166, 35, 0.10) 0%, rgba(245, 166, 35, 0.04) 100%);
    --gold-line: rgba(245, 166, 35, 0.30);

    /* Superficies corporativas: oscuras en ambos temas, por diseño */
    --shell: #0F1419;
    --shell-deep: #0A0D12;
    --shell-alt: #1A1F2E;
    --on-shell: #FFFFFF;
    --on-shell-muted: #D1D5DB;
    --on-shell-faint: #9CA3AF;

    --radius-sm: 6px;
    --radius-md: 14px;
    --radius-lg: 16px;
    --radius-pill: 50px;

    --wrap: 1200px;
    --wrap-prose: 900px;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #0F1419;
    --bg-secondary: #151A24;
    --bg-card: #1E2435;
    --text-primary: #FFFFFF;
    --text-secondary: #D1D5DB;
    --text-muted: #9CA3AF;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: rgba(0, 0, 0, 0.40);
}

[data-theme="light"] {
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-card: #FFFFFF;
    --text-primary: #0F1419;
    --text-secondary: #374151;
    --text-muted: #6B7280;
    --border: rgba(0, 0, 0, 0.09);
    --shadow: rgba(15, 20, 25, 0.12);
}


/* 02. Reset y base ======================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

body,
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }

ul, ol { padding: 0; list-style: none; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5.5rem;   /* compensa la cabecera fija */
}

body {
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
    overflow-x: hidden;
}

a { color: inherit; }

img, svg { display: block; max-width: 100%; }

strong { color: var(--text-primary); font-weight: 600; }

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

/* Visibilidad por idioma.
   Único punto de control: depende solo del atributo lang del <html>.
   Lleva !important para prevalecer sobre el display de .callout--note
   y sobre cualquier estilo en línea que fije el JavaScript. */
[data-lang-only]                        { display: none !important; }
html[lang="es"] [data-lang-only="es"]   { display: flex !important; }
html[lang="en"] [data-lang-only="en"]   { display: flex !important; }


/* 03. Utilidades ========================================================== */

.wrap {
    max-width: var(--wrap);
    margin-inline: auto;
}

.wrap--prose {
    max-width: var(--wrap-prose);
    margin-inline: auto;
}

.rule {
    width: 80px;
    height: 4px;
    background: var(--gold);
    border-radius: 2px;
    margin: 0 auto 2rem;
}

.accent { color: var(--gold); }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: 50%;
    translate: -50% -150%;
    z-index: 2000;
    background: var(--gold);
    color: var(--shell);
    padding: 0.7rem 1.4rem;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    transition: translate 0.2s var(--ease);
}

.skip-link:focus { translate: -50% 0; }


/* 04. Cabecera y navegación =============================================== */

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    background: var(--shell);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.site-nav {
    max-width: var(--wrap);
    margin-inline: auto;
    padding: 1.1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    flex-shrink: 0;
}

.logo__mark {
    width: 38px;
    height: 38px;
    background: var(--gold);
    color: var(--shell);
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1.2rem;
    line-height: 1;
}

.logo__text {
    color: var(--on-shell);
    font-size: 1.15rem;
    font-weight: 600;
    white-space: nowrap;
}

.logo__text b {
    color: var(--gold);
    font-weight: 600;
}

.nav-cluster {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-menu a,
.back-link {
    color: var(--on-shell-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.25s var(--ease);
}

.nav-menu a:hover,
.back-link:hover { color: var(--gold); }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-toggle { display: none; }


/* 05. Controles (idioma / tema) =========================================== */

.controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.ctrl {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-pill);
    color: var(--on-shell-muted);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.25s var(--ease),
                border-color 0.25s var(--ease),
                color 0.25s var(--ease);
}

.ctrl:hover {
    background: rgba(245, 166, 35, 0.15);
    border-color: var(--gold);
    color: var(--gold);
}

/* Sin JavaScript los botones no hacen nada: se ocultan */
.no-js .controls,
.no-js .nav-toggle { display: none; }


/* 06. Hero de portada ===================================================== */

.hero {
    position: relative;
    isolation: isolate;
    min-height: 100svh;
    display: grid;
    place-items: center;
    background: var(--shell);
    color: var(--on-shell);
    text-align: center;
    overflow: hidden;
}

.hero__glow {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
}

.hero__glow--a {
    top: 5rem;
    left: 2rem;
    width: 18rem;
    height: 18rem;
    background: radial-gradient(circle, rgba(245, 166, 35, 0.12) 0%, transparent 70%);
    animation: glow-a 8s ease-in-out infinite;
}

.hero__glow--b {
    right: 2rem;
    bottom: 5rem;
    width: 24rem;
    height: 24rem;
    background: radial-gradient(circle, rgba(245, 166, 35, 0.09) 0%, transparent 70%);
    animation: glow-b 10s ease-in-out infinite;
}

@keyframes glow-a {
    0%, 100% { transform: scale(1);   opacity: 0.3; }
    50%      { transform: scale(1.2); opacity: 0.5; }
}

@keyframes glow-b {
    0%, 100% { transform: scale(1.2); opacity: 0.2; }
    50%      { transform: scale(1);   opacity: 0.4; }
}

.hero__inner {
    max-width: 860px;
    padding: 7rem 2rem 6rem;
}

.hero__lead {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--on-shell-muted);
    font-weight: 300;
    margin-bottom: 2.5rem;
    text-wrap: pretty;
}

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--gold-grad);
    color: var(--shell);
    border-radius: var(--radius-pill);
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(245, 166, 35, 0.4);
}

.scroll-cue {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    translate: -50% 0;
    color: var(--gold);
    animation: cue 2s ease-in-out infinite;
}

@keyframes cue {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(10px); }
}


/* 07. Cabecera de páginas interiores ====================================== */

.page-hero {
    background: var(--shell);
    color: var(--on-shell);
    padding: 8rem 2rem 4rem;
    text-align: center;
}

.page-hero__lead {
    font-size: 1.05rem;
    color: var(--on-shell-muted);
    font-weight: 300;
}


/* 08. Secciones =========================================================== */

.section { padding: 6rem 2rem; }

.section--plain     { background: var(--bg-primary); }
.section--alt       { background: var(--bg-secondary); }
.section--shell     { background: var(--shell);     color: var(--on-shell); }
.section--shell-alt { background: var(--shell-alt); color: var(--on-shell); }

h1 {
    font-size: clamp(2.2rem, 5vw, 3.75rem);
    font-weight: 700;
    line-height: 1.18;
    margin-bottom: 1.5rem;
    text-wrap: balance;
}

.page-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
}

h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.75rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    text-wrap: balance;
}

h3 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.section__lead {
    max-width: 860px;
    margin: 0 auto 4rem;
    text-align: center;
    font-size: 1.05rem;
    line-height: 1.8;
    text-wrap: pretty;
}

.section--plain .section__lead,
.section--alt   .section__lead { color: var(--text-muted); }

.section--shell     .section__lead,
.section--shell-alt .section__lead { color: var(--on-shell-muted); }


/* 09. Rejillas y tarjetas ================================================= */

.grid { display: grid; gap: 1.75rem; }

.grid--features  { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--portfolio { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.grid--info      { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }

.grid--contact {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    max-width: 950px;
    margin-inline: auto;
}

.card {
    padding: 2.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: transform 0.3s var(--ease),
                box-shadow 0.3s var(--ease),
                border-color 0.3s var(--ease);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px var(--shadow);
    border-color: var(--gold-line);
}

.card p {
    color: var(--text-muted);
    line-height: 1.7;
}

/* Variante con filete dorado a la izquierda (política de cookies) */
.card--edge { border-left: 4px solid var(--gold); }

.icon-tile {
    width: 64px;
    height: 64px;
    background: var(--gold-grad);
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    color: #FFFFFF;
    margin-bottom: 1.5rem;
    transition: transform 0.3s var(--ease);
}

.icon-tile--sm {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    margin-bottom: 1.25rem;
}

.icon-tile--round {
    border-radius: 50%;
    flex-shrink: 0;
}

.card:hover .icon-tile { transform: scale(1.1); }


/* 10. Portfolio =========================================================== */

.tag {
    display: inline-block;
    padding: 0.38rem 0.9rem;
    margin-bottom: 1.15rem;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 600;
    color: #FFFFFF;
}

.tag--blue   { background: #2563EB; }
.tag--purple { background: #7C3AED; }
.tag--orange { background: #EA580C; }
.tag--teal   { background: #0D9488; }

.card--portfolio h3 { font-size: 1.35rem; }

.card--portfolio h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.25s var(--ease);
}

.card--portfolio h3 a:hover,
.card--portfolio h3 a:focus-visible { color: var(--gold); }


/* 11. Llamada a la acción y cifras ======================================== */

.cta { text-align: center; }

.cta h2 { color: var(--on-shell); }

.cta__icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    background: var(--gold-grad);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #FFFFFF;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 2.5rem;
    max-width: 900px;
    margin: 4rem auto 0;
}

.stats dt {
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--gold);
}

.stats dd {
    margin: 0.4rem 0 0;
    color: var(--on-shell-muted);
    font-size: 0.95rem;
}


/* 12. Contacto ============================================================ */

.contact h2 { color: var(--on-shell); }

.card--contact {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(245, 166, 35, 0.2);
    text-align: center;
}

.card--contact:hover {
    border-color: var(--gold);
    box-shadow: none;
}

.card--contact h3 { color: var(--on-shell); }

.card--contact p,
.card--contact a {
    color: var(--on-shell-muted);
    text-decoration: none;
    transition: color 0.25s var(--ease);
}

.card--contact a:hover,
.card--contact a:focus-visible { color: var(--gold); }

.card--contact .icon-tile {
    width: 66px;
    height: 66px;
    margin-inline: auto;
}


/* 13. Páginas legales ===================================================== */

.legal {
    max-width: var(--wrap-prose);
    margin-inline: auto;
    padding: 4rem 2rem;
}

.legal__block { margin-bottom: 3rem; }

.legal__block h2 {
    position: relative;
    padding-left: 1.25rem;
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    text-align: left;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

.legal__block h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.15em;
    width: 4px;
    height: 0.9em;
    background: var(--gold);
    border-radius: 2px;
}

.legal__block p {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.legal__block p:last-child { margin-bottom: 0; }

.legal__block li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.legal__block li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.7rem;
    width: 6px;
    height: 6px;
    background: var(--gold);
    border-radius: 50%;
}

/* Ficha de datos societarios */
.data-box {
    margin-top: 1rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 4px solid var(--gold);
    border-radius: 10px;
}

.data-box p {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.data-box p:last-child { margin-bottom: 0; }

/* Aviso destacado, usado para la nota de prevalencia y los recuadros */
.callout {
    padding: 1.25rem 1.5rem;
    background: var(--gold-wash);
    border: 1px solid var(--gold-line);
    border-radius: 10px;
}

.callout p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.7;
}

.callout--note {
    margin-bottom: 3rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.callout--note p { font-size: 0.9rem; }

.callout--note svg {
    flex-shrink: 0;
    margin-top: 0.15rem;
    color: var(--gold);
}

.callout--wide {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 2rem;
    border-radius: var(--radius-md);
}

.callout--wide h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.6rem;
}

.callout--inline { margin-top: 1.5rem; }

.callout--inline p { font-weight: 500; }

/* Bloque introductorio centrado (política de cookies) */
.intro {
    text-align: center;
    margin-bottom: 4rem;
}

.intro h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.intro p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

.intro .icon-tile {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(245, 166, 35, 0.2);
}

.updated {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}


/* 14. Pie ================================================================= */

.site-footer {
    background: var(--shell-deep);
    color: var(--on-shell);
    padding: 3rem 2rem 1.5rem;
}

.site-footer__top {
    max-width: var(--wrap);
    margin: 0 auto 2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.75rem;
}

.footer-links a {
    color: var(--on-shell-faint);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.25s var(--ease);
}

.footer-links a:hover { color: var(--gold); }
.footer-links a[aria-current="page"] { color: var(--gold); }

.site-footer__bottom {
    max-width: var(--wrap);
    margin-inline: auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    color: var(--on-shell-faint);
    font-size: 0.85rem;
}


/* 15. Revelado al hacer scroll ============================================ */

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

.grid > .reveal:nth-child(2) { transition-delay: 0.10s; }
.grid > .reveal:nth-child(3) { transition-delay: 0.20s; }
.grid > .reveal:nth-child(4) { transition-delay: 0.30s; }


/* 16. Adaptación a pantallas pequeñas ===================================== */

@media (max-width: 860px) {

    .site-nav { padding: 1rem 1.25rem; }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        padding: 0;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: var(--radius-sm);
        color: var(--on-shell-muted);
        cursor: pointer;
    }

    .nav-cluster {
        position: absolute;
        inset: 100% 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        max-height: 0;
        padding: 0 1.25rem;
        background: var(--shell);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        overflow: hidden;
        transition: max-height 0.3s var(--ease), padding 0.3s var(--ease);
    }

    .site-nav[data-open="true"] .nav-cluster {
        max-height: 26rem;
        padding: 1rem 1.25rem 1.5rem;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0;
    }

    .nav-menu a {
        display: block;
        padding: 0.85rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .back-link {
        padding: 0.85rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .controls { padding-top: 1rem; }

    .section     { padding: 4rem 1.25rem; }
    .hero__inner { padding: 7rem 1.25rem 5rem; }
    .page-hero   { padding: 7rem 1.25rem 3rem; }
    .legal       { padding: 3rem 1.25rem; }

    .stats { grid-template-columns: repeat(2, 1fr); gap: 2rem; }

    .callout--wide {
        flex-direction: column;
        text-align: center;
    }

    .callout--wide .icon-tile { margin-inline: auto; }
}


/* 17. Preferencias del sistema e impresión ================================ */

@media (prefers-reduced-motion: reduce) {

    html { scroll-behavior: auto; }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

@media print {

    .site-header,
    .scroll-cue,
    .controls,
    .hero__glow { display: none; }

    body {
        background: #FFFFFF;
        color: #000000;
    }

    .section,
    .page-hero,
    .site-footer {
        background: #FFFFFF;
        color: #000000;
    }

    .card { break-inside: avoid; }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.85em;
        color: #555555;
    }
}