/* 
   - Agustín Disainer - ALORA INSPIRED PREMIUM REDESIGN 2026
   - Aesthetic: Corporate Creative / High-End Agency
*/

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;800&family=Inter:wght@300;400;600;700&display=swap');
@import url('https://api.fontshare.com/v2/css?f[]=satoshi@900,700,500,400&display=swap');

:root {
    /* Alora-Inspired Palette */
    --bg-primary: #080808;
    --bg-secondary: #0f0f0f;
    --bg-accent-soft: #141414;
    --border-color: rgba(255, 255, 255, 0.08);

    /* Branding */
    --accent: #FFCC00;
    --accent-glow: rgba(255, 204, 0, 0.4);
    --accent-dim: rgba(255, 204, 0, 0.1);

    /* Typography */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;
    --text-white: #FFFFFF;
    --text-white-rgb: 255, 255, 255;
    --text-gray: #a0a0a0;
    --text-muted: #555555;
    --text-black-rgb: 0, 0, 0;

    /* Grid & Spacing */
    --container-max: 1400px;
    --space-unit: 1rem;

    /* Motion */
    --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --transition-base: 0.6s var(--ease-standard);
}

/* Light Theme Overrides */
[data-theme="light"] {
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-accent-soft: #f0f0f5;
    --border-color: rgba(0, 0, 0, 0.1);

    --text-white: #111111;
    --text-white-rgb: 17, 17, 17;
    --text-gray: #444444;
    --text-muted: #666666;
    --text-black-rgb: 255, 255, 255;

    /* Yellow accent should stay visible, adjust if needed for contrast. Original --accent is bright yellow. */
    --accent: #FFCC00;
    --accent-glow: rgba(255, 204, 0, 0.4);
    --accent-dim: rgba(255, 204, 0, 0.1);
}

[data-theme="light"] .hero .glass-mask {
    background: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] header.scrolled {
    background: rgba(245, 245, 247, 0.9);
}

[data-theme="light"] .logo img {
    filter: none;
}

[data-theme="light"] .footer-logo-wrapper img {
    filter: invert(0) !important;
    /* already black in dark mode due to brightness(0) filter */
}

/* Footer Divider Line */
.footer-divider {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.2);
    margin: 3rem 0 1.5rem;
}

[data-theme="light"] .footer-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.4);
}

/* Huge Footer Logos */
.footer-huge-logo {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    pointer-events: none;
    position: relative;
    z-index: 1;
    margin-top: 1.5rem;
}

.footer-huge-logo img {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: bottom;
    /* slightly translate to cut off at the bottom as seen in mockups */
    transform: translateY(1%);
}

.logo-footer-light {
    display: none;
}

[data-theme="light"] .logo-footer-dark {
    display: none;
}

[data-theme="light"] .logo-footer-light {
    display: block;
}

/* Fix for Ver Trabajos button text in light mode */
[data-theme="light"] .btn-ver-trabajos {
    color: #111111 !important;
}

/* Custom Icons fix in light mode */
[data-theme="light"] .tech-card img[src*="github"],
[data-theme="light"] .tech-card img[src*="Illustrator"],
[data-theme="light"] .tech-card img[src*="Photoshop"],
[data-theme="light"] .tech-card img[src*="After"],
[data-theme="light"] .tech-card img[src*="Sass"],
[data-theme="light"] .tech-card img[src*="gemini"],
[data-theme="light"] .tech-card img[src*="coreldraw"],
[data-theme="light"] .tech-card img[src*="firefly"] {
    filter: none;
}

[data-theme="light"] .card-badge {
    background: rgba(255, 204, 0, 0.1);
}

