@import url('./dark-theme.css');
/* @import url('./light-theme.css'); */


/* ===================================
   Reset & Base Styles
   =================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


::selection {
    background-color: orangered;
    color: white;
}

/* ── Image protection ── */
img {
    -webkit-user-drag: none;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
    /* fallback for browsers without JS */
}

/* Re-enable pointer events on images that need to be clickable (slider links, etc.) */
a img,
.project-card img,
.overlay-logo-wrap img,
.profile-card-image,
.floating-avatar__img {
    pointer-events: auto;
}


html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: #0d0c11;
    overflow-x: hidden;
}

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===================================
   Header Fixed
   =================================== */
.header-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    max-width: var(--max-width-content);
    margin: 0 auto;
    z-index: 1000;
    background: radial-gradient(ellipse 362px 103.5px at 1063px 22px,
            rgba(34, 37, 45, 1) 0%,
            rgba(24, 25, 32, 1) 50%,
            rgba(14, 13, 18, 1) 100%);
    padding: var(--spacing-md) var(--spacing-md);
    backdrop-filter: blur(10px);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Gradient border — solo el borde, sin afectar el fondo */
.header-sticky::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    /* grosor del borde */
    background: linear-gradient(142deg, rgb(255 255 255 / 0%) 0%, #4e42b900 40%, rgb(252 251 255 / 7%) 70%, #69696921 100%);

    /* Recorta el interior: solo queda la "corona" de 1px */
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}


.header-content {
    max-width: var(--max-width-content);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0;
    transition: 1s;
    cursor: pointer;
}

.logo img {
    width: 50px;
    transition: 1s;
}

.logo img:hover {
    width: 52px;
    transition: 1s;
}

/* ===================================
   Firma SVG Animada
   =================================== */
#firma-svg {
    display: block;
    overflow: visible;
    /* Escalar para que coincida con la altura de la imagen del logo */
    height: 40px;
    width: auto;
}

.signature-path {
    fill: none !important;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* ===================================
   Buttons
   =================================== */
.btn-primary,
.btn-secondary,
.btn-icon {
    /* padding: 12px; */
    font-family: var(--font-primary);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 14px 18px;
}


.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-text-white);
    /* box-shadow: var(--shadow-button); */
    /* background-image: linear-gradient(241deg, #ff6f00 6%, #fe3c00 92%); */

    /* Base state for smooth transition */
    box-shadow: 0px 15px 46px -6px rgba(254, 60, 0, 0);
    border-bottom: 1px solid rgba(255, 255, 255, 0);

    transition: background-color 0.6s ease, box-shadow 0.6s ease, border-bottom-color 0.6s ease;
}

.btn-primary:hover {
    background-color: var(--color-primary);

    /* Target state */
    box-shadow: 0px 15px 46px -6px rgba(254, 60, 0, 1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text-white);
    border: 1px solid var(--color-border-secondary);
    border-radius: var(--radius-md);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-large {
    padding: 12px 24px;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 10px;
    color: var(--color-text-white);
    border-radius: var(--radius-md);
}

.btn-icon:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ===================================
   Hero Section
   =================================== */
.hero-section {
    position: relative;
    background: radial-gradient(ellipse 703px 599.06px at 1316px 731.74px,
            rgba(34, 37, 45, 1) 0%,
            rgba(24, 25, 32, 1) 50%,
            rgba(14, 13, 18, 1) 100%);
    border-bottom: 1px solid var(--color-border-primary);
    padding-top: calc(var(--spacing-4xl) + 80px);
    /* Espacio para header + padding original */
    padding-left: var(--spacing-3xl);
    padding-right: var(--spacing-3xl);
    padding-bottom: var(--spacing-4xl);
    padding-top: 150px;
}

.hero-container {
    max-width: var(--max-width-content);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-xl);
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    max-width: 25%;
}

.hero-image-right {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.3));
    /* Optional polish */
}

@media (max-width: 968px) {
    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 0;
    }

    .hero-text {
        align-items: center;
    }

    .hero-description {
        text-align: left;
    }

    .hero-visual {
        max-width: 80%;
        justify-content: center;
    }
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.hero-subtitle {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.hero-avatar {
    width: 40px;
    /* height: 50px; */
    /* border-radius: 50%; */
    /* border-radius: 50%; */
    object-fit: cover;
    flex-shrink: 0;
}

.hero-subtitle-text {
    display: flex;
    flex-direction: column;
    gap: 0px;
    text-align: left;
    align-items: flex-start;
}

@media (max-width: 450px) {
    .hero-subtitle {
        flex-direction: column;
        align-items: flex-start;
    }
}

.hero-name {
    font-family: 'Kanit', sans-serif;
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-md);
    color: var(--color-text-white);
    line-height: 1.5;
}

.hero-role {
    font-family: 'Kanit', sans-serif;
    font-weight: var(--font-weight-normal);
    font-size: var(--font-size-md);
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.hero-title {
    font-family: var(--font-primary);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-extrabold);
    line-height: 1.1;
    color: var(--color-text-secondary);
    max-width: 700px;
    /* Needed for the absolutely-positioned .floating-avatar */
    position: relative;
}

.hero-title span {
    color: #fff;
}

.hero-description {
    font-family: var(--font-secondary);
    font-size: var(--font-size-md);
    color: var(--color-text-secondary);
    line-height: 1.5;
    max-width: 655px;
    margin-top: 1rem;
}

.hero-actions {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

/* ===================================
   Floating Avatar — Pop-up on Hover
   Triggered when hovering .hero-title
   =================================== */

/* Container: fixed so it can follow the cursor across the viewport */
.floating-avatar {
    position: fixed;
    /* Top/left are set dynamically by JS — no static values here */
    width: 160px;
    height: 160px;
    pointer-events: none;
    /* Never blocks mouse events */
    z-index: 9998;
    /* Below custom cursor, above everything else */

    /* Estado inicial: invisible y colapsado */
    opacity: 0;
    transform: scale(0.3) translateY(40px);
    transform-origin: center bottom;

    will-change: transform, opacity, left, top;
}

/* La imagen o GIF dentro del contenedor */
.floating-avatar__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px 12px 12px 0;
    /* border: 2px solid rgba(255, 255, 255, 0.15); */
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 8px 24px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: block;
}

