/* ============================================
   COLFRAME - Industrial Swiss Design System
   Main CSS (Consolidated - no @import cascade)
   ============================================ */

/* ---- BASE: Variables (Design Tokens) ---- */
:root {
    /* Brand Colors - Industrial Swiss Palette */
    --colframe-blue: #0072C1;
    --colframe-navy: #071D49;
    --colframe-light: #F3F4F6;

    /* Layout Variables */
    --header-height: 100px;
    --card-offset: 40px;

    /* Spacing System */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Border Radius - CRITICAL: Zero for Industrial Swiss */
    --border-radius: 0px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- BASE: Typography ---- */
h1,
h2,
h3,
h4,
h5,
h6,
.font-brand {
    font-family: 'Montserrat', sans-serif;
}

body,
p,
.font-body {
    font-family: 'Inter', sans-serif;
}

.font-tech {
    font-family: 'Space Mono', monospace;
}

.font-gothic {
    font-family: 'Century Gothic', CenturyGothic, AppleGothic, 'Trebuchet MS', sans-serif;
}

body {
    overflow-x: clip;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--colframe-navy);
}

::-webkit-scrollbar-thumb {
    background: var(--colframe-blue);
}

::-webkit-scrollbar-thumb:hover {
    background: #fff;
}

/* Hollow outlined text — uses text-shadow (raster-based) instead of
   -webkit-text-stroke (vector-based) to avoid internal path artifacts
   on heavy fonts like Montserrat 900. */
.text-stroke {
    color: #071D49; /* navy fill — blends with body bg so letters read as hollow */
    -webkit-text-stroke: 0;
    text-shadow:
        -1px -1px 0 rgba(255, 255, 255, 0.45),
         1px -1px 0 rgba(255, 255, 255, 0.45),
        -1px  1px 0 rgba(255, 255, 255, 0.45),
         1px  1px 0 rgba(255, 255, 255, 0.45);
}

.text-stroke-black {
    color: #000;
    -webkit-text-stroke: 0;
    text-shadow:
        -1px -1px 0 rgba(255, 255, 255, 0.45),
         1px -1px 0 rgba(255, 255, 255, 0.45),
        -1px  1px 0 rgba(255, 255, 255, 0.45),
         1px  1px 0 rgba(255, 255, 255, 0.45);
}


/* ---- a11y: Focus visible — Alto #10 ---- */
:focus-visible {
    outline: 2px solid var(--colframe-blue);
    outline-offset: 3px;
}

/* Quita el outline por defecto del navegador solo cuando usamos :focus-visible */
:focus:not(:focus-visible) {
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---- COMPONENT: Split Slider Hero ---- */
.split-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.layer {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.layer-top {
    width: 80%;
    z-index: 10;
    border-right: none;
}

.layer img {
    position: absolute;
    height: 100%;
    width: 100vw;
    object-fit: cover;
    object-position: center;
}

.handle {
    position: absolute;
    height: 100%;
    width: 4px;
    background-color: var(--colframe-blue);
    top: 0;
    left: 80%;
    transform: translateX(-50%);
    z-index: 20;
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 114, 193, 0.5);
}

.handle-icon {
    background-color: white;
    color: var(--colframe-navy);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
}

@media (max-width: 767px) {
    .handle {
        display: none !important;
    }

    .layer-top {
        width: 0% !important;
        border: none;
    }

    .layer-bottom img {
        width: 100vw !important;
    }
}

/* ---- COMPONENT: Bento Grid ---- */
.bento-card {
    transition: transform var(--transition-smooth);
}

.bento-card:hover {
    transform: translateY(-5px);
}

/* ---- COMPONENT: Sticky Stacking Cards ---- */
.stack-area {
    position: relative;
}

.sticky-card {
    position: relative;
    width: 100%;
    margin-bottom: 40px;
    background: var(--colframe-navy);
    border: 2px solid var(--colframe-blue);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 10;
}

@media (min-width: 768px) {
    .sticky-card {
        position: sticky;
        top: calc(var(--header-height) + var(--card-offset));
        height: 500px;
        margin-bottom: 50px;
        box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.8);
        transform-origin: center top;
        transition: transform var(--transition-slow);
    }

    /* DYNAMIC STACKING LOGIC - CRITICAL: Do Not Change */
    .sticky-card:nth-of-type(1) {
        top: calc(10vh + 20px);
    }

    .sticky-card:nth-of-type(2) {
        top: calc(10vh + 60px);
    }

    .sticky-card:nth-of-type(3) {
        top: calc(10vh + 100px);
    }

    .sticky-card:nth-of-type(4) {
        top: calc(10vh + 140px);
    }
}

/* ---- COMPONENT: Mobile Menu ---- */
#mobileMenu {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-open {
    transform: translateX(0) !important;
}

.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.menu-open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

.menu-open .mobile-link:nth-child(1) {
    transition-delay: 0.1s;
}

.menu-open .mobile-link:nth-child(2) {
    transition-delay: 0.2s;
}

.menu-open .mobile-link:nth-child(3) {
    transition-delay: 0.3s;
}

.menu-open .mobile-link:nth-child(4) {
    transition-delay: 0.4s;
}

/* ---- COMPONENT: Interactive Map (Blueprint Style) ---- */
.blueprint-map {
    filter: grayscale(100%) invert(92%) contrast(120%);
    mix-blend-mode: normal;
    opacity: 0.6;
    transition: filter var(--transition-slow), opacity var(--transition-slow);
}

.map-container:hover .blueprint-map {
    filter: grayscale(0%);
    opacity: 1;
}

/* ---- PAGE: Portfolio ---- */
.project-card {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card.hidden-card {
    display: none;
}

.filter-btn.active {
    background-color: #0072C1;
    border-color: #0072C1;
    color: white;
}