[data-theme="light"] .progress-bar {
    background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .gallery-progress .progress-bar.active {
    background: var(--accent);
}

/* FAQ light mode: make dividers visible - Darker and sharper */
[data-theme="light"] .faq-item {
    border-color: rgba(0, 0, 0, 0.4);
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .faq-item:hover {
    border-color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .faq-accordion {
    border-left-color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .faq-category-toggle {
    border-bottom: 1px solid rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .faq-question {
    color: var(--text-white);
}

/* Specific text color fixes for light mode */
[data-theme="light"] .tech-card span,
[data-theme="light"] .social-icon-box {
    color: var(--text-white);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    /* Adjusted offset for flush connection with header */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a {
    text-decoration: none;
    /* Remove underline from all links */
}

body {
    background-color: var(--bg-primary);
    color: var(--text-white);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Base Grid */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 4%;
}

.container-full {
    max-width: 2500px;
    margin: 0 auto;
    padding: 0 1.5%;
}

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

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: clamp(1rem, 3vw, 1.5rem) 0;
    padding-top: calc(clamp(1rem, 3vw, 1.5rem) + env(safe-area-inset-top, 0));
    transition: var(--transition-base);
}

header.scrolled {
    background: rgba(8, 8, 8, 0.9);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
}

main {
    position: relative;
}

.nav-layout-v4 {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding: 0 6%;
    gap: 3.5rem;
}

.nav-left-content {
    display: flex;
    align-items: center;
    gap: 3rem;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-white);
    font-family: 'Satoshi', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: 0.3s;
}

.nav-links a:hover {
    color: var(--accent);
}

.btn-contacto-pill {
    padding: 0.6rem 1.4rem;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 50px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
    text-decoration: none;
}

.btn-contacto-pill:hover {
    background: var(--accent);
    color: #000;
}

.btn-contacto-pill .arrow {
    font-size: 14px;
}


@keyframes soundAnim {
    from {
        height: 20%;
    }

    to {
        height: 100%;
    }
}

.nav-links a:hover {
    color: var(--accent);
}

.btn-contacto-mobile,
.mobile-menu-footer {
    display: none;
}

/* Hamburger Menu Button */
.hamburger-menu {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 6px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hamburger-menu span {
    width: 25px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    transition: 0.3s ease;
    display: block;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Buttons */
.btn-cta {
    position: relative;
    padding: 1rem 2.5rem;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: 'Satoshi', sans-serif;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition-base);
    text-decoration: none;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-cta:hover {
    background: transparent;
    color: var(--accent) !important;
    /* Yellow text visible on dark background */
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* ==============================
   Music Equalizer Toggle Button
   ============================== */
@keyframes eq-bounce-1 {
    0%, 100% { height: 4px; }
    50%       { height: 18px; }
}
@keyframes eq-bounce-2 {
    0%, 100% { height: 12px; }
    35%       { height: 22px; }
    70%       { height: 5px; }
}
@keyframes eq-bounce-3 {
    0%, 100% { height: 8px; }
    25%       { height: 20px; }
    60%       { height: 3px; }
    80%       { height: 16px; }
}
@keyframes eq-bounce-4 {
    0%, 100% { height: 6px; }
    40%       { height: 24px; }
    75%       { height: 9px; }
}
@keyframes eq-bounce-5 {
    0%, 100% { height: 14px; }
    30%       { height: 4px; }
    65%       { height: 20px; }
}

.music-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    position: fixed;
    top: clamp(1rem, 3vw, 1.5rem);
    right: calc(6% + 52px); /* 52px gap from the theme toggle */
    width: 36px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1010;
    padding: 0;
    border-radius: 4px;
    opacity: 0.65;
    transition: opacity 0.3s ease, transform 0.2s ease;
}

.music-toggle:hover {
    opacity: 1;
    transform: scale(1.08);
}

.music-toggle.is-playing {
    opacity: 1;
}

.eq-bars {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 24px;
}

.eq-bar {
    display: block;
    width: 3px;
    height: 4px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: height 0.15s ease;
}

/* When playing: animate each bar with its unique keyframes and delay */
.music-toggle.is-playing .eq-bar:nth-child(1) {
    animation: eq-bounce-1 0.9s ease-in-out infinite;
}
.music-toggle.is-playing .eq-bar:nth-child(2) {
    animation: eq-bounce-2 0.7s ease-in-out infinite 0.15s;
}
.music-toggle.is-playing .eq-bar:nth-child(3) {
    animation: eq-bounce-3 0.8s ease-in-out infinite 0.05s;
}
.music-toggle.is-playing .eq-bar:nth-child(4) {
    animation: eq-bounce-4 0.6s ease-in-out infinite 0.25s;
}
.music-toggle.is-playing .eq-bar:nth-child(5) {
    animation: eq-bounce-5 1.0s ease-in-out infinite 0.1s;
}

/* Light theme: keep bars visible */
[data-theme="light"] .eq-bar {
    background-color: #111111;
}

/* Mobile header: hide music and theme toggles (solo burger visible) */
@media (max-width: 768px) {
    .music-toggle {
        display: none !important;
    }

    .theme-toggle {
        display: none !important;
    }
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    position: fixed;
    top: clamp(1rem, 3vw, 1.5rem);
    right: 6%;
    width: 35px;
    height: 35px; /* Same height as music-toggle for alignment */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1010;
    transition: transform 0.3s;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* ========== HEADER MOBILE (max-width: 768px) ========== */
@media (max-width: 768px) {
    /* Header siempre fijo al hacer scroll (no se desplaza con la web) */
    #header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1000;
    }

    /* Contenedores del header sin transform para que fixed funcione respecto al viewport */
    #header .nav-wrap,
    #header .nav-layout-v4 {
        transform: none !important;
    }

    /* Solo burger visible en la barra: ocultar logo y pill CONTACTO (el overlay .nav-links debe seguir en DOM) */
    .nav-left-content .logo,
    .nav-left-content .btn-contacto-pill {
        display: none !important;
    }

    /* Burger centrado arriba, fijo al viewport: no baja con el scroll, igual que el header */
    .hamburger-menu {
        position: fixed !important;
        top: calc(clamp(1rem, 3vw, 1.5rem) + env(safe-area-inset-top, 0)) !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        right: auto !important;
        z-index: 1010 !important;
        display: flex !important;
    }

    .hamburger-menu span {
        background: var(--accent) !important;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    /* Menú fullscreen amarillo, contenido centrado */
    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        background-color: var(--accent);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateY(-100%);
        transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1001;
        visibility: hidden;
        pointer-events: none;
        padding: 5rem 10% 2rem;
    }

    .nav-links.active {
        transform: translateY(0);
        visibility: visible;
        pointer-events: auto;
    }

    .nav-links-inner {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .nav-links a {
        font-size: 1.1rem;
        color: #000 !important;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        text-decoration: none;
        padding: 0.5rem 0;
        font-family: var(--font-heading);
    }

    /* Botón CONTACTO grande, blanco, con flecha */
    .btn-contacto-mobile {
        display: inline-flex !important;
        background: #fff;
        color: #000 !important;
        margin-top: 2.5rem;
        padding: 1rem 2.5rem;
        font-family: var(--font-heading);
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-size: 1rem;
        border-radius: 50px;
        text-align: center;
        width: auto;
        min-width: 200px;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
    }

    .btn-contacto-mobile .arrow {
        font-size: 1rem;
    }

    /* SIGUEME + iconos abajo del menú */
    .mobile-menu-footer {
        position: absolute;
        bottom: 8vh;
        width: 100%;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.2rem;
    }

    .mobile-footer-tag {
        color: #000;
        font-weight: 900;
        font-size: 0.85rem;
        letter-spacing: 0.15em;
        margin-bottom: 0;
    }

    .mobile-social-icons {
        display: flex;
        gap: 1rem;
        justify-content: center;
    }

    .mobile-social-icons a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        border: 2px solid #000;
        border-radius: 10px;
        color: #000 !important;
        background: transparent;
    }

    .mobile-social-icons a svg {
        width: 24px;
        height: 24px;
        fill: #000;
    }

    .hamburger-menu.active span {
        background: #000 !important;
    }
}

/* Hero Section */
/* Hero Section v4 */
.hero-v4 {
    height: 100vh;
    display: flex;
    align-items: flex-end;
    padding-bottom: 6vh;
    position: sticky;
    top: 0;
    z-index: 1;
    overflow: hidden;
}

.hero-container-v4 {
    width: 100%;
    padding: 0 6%;
    position: relative;
    z-index: 5;
    /* Ensure text is above animation layers */
}

/* Cinematic Animation Layers */
.is-loaded .hero-anim-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("img/fondo_header_webp version dark.webp");
    background-size: cover;
    background-position: center;
    opacity: 0;
    z-index: -10;
    /* BG fade in (1s) + Impact dip (0.35s starting at 0.7s) */
    animation:
        fadeInBg 1s ease-out forwards,
        bgImpact 0.35s ease-out 0.7s forwards;
}

[data-theme="light"] .hero-anim-background {
    background-image: url("img/fondo_header_webp version white.webp");
}

/* Hero: imágenes mobile solo en viewport ≤768px */
@media (max-width: 768px) {
    .is-loaded .hero-anim-background {
        background-image: url("img/fondo_header_webp version dark_versionmovil.webp");
    }
}

.is-loaded .hero-anim-logo {
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 105vw;
    max-width: none;
    opacity: 0;
    z-index: -9;
    animation:
        logoSweep 0.8s ease-out 0.5s forwards,
        logoImpact 0.35s ease-out 0.7s forwards,
        logoErase 0.9s cubic-bezier(0.4, 0, 1, 1) 1.1s forwards;
    pointer-events: none;
    /* Máscara suave para el barrido de desaparición (--logo-erase animado) */
    -webkit-mask-image: linear-gradient(to right,
        transparent var(--logo-erase),
        black calc(var(--logo-erase) + 22%));
    mask-image: linear-gradient(to right,
        transparent var(--logo-erase),
        black calc(var(--logo-erase) + 22%));
}

.hero-anim-logo picture,
.hero-anim-busto picture {
    display: block;
    width: 100%;
}

.hero-anim-logo img,
.hero-anim-busto img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.is-loaded .hero-anim-busto {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform-origin: bottom center;
    transform: translate(-50%, -150%);
    width: clamp(400px, 55vw, 950px);
    z-index: -8;
    /* Heavy fall (0.7s starting at 0s) + Compression (0.18s at 0.7s) + Breath Loop (starting 1s) */
    animation:
        bustoFall 0.7s cubic-bezier(0.55, 0.055, 0.675, 0.19) 0s forwards,
        bustoCompression 0.18s ease-out 0.7s forwards,
        bustoBreath 8s ease-in-out 1s infinite;
    pointer-events: none;
}

/* Animated background text lines (between background and bust) */
.hero-anim-lines {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0px;
    z-index: -9;
    opacity: 0;
    pointer-events: none;
    animation: linesFadeIn 0.7s ease-out 1.3s forwards;
    overflow: visible;
    /* Empujar el bloque hacia abajo para q la virgulilla de la 1ª línea
       no choque con el borde superior del hero (overflow:hidden del padre) */
    padding-top: clamp(1rem, 2vw, 3rem);
}

.hero-anim-line {
    /* IMPORTANTE: overflow-x:hidden + overflow-y:visible no funciona en CSS
       (el spec obliga a overflow-y:auto cuando overflow-x != visible).
       La única solución real: clip-path con inset negativo en el top,
       que clipea los lados del marquee PERO deja salir 7vw hacia arriba
       para q la virgulilla de la Ñ sea completamente visible. */
    overflow: visible;
    clip-path: inset(-7vw 0px 0.08em 0px);
}

.hero-anim-line-track {
    display: inline-flex;
    min-width: 200%;
    white-space: nowrap;
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    font-size: clamp(6rem, 20vw, 22rem);
    letter-spacing: -0.01em;
    mix-blend-mode: normal;
    /* line-height ajustado para q las 3 líneas se superpongan y la virgulilla
       de la Ñ pise la línea de arriba naturalmente */
    line-height: 0.82;
}

.hero-anim-line-track span {
    padding-right: 2rem;
}

/* Opacidades variadas por línea */
.hero-anim-line--top .hero-anim-line-track {
    color: rgba(255, 255, 255, 0.14);
    /* Más lento = loop menos brusco y más contemplativo */
    animation: heroLineMarqueeLTR 55s linear infinite;
}

.hero-anim-line--middle .hero-anim-line-track {
    color: rgba(255, 255, 255, 0.28);
    animation: heroLineMarqueeRTL 75s linear infinite;
}

.hero-anim-line--bottom .hero-anim-line-track {
    color: rgba(255, 255, 255, 0.08);
    animation: heroLineMarqueeLTR 95s linear infinite;
}

/* --- Keyframes --- */

@keyframes fadeInBg {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes bgImpact {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(12px);
    }
}

@keyframes logoImpact {

    0%,
    100% {
        transform: translate(-50%, -50%) translateY(0);
    }

    50% {
        transform: translate(-50%, -50%) translateY(6px);
    }
}

@keyframes bustoFall {
    0% {
        transform: translate(-50%, -150%);
    }

    100% {
        transform: translate(-50%, 0);
    }
}

@keyframes bustoCompression {

    0%,
    100% {
        transform: translate(-50%, 0);
    }

    50% {
        transform: translate(-50%, 6px);
    }
}

@keyframes bustoBreath {

    0%,
    100% {
        transform: translate(-50%, 0) scale(1);
    }

    50% {
        transform: translate(-50%, 0) scale(1.008);
    }
}

@keyframes logoSweep {
    0% {
        opacity: 0;
        clip-path: inset(0 100% 0 0);
        filter: blur(15px);
    }

    100% {
        opacity: 0.18;
        /* 20% more transparent than previous 0.38 */
        clip-path: inset(0 0 0 0);
        filter: blur(0px);
    }
}

/* @property permite animar valores dentro de gradientes (Chrome 85+, Firefox 128+) */
@property --logo-erase {
    syntax: '<percentage>';
    inherits: false;
    initial-value: -25%;  /* valor inicial = máscara mostrando todo */
}

/* Logo erase: barrido suave de izquierda → derecha (D primero, R al final) */
@keyframes logoErase {
    0%   { --logo-erase: -25%; opacity: 0.18; } /* totalmente visible */
    100% { --logo-erase: 115%; opacity: 0.18; } /* totalmente oculto */
}

/* Background text lines fade-in */
@keyframes linesFadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* Infinite marquee for hero background lines */
@keyframes heroLineMarqueeLTR {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes heroLineMarqueeRTL {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0);
    }
}

.hero-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
}

.hero-bottom-left {
    max-width: 850px;
    /* Give more space to the title */
}

.hero-title-v4 {
    font-size: clamp(1.8rem, 4.5vw, 3.3rem);
    line-height: 0.95;
    margin-bottom: 1rem;
    font-weight: 900;
    letter-spacing: -0.01em;
}

.hero-subtitle-yellow {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 2.5rem;
}

.hero-btns-v4 {
    display: flex;
    gap: 1.2rem;
    align-items: center;
}

.btn-outline-gold-v4 {
    padding: 0.7rem 1.6rem;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.05em;
    border-radius: 4px;
    text-decoration: none;
    transition: 0.3s;
}

.btn-outline-gold-v4:hover {
    background: var(--accent);
    color: #000;
}

.btn-pill-white-v4 {
    padding: 0.7rem 1.6rem;
    background: #fff;
    color: #000;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.05em;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: 0.3s;
}

.btn-pill-white-v4:hover {
    transform: scale(1.05);
}

.hero-bottom-right {
    max-width: 650px;
    /* Restored to ensure 3-line layout */
    text-align: right;
    padding-bottom: 0px;
    display: flex;
    align-items: flex-end;
}

.hero-description-v4 {
    font-size: 16.5px;
    color: var(--text-gray);
    line-height: 1.2;
    font-weight: 500;
    letter-spacing: 0.02em;
    margin: 0;
}

/* Ensure subsequent sections cover the sticky hero */
section:not(.hero-v4) {
    position: relative;
    z-index: 10;
    background-color: var(--bg-primary);
}


/* Section Styling */
section {
    padding: 8rem 0;
    scroll-margin-top: 100px;
}

.section-tag {
    color: var(--accent);
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
    display: block;
}

.section-title {
    font-size: clamp(3.45rem, 6.9vw, 5.5rem);
    margin-bottom: 4rem;
}

/* Industrial Glass Cards */
.card-glass {
    background: var(--bg-accent-soft);
    border: 1px solid var(--border-color);
    padding: 3rem;
    border-radius: 8px;
    transition: border-color 0.4s var(--ease-standard), transform 0.4s var(--ease-standard);
    will-change: border-color, transform;
}

.card-glass:hover {
    border-color: rgba(255, 204, 0, 0.4);
    transform: translateY(-10px);
}

/* Expertise Grid */
.expertise-grid .card-glass {
    grid-column: span 4;
}

.expertise-grid .card-glass h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
}

.icon-wrap {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 4px;
}

.card-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--accent);
    color: var(--accent);
    border-radius: 4px;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    transition: var(--transition-base);
}