/* Estado ACTIVO (clase añadida por JS en mouseenter del h1) */
.floating-avatar.is-visible {
    animation: popIn 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Estado flotación idle (clase añadida por JS tras terminar popIn) */
.floating-avatar.is-floating {
    opacity: 1;
    /* scale(1) ya se aplica via popIn forwards */
    transform: scale(1) translateY(0);
    animation: float 3s ease-in-out infinite;
}

/* Estado de salida (mouseout) */
.floating-avatar.is-hiding {
    animation: popOut 250ms cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

/* ── @keyframes ── */

/* Entrada con rebote elástico */
@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(40px);
    }

    60% {
        opacity: 1;
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0px);
    }
}

/* Flotación suave e infinita (idle) */
@keyframes float {

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

    50% {
        transform: scale(1) translateY(-10px);
    }
}

/* Salida rápida hacia abajo */
@keyframes popOut {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0px);
    }

    100% {
        opacity: 0;
        transform: scale(0.3) translateY(30px);
    }
}

/* ===================================
   GradualBlur Effect — Pure Blur
   Fixed at the bottom of the viewport
   No color overlay, only backdrop blur
   =================================== */
.gradual-blur {
    position: fixed;
    pointer-events: none;
    z-index: 999;
    height: 10rem;
    left: 0;
    right: 0;
}

.gradual-blur--bottom {
    bottom: 0;
}

.gradual-blur__inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.gradual-blur__layer {
    position: absolute;
    inset: 0;
}

/* Capa 1 — Blur muy suave, banda superior */
.gradual-blur__layer[data-index="0"] {
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    mask-image: linear-gradient(to bottom, transparent 0%, black 12.5%, black 25%, transparent 37.5%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 12.5%, black 25%, transparent 37.5%);
}

/* Capa 2 */
.gradual-blur__layer[data-index="1"] {
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    mask-image: linear-gradient(to bottom, transparent 12.5%, black 25%, black 50%, transparent 62.5%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 12.5%, black 25%, black 50%, transparent 62.5%);
}

/* Capa 3 */
.gradual-blur__layer[data-index="2"] {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    mask-image: linear-gradient(to bottom, transparent 25%, black 50%, black 62.5%, transparent 75%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 25%, black 50%, black 62.5%, transparent 75%);
}

/* Capa 4 */
.gradual-blur__layer[data-index="3"] {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    mask-image: linear-gradient(to bottom, transparent 50%, black 75%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 50%, black 75%);
}

/* Capa 5 — Blur máximo, banda inferior */
.gradual-blur__layer[data-index="4"] {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    mask-image: linear-gradient(to bottom, transparent 62.5%, black 87.5%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 62.5%, black 87.5%);
}

/* ===================================
   Logo Slider Section
   =================================== */
.logo-slider-section {
    background: radial-gradient(ellipse 314.48px 61px at 672.55px -11px,
            rgba(26, 28, 34, 1) 0%,
            rgba(15, 14, 19, 1) 100%);
    border-bottom: 1px solid #904de01f;
    padding: var(--spacing-md) var(--spacing-lg);
    overflow: hidden;
    border-radius: 0px 0px 30px 30px;
    max-width: 82%;
    margin: 0 auto;
}

.logo-slider-container {
    max-width: var(--max-width-content);
    margin: 0 auto;
}

.logo-slider-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
    width: 100%;
}

/* Label (texto) */
.logo-slider-label {
    flex-shrink: 0;
    text-align: center;
}

.logo-slider-label p {
    font-family: var(--font-secondary);
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    line-height: 2;
}

/* Wrapper del slider con efecto blur en los bordes */
/* Wrapper del slider con efecto blur en los bordes */
.logo-slider-wrapper {
    width: 100%;
    flex: 1;
    position: relative;
    overflow: hidden;
    /* Efecto de fade/blur en los bordes */
    -webkit-mask-image: linear-gradient(to right, transparent, black 80px, black calc(100% - 80px), transparent);
    mask-image: linear-gradient(to right, transparent, black 80px, black calc(100% - 80px), transparent);
}

.infinite-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.slider-track {
    display: flex;
    width: max-content;
    gap: 0 !important;
    white-space: nowrap;
    will-change: transform;
    animation: infiniteScroll 60s linear infinite;
}

.slide-group {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 112px;
    padding-right: 112px;
    /* Mismo valor que el gap */
}

/* Logo items */
.logo-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.logo-item img {
    height: auto;
    width: auto;
    max-height: 30px;
    /* filter: brightness(0) invert(1); */
    filter: grayscale(100%);
    opacity: 0.8;
    /* transition: opacity var(--transition-normal); */
    transition: .3s;
}

.logo-item img:hover {
    opacity: 1;
    filter: none;
    transition: .3s;
}



