/* ========================================
   CSS Variables & Design Tokens
   ======================================== */
:root {
    /* Tech Side - Felipe Pereira (Purple/Violet) */
    --tech-primary: #4c1d95;
    --tech-secondary: #6b21a8;
    --tech-accent: #a855f7;
    --tech-text: #ffffff;
    --tech-text-muted: #e9d5ff;
    --tech-overlay: rgba(76, 29, 149, 0.75);

    /* Personal Side - Manuel Pereira (Dark Navy + Orange) */
    --personal-primary: #0f172a;
    --personal-secondary: #1e293b;
    --personal-accent: #f97316;
    --personal-text: #ffffff;
    --personal-text-muted: #94a3b8;
    --personal-overlay: rgba(15, 23, 42, 0.75);

    /* Common */
    --transition-fast: 0.3s ease;
    --transition-medium: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Layout */
    --panel-width: 50%;
    --panel-expanded: 58%;
    --panel-contracted: 42%;
}

/* ========================================
   Reset & Base Styles
   ======================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    overflow: hidden;
    background: #4c1d95;
}

/* ========================================
   Split Container Layout
   ======================================== */
.split-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* ========================================
   Panel Base Styles
   ======================================== */
.split-panel {
    position: relative;
    width: var(--panel-width);
    height: 100%;
    overflow: hidden;
    transition: width var(--transition-medium);
    cursor: pointer;
}

/* Background Images */
.panel-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform var(--transition-slow);
    will-change: transform;
}

.panel-left .panel-bg {
    background-image: url('https://images.unsplash.com/photo-1555066931-4365d14bab8c?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    /* background-image: url('https://fpereiradev.sppa.cl/video.webp'); */

}

.panel-right .panel-bg {
    background-image: url('https://manuel-pereira.sppa.cl/profile3.png');
}

/* Overlays */
.panel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity var(--transition-medium), backdrop-filter var(--transition-medium);
    will-change: opacity, backdrop-filter;
}

.panel-left .panel-overlay {
    background: linear-gradient(135deg,
            rgba(76, 29, 149, 0.88) 0%,
            rgba(107, 33, 168, 0.8) 50%,
            rgba(76, 29, 149, 0.85) 100%);
}

.panel-right .panel-overlay {
    background: linear-gradient(135deg,
            rgba(15, 23, 42, 0.88) 0%,
            rgba(30, 41, 59, 0.82) 50%,
            rgba(15, 23, 42, 0.85) 100%);
}

/* ========================================
   Panel Content
   ======================================== */
.panel-content {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.content-wrapper {
    text-align: center;
    max-width: 500px;
}

/* Animated Entry */
.content-wrapper>* {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.content-wrapper>*:nth-child(1) {
    animation-delay: 0.2s;
}

.content-wrapper>*:nth-child(2) {
    animation-delay: 0.4s;
}

.content-wrapper>*:nth-child(3) {
    animation-delay: 0.6s;
}

.content-wrapper>*:nth-child(4) {
    animation-delay: 0.8s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tags */
.panel-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    margin-bottom: 1.5rem;
}

.panel-left .panel-tag {
    color: var(--tech-accent);
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.4);
}

.panel-right .panel-tag {
    color: var(--personal-accent);
    background: rgba(249, 115, 22, 0.15);
    border: 1px solid rgba(249, 115, 22, 0.4);
}

/* Titles */
.panel-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.panel-left .panel-title {
    color: var(--tech-text);
    text-shadow: 0 0 40px rgba(168, 85, 247, 0.25);
}

.panel-right .panel-title {
    color: var(--personal-text);
}

/* Subtitles */
.panel-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 400;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.panel-left .panel-subtitle {
    color: var(--tech-text-muted);
}

.panel-right .panel-subtitle {
    color: var(--personal-text-muted);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-icon {
    display: flex;
    align-items: center;
    transition: transform var(--transition-fast);
}

.btn:hover .btn-icon {
    transform: translateX(5px);
}

/* Tech Button */
.btn-tech {
    color: #ffffff;
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}

.btn-tech:hover {
    background: linear-gradient(135deg, #c084fc 0%, #8b5cf6 100%);
    box-shadow: 0 8px 30px rgba(168, 85, 247, 0.6);
    transform: translateY(-3px);
}

/* Personal Button */
.btn-personal {
    color: #ffffff;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}

.btn-personal:hover {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    box-shadow: 0 8px 30px rgba(249, 115, 22, 0.6);
    transform: translateY(-3px);
}

/* ========================================
   Split Divider
   ======================================== */
.split-divider {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 80px;
    background: linear-gradient(180deg,
            transparent 0%,
            rgba(255, 255, 255, 0.5) 50%,
            transparent 100%);
    border-radius: 2px;
    z-index: 100;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

/* ========================================
   Hover States (Desktop)
   ======================================== */
@media (min-width: 769px) {

    /* Left panel hovered */
    .split-container.left-active .panel-left {
        width: var(--panel-expanded);
    }

    .split-container.left-active .panel-right {
        width: var(--panel-contracted);
    }

    .split-container.left-active .panel-left .panel-bg {
        transform: scale(1.08);
    }

    .split-container.left-active .panel-right .panel-overlay {
        opacity: 1;
        backdrop-filter: blur(3px);
    }

    .split-container.left-active .panel-right .panel-content {
        opacity: 0.5;
    }

    /* Right panel hovered */
    .split-container.right-active .panel-right {
        width: var(--panel-expanded);
    }

    .split-container.right-active .panel-left {
        width: var(--panel-contracted);
    }

    .split-container.right-active .panel-right .panel-bg {
        transform: scale(1.08);
    }

    .split-container.right-active .panel-left .panel-overlay {
        opacity: 1;
        backdrop-filter: blur(3px);
    }

    .split-container.right-active .panel-left .panel-content {
        opacity: 0.5;
    }

    /* Hide divider on hover */
    .split-container.left-active .split-divider,
    .split-container.right-active .split-divider {
        opacity: 0;
    }

    /* Content opacity transition */
    .panel-content {
        transition: opacity var(--transition-medium);
    }
}

/* ========================================
   Responsive Design (Mobile)
   ======================================== */
@media (max-width: 768px) {
    .split-container {
        flex-direction: column;
        overflow-y: auto;
    }

    .split-panel {
        width: 100%;
        height: 50vh;
        min-height: 400px;
    }

    .split-divider {
        width: 60px;
        height: 3px;
        background: linear-gradient(90deg,
                transparent 0%,
                rgba(255, 255, 255, 0.5) 50%,
                transparent 100%);
        top: 50%;
        left: 50%;
    }

    .panel-title {
        font-size: 2.2rem;
    }

    .panel-subtitle {
        font-size: 1rem;
    }

    .content-wrapper {
        padding: 1rem;
    }

    .btn {
        padding: 0.875rem 1.75rem;
        font-size: 0.9rem;
    }
}

/* Small mobile adjustments */
@media (max-width: 480px) {
    .split-panel {
        min-height: 350px;
    }

    .panel-tag {
        font-size: 0.65rem;
        padding: 0.4rem 0.8rem;
    }

    .panel-title {
        font-size: 1.8rem;
    }

    .panel-subtitle {
        font-size: 0.9rem;
        margin-bottom: 2rem;
    }
}

/* ========================================
   Accessibility
   ======================================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states */
.btn:focus {
    outline: 3px solid currentColor;
    outline-offset: 3px;
}

.btn:focus:not(:focus-visible) {
    outline: none;
}

.btn:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 3px;
}