.card-glass:hover .card-icon {
    background: var(--accent);
    color: #000000;
    /* Black icon on yellow background */
    transform: scale(1.05);
}

/* Portfolio Gallery */
.portfolio-gallery-wrapper {
    position: relative;
    margin-top: 4rem;
}

.gallery-counter {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    z-index: 20;
}

.portfolio-gallery {
    display: flex;
    position: relative;
    width: 100%;
    height: 600px;
    border-radius: 20px;
    overflow: hidden;
    background: var(--bg-primary);
}

.gallery-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    opacity: 0;
    transition: opacity 0.6s var(--ease-standard);
    pointer-events: none;
}

.gallery-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.slide-image {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-radius: 20px 0 0 20px;
}

.slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out-expo);
}

.gallery-slide.active .slide-image img {
    animation: zoomIn 0.8s var(--ease-out-expo) forwards;
}

@keyframes zoomIn {
    from {
        transform: scale(1.1);
    }

    to {
        transform: scale(1);
    }
}

.slide-content {
    flex: 0 0 45%;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-accent-soft));
    border-radius: 0 20px 20px 0;
}

.slide-badge {
    display: inline-block;
    width: fit-content;
    background: linear-gradient(135deg, var(--accent), #FFCC00);
    color: #000;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
}

.slide-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-white);
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.slide-description {
    font-size: 1rem;
    color: var(--text-gray);
    margin-bottom: 2rem;
    line-height: 1.7;
    flex: 1;
}

.portfolio-grid-wrapper {
    overflow: hidden;
    position: relative;
    width: 100%;
    padding-inline: 4vw;
}

/* Fila horizontal de cards */
.portfolio-overlay-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 1.5rem;
    margin-top: 2rem;
    will-change: transform;
    align-items: flex-start;
}

/* Item (imagen + texto abajo) */
.portfolio-item {
    flex: 0 0 clamp(230px, 22vw, 360px);
    min-width: clamp(230px, 22vw, 360px);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Imagen de la card */
.overlay-card {
    position: relative;
    height: clamp(260px, 26vw, 380px);
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    transition: all 0.4s var(--ease-out-expo);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Variación de alturas como en el ejemplo (por item) */
.portfolio-item:nth-child(3n+1) .overlay-card {
    height: clamp(240px, 24vw, 340px);
}

.portfolio-item:nth-child(3n+2) .overlay-card {
    height: clamp(280px, 30vw, 420px);
}

.portfolio-item:nth-child(3n) .overlay-card {
    height: clamp(260px, 28vw, 380px);
}

/* Oscurecido suave al hover con texto Ver Proyecto */
.overlay-card::before {
    content: "VER PROYECTO";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    opacity: 0;
    transition: all 0.4s var(--ease-standard);
    z-index: 2;
}

.overlay-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.35s var(--ease-standard);
    pointer-events: none;
    z-index: 1;
}

.portfolio-item:hover .overlay-card::before {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.portfolio-item:hover .overlay-card::after {
    background: rgba(0, 0, 0, 0.4);
    /* Darker for better text contrast */
}

/* Bloque de texto debajo */
.portfolio-meta {
    width: 100%;
}

.card-badge {
    position: static;
    display: inline-block;
    background: rgba(0, 0, 0, 0.7);
    color: var(--accent);
    padding: 0.5rem 0.9rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    width: fit-content;
    margin-bottom: 0.75rem;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-white);
    line-height: 1.2;
    text-transform: capitalize;
    margin-bottom: 0.75rem;
}

.card-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    margin: 0.5rem 0 0 0;
    margin-bottom: 1.1rem;
}

.static-card-category {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-left: 0.5rem;
}



/* Botón debajo */
.portfolio-meta .portfolio-btn {
    width: 100%;
    padding: 1rem 1.2rem;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 8px;
    font-family: 'Satoshi', sans-serif;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: transform 0.25s var(--ease-standard), box-shadow 0.25s var(--ease-standard);
}

.portfolio-meta .portfolio-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 204, 0, 0.25);
}

/* Hidden Projects */
.hidden-projects {
    display: block;
}

.portfolio-overlay-grid.show-all .hidden-projects {
    display: block;
    animation: fadeInCard 0.5s var(--ease-standard) forwards;
}

@keyframes fadeInCard {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Toggle Projects Button - Circular with Plus */
.toggle-projects-btn {
    width: 60px;
    height: 60px;
    background: rgba(255, 204, 0, 0.1);
    border: 2px solid var(--accent);
    border-radius: 50%;
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s var(--ease-standard);
    flex-shrink: 0;
    font-size: 1.5rem;
    font-weight: bold;
}

.toggle-projects-btn:hover {
    background: var(--accent);
    color: #000;
    transform: scale(1.1);
}

.toggle-projects-btn:active {
    transform: scale(0.95);
}

.plus-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Gallery Controls */
.gallery-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2rem;
    gap: 2rem;
}

.gallery-btn-prev,
.gallery-btn-next {
    width: 50px;
    height: 50px;
    background: rgba(255, 204, 0, 0.1);
    border: 2px solid var(--accent);
    border-radius: 50%;
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s var(--ease-standard);
    flex-shrink: 0;
}

.gallery-btn-prev:hover,
.gallery-btn-next:hover {
    background: var(--accent);
    color: #000;
    transform: scale(1.1);
}

.gallery-btn-prev:active,
.gallery-btn-next:active {
    transform: scale(0.95);
}

/* Progress Bars */
.gallery-progress {
    flex: 1;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    transition: background 0.3s ease;
}

.progress-bar.active {
    background: var(--accent);
}

/* Card Image Container */
.portfolio-card-image {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

.portfolio-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out-expo);
    will-change: transform;
}

.portfolio-card:hover .portfolio-card-image img {
    transform: scale(1.08);
}

/* Badge */
.portfolio-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, var(--accent), #FFCC00);
    color: #000;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.3);
}

/* Card Content */
.portfolio-card-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.portfolio-card-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-white);
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.portfolio-card-description {
    font-size: 0.95rem;
    color: #B0B0B0;
    margin-bottom: 1.5rem;
    flex: 1;
    line-height: 1.6;
}

/* Action Button */
.portfolio-btn {
    width: 100%;
    padding: 1.1rem;
    background: linear-gradient(135deg, var(--accent), #FFCC00);
    color: #000;
    border: none;
    border-radius: 12px;
    font-family: 'Satoshi', sans-serif;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s var(--ease-standard);
    will-change: background, transform;
}

.portfolio-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #FFCC00, var(--accent));
}

.portfolio-btn:active {
    transform: translateY(0);
}

/* Transitions */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
    will-change: opacity, transform;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Footer & Contact Wrap */
.contact-block {
    grid-column: span 12;
    text-align: center;
    padding: 6rem;
    background: linear-gradient(to bottom, var(--bg-primary), var(--bg-secondary));
    border-top: 1px solid var(--border-color);
}

/* Scrollable Text Box */
.scroll-box {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
    font-family: 'Satoshi', sans-serif;
}

.scroll-box::-webkit-scrollbar {
    width: 6px;
    display: block !important;
}

.scroll-box::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.scroll-box::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

/* Attempt to show scrollbar buttons (arrows) */
.scroll-box::-webkit-scrollbar-button:single-button {
    background-color: var(--bg-secondary);
    display: block;
    height: 12px;
    width: 6px;
    background-position: center;
    background-repeat: no-repeat;
}

.scroll-box::-webkit-scrollbar-button:single-button:vertical:decrement {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23FFCC00'><polygon points='50,0 0,100 100,100'/></svg>");
}

.scroll-box::-webkit-scrollbar-button:single-button:vertical:increment {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23FFCC00'><polygon points='50,100 0,0 100,0'/></svg>");
}