/* Animación infinita */
@keyframes infiniteScroll {
    from {
        transform: translateX(0);
    }

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

/* Pausar en hover (opcional) */
/* Pausar en hover (opcional) */
/* .infinite-slider:hover .slider-track {
    animation-play-state: paused;
} */

/* Responsive */
@media (min-width: 768px) {
    .logo-slider-layout {
        flex-direction: row;
        align-items: center;
    }

    .logo-slider-label {
        text-align: right;
        max-width: 176px;
        padding-right: var(--spacing-lg);
        /* border-right: 1px solid rgba(255, 255, 255, 0.1); */
    }

    .logo-slider-wrapper {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .logo-slider-section {
        max-width: 100%;
        border-radius: 0;
        padding-bottom: var(--spacing-xl);
    }

    .slide-group {
        gap: 50px;
        padding-right: 50px;
        /* debe coincidir con el gap */
    }

    .slider-track {
        animation-duration: 35s;
        /* Ajusta la velocidad para que no sea tan lento en móvil */
    }
}

/* ===================================
   Portfolio Section
   =================================== */
.portfolio-section {
    background-color: #0d0c11;
    padding: var(--spacing-4xl) var(--spacing-3xl);
}

.portfolio-container {
    max-width: var(--max-width-content);
    margin: 0 auto;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.project-card {
    height: 454px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
}

.project-image {
    flex: 1;
    overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: relative;
    /* border: 1px solid var(--color-border-card) */
}

.project-image img,
.project-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-image video {
    transform: scale(1.35) translate(2%, -2%);
    /* Aumentamos zoom y desplazamos ligeramente para forzar la esquina superior derecha */
}

.project-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--color-border-card);
    border-left: 1px solid var(--color-border-card);
    border-right: 1px solid var(--color-border-card);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    background-color: var(--color-bg-card-red);
}

.project-card[data-color="green"] .project-info {
    background-color: var(--color-bg-card-green);
}

.project-card[data-color="black"] .project-info {
    background-color: var(--color-bg-card-black);
}


.project-card[data-color="red"] .project-info {
    background-color: var(--color-bg-card-red);
}

.project-card[data-color="purple"] .project-info {
    background-color: var(--color-bg-card-purple);
}

.project-card[data-color="blue"] .project-info {
    background-color: var(--color-bg-card-blue);
}

.project-card[data-color="pink"] .project-info {
    background-color: var(--color-bg-card-pink);
}

.project-card[data-color="orange"] .project-info {
    background-color: var(--color-bg-card-orange);
}

.project-card[data-color="teal"] .project-info {
    background-color: var(--color-bg-card-teal);
}

/* ===================================
   Skeleton / Empty Card
   =================================== */
.project-card.skeleton-card {
    pointer-events: none;
    cursor: default;
    background-color: #121212;
    border-radius: var(--radius-lg);
}

.skeleton-card .project-image {
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed rgba(255, 255, 255, 0.1) !important;
}

.skeleton-icon-center {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.skeleton-card .project-info {
    background-color: #0c0d12;
    /* border-top: 1px dashed rgba(255, 255, 255, 0.3) !important; */
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1) !important;
    border-left: 1px dashed rgba(255, 255, 255, 0.1) !important;
    border-right: 1px dashed rgba(255, 255, 255, 0.1) !important;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 24px 16px;
}

.skeleton-icon {
    width: 40px;
    height: 40px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background-color: #09090c;
}

.skeleton-text-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.skeleton-title {
    width: 150px;
    height: 14px;
    background-color: #0000004a;
    border-radius: 20px;
}

.skeleton-meta {
    width: 100px;
    height: 10px;
    background-color: #0000004a;
    border-radius: 20px;
}

.skeleton-action {
    width: 24px;
    height: 6px;
    background-color: #0000004a;
    border-radius: 20px;
}

.project-icon {
    width: 45px;
    height: 45px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.project-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.project-text {
    flex: 1;
}

.project-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-primary);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-white);
    margin-bottom: -7px;
}

.project-year {
    font-size: var(--font-size-md);
    font-weight: 300;
    font-family: var(--font-secondary);
    text-transform: uppercase;
    color: rgb(255 255 255 / 25%);
}

.project-description {
    font-family: var(--font-secondary);
    font-size: var(--font-size-md);
    color: rgb(255 255 255 / 54%);
    line-height: 1.7;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* ===================================
   About Section
   =================================== */
.about-section {
    background-color: var(--color-bg-primary);
    padding: 0 var(--spacing-3xl) var(--spacing-3xl);
}

.about-card {
    max-width: var(--max-width-content);
    margin: 0 auto;
    display: flex;
    height: 270px;
    overflow: hidden;
    border-radius: var(--radius-sm);
}

.about-image {
    width: 330px;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse 625px 333.5px at 238px 19px,
            rgba(15, 116, 217, 1) 9.12%,
            rgba(8, 81, 199, 1) 26.32%,
            rgba(1, 46, 181, 1) 43.51%,
            rgba(1, 35, 136, 1) 53.91%,
            rgba(1, 23, 91, 1) 64.30%,
            rgba(0, 17, 68, 1) 69.50%,
            rgba(0, 12, 45, 1) 74.70%,
            rgba(0, 6, 23, 1) 79.90%,
            rgba(0, 3, 11, 1) 82.50%,
            rgba(0, 0, 0, 1) 85.10%);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.about-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 1;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.about-content {
    flex: 1;
    padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-lg) var(--spacing-lg);
    background: radial-gradient(ellipse 455.85px 338.38px at 853.34px 413.33px,
            rgba(34, 37, 45, 1) 0%,
            rgba(24, 25, 32, 1) 50%,
            rgba(14, 13, 18, 1) 100%);
    border: 1px solid var(--color-border-card);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    justify-content: center;
}

.about-header {
    text-align: center;
}

.about-greeting {
    font-family: var(--font-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-normal);
    color: var(--color-text-white);
    line-height: 2.5;
    margin-bottom: 0;
}

.about-name {
    font-family: var(--font-primary);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-white);
    line-height: 1;
}

.about-description {
    font-family: var(--font-secondary);
    font-size: var(--font-size-md);
    color: var(--color-text-muted);
    line-height: 1.5;
    max-width: 585px;
}

/* ===================================
   Footer
   =================================== */
.footer-social {
    background-color: var(--color-border-primary);
    border-top: 1px solid var(--color-border-primary);
    padding: var(--spacing-lg) var(--spacing-3xl);
}

.social-links {
    max-width: var(--max-width-container);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
    background-color: rgba(18, 18, 24, 0.08);
    border-radius: var(--radius-lg);
    padding: 0 17px 0 0;
    overflow: hidden;
}

.social-link {
    font-family: var(--font-secondary);
    font-size: var(--font-size-sm);
    color: var(--color-text-footer);
    background-color: var(--color-bg-tertiary);
    padding: 4px 16px;
    line-height: 2;
    transition: all var(--transition-normal);
}

.social-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-text-white);
}

.footer-copyright {
    background-color: var(--color-border-primary);
    padding: var(--spacing-xl) var(--spacing-3xl);
}