.carousel-control.next {
    right: 3rem;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23FFCC00'><polygon points='50,100 0,0 100,0'/></svg>");
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: calc(30px + env(safe-area-inset-bottom, 0px));
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s var(--ease-out-expo);
    text-decoration: none;
    font-size: 1.2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--accent);
    color: var(--bg-primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(255, 204, 0, 0.2);
}

/* Contact Form */
.contact-form-wrap {
    margin-top: 4rem;
    width: 100%;
    text-align: left;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    font-family: 'Satoshi', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    color: white;
    font-family: var(--font-body);
    font-size: 1rem;
    border-radius: 4px;
    transition: var(--transition-base);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 1px var(--accent);
}

textarea.form-input {
    min-height: 150px;
    resize: vertical;
}

.btn-submit {
    width: 100%;
    padding: 1.25rem;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    font-family: 'Satoshi', sans-serif;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-base);
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px var(--accent-glow);
}

/* Tech Stack Section - Animated Marquee */
.tech-section {
    padding: 6rem 0;
    background: var(--bg-secondary) url('img/zonah.webp') center/cover no-repeat;
    border-top: none;
    overflow: hidden;
}

[data-theme="light"] .tech-section {
    background: var(--bg-secondary) url('img/zonah_w.webp') center/cover no-repeat;
}

[data-theme="light"] .tech-section .section-tag {
    color: #fff;
}

.tech-section .section-tag {
    color: var(--accent);
}

.tech-section .section-title {
    color: var(--text-white);
}

.tech-marquee-container {
    display: flex;
    overflow: hidden;
    user-select: none;
    gap: 3rem;
    padding: 2rem 0;
    /* Increased padding to prevent clipping on hover */
}

.tech-marquee {
    flex-shrink: 0;
    display: flex;
    justify-content: space-around;
    min-width: 100%;
    gap: 3rem;
    animation: scroll-marquee 40s linear infinite;
}

.tech-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 1rem 2rem;
    border-radius: 12px;
    white-space: nowrap;
    transition: var(--transition-base);
}

.tech-card img,
.tech-card svg {
    height: 32px;
    width: auto;
    filter: brightness(0);
    opacity: 0.9;
    transition: var(--transition-base);
}

.tech-card:hover {
    border-color: var(--accent);
    background: rgba(255, 204, 0, 0.05);
    transform: translateY(-5px);
}

.tech-card:hover img,
.tech-card:hover svg {
    filter: none;
    opacity: 1;
}

.tech-card span {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #000;
    transition: var(--transition-base);
}

.tech-card:hover span {
    color: var(--accent);
}

@keyframes scroll-marquee {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-100%);
    }
}

@keyframes trama-move {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 100px 100px;
    }
}

/* Project Modal Lightbox */
.project-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-modal.active {
    display: flex;
    opacity: 1;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
    cursor: pointer;
}

.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    padding: 80px 20px 20px 20px;
    overflow: hidden;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 1150px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding: 0 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
    border-radius: 8px;
}

/* Custom scrollbar for modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #FFCC00;
}

.modal-image {
    width: calc(100% - 10px);
    height: auto;
    border-radius: 8px;
    display: block;
}

/* Modal Close Button */
.modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 204, 0, 0.1);
    border: 1px solid var(--accent);
    border-radius: 50%;
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s var(--ease-standard);
    z-index: 10002;
}

.modal-close:hover {
    background: var(--accent);
    color: #000;
    transform: rotate(90deg);
}

@media (max-width: 768px) {
    .modal-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }

    .modal-container {
        padding: 70px 10px 10px 10px;
    }

    .modal-content {
        max-width: 100%;
        padding: 0 10px;
    }
}

@media (max-width: 1024px) {
    .portfolio-overlay-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        margin-top: 2rem;
    }

    .overlay-card {
        height: 320px;
    }

    .card-content {
        padding: 1.5rem;
        padding-top: 7rem;
        padding-bottom: 5rem;
    }

    .card-title {
        font-size: 1.3rem;
    }

    .card-description {
        font-size: 0.85rem;
    }

    @media (max-width: 768px) {
        .grid-12 {
            grid-template-columns: 1fr;
            gap: 2rem;
        }

        /* Hero section refinements for mobile */
        .hero-v4 {
            height: 100vh;
            height: 100dvh;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: center;
            padding: 100px 6% 40px;
            text-align: center;
        }

        .hero-container-v4 {
            padding: 0;
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-end;
            height: 100%;
            gap: 1.5rem;
        }

        .hero-bottom-content {
            flex-direction: column;
            align-items: center;
            width: 100%;
            gap: 2rem;
        }

        .hero-bottom-left {
            max-width: 100%;
            order: 2;
        }

        .hero-title-v4 {
            font-size: 1.5rem;
            line-height: 1.15;
            margin-bottom: 0;
            text-align: center;
            color: #fff;
            width: 100%;
            font-weight: 800;
            text-transform: uppercase;
            text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 4px 20px rgba(0, 0, 0, 0.35);
        }

        .hero-subtitle-yellow {
            display: none;
        }

        .hero-btns-v4 {
            order: 1;
            justify-content: center;
            width: 100%;
            margin-bottom: 2rem;
            margin-top: 1.5rem;
        }

        .btn-outline-gold-v4 {
            display: none;
        }

        .btn-pill-white-v4 {
            background: #fff !important;
            color: #000 !important;
            padding: 0.9rem 2.8rem;
            font-size: 0.95rem;
            border-radius: 50px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: none;
        }

        .hero-bottom-right {
            display: none;
        }

        /* Busto: un poco más abajo y un poco más grande */
        .is-loaded .hero-anim-busto {
            width: 96vw;
            max-width: 540px;
            bottom: -1%;
            left: 50%;
            transform-origin: bottom center;
            animation:
                bustoFall 0.7s cubic-bezier(0.55, 0.055, 0.675, 0.19) 0s forwards,
                bustoCompression 0.18s ease-out 0.7s forwards,
                bustoBreath 8s ease-in-out 1s infinite;
        }

        /* DISAINER detrás del busto, más arriba */
        .is-loaded .hero-anim-logo {
            width: 150vw;
            top: 26%;
            left: 50% !important;
            transform: translate(-50%, -50%) !important;
        }
    }

    nav {
        padding-right: 0;
    }

    .hamburger-menu {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 0;
        overflow: hidden;
        background: var(--accent);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        opacity: 1;
        visibility: hidden;
        transition: height 0.5s var(--ease-standard), visibility 0s linear 0.5s;
        z-index: 999;
        padding: calc(env(safe-area-inset-top, 20px) + 5rem) 7vw 2rem 7vw;
        min-height: 0;
    }

    .nav-links-inner {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.12rem;
        width: 100%;
        flex: 1;
        justify-content: flex-start;
        opacity: 0;
        transition: opacity 0.35s ease 0.35s;
        /* Aparecen enlaces e iconos después de que baje el amarillo */
    }

    .nav-links.active .nav-links-inner {
        opacity: 1;
    }

    /* Tipografía menú móvil: Montserrat, ~80% bold (600 = semi-bold) como en el JPG */
    .nav-links,
    .nav-links a,
    .nav-links .nav-menu-social-title {
        font-family: var(--font-heading);
    }

    .nav-links a:not(.btn-cta) {
        font-size: 0.85rem;
        font-weight: 600;
        color: #000;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .nav-links a:hover {
        opacity: 0.85;
    }

    .nav-links a.btn-cta {
        margin-top: 0.5rem;
        background: #000;
        color: var(--accent);
        border: 1px solid #000;
        border-radius: 0;
        font-size: 0.9rem;
        font-weight: 600;
        padding: 0.6rem 2.2rem;
        width: auto;
        min-width: 160px;
        letter-spacing: 0.1em;
    }

    .nav-menu-social {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        margin-top: auto;
        padding-top: 2.5rem;
    }

    .nav-menu-social-title {
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.15em;
        color: #000;
    }

    /* 1. Contenedor de los iconos */
    .nav-menu-social-icons {
        display: flex;
        gap: 0.8rem;
        align-items: center;
        justify-content: center;
        /* Para que queden bien centrados en el móvil */
    }

    /* 2. El cuadradito (Clon del Footer) */
    .nav-menu-social-icons .social-icon-box {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1.5px solid #000;
        border-radius: 10px;
        background-color: transparent;
        transition: all 0.3s ease;
        /* Esta es la 'reacción' suave */
        text-decoration: none;
    }

    /* 3. El dibujo interno */
    .nav-menu-social-icons .social-icon-box svg {
        width: 26px !important;
        height: 26px !important;
        fill: #000;
        display: block;
        transition: all 0.3s ease;
    }

    /* 4. LA REACCIÓN AL MOUSE (Hover) */
    .nav-menu-social-icons .social-icon-box:hover {
        background-color: #000;
    }

    .nav-menu-social-icons .social-icon-box:hover svg {
        fill: #FFCC00;
        /* El logo se pone blanco cuando el fondo se pone negro */
    }

    /* Iconos del menú = mismos que el footer (.social-icon-box) */
    .nav-menu-social-icon {
        display: flex;
    }

    .nav-menu-social-icon svg {
        /* Quitamos el ancho fijo para que mande el tamaño que pusimos en el HTML */
        max-width: 32px;
        max-height: 32px;
        fill: #000;
        display: block;
    }

    .nav-links.active {
        visibility: visible;
        height: 100vh;
        height: 100dvh;
        transition: height 0.5s var(--ease-standard), visibility 0s linear 0s;
    }

    /* Sin empuje del contenido: menú en overlay como en portfolio, así los enlaces llevan al lugar correcto */
    body.menu-open #inicio {
        margin-top: 0;
    }

    /* Logo and Hamburger color when menu is active */
    .logo {
        position: relative;
        z-index: 1002;
    }

    body.menu-open .logo img,
    .nav-links.active~.logo img {
        filter: brightness(0) !important;
        /* Turn logo black when menu is open */
    }

    .hamburger-menu.active span {
        background: #000;
        /* Black X on yellow */
    }

    /* Restore section tags for specific sections on mobile as requested */
    /* Left-aligned section tags (Original) */
    .hero-content .section-tag,
    #perfil .section-tag,
    #portfolio .section-tag {
        display: block !important;
        text-align: left;
        margin: 0 0 1rem 0;
        padding-left: 0 !important;
    }

    /* Centered section tags */
    #servicios .section-tag,
    #contacto .section-tag,
    #faq .section-tag,
    .tech-section .section-tag {
        display: block !important;
        text-align: center;
        margin: 0 auto 1rem auto;
        padding-left: 0 !important;
    }

    /* Sección Herramientas / Tecnologías más compacta en alto */
    .tech-section {
        padding: 2.5rem 0;
    }

    .tech-section .section-tag {
        margin-bottom: 0.5rem;
    }

    .tech-section .section-title {
        margin-bottom: 1.5rem;
    }

    .tech-marquee-container {
        padding: 0.75rem 0;
    }

    /* FAQ: encabezados de categoría más chicos, una línea, y en relación al título de sección */
    #faq .section-title {
        font-size: clamp(2rem, 8vw, 3rem);
        margin-bottom: 2rem;
    }

    .faq-category-toggle {
        font-size: 0.65rem;
        letter-spacing: 0.12em;
        padding: 0.75rem 0;
    }

    /* De-box Contact Form on Mobile */
    #contacto .card-glass {
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        padding: 0 !important;
    }

    /* Remove page title overlay in menu */
    .nav-links.active::before {
        display: none;
    }


    .expertise-grid .card-glass {
        grid-column: span 6;
    }

    .portfolio-controls {
        margin-bottom: -2.5rem;
        gap: 0.8rem;
    }

    .portfolio-btn-nav {
        width: 42px;
        height: 42px;
    }

    .portfolio-gallery {
        height: 580px;
        min-height: 580px;
    }

    .slide-image {
        flex: 1;
        height: 100%;
    }

    .slide-content {
        padding: 2.5rem;
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        overflow-y: auto;
        max-height: 580px;
    }

    .slide-title {
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }

    .slide-description {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
        line-height: 1.6;
    }

    .slide-badge {
        margin-bottom: 1rem;
    }

    .portfolio-btn {
        margin-top: 0;
        /* Align with global 5mm gap */
        padding: 0.8rem 1.5rem;
    }

    .gallery-counter {
        font-size: 0.8rem;
    }

    .gallery-btn-prev,
    .gallery-btn-next {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 900px) {
    .portfolio-overlay-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .overlay-card {
        height: 300px;
    }
}

@media (max-width: 760px) {
    .portfolio-overlay-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 1.5rem;
    }

    .overlay-card {
        height: 280px;
    }

    .card-content {
        padding: 1.5rem;
        padding-top: 6.5rem;
        padding-bottom: 4.5rem;
    }

    .card-title {
        font-size: 1.2rem;
    }

    .card-description {
        font-size: 0.8rem;
        line-height: 1.5;
    }

}

@media (max-width: 600px) {
    .portfolio-overlay-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .overlay-card {
        height: 250px;
    }

    .card-content {
        padding: 1.2rem;
        padding-top: 5.5rem;
        padding-bottom: 3.5rem;
        gap: 0.8rem;
    }

    .card-badge {
        top: 1rem;
        right: 1rem;
        padding: 0.35rem 0.75rem;
        font-size: 0.6rem;
    }

    .card-title {
        font-size: 1.05rem;
        margin: 0;
    }

    .card-description {
        font-size: 0.75rem;
        line-height: 1.4;
        margin: 0;
    }

}

.portfolio-gallery {
    height: auto;
    max-height: none;
    flex-direction: column;
}

.slide-image {
    flex: 0 0 auto;
    height: 280px;
    border-radius: 20px 20px 0 0;
    width: 100%;
}

.slide-content {
    flex: 0 0 auto;
    padding: 2rem;
    border-radius: 0 0 20px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: auto;
}

.slide-title {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

.slide-description {
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
    line-height: 1.6;
    flex: 1;
}

.slide-badge {
    margin-bottom: 0.8rem;
    padding: 0.5rem 1rem;
    font-size: 0.65rem;
}


.portfolio-controls {
    margin-bottom: -1.5rem;
    margin-top: 2rem;
    gap: 1rem;
}

.gallery-btn-prev,
.gallery-btn-next {
    width: 40px;
    height: 40px;
}

@media (max-width: 760px) {
    .portfolio-gallery-wrapper {
        margin-top: 2rem;
    }

    .portfolio-gallery {
        height: auto;
        max-height: none;
        flex-direction: column;
        border-radius: 16px;
    }

    .slide-image {
        flex: 0 0 auto;
        height: 250px;
        border-radius: 16px 16px 0 0;
        width: 100%;
    }

    .slide-content {
        flex: 0 0 auto;
        padding: 1.5rem;
        border-radius: 0 0 16px 16px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-height: auto;
    }

    .slide-badge {
        display: inline-block;
        width: fit-content;
        padding: 0.4rem 0.9rem;
        font-size: 0.6rem;
        margin-bottom: 0.8rem;
        border-radius: 50px;
    }

    .slide-title {
        font-size: 1.2rem;
        margin-bottom: 0.6rem;
        line-height: 1.3;
    }

    .slide-description {
        font-size: 0.8rem;
        margin-bottom: 1rem;
        line-height: 1.5;
        flex: 1;
    }


    .portfolio-controls {
        margin-bottom: 0rem;
        margin-top: 1.5rem;
        gap: 0.8rem;
    }

    .portfolio-btn-nav {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .gallery-counter {
        font-size: 0.75rem;
        top: 1rem;
        right: 1rem;
    }

    .gallery-btn-prev,
    .gallery-btn-next {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .gallery-progress {
        gap: 0.3rem;
        flex: 1;
    }

    .progress-bar {
        height: 3px;
    }
}

@media (max-width: 600px) {
    .grid-12 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero {
        padding-top: 50px;
        /* Hero más arriba en móvil */
    }

    /* Mobile Hero Background Pattern */
    .hero .bg-logo-blur {
        background-image: url('img/logo.png');
        background-size: auto 150px;
        background-repeat: repeat;
        background-position: 0 0;
        opacity: 0.15;
        animation: trama-move 30s linear infinite;
    }

    .hero h1 {
        font-size: 10.5vw;
        /* Adjusted to prevent overflow */
        line-height: 0.9;
        text-transform: uppercase;
        font-weight: 800;
        letter-spacing: -2px;
    }

    .mobile-break {
        display: block;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-btns {
        flex-direction: column !important;
        gap: 0.8rem !important;
        width: 100%;
        margin-top: 2rem;
    }

    .hero-btns a {
        width: 100%;
        text-align: center;
        margin: 0;
        /* Clear any stray margins */
    }

    .expertise-grid .card-glass {
        grid-column: span 12;
        margin: 0;
        width: 100%;
    }

    .portfolio-controls {
        margin-bottom: 1rem;
    }

    .portfolio-btn-nav {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .portfolio-gallery {
        height: auto;
        max-height: none;
        flex-direction: column;
        border-radius: 14px;
    }

    .slide-image {
        flex: 0 0 auto;
        height: 200px;
        border-radius: 14px 14px 0 0;
        width: 100%;
    }

    .slide-content {
        flex: 0 0 auto;
        padding: 1.2rem;
        border-radius: 0 0 14px 14px;
        display: flex;
        flex-direction: column;
        /* Removed justify-content/min-height to rely on margin */
    }

    .portfolio-btn {
        margin-top: 4rem !important;
        /* Force large spacing */
        width: 100%;
        text-align: center;
    }
}

.portfolio-btn {
    margin-top: 0;
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    width: 100%;
}

.gallery-counter {
    font-size: 0.7rem;
    top: 0.8rem;
    right: 0.8rem;
}

.gallery-controls {
    margin-top: 1rem;
    gap: 0.5rem;
}

.gallery-btn-prev,
.gallery-btn-next {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
}

.gallery-progress {
    gap: 0.25rem;
}

.progress-bar {
    height: 2px;
}

.portfolio-card-image {
    height: 220px;
}

.portfolio-card-title {
    font-size: 1.1rem;
}

.portfolio-card-description {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.container {
    padding: 0 5%;
}

section {
    padding: 4rem 0;
}

.contact-block {
    padding: 3rem !important;
}

.section-title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.section-tag {
    font-size: 0.7rem;
}

.tech-card {
    padding: 0.8rem 1.5rem;
    gap: 0.8rem;
}

.tech-card span {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
}

@media (max-width: 600px) {

    .container,
    .container-full {
        padding: 0 7vw;
    }

    .nav-wrap {
        padding: 0 7vw;
    }

    .grid-12 {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        /* Container's 7vw padding will handle the margins */
    }

    .expertise-grid {
        padding-right: 0;
        /* Let cards handle internal container limit */
    }

    .card-glass {
        width: 100%;
        /* Fill container (which has 7vw padding) */
        margin: 0 0 1.5rem 0;
        padding: 1.5rem;
        /* Reduced padding for more horizontal form space */
    }

    .expertise-grid .card-glass {
        margin-bottom: 2rem;
    }

    .logo img {
        height: 30px !important;
    }

    .portfolio-gallery {
        flex-direction: column;
        height: auto;
        max-height: 800px;
    }

    .slide-image {
        flex: 0 0 45%;
        border-radius: 15px 15px 0 0;
    }

    .slide-content {
        flex: 0 0 55%;
        padding: 1.5rem;
        border-radius: 0 0 15px 15px;
    }

    .slide-title {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }

    .slide-description {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

    .slide-badge {
        padding: 0.5rem 1rem;
        font-size: 0.65rem;
        margin-bottom: 1rem;
    }

    .gallery-counter {
        font-size: 0.75rem;
        top: 10px;
        right: 10px;
    }

    .gallery-controls {
        margin-top: 1rem;
        gap: 0.8rem;
    }

    .gallery-btn-prev,
    .gallery-btn-next {
        width: 36px;
        height: 36px;
    }

    .gallery-progress {
        gap: 0.2rem;
    }

    .progress-bar {
        height: 2px;
    }

    .hero h1 {
        font-size: 10.5vw;
        letter-spacing: -0.05em;
        line-height: 0.9;
        text-transform: uppercase;
        font-weight: 800;
        margin-bottom: 2rem;
    }

    .hero p {
        font-size: 1rem;
        margin-bottom: 2.5rem;
        max-width: calc(100% - 7vw);
        /* Ensure it hits the invisible right boundary */
        text-wrap: balance;
    }

    .portfolio-item {
        flex: 0 0 85vw;
        min-width: 85vw;
    }

    .portfolio-meta {
        display: flex;
        flex-direction: column;
        /* Removed min-height to prevent excessive gaps */
    }

    .card-description {
        margin-bottom: 1.2rem;
        /* Exactly ~5mm distance from button */
        flex-grow: 0;
        /* Don't push button to the bottom */
    }

    .portfolio-meta .portfolio-btn {
        margin-top: 0;
        /* Relying on card-description margin-bottom */
    }
}

/* Custom Contact Modal Styles */
#customModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#customModal.active {
    display: flex;
    opacity: 1;
}

#customModal .modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 3rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

#customModal.active .modal-content {
    transform: scale(1);
}

#customModal .modal-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-white);
}

#customModal .modal-content p {
    color: var(--text-gray);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

#customModal .modal-content .btn-cta {
    display: inline-block;
    margin: 0 auto;
}



#contacto h2 {
    font-size: clamp(1.8rem, 6.5vw, 2.8rem) !important;
    line-height: 1.2;
    margin-bottom: 2.5rem;
    text-align: center;
}

#contacto h3 {
    font-size: clamp(1rem, 4.5vw, 1.6rem) !important;
    line-height: 1.4;
    text-align: center;
}

/* Service Buttons */
.btn-service-outline {
    display: inline-block;
    padding: 1rem 2.8rem;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: 'Satoshi', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-radius: 4px;
    /* geometric but high-end */
    transition: all 0.4s var(--ease-standard);
}

.service-btn:hover {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-2px);
}