.copyright-content {
    max-width: var(--max-width-container);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--color-border-overlay);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.copyright-text {
    font-family: var(--font-secondary);
    font-size: var(--font-size-sm);
    color: var(--color-text-footer);
    padding: 0 8px 0 16px;
    line-height: 2;
}

.copyright-author {
    font-family: var(--font-secondary);
    font-size: var(--font-size-sm);
    color: var(--color-accent);
    background-color: rgba(24, 0, 49, 0.3);
    padding: 8px 16px;
    border-radius: 0 11.2px 11.2px 0;
    line-height: 2;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 1200px) {

    .header-sticky,
    .hero-section,
    .logo-slider-section,
    .portfolio-section,
    .about-section,
    .footer-social,
    .footer-copyright {
        padding-left: var(--spacing-lg);
        padding-right: var(--spacing-lg);
        /* padding-bottom: 0; */
    }
}

@media (max-width: 992px) {
    .hero-title {
        font-size: 48px;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .project-card.skeleton-card {
        display: none !important;
    }

    .project-card {
        height: 320px;
    }

    .project-image {
        max-height: 220px;
    }

    .about-card {
        flex-direction: column;
        height: auto;
    }

    .about-image {
        width: 100%;
        height: 300px;
        border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    }

    .about-content {
        border-left: 1px solid var(--color-border-card);
        border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    }
}

@media (max-width: 768px) {
    .header-nav {
        gap: var(--spacing-sm);
    }

    .btn-secondary {
        display: none;
    }

    .hero-title {
        font-size: 31px;
    }

    .hero-section {
        padding-bottom: var(--spacing-2xl);
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions button {
        width: 100%;
    }

    .social-links {
        flex-wrap: wrap;
        padding: var(--spacing-sm);
    }

    .copyright-content {
        flex-direction: column;
        text-align: center;
    }

    .copyright-author {
        border-radius: 0 0 11.2px 11.2px;
        width: 100%;
    }
}

/* ===================================
   Animations
   =================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hero-section,
.portfolio-section,
.about-section {
    animation: fadeInUp 0.8s ease-out;
}

.project-card {
    animation: scaleIn 0.5s ease-out backwards;
}

.project-card:nth-child(1) {
    animation-delay: 0.1s;
}

.project-card:nth-child(2) {
    animation-delay: 0.2s;
}

.project-card:nth-child(3) {
    animation-delay: 0.3s;
}

.project-card:nth-child(4) {
    animation-delay: 0.4s;
}

.project-card:nth-child(5) {
    animation-delay: 0.5s;
}

.project-card:nth-child(6) {
    animation-delay: 0.6s;
}

/* ===================================
   Custom Cursor for Project Cards
   =================================== */
.custom-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    display: none;
    transform: translate(-50%, -50%);
}

.custom-cursor.active {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-primary);
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    /* box-shadow: 0 8px 24px rgba(38, 112, 221, 0.4); */
    transition: opacity 0.2s ease;
}

.custom-cursor svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Ocultar cursor normal en las cards */
.project-card:hover {
    cursor: none;
}

.portfolio-section:has(.project-card:hover) {
    cursor: none;
}

/* Project card link wrapper */
.project-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition-normal);
}

.project-card-link:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
    border-radius: var(--radius-lg);
}

/* ===================================
   Custom Circular Cursor
   =================================== */
* {
    cursor: none !important;
}

.cursor-dot {
    width: 10px;
    height: 10px;
    background-color: var(--color-primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.15s ease, opacity 0.15s ease;
    transform: translate(-50%, -50%);
}

.cursor-dot.expand {
    transform: translate(-50%, -50%) scale(2.5);
    background-color: rgba(254, 60, 0, 0.8);
    animation: cursor-pulse 1.5s infinite;
}

@keyframes cursor-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(254, 60, 0, 0.6);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(254, 60, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(254, 60, 0, 0);
    }
}

.cursor-dot.hide {
    opacity: 0;
}

/* ===================================
   Footer Minimal
   =================================== */
.footer-minimal {
    position: relative;
    padding: var(--spacing-xl) var(--spacing-md);
    background-color: transparent;
    background: radial-gradient(35% 80% at 30% 0%, rgba(255, 255, 255, 0.1), transparent);
    padding-bottom: 100px;
    /* Or rely on body bg */
}

.footer-minimal-container {
    max-width: var(--max-width-content);
    /* max-w-4xl */
    margin: 0 auto;
    position: relative;

}

.footer-divider {
    height: 1px;
    width: 100%;
    background-color: var(--color-border-card);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 24px;
    padding: 16px;
}

.footer-brand-col {
    grid-column: span 6;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-logo-link {
    width: max-content;
    opacity: 0.25;
    color: inherit;
    transition: opacity var(--transition-normal);
}

.footer-logo-link:hover {
    opacity: 1;
}

.footer-icon-large {
    width: 32px;
    height: 32px;
}

.footer-description {
    color: var(--color-text-secondary);
    /* text-muted-foreground */

    font-size: 24px;
    font-weight: 900;
    /* text-sm */
    max-width: 384px;
    /* max-w-sm */
}

.footer-social-icons a {
    background-color: var(--color-bg-secondary);
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    font-family: var(--font-primary);
    font-size: 20px;
    font-weight: var(--font-weight-medium);
    /* box-shadow: 0 8px 24px rgba(38, 112, 221, 0.4); */
    transition: opacity 0.2s ease;
}


.footer-social-icons {
    display: flex;
    gap: 8px;
    /* gap-2 */
}

.footer-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    /* p-1.5 */
    border-radius: 6px;
    /* rounded-md */
    /* border: 1px solid var(--color-border-card); */
    transition: background-color var(--transition-fast);
    color: inherit;
}

.footer-social-btn:hover {
    background-color: var(--color-bg-tertiary);
    /* hover:bg-accent approx */
}

.footer-icon-sm {
    width: 16px;
    /* size-4 */
    height: 16px;
}

.footer-links-wrapper {
    grid-column: span 6;
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: flex-start;
}