.expertise-grid .card-glass {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: linear-gradient(to bottom, var(--bg-primary), var(--bg-secondary));
}

.expertise-grid .card-glass p {
    flex-grow: 1;
}

/* Footer Redesign */
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.4fr 1fr 1.5fr;
    gap: 2rem;
    align-items: start;
}

.footer-brand,
.footer-links-group,
.footer-policies-group,
.footer-contact-group,
.footer-social-group {
    display: flex;
    flex-direction: column;
}

.footer-header {
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 1rem;
    color: #000;
    min-height: 45px;
    display: flex;
    align-items: center;
}

.footer-logo-wrapper {
    min-height: 45px;
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.footer-v-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-v-links a,
.footer-contact-link {
    color: #000;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    transition: var(--transition-base);
}

.footer-v-links a:hover,
.footer-contact-link:hover {
    text-decoration: underline !important;
}

.footer-logo-wrapper img {
    height: 30px;
    width: auto;
    display: block;
}

.social-icons {
    display: flex;
    gap: 0.8rem;
    transition: var(--transition-base);
}

.footer-social-group.text-right {
    align-items: flex-end;
}

.footer-social-group.text-right .footer-header {
    justify-content: flex-end;
}

.social-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 2px solid #000;
    border-radius: 6px;
    color: #000;
    transition: all 0.3s ease;
}

.social-icon-box:hover {
    background: #000;
    color: var(--accent);
    transform: translateY(-3px);
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }

    .footer-social-group.text-right {
        align-items: flex-start;
    }

    .footer-social-group.text-right .footer-header {
        justify-content: flex-start;
    }

    .footer-social-group .social-icons {
        justify-content: flex-start !important;
    }
}

@media (max-width: 600px) {
    #perfil h2.section-title {
        margin-bottom: 1.5rem !important;
        /* Closer to scrollbox */
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

/* --- Dedicated Portfolio Page Styles --- */
/* --- Dedicated Portfolio Page Styles --- */
.portfolio-hero {
    padding-top: 120px;
    padding-bottom: 60px;
    background: var(--bg-primary);
}

/* Policies Page Section */
.policy-page {
    padding-top: 120px;
    padding-bottom: 0;
    background: var(--bg-primary);
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

.policy-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 4%;
}

.policy-section {
    margin-bottom: 5rem;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--ease-standard);
}

.policy-section:last-of-type {
    margin-bottom: 0;
}

.policy-section.appear {
    opacity: 1;
    transform: translateY(0);
}

.policy-section h2 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    color: var(--accent);
    margin-bottom: 1.5rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: -1px;
}

.policy-section h3 {
    font-size: clamp(1.2rem, 3vw, 1.4rem);
    color: var(--text-white);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.policy-section p {
    color: var(--text-gray);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.policy-list {
    list-style: none;
    padding-left: 0;
}

.policy-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 1.2rem;
    color: var(--text-gray);
    line-height: 1.7;
}

.policy-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

.policy-list li strong {
    color: var(--text-white);
    display: block;
    margin-bottom: 0.2rem;
}

.policy-hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 4rem 0;
    opacity: 0.25;
}

[data-theme="light"] .policy-hr {
    border-top-color: rgba(0, 0, 0, 0.4) !important;
    opacity: 1 !important;
}

@media (max-width: 768px) {
    .policy-page {
        padding-top: 100px;
        padding-bottom: 0;
    }

    .policy-container {
        padding: 0 7vw;
    }

    .policy-section {
        margin-bottom: 3rem;
    }

    .policy-section h2 {
        font-size: 1.8rem;
    }

    .policy-section p {
        font-size: 1rem;
    }
}

.portfolio-static-grid {
    gap: 0.8rem;
    margin-top: 2rem;
}

.portfolio-static-item {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    cursor: pointer;
}

.static-card-img {
    aspect-ratio: 16/10;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    transition: var(--transition-base);
    border: 1px solid var(--border-color);
}

.portfolio-static-item:hover .static-card-img {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.static-card-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-white);
    padding-left: 0.2rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.static-card-category {
    font-size: 0.6rem;
    font-weight: 400;
    color: var(--accent);
    opacity: 0.8;
    letter-spacing: 0.05em;
}

@media (max-width: 1024px) {
    .portfolio-static-grid .portfolio-static-item {
        grid-column: span 6 !important;
    }
}

/* Global Footer Link Fix */
.footer-links-group a,
.footer-contact-group a {
    color: #000 !important;
    text-decoration: none !important;
}

.footer-links-group a:hover,
.footer-contact-group a:hover {
    text-decoration: underline !important;
}


/* Global Interactive Background Layers */
.bg-logo-blur {
    position: absolute;
    inset: 0;
    background-image: url('img/logo.png');
    background-size: auto 150px;
    background-repeat: repeat;
    opacity: 0.12;
    /* Subtle pattern */
    z-index: 1;
    pointer-events: none;
    animation: trama-move 60s linear infinite;
}

.glass-mask {
    position: absolute;
    inset: 0;
    background: #000000;
    /* Pure black to cover pattern by default */
    z-index: 2;
    pointer-events: none;
    /* Initial state: everything hidden */
    -webkit-mask-image: radial-gradient(circle 0px at 50% 50%, transparent 0%, black 100%);
    mask-image: radial-gradient(circle 0px at 50% 50%, transparent 0%, black 100%);
}

[data-theme="light"] .glass-mask {
    background: #ffffff;
    /* Use white in light theme to match background */
}

@keyframes trama-move {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 1000px 1000px;
    }
}

/* FAQ Section Styles */
.faq-container {
    max-width: 900px;
    margin: 4rem auto;
}

.faq-category {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.faq-category-toggle {
    width: 100%;
    padding: 1.5rem 0;
    background: transparent;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: var(--accent);
    font-family: 'Satoshi', sans-serif;
    font-weight: 500;
    font-size: 1.25rem;
    text-transform: uppercase;
    text-align: left;
    transition: var(--transition-base);
}

.faq-category-toggle:hover {
    opacity: 0.8;
}

.category-icon {
    font-size: 1rem;
    transition: transform 0.4s var(--ease-standard);
}

.faq-category.active .category-icon {
    transform: rotate(180deg);
}

.faq-category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-category.active .faq-category-content {
    max-height: 2000px;
    /* High enough to contain all questions */
    padding-bottom: 2rem;
}

.faq-accordion {
    padding-left: 1rem;
    border-left: 1px solid var(--accent);
    margin-top: 1rem;
}

.faq-item {
    background: var(--bg-accent-soft);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: var(--transition-base);
}

.faq-item:hover {
    border-color: var(--accent-glow);
}

.faq-question {
    width: 100%;
    padding: 1.2rem 1.5rem;
    background: transparent;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: var(--text-white);
    font-family: 'Satoshi', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    text-align: left;
    transition: background 0.3s ease;
}

.faq-question:hover {
    background: rgba(255, 255, 255, 0.02);
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--accent);
    transition: transform 0.4s var(--ease-standard);
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--ease-standard), padding 0.4s ease;
    padding: 0 2rem;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding-bottom: 2rem;
}

.faq-answer p {
    color: var(--accent);
    /* Yellow text as requested */
    line-height: 1.8;
    font-size: 1rem;
    font-family: 'Satoshi', sans-serif;
}

/* FAQ CTA Button */
.btn-faq-cta {
    color: var(--text-white) !important;
    border-color: rgba(var(--text-white-rgb), 0.3) !important;
}

[data-theme="light"] .btn-faq-cta {
    color: #000000 !important;
    border-color: rgba(0, 0, 0, 0.4) !important;
}

[data-theme="light"] .btn-faq-cta:hover {
    border-color: var(--accent) !important;
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.2) !important;
}

@media (max-width: 600px) {
    .portfolio-static-grid .portfolio-static-item {
        grid-column: span 12 !important;
    }
}

.portfolio-hero {
    padding-top: 100px;
}

/* --- Interactive Services Section (Luxury Accordion Refined) --- */
.services-interactive-section {
    padding: 120px 0;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
    z-index: 10;
}

#servicios .section-title {
    font-size: clamp(1.8rem, 5vw, 4rem);
    margin-bottom: 1rem;
}

.services-accordion-wrapper {
    width: 100%;
}

.accordion-item {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    /* background: var(--row-bg); -> Moved to header */
    transition: filter 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.accordion-item:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .accordion-item {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .accordion-item:last-child {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* Hover brightness effect as requested */
.accordion-item:hover {
    filter: brightness(1.15);
}

.accordion-item.active {
    background: #000;
    /* Expands to black background in dark mode */
    filter: none;
    z-index: 5;
}

[data-theme="light"] .accordion-item.active {
    background: #fff;
    /* Expands to white in light mode */
}

.accordion-header {
    /* Transparent background, moved to ::before */
    padding: clamp(1rem, 2.5vw, 1.75rem) 6%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
    overflow: hidden;
    /* Clips the sliding bar */
}

/* The actual sliding "Bar" background */
.accordion-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--row-bg);
    z-index: -1;
    transition: transform 0.7s cubic-bezier(0.19, 1, 0.22, 1), background 0.5s ease;
}

.accordion-item.active .accordion-header::before {
    transform: translateX(82%);
    /* Slides to leave a box on the right */
    /* background: #000; -> Removed to keep the bar color behind the number as in JPG */
}


.service-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: clamp(1.7rem, 3.5vw, 2.75rem);
    text-transform: uppercase;
    color: #fff;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.1;
    position: relative;
    /* Ensure it stays above the sliding bar */
    z-index: 2;
}

.service-number {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: clamp(1rem, 3vw, 3.25rem);
    color: #fff;
    opacity: 0.95;
    transition: all 0.5s var(--ease-standard);
    line-height: 1;
    position: absolute;
    right: 6%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    pointer-events: none;
}

[data-theme="light"] .service-name,
[data-theme="light"] .service-number {
    color: #fff;
}

/* Tema claro: al expandir (barra corrida) los títulos en negro para verse sobre el fondo claro */
[data-theme="light"] .accordion-item.active .service-name,
[data-theme="light"] .accordion-item.active .service-number {
    color: #000;
}

/* Expanded state transformations - Overridden for slide right */
.accordion-item.active .service-number {
    opacity: 0.8;
}

.accordion-body {
    max-height: 0;
    opacity: 0;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    padding: 0 6%;
}

.accordion-item.active .accordion-body {
    max-height: 1500px;
    opacity: 1;
    padding-bottom: clamp(4rem, 8vw, 8rem);
}

.accordion-content {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 5rem;
    align-items: start;
    transform: translateY(30px);
    transition: transform 0.6s var(--ease-out-expo);
}

.accordion-item.active .accordion-content {
    transform: translateY(0);
}

.expanded-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.info-description {
    font-family: 'Satoshi', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #ccc;
    max-width: 650px;
    font-weight: 400;
    margin-bottom: 2rem;
}

.btn-me-interesa {
    display: inline-flex;
    padding: 0.8rem 1.8rem;
    background: var(--accent);
    color: #000;
    font-family: 'Satoshi', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.4s ease;
}

.btn-me-interesa:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--accent-glow);
    filter: brightness(1.1);
}

[data-theme="light"] .expanded-title {
    color: #000;
}

[data-theme="light"] .info-description {
    color: #333;
}

.service-bullets {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.service-bullets li {
    font-family: 'Satoshi', sans-serif;
    font-weight: 500;
    color: #fff;
    font-size: 1.1rem;
    position: relative;
    padding-left: 2rem;
    letter-spacing: 0.01em;
}

[data-theme="light"] .service-bullets li {
    color: #000;
}

.service-bullets li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 1.5rem;
    line-height: 1;
}

/* Mobile Responsiveness for Accordion */
@media (max-width: 1024px) {
    .accordion-content {
        grid-template-columns: 1fr;
        gap: 3.5rem;
    }

    .accordion-header {
        padding: 2rem 6%;
    }

    .accordion-item.active .accordion-body {
        padding-bottom: 5rem;
    }

    .expanded-title {
        font-size: 1.8rem;
    }
}

/* Servicios acordeón mobile: títulos más chicos, barras más bajas y más aire al desplegar */
@media (max-width: 768px) {
    .accordion-header {
        padding: 0.75rem 6%;
    }

    .accordion-header .service-name {
        font-size: clamp(1.1rem, 4.5vw, 1.45rem);
    }

    .accordion-item.active .accordion-body {
        padding-top: 1.75rem;
    }
}

/* Nav Arrows */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--accent);
    padding: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.4s ease;
}

.carousel-arrow svg {
    width: 50px;
    height: 50px;
    stroke-width: 2;
}

.carousel-arrow:hover {
    color: var(--text-white);
    transform: translateY(-50%) scale(1.1);
}

.carousel-arrow.prev {
    left: 20px;
}

.carousel-arrow.next {
    right: 20px;
}

/* Indicators Inside (Yellow Bars on Image) */
.carousel-external-indicators {
    position: absolute;
    bottom: 3.5rem;
    /* Over the bottom of the image */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    z-index: 10;
}

.indicator-bar {
    width: 50px;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0;
    cursor: pointer;
    transition: all 0.6s var(--ease-standard);
}

.indicator-bar.active {
    background: var(--accent);
    width: 100px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* Responsive High Precision */
@media (max-width: 1024px) {
    .service-glass-card {
        max-width: 90%;
    }
}

.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .services-carousel-section {
        background: var(--bg-primary) !important;
    }

    .carousel-overlay {
        background: linear-gradient(180deg,
                rgba(var(--text-white-rgb), 0.1) 0%,
                rgba(var(--text-white-rgb), 0.05) 50%,
                rgba(var(--text-white-rgb), 0.2) 100%) !important;
    }

    .service-glass-card {
        background: var(--bg-accent-soft) !important;
        border: 1px solid var(--border-color) !important;
        box-shadow: 0 40px 80px rgba(0, 0, 0, 0.2) !important;
        padding: 2.5rem 1.5rem;
        border-radius: 20px;
        max-width: 95%;
        max-height: 80vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
    }

    .service-title {
        font-size: 1.4rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        width: 100% !important;
        margin-bottom: 1.2rem !important;
        letter-spacing: -0.5px !important;
    }

    .service-description,
    .card-subtitle {
        color: var(--text-gray) !important;
    }

    .indicator-bar {
        background-color: rgba(var(--text-white-rgb), 0.2) !important;
        width: 35px;
        height: 3px;
    }

    .indicator-bar.active {
        background-color: var(--accent) !important;
        width: 70px;
    }

    .carousel-main-container {
        height: auto;
        min-height: 85vh;
    }

    .carousel-flex {
        padding: 4rem 1.5rem;
    }

    .card-header-group {
        margin-bottom: 2rem;
    }

    .card-category {
        font-size: 0.75rem;
    }

    .card-subtitle {
        font-size: 0.9rem;
    }

    .service-icon-box {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .service-description {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 0;
    }

    .mobile-hide {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .card-footer-action {
        margin-top: 2.5rem;
        width: 100%;
    }

    .btn-service-outline {
        width: 100%;
        text-align: center;
        padding: 1rem;
        font-size: 0.9rem;
    }

    .carousel-arrow {
        display: none;
    }

    .carousel-external-indicators {
        bottom: 2.5rem;
        gap: 12px;
    }

    /* Contact Form Mobile Width Adjustments */
    #contacto .container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .contact-form-wrap {
        padding: 0;
    }

    .form-input {
        width: 100%;
        padding: 1rem 1.2rem;
        font-size: 1rem;
    }

    textarea.form-input {
        min-height: 180px;
    }

    .btn-submit {
        width: 100%;
        padding: 1.2rem;
        font-size: 1rem;
    }
}

/* --- LIGHT MODE REFINEMENTS (PHASE X) --- */

/* 1. Carousel Images Swap */
[data-theme="light"] .carousel-slide[style*="branding_web_serv_fondo_carrusel_1.webp"] {
    background-image: url('img/carrusel/branding_web_serv_fondo_carrusel_1_white.webp') !important;
}

[data-theme="light"] .carousel-slide[style*="desarrollo_web_serv_fondo_carrusel_2.webp"] {
    background-image: url('img/carrusel/desarrollo_web_serv_fondo_carrusel_2_white.webp') !important;
}

[data-theme="light"] .carousel-slide[style*="ecommerce_web_serv_fondo_carrusel_3.webp"] {
    background-image: url('img/carrusel/ecommerce_web_serv_fondo_carrusel_3_white.webp') !important;
}

[data-theme="light"] .carousel-slide[style*="socialmedia_web_serv_fondo_carrusel_4.webp"] {
    background-image: url('img/carrusel/socialmedia_web_serv_fondo_carrusel_4_white.webp') !important;
}

[data-theme="light"] .carousel-slide[style*="uxui_web_serv_fondo_carrusel_5.webp"] {
    background-image: url('img/carrusel/uxui_web_serv_fondo_carrusel_5_white.webp') !important;
}

[data-theme="light"] .carousel-slide[style*="consul_serv_fondo_carrusel_6.webp"] {
    background-image: url('img/carrusel/consul_serv_fondo_carrusel_6_white.webp') !important;
}

/* 2. Carousel Frosted Glass White Contrast */
[data-theme="light"] .carousel-overlay {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.9) 100%) !important;
}