.footer-links-col {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-col-title {
    display: block;
    color: var(--color-text-secondary);
    font-size: var(--font-size-md);
    /* text-xs */
    margin-bottom: 4px;
    /* mb-1 */
}

.footer-links-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    /* gap-1 */
}

.footer-link {
    width: max-content;
    padding: 4px 0;
    /* py-1 */
    font-size: var(--font-size-md);
    /* text-sm */
    transition: all 200ms;
    color: inherit;
}

.footer-link:hover {
    text-decoration: underline;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    /* gap-2 */
    padding-top: 8px;
    /* pt-2 */
    padding-bottom: 20px;
    /* pb-5 */
    max-width: var(--max-width-content);
    margin: 0 auto;
}

.footer-copyright-text {
    color: var(--color-text-secondary);
    text-align: center;
    font-weight: 100;
    /* font-thin */
    font-size: var(--font-size-md);
}

.footer-author-link {
    color: inherit;
    text-decoration: underline;
}

@media (min-width: 768px) {
    .footer-brand-col {
        grid-column: span 4;
    }

    .footer-links-wrapper {
        grid-column: span 2;
        align-items: flex-end;
    }

    .footer-links-col,
    .footer-links-list {
        align-items: flex-end;
    }
}

/* Corrección para Slider Infinito Perfecto movido arriba */

/* ===================================
   Availability Banner
   =================================== */
.availability-section {
    padding: var(--spacing-xl) var(--spacing-3xl);
}

.availability-container {
    max-width: var(--max-width-content);
    margin: 0 auto;
}

.availability-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
    padding: var(--spacing-xl) var(--spacing-2xl);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.availability-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px -8px rgba(0, 0, 0, 0.3);
}

/* Indicator */
.availability-indicator {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.availability-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #4ade80;
    z-index: 1;
    animation: availPulse 2.5s ease-in-out infinite;
}

.availability-dot-ring {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid rgba(74, 222, 128, 0.25);
    background: rgba(74, 222, 128, 0.04);
    animation: availRing 2.5s ease-in-out infinite;
}

@keyframes availPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.75;
        transform: scale(0.9);
    }
}

@keyframes availRing {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.5;
    }
}

/* Content */
.availability-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.availability-status {
    font-family: var(--font-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-white);
    margin: 0;
}