[data-theme="light"] .service-glass-card {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.05) !important;
}

/* 3. Typography in Carousel (Soluciones Integrales title, Description text) */
[data-theme="light"] .card-subtitle {
    color: #000000 !important;
    text-shadow: none !important;
}

[data-theme="light"] .service-description {
    color: #000000 !important;
    font-weight: 500 !important;
}

/* 3.5 Carousel Indicators */
[data-theme="light"] .indicator-bar {
    background-color: #000000 !important;
    /* Inactive indicators in black */
    opacity: 0.5 !important;
}

[data-theme="light"] .indicator-bar.active {
    background-color: var(--accent) !important;
    /* Active indicator stays yellow */
    opacity: 1 !important;
}

/* 4. Portfolio Card Texts Black */
[data-theme="light"] .slide-description,
[data-theme="light"] .card-description {
    color: #000000 !important;
    font-weight: 500;
}

/* 5. Tech Carousel Items */
[data-theme="light"] .tech-card {
    border-color: #ffffff !important;
    background-color: transparent !important;
}

[data-theme="light"] .tech-card span {
    color: #ffffff !important;
}

[data-theme="light"] .tech-card img,
[data-theme="light"] .tech-card svg {
    filter: brightness(0) invert(1) !important;
    opacity: 1 !important;
}

[data-theme="light"] .tech-card:hover {
    border-color: var(--accent) !important;
    background-color: rgba(255, 204, 0, 0.05) !important;
}

[data-theme="light"] .tech-card:hover span {
    color: #ffffff !important;
}

[data-theme="light"] .tech-card:hover img,
[data-theme="light"] .tech-card:hover svg {
    filter: none !important;
    /* Back to original color */
}

/* 6. Footer Restyling (White Texts/Icons on Yellow Background) */
[data-theme="light"] footer,
[data-theme="light"] .footer,
[data-theme="light"] footer.footer {
    background-color: #FFCC00 !important;
    /* Force the exact yellow var(--accent) wasn't reliable on root */
}

/* Footer elements to White */
[data-theme="light"] footer .footer-brand p,
[data-theme="light"] footer .container,
[data-theme="light"] footer .footer-header,
[data-theme="light"] footer .footer-v-links a,
[data-theme="light"] footer .footer-contact-link {
    color: #ffffff !important;
}

/* Footer Logo White */
[data-theme="light"] footer .footer-logo-wrapper img {
    filter: brightness(0) invert(1) !important;
}

/* Footer border fixes */
[data-theme="light"] footer hr {
    border-top: 1px solid #ffffff !important;
}

/* Footer Icons to White */
[data-theme="light"] footer .social-icon-box {
    border-color: #ffffff !important;
}

[data-theme="light"] footer .social-icon-box svg {
    fill: #ffffff !important;
}

/* Footer Icons Hover (Reverse colors) */
[data-theme="light"] footer .social-icon-box:hover {
    background-color: #ffffff !important;
}

[data-theme="light"] footer .social-icon-box:hover svg {
    fill: #FFCC00 !important;
}

/* --- PRELOADER (CARGANDO) --- */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #080808;
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

[data-theme="light"] .preloader {
    background-color: var(--bg-primary) !important;
    /* Will be white in light mode */
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-video {
    width: 50vw;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
}

.preloader-dark {
    -webkit-mask-image: radial-gradient(50% 50% at 50% 50%, black 60%, transparent 100%);
    mask-image: radial-gradient(50% 50% at 50% 50%, black 60%, transparent 100%);
}

[data-theme="light"] .preloader-dark {
    display: none !important;
}

[data-theme="light"] .preloader-light {
    display: block !important;
}

.preloader-counter {
    position: absolute;
    bottom: 3rem;
    right: 4rem;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: var(--text-white);
    letter-spacing: -0.02em;
    font-family: var(--font-primary);
}

@media (max-width: 768px) {
    .preloader-video {
        width: 80vw;
    }

    .preloader-counter {
        bottom: 2rem;
        right: 2rem;
    }
}

/* 7. Hero Section Light Mode Refinements */
[data-theme="light"] .hero-subtitle-yellow {
    color: #000000 !important;
}

/* =========================================================
   DESKTOP RESPONSIVE TUNING (ONLY > 1024px)
   - 1600px+: base desktop (sin cambios)
   - 1440px: ajustar escala del hero y navegación
   - 1280px: compactar más sin romper layout
   - 1025–1280px: límite inferior de escritorio
   Importante: NO tocar nada por debajo de 1024px.
   ========================================================= */

/* 1) 1441px–1600px: ligera compactación del hero */
@media (max-width: 1600px) and (min-width: 1441px) {
    .hero-container-v4 {
        padding: 0 5%;
    }

    .hero-bottom-left {
        max-width: 780px;
    }

    .hero-title-v4 {
        font-size: clamp(2.4rem, 3.5vw, 3.1rem);
    }

    .hero-subtitle-yellow {
        font-size: 0.95rem;
    }

    .is-loaded .hero-anim-busto {
        width: clamp(380px, 48vw, 860px);
    }
}

/* 2) 1281px–1440px: asegurar busto completo y header estable */
@media (max-width: 1440px) and (min-width: 1281px) {
    header {
        padding: clamp(0.9rem, 2.5vw, 1.3rem) 0;
    }

    .nav-layout-v4 {
        padding: 0 4%;
        gap: 2.5rem;
    }

    .nav-left-content {
        gap: 2rem;
    }

    .nav-links-inner {
        gap: 1.5rem;
    }

    .nav-links a {
        font-size: 10px;
        letter-spacing: 0.06em;
    }

    .btn-contacto-pill {
        padding: 0.55rem 1.2rem;
        font-size: 10px;
    }

    .hero-v4 {
        padding-bottom: 4vh;
    }

    .hero-container-v4 {
        padding: 0 5%;
    }

    .hero-bottom-left {
        max-width: 720px;
    }

    .hero-title-v4 {
        font-size: clamp(2.1rem, 3.1vw, 2.7rem);
    }

    .hero-subtitle-yellow {
        font-size: 0.9rem;
    }

    .is-loaded .hero-anim-logo {
        width: 105vw;
        top: 40%;
    }

    /* Busto algo más contenido para que no se recorte */
    .is-loaded .hero-anim-busto {
        width: clamp(360px, 52vw, 780px);
    }
}

/* 3) 1025px–1280px: escritorio mínimo, todo más compacto sin tocar tablet */
@media (max-width: 1280px) and (min-width: 1025px) {
    header {
        padding: clamp(0.7rem, 2vw, 1.1rem) 0;
    }

    .nav-layout-v4 {
        padding: 0 3%;
        gap: 2rem;
    }

    .nav-left-content {
        gap: 1.5rem;
    }

    .nav-links-inner {
        gap: 1.2rem;
    }

    .nav-links a {
        font-size: 9px;
        letter-spacing: 0.06em;
    }

    .btn-contacto-pill {
        padding: 0.5rem 1.05rem;
        font-size: 9px;
    }

    .hero-v4 {
        padding-bottom: 3vh;
    }

    .hero-container-v4 {
        padding: 0 3%;
    }

    .hero-bottom-left {
        max-width: 640px;
    }

    .hero-title-v4 {
        font-size: clamp(1.9rem, 2.8vw, 2.4rem);
    }

    .hero-subtitle-yellow {
        font-size: 0.85rem;
    }

    .hero-bottom-right {
        max-width: 420px;
    }

    /* Ajustar logo de fondo y busto para que quepan completos en alturas menores */
    .is-loaded .hero-anim-logo {
        width: 110vw;
        top: 38%;
    }

    .is-loaded .hero-anim-busto {
        width: clamp(320px, 50vw, 720px);
    }
}

[data-theme="light"] .btn-outline-gold-v4 {
    background: var(--accent) !important;
    color: #000000 !important;
    border-color: var(--accent) !important;
}

[data-theme="light"] .btn-outline-gold-v4:hover {
    filter: brightness(0.9);
}