.availability-sub {
    font-family: var(--font-secondary);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .availability-section {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .availability-card {
        flex-direction: column;
        text-align: center;
        padding: var(--spacing-xl);
        gap: var(--spacing-md);
    }
}



/* ===================================
   Text Marquee Slider
   =================================== */
.text-marquee-section {
    padding: var(--spacing-lg) 0;
    overflow: hidden;
    /* max-width: var(--max-width-content); */
    margin: 200px auto;
    background: #fe3c00;
    mask-image: linear-gradient(to right, transparent, black 80px, black calc(100% - 80px), transparent);
    transform: skew(0.03turn, 355deg);
    border: 2px solid #ffffff4d;
    /* box-shadow: 4px 16px 10px 9px #ffffff; */

    background-color: #fe3c00;
    opacity: 1;
    background-size: 10px 10px;
    background-image: repeating-linear-gradient(45deg, #e33702 0, #e33702 1px, #fe3c00 0, #fe3c00 50%);
}

.text-marquee-container {
    /* max-width: var(--max-width-content); */
    margin: 0 auto;
}

.text-marquee-wrapper {
    width: 100%;
    position: relative;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, black 80px, black calc(100% - 80px), transparent);
    mask-image: linear-gradient(to right, transparent, black 80px, black calc(100% - 80px), transparent);
}

.infinite-text-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.text-marquee-track {
    display: flex;
    gap: 0;
    will-change: transform;
    animation: textMarqueeScroll 60s linear infinite;
    width: max-content;
}

.marquee-item {
    flex-shrink: 0;
    font-family: var(--font-primary);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-white);
    white-space: nowrap;
    padding: 0 var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@keyframes textMarqueeScroll {
    from {
        transform: translateX(0);
    }

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



/* ===================================
   New About Me Description Section
   =================================== */
.sobre-mi_descripcion {
    width: 80%;
    height: 30%;
    max-width: 1280px;
    border-radius: 3rem 2rem 2rem 3rem;
    margin: 15rem auto;
    display: grid;
    grid-template-columns: 1.1fr 2fr;
    grid-template-rows: 321px;
    grid-column-gap: 2em;
    background-color: #0f1011;
    background-size: 20px 20px;
    box-shadow: rgb(12 2 59 / 13%) 0px 110px 124px -57px;

    /* Gradient border via outline trick */
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
}

/* Gradient border layer */
.sobre-mi_descripcion::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(167deg,
            rgba(255, 255, 255, 0.12) 0%,
            rgba(255, 255, 255, 0.03) 40%,
            rgba(147, 90, 255, 0.25) 70%,
            rgba(80, 140, 255, 0.2) 100%);
    z-index: -1;
    pointer-events: none;
}

.box-image {
    background: conic-gradient(from 271deg at 50% 36%, #e39401, #f9c302 12.5%, #f9c302 25%, #f9c302 37.5%, #e39401 50.5%) 0% 0% / 100% 200%;
    border-radius: 3rem 0 0 3rem;
    /* border: 4px solid #28292a; */
    -webkit-border-radius: 3rem 0 0 3rem;
    -moz-border-radius: 3rem 0 0 3rem;
    -ms-border-radius: 3rem 0 0 3rem;
    -o-border-radius: 3rem 0 0 3rem;
    transition: 350ms;
    -webkit-transition: 350ms;
    -moz-transition: 350ms;
    -ms-transition: 350ms;
    -o-transition: 350ms;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    -webkit-clip-path: inset(-200px 0 0 0 round 3rem 0 0 3rem);
    clip-path: inset(-200px 0 0 0 round 3rem 0 0 3rem);
}

@property --g2-1-x-position {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 87.96875%;
}

@property --g2-1-y-position {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 91.1328125%;
}

@property --g2-2-x-position {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 13.398437500000002%;
}

@property --g2-2-y-position {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 82.734375%;
}

.gradient-3 {
    background: radial-gradient(100% 100% at 4% 3%, #fe3c00db 0%, transparent), radial-gradient(100% 100% at var(--g2-1-x-position) var(--g2-1-y-position), #6b00ff6e -32%, transparent), radial-gradient(100% 100% at var(--g2-2-x-position) var(--g2-2-y-position), #ffa700ad 0%, transparent), #0c0c10;
    animation-name: g-2;
    animation-iteration-count: infinite;
    animation-duration: 10s;
    transition-timing-function: ease-in-out;
}

@keyframes g-2 {
    50% {
        --g2-1-x-position: 15%;
        --g2-1-y-position: 15%;
        --g2-2-x-position: 61.21093749999999%;
        --g2-2-y-position: 13.750000000000002%;
    }
}

/*
.box-image:hover {
  background: conic-gradient(from 60deg at 50% 36%, #e39401, #f9c302 12.5%, #f9c302 25%, #f9c302 37.5%, #e39401 50.5%)
    0% 0% / 100% 200%;
  transition: 350ms;
  -webkit-transition: 350ms;
  -moz-transition: 350ms;
  -ms-transition: 350ms;
  -o-transition: 350ms;
}
*/

.box-image img {
    display: flex;
    width: 100%;
    max-width: 320px;
    margin: -48px auto -65px auto;
    transition: transform 0.5s ease-out, filter 0.5s ease-out;
    transform: translateY(15px);
    filter: grayscale(100%);
}

.sobre-mi_descripcion:hover .box-image img {
    transform: translateY(0px);
    filter: grayscale(0%);
}

@media (max-width: 1390px) {
    .box-image img {
        margin-top: 0;
        max-width: 300px;
        align-self: flex-end;
    }
}

/* .sobre-mi_descripcion img {
   width: 350px;
   display: grid;
   margin-top: -2.6rem;

   border-radius: 2.1rem;
   /* filter: drop-shadow(0 1.5rem 1.2rem rgba(255, 255, 0, 0.301)); 
   */

.descripcion-texto {
    /* font-weight: 100; */
    /* color: #e6e6e6; */
    padding: var(--spacing-xl) var(--spacing-xl) var(--spacing-xl) 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--spacing-md);
}

.descripcion-texto h4 {
    font-family: var(--font-primary);
    font-size: 36px;
    font-weight: var(--font-weight-bold);
    color: var(--color-text-white);
    line-height: 1.15;
    margin: 0;

    /* font-size: var(--font-size-lg);
    margin: 2rem 0 1rem 0;
    
    font-weight: 500; */
}

/* .descripcion-texto h4::after {
    content: " />";
    color: #d4d4d4;
    font-weight: var(--font-weight-normal);
} */

/* .descripcion-texto h4::before {
   content: "< ";
   color: #e6e6e6;
} */

.descripcion-texto p {
    font-size: var(--font-size-md);
    font-family: var(--font-secondary);
    margin: 0;
    line-height: 1.7;
    color: var(--color-text-secondary);
    text-align: left;
}

.descripcion-texto p strong {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-white);
    /* text-decoration: underline; */
    background-image: url(img/dash-name.svg);
    background-repeat: no-repeat;
    background-position: left bottom -2px;
}

@media (max-width: 968px) {
    .sobre-mi_descripcion {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        width: 90%;
        margin: 8rem auto 5rem;
        border-radius: 2rem;
    }

    .box-image {
        border-radius: 2rem 2rem 0 0;
        -webkit-border-radius: 2rem 2rem 0 0;
        -moz-border-radius: 2rem 2rem 0 0;
        -ms-border-radius: 2rem 2rem 0 0;
        -o-border-radius: 2rem 2rem 0 0;
        -webkit-clip-path: inset(-200px 0 0 0 round 2rem 2rem 0 0);
        clip-path: inset(-200px 0 0 0 round 2rem 2rem 0 0);
        height: 200px;
    }

    .box-image img {
        width: 100%;
        max-width: 200px;
        margin: 0 auto -50px auto;
    }

    .descripcion-texto {
        padding: var(--spacing-xl);
        text-align: center;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .descripcion-texto h4 {
        font-size: 28px;
    }

    .box-image {
        height: 160px;
    }

    .box-image img {
        max-width: 160px;
        margin-bottom: -40px;
    }
}

/* ===================================
   Figma Component Implementation
   =================================== */
/* Main Container: data-name="contenedor" data-node-id="847:23158" */
/* Main Container: data-name="contenedor" data-node-id="847:23158" */
.profile-card {
    /* --card-size controls the overall scale of the component */
    --card-size: 40px;
    font-size: var(--card-size);

    position: relative;
    width: 1em;
    height: 1.12em;
    bottom: -0.16em;
}

/* Gradient Background: data-node-id="847:23159" */
.profile-card-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0.88em;
    background: linear-gradient(to bottom, #fe7348 0%, #fe3c00 100%);
    border-bottom-left-radius: 0.46em;
    border-bottom-right-radius: 0.46em;
    border-top-left-radius: 0.04em;
    border-top-right-radius: 0.04em;
    z-index: 1;
    border: 1px solid #ffffff1c;
}

/* Image Container: data-name="imagen" data-node-id="847:23160" */
.profile-card-image-container {
    position: absolute;
    top: -0.24em;
    left: 0;
    width: 100%;
    height: 1.12em;
    z-index: 2;
}

/* Inner Mask: overflow-hidden pointer-events-none */
.profile-card-image-mask {
    position: absolute;
    inset: 0;
    border-bottom-left-radius: 0.46em;
    border-bottom-right-radius: 0.46em;
    pointer-events: none;
    /* Allow space above for the hover effect but clip the bottom with the same radius */
    -webkit-clip-path: inset(-2em 0 0 0 round 0 0 0.46em 0.46em);
    clip-path: inset(-2em 0 0 0 round 0 0 0.46em 0.46em);
}

/* Image */
.profile-card-image {
    position: absolute;
    top: 0;
    left: -0.08%;
    width: 103.02%;
    height: 134.43%;
    max-width: none;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease-out;
}

/* Trigger hover on image when hovering the parent container (image + text) */
.hero-subtitle:hover .profile-card-image {
    transform: translateY(-0.16em);
}


/* ============================================================
   PROJECT CARD MODAL — FLIP Shared Element Transition
   ============================================================ */

/* Cards become interactive */
.project-card {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

/* Grid dims when modal is open */
body.modal-open .portfolio-grid {
    filter: blur(3px) brightness(0.55);
    transition: filter 420ms cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

/* ── Backdrop ── */
.project-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    pointer-events: none;
    contain: strict;
    visibility: hidden;
}

.project-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 9, 13, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 380ms cubic-bezier(0.4, 0, 0.2, 1);
}

.project-overlay.is-open {
    pointer-events: auto;
    visibility: visible;
}

.project-overlay.is-open .project-overlay__backdrop {
    opacity: 1;
}

/* ── Panel ── */
.project-overlay__panel {
    position: absolute;
    background: var(--color-bg-primary);
    /* Was hardcoded #141418 */
    border: 1px solid var(--color-border-card);
    border-radius: 20px;
    overflow: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.04);
    /* JS sets position/size for FLIP; CSS handles the eased transition */
    transition:
        transform 480ms cubic-bezier(0.4, 0, 0.2, 1),
        border-radius 480ms cubic-bezier(0.4, 0, 0.2, 1),
        opacity 240ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* When fully open the panel is centered and full-size */
.project-overlay__panel.is-active {
    border-radius: 24px;
}

/* ── Content area ── */
.overlay-content {
    padding: 28px 32px 36px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    opacity: 0;
    transform: translateY(14px);
    transition:
        opacity 300ms cubic-bezier(0.4, 0, 0.2, 1) 220ms,
        transform 300ms cubic-bezier(0.4, 0, 0.2, 1) 220ms;
}

.project-overlay.is-open .overlay-content {
    opacity: 1;
    transform: translateY(0);
}

/* ── Fila superior: header + description lado a lado ── */
.overlay-top-row {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    /* margin-right: 24px; */
}

/* ── Header: logo + title + meta ── */
.overlay-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.overlay-logo-wrap {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.overlay-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.overlay-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.overlay-tags {
    font-family: var(--font-primary, 'Kanit', sans-serif);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
}

.overlay-title {
    font-family: var(--font-primary, 'Kanit', sans-serif);
    font-size: clamp(18px, 3vw, 26px);
    font-weight: 600;
    color: #fff;
    margin: 0;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Meta: cliente / año / rol — al lado del logo dentro del header ── */
.overlay-meta {
    display: flex;
    gap: 0;
    flex-shrink: 0;
    align-items: center;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    /* padding-left: 20px;
    margin-left: 4px; */
}

.overlay-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 20px;
    position: relative;
}

.overlay-meta-item+.overlay-meta-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 60%;
    background: rgba(255, 255, 255, 0.08);
}

.overlay-meta-label {
    font-family: var(--font-primary, 'Kanit', sans-serif);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
}

.overlay-meta-value {
    font-family: var(--font-secondary, 'Ubuntu Sans', sans-serif);
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
}

/* ── Description — al lado del header en overlay-top-row ── */
.overlay-description {
    font-family: var(--font-secondary, 'Ubuntu Sans', sans-serif);
    font-size: 16px;
    line-height: 1.75;
    color: var(--color-text-white);
    margin: 0;
    flex: 1;
    /* Separador visual izquierdo */
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding-left: 24px;
}

/* ── Project full-width image — full-bleed, scroll del panel ── */
.overlay-project-image {
    /* Rompe el padding lateral y bottom de .overlay-content */
    margin-left: -32px;
    margin-right: -32px;
    margin-bottom: -36px;
    /* Ancho exacto que compensa los márgenes negativos */
    width: calc(100% + 64px);
    /* Sin scroll propio: el panel ya hace overflow-y: auto */
    overflow: visible;
    flex-shrink: 0;
}

.overlay-project-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    /* Redondea solo las esquinas inferiores para respetar el border-radius del panel */
    border-radius: 0 0 20px 20px;
    /* Opacity managed by JS for fade-in effect */
}

/* ── Skeleton shimmer while image preloads ── */
.overlay-project-image.is-loading {
    min-height: 280px;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0 0 20px 20px;
}

.overlay-project-image.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.06) 40%,
            rgba(255, 255, 255, 0.1) 50%,
            rgba(255, 255, 255, 0.06) 60%,
            transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
    border-radius: 0 0 20px 20px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ── Close button ── */
.overlay-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition:
        background 200ms ease,
        color 200ms ease,
        transform 200ms ease;
    opacity: 0;
    transition:
        opacity 280ms cubic-bezier(0.4, 0, 0.2, 1) 200ms,
        background 160ms ease,
        color 160ms ease,
        transform 160ms ease;
}

.project-overlay.is-open .overlay-close {
    opacity: 1;
}

.overlay-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: rotate(90deg) scale(1.05);
}

/* ── Modificadores de Layout ── */
.overlay-top-row.layout-column {
    flex-direction: column;
    gap: 20px;
}

.overlay-top-row.layout-column .overlay-description {
    border-left: none;
    padding-left: 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Responsive ── */
@media (max-width: 968px) {
    .overlay-top-row {
        flex-direction: column;
        gap: 20px;
    }

    .overlay-description {
        border-left: none;
        padding-left: 0;
        padding-top: 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }
}

@media (max-width: 600px) {
    .overlay-cover {
        height: 180px;
    }

    .overlay-content {
        padding: 20px 20px 28px;
        gap: 18px;
    }

    /* En móvil la fila superior se apila en columna */
    .overlay-top-row {
        flex-direction: column;
        gap: 16px;
    }

    .overlay-description {
        border-left: none;
        padding-left: 0;
        padding-top: 16px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .overlay-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .overlay-meta {
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        padding-top: 12px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        width: 100%;
        gap: 0;
    }

    .overlay-title {
        white-space: normal;
        font-size: clamp(16px, 5vw, 22px);
    }

    .overlay-project-image {
        /* Ajustar márgenes al padding reducido de móvil (20px / 28px) */
        margin-left: -20px;
        margin-right: -20px;
        margin-bottom: -28px;
        width: calc(100% + 40px);
    }
}

/* ── Case Study Content Styles ── */
.case-study-content {
    font-family: var(--font-primary);
    color: var(--color-text-primary);
    line-height: 1.6;
}

.case-study-row {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    margin-bottom: 150px;
}

.case-study-col {
    flex: 1;
    min-width: 0;
    /* Prevents overflow in flex children */
}

/* En mobile, hacer que la fila se rompa en columnas si no hay espacio */
@media (max-width: 768px) {
    .case-study-row {
        flex-direction: column;
        gap: 24px;
        margin-bottom: 56px;
    }

    /* La columna que contiene una imagen siempre aparece primero (arriba) */
    .case-study-col:has(figure) {
        order: -1;
    }
}

.case-study-content h3 {
    margin-top: 0;
    font-size: 1.5em;
    color: var(--color-text-white);
    margin-bottom: 8px;
}

.case-study-content p {
    margin-bottom: 24px;
    color: var(--color-text-white);
}

.case-study-content ul {
    margin-top: 0;
    margin-bottom: 24px;
    color: var(--color-text-white);
    padding-left: 20px;
}

.case-study-content li {
    margin-bottom: 8px;
}

.case-study-content figure {
    margin: 32px 0;
}

.case-study-content figure img {
    width: 100%;
    border-radius: 8px;
    /* border: 1px solid var(--color-border-card); */
}

.case-study-content figcaption {
    margin-top: 12px;
    font-size: 0.85em;
    color: var(--color-text-secondary);
    text-align: center;
    font-style: italic;
}

.case-study-content .code-block-wrapper {
    background: var(--color-bg-tertiary);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--color-border-card);
    margin: 24px 0;
    overflow-x: auto;
}

.case-study-content .code-block-wrapper pre {
    margin: 0;
}

.case-study-content .code-block-wrapper code {
    color: #d4d4d4;
    font-family: monospace;
    font-size: 14px;
}

.case-study-content .token-comment {
    color: #6a9955;
}

.case-study-content .token-selector {
    color: #569cd6;
}

.case-study-content .token-variable {
    color: #9cdcfe;
}

.case-study-content .token-value {
    color: #ce9178;
}

.case-study-content .code-figcaption {
    margin-top: -16px;
    margin-bottom: 32px;
    font-size: 0.85em;
    color: var(--color-text-secondary);
    text-align: center;
    font-style: italic;
}

.case-study-content .project-external-link {
    display: inline-flex;
    margin-top: 16px;
}

/* ── Case-Study scoped Theme Toggle ── */
.cs-theme-toggle-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 32px;
}

.cs-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
    user-select: none;
}

.cs-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.9);
}

/* Pill track */
.cs-theme-toggle__track {
    position: relative;
    width: 32px;
    height: 18px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
    transition: background 0.25s ease;
}

.cs-theme-toggle__thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s ease;
}

/* Icons */
.cs-theme-toggle__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
}

/* Default (dark mode): show moon, hide sun */
.cs-theme-toggle__icon--sun {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.cs-theme-toggle__icon--moon {
    opacity: 0.7;
}

/* Label */
.cs-theme-toggle__label {
    transition: opacity 0.2s ease;
}

/* ── LIGHT STATE — toggled via data-cs-theme="light" on .case-study-content ── */
.case-study-content[data-cs-theme="light"] .cs-theme-toggle {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.14);
    color: rgba(0, 0, 0, 0.65);
}

.case-study-content[data-cs-theme="light"] .cs-theme-toggle:hover {
    background: rgba(0, 0, 0, 0.09);
    border-color: rgba(0, 0, 0, 0.22);
    color: rgba(0, 0, 0, 0.85);
}

.case-study-content[data-cs-theme="light"] .cs-theme-toggle__track {
    background: #fe3c00;
}

.case-study-content[data-cs-theme="light"] .cs-theme-toggle__thumb {
    background: #ffffff;
    transform: translateX(14px);
}

.case-study-content[data-cs-theme="light"] .cs-theme-toggle__icon--sun {
    opacity: 1;
    width: 14px;
}

.case-study-content[data-cs-theme="light"] .cs-theme-toggle__icon--moon {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.case-study-content[data-cs-theme="light"] .cs-theme-toggle__label::before {
    content: 'Dark';
}

.case-study-content[data-cs-theme="dark"] .cs-theme-toggle__label::before {
    content: 'Light';
}

.cs-theme-toggle__label {
    font-size: 0;
    /* hide original text, replaced by ::before */
}

.cs-theme-toggle__label::before {
    font-size: 13px;
}

/* ── Case Study Light Mode — scoped overrides ── */
.case-study-content[data-cs-theme="light"] {
    background: #f7f7f8;
    padding: 24px;
    border-radius: 16px;
    margin: -24px;
    /* compensate overlay-content padding so it fills edge-to-edge */
    transition: background 0.35s ease;
}

.case-study-content[data-cs-theme="light"] h3 {
    color: #1d1d1f;
}

.case-study-content[data-cs-theme="light"] p,
.case-study-content[data-cs-theme="light"] ul,
.case-study-content[data-cs-theme="light"] li,
.case-study-content[data-cs-theme="light"] strong {
    color: #3a3a3c;
}

.case-study-content[data-cs-theme="light"] figcaption {
    color: #6e6e73;
}

.case-study-content[data-cs-theme="light"] figure img {
    border-color: rgba(0, 0, 0, 0.1);
}

.case-study-content[data-cs-theme="light"] .code-block-wrapper {
    background: #ebebeb;
    border-color: rgba(0, 0, 0, 0.1);
}

.case-study-content[data-cs-theme="light"] .code-figcaption {
    color: #6e6e73;
}

/* Smooth background transition for dark → light on the wrapper */
.case-study-content {
    transition: background 0.35s ease, padding 0.35s ease;
}