/* ============================================================
   Bryant Asprilla — Portfolio Styles
   ============================================================ */

:root {
   --primary: #0d6efd;
    --dark:    #212529;
    --light:   #f8f9fa;
    --navbar-h: 56px;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html  { scroll-behavior: smooth; }
body  { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; padding-top: var(--navbar-h); }
section { scroll-margin-top: var(--navbar-h); }

/* ---- Section title ---- */
.section-title { font-weight: 700; position: relative; display: inline-block; }
.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px; left: 50%;
    transform: translateX(-50%);
    width: 60px; height: 3px;
    background: var(--primary);
}

/* ---- Navbar ---- */
.navbar       { box-shadow: 0 2px 4px rgba(0,0,0,.1); }
.navbar-brand { font-weight: 700; font-size: 1.5rem; }
.nav-link     { font-weight: 500; }
.nav-link:hover { color: var(--primary) !important; }

/* ---- Hero ---- */
.hero-section {
    background-image: linear-gradient(rgba(0,0,0,.5), rgba(0,0,0,.6)), url('../images/profile.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    position: relative;
    overflow: hidden;
}
.hero-section::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.3); z-index: 0; }
.hero-section .container { position: relative; z-index: 1; }
.profile-img { display: none; }
.hero-section .btn               { padding: 12px 30px; font-weight: 600; border-radius: 50px; transition: all .3s; }
.hero-section .btn-primary       { background: white; color: var(--primary); border: none; }
.hero-section .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(0,0,0,.2); }
.hero-section .btn-outline-secondary       { border-color: white; color: white; }
.hero-section .btn-outline-secondary:hover { background: white; color: var(--dark); transform: translateY(-2px); }
.social-links .btn { width: 40px; height: 40px; border-radius: 50%; padding: 0; display: inline-flex; align-items: center; justify-content: center; margin: 0 5px; border-color: white; color: white; transition: all .3s; }
.social-links .btn:hover { background: white; color: var(--dark); transform: translateY(-2px); }

/* ---- Misc ---- */
.badge          { font-weight: 500; padding: 8px 12px; }
.contact-info i { color: var(--primary); }

/* ---- Scrollbar ---- */
::-webkit-scrollbar       { width: 8px; }
::-webkit-scrollbar-track { background: var(--light); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

@media (max-width: 768px) {
    .hero-section { background-attachment: scroll; }
    /* Frame layout: name/subtitle at top, buttons at bottom, face visible in between.
       Override Bootstrap min-vh-100 to account for the fixed navbar height so nothing
       spills off screen. dvh (dynamic viewport height) also adjusts for the browser's
       address bar / bottom chrome on mobile devices. */
    .hero-section .row {
        align-items: stretch !important;
        min-height: calc(100vh - var(--navbar-h)) !important;
        min-height: calc(100dvh - var(--navbar-h)) !important;
    }
    .hero-section .col-lg-8 {
        display: flex !important;
        flex-direction: column;
        padding-top: 5vh;
        padding-bottom: 3vh;
    }
    /* Push buttons down; social links follow naturally */
    .hero-section .col-lg-8 > .d-flex {
        margin-top: auto;
        margin-bottom: 0.75rem;
        /* Stack buttons vertically so longer translated text never wraps mid-button */
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.6rem !important;
    }
    /* Uniform button width so both buttons look intentionally matched */
    .hero-section .col-lg-8 > .d-flex .btn {
        width: 100%;
        max-width: 260px;
    }
}


/* ============================================================
   EXPERIENCE TIMELINE
   Section is 80vh tall on desktop so adjacent sections peek.
   Panels are absolutely stacked; only arrows + sidebar navigate.
   Page scroll works normally over this section.
   ============================================================ */

#experience {
    display: flex;
    flex-direction: row;
    height: 80vh;
    max-height: 700px;
    overflow: hidden;
    position: relative;
    scroll-margin-top: var(--navbar-h);
    border-top:    1px solid rgba(0,0,0,.08);
    border-bottom: 1px solid rgba(0,0,0,.08);
}

/* ---- Sidebar ---- */
.tl-sidebar {
    width: 175px;
    min-width: 175px;
    flex-shrink: 0;
    height: 100%;
    background: rgba(0,0,0,.93);
    border-right: 1px solid rgba(255,255,255,.1);
    padding: 36px 16px;
    overflow-y: auto;
    z-index: 50;  /* Increased from 10 */
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tl-sidebar::-webkit-scrollbar       { width: 3px; }
.tl-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 2px; }

.tl-sidebar-heading {
    color: white;
    font-size: .78rem; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase;
    margin-bottom: 18px; padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,.15);
    flex-shrink: 0;
}
.tl-nav-item {
    padding: 11px 10px;
    cursor: pointer;
    border-left: 3px solid transparent;
    border-radius: 0 6px 6px 0;
    transition: all .25s;
    opacity: .5;
    user-select: none;
}
.tl-nav-item:hover  { opacity: 1; background: rgba(255,255,255,.06); border-left-color: rgba(255,255,255,.4); }
.tl-nav-item.active { opacity: 1; background: rgba(255,255,255,.1);  border-left-color: #667eea; }
.tl-nav-title { color: white; font-weight: 600; font-size: .82rem; margin-bottom: 4px; line-height: 1.3; white-space: normal; word-break: break-word; }
.tl-nav-meta  { color: rgba(255,255,255,.5); font-size: .73rem; }

/* ---- Story pane ---- */
.tl-scroll-pane {
    flex: 1;
    height: 100%;
    overflow: hidden;
    position: relative;
    pointer-events: none;  /* let page scroll events pass through */
}

/* ---- Story panels (absolutely stacked, slide vertically) ---- */
.tl-panel {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: #1a1a2e;
    transform: translateY(100%);
    transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;  /* let page scroll through */
}
.tl-panel.active { 
    transform: translateY(0%);
    pointer-events: auto;  /* active panel can receive clicks */
}
.tl-panel.above  { transform: translateY(-100%); }

/* Per-panel background gradients */
.tl-panel[data-index="0"] { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #2d4a6e 100%); }
.tl-panel[data-index="1"] { background: linear-gradient(135deg, #0d1b2a 0%, #1b3a4b 50%, #2e5266 100%); }
.tl-panel[data-index="2"] { background: linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 50%, #4a2c6f 100%); }
.tl-panel[data-index="3"] { background: linear-gradient(135deg, #0d1b2a 0%, #1b4332 50%, #2d6a4f 100%); }
.tl-panel[data-index="4"] { background: linear-gradient(135deg, #1a0a2e 0%, #2d1b69 50%, #5e3ba8 100%); }
.tl-panel[data-index="5"] { background: linear-gradient(135deg, #0f1c2e 0%, #1f3a5f 50%, #3d5a80 100%); }
.tl-panel[data-index="6"] { background: linear-gradient(135deg, #1a1a2e 0%, #2d3436 50%, #636e72 100%); }
.tl-panel[data-index="7"] { background: linear-gradient(135deg, #1a0a00 0%, #5e3023 50%, #9c6644 100%); }

/* ---- Background image (layered on gradient) ---- */
.tl-bg { position: absolute; inset: 0; z-index: 0; }
.tl-bg img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: 50% 40%;
    opacity: 0.6;
}

/* Portrait personal photos — contain so face/body isn't cropped on desktop */
.tl-panel[data-index="1"] .tl-bg img { object-fit: contain; object-position: right center; }
.tl-panel[data-index="2"] .tl-bg img { object-fit: contain; object-position: right center; }
.tl-panel[data-index="5"] .tl-bg img { object-fit: contain; object-position: right center; }
.tl-panel[data-index="6"] .tl-bg img { object-fit: contain; object-position: right center; }
.tl-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(
        to right,
        rgba(0,0,0,.92)  0%,
        rgba(0,0,0,.80) 25%,
        rgba(0,0,0,.50) 45%,
        rgba(0,0,0,.20) 65%,
        rgba(0,0,0,.05) 80%,
        rgba(0,0,0,0)  100%
    );
}

/* ---- Particle field canvas (desktop portrait panels) ---- */
.tl-particles {
    position: absolute; inset: 0;
    pointer-events: none;
    z-index: -1;
}
@media (max-width: 768px) {
    .tl-particles { display: none; }
}

/* ---- Story text ---- */
.tl-content {
    position: relative;
    z-index: 2;
    width: min(520px, 60%);
    max-height: 75%;
    margin-left: 6%;
    padding-right: 20px;
    color: white;
    overflow-y: auto;
    overflow-x: hidden;
    pointer-events: auto;  /* Ensure content is clickable */
}
.tl-content::-webkit-scrollbar { width: 4px; }
.tl-content::-webkit-scrollbar-track { background: rgba(255,255,255,.1); border-radius: 2px; }
.tl-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,.3); border-radius: 2px; }
.tl-content::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.5); }

.tl-location { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: rgba(255,255,255,.75); margin-bottom: 8px; }
.tl-location span { font-size: 1.3rem; }
.tl-title    { font-size: clamp(1.5rem, 2.5vw, 2.4rem); font-weight: 700; line-height: 1.15; margin-bottom: 10px; }
.tl-date     { font-size: .9rem; color: rgba(255,255,255,.6); font-weight: 500; margin-bottom: 16px; }
.tl-text     { font-size: clamp(.85rem, 1.1vw, 1rem); line-height: 1.8; color: rgba(255,255,255,.9); text-shadow: 0 1px 3px rgba(0,0,0,.6); overflow-wrap: break-word; }
.tl-text a   { color: rgba(255,255,255,.9); text-decoration: underline; text-underline-offset: 3px; transition: color .2s; }
.tl-text a:hover { color: #ffffff; }

/* ---- Fun fact: Lightbulb Pulse ---- */
.tl-fun-trigger {
    position: relative;
    z-index: 10;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, rgba(255,215,0,.2), rgba(255,165,0,.3));
    color: #ffd700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    margin-left: 8px;
    transition: all .3s;
    box-shadow: 0 0 0 0 rgba(255,215,0,.4);
    animation: pulse 2s infinite;
    pointer-events: auto;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,215,0,.4); }
    50% { box-shadow: 0 0 0 8px rgba(255,215,0,0); }
}
.tl-fun-trigger svg { width: 20px; height: 20px; }
.tl-fun-trigger:hover {
    background: linear-gradient(135deg, rgba(255,215,0,.4), rgba(255,165,0,.5));
    color: #fff;
    transform: scale(1.1);
    animation: none;
}
.tl-fun-trigger.active {
    background: linear-gradient(135deg, rgba(255,215,0,.6), rgba(255,165,0,.7));
    transform: scale(1.1) rotate(15deg);
    animation: none;
}

.tl-fun-fact {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity .3s ease .05s,
                margin-top .4s cubic-bezier(0.4, 0, 0.2, 1);
}
.tl-fun-fact.revealed {
    max-height: 500px;
    opacity: 1;
    margin-top: 12px;
}

/* ---- Navigation arrows ---- */
.tl-arrow {
    position: absolute;
    left: calc(175px + (100% - 175px) / 2);
    transform: translateX(-50%);
    z-index: 100;  /* Increased from 30 to be above all content */
    width: 48px; height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.4);
    background: rgba(0,0,0,.35);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .25s, background .2s, border-color .2s, transform .2s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: auto;  /* arrows always clickable */
}
.tl-arrow svg    { width: 20px; height: 20px; display: block; }
.tl-arrow:hover  { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.85); transform: translateX(-50%) scale(1.1); }
.tl-arrow:active { transform: translateX(-50%) scale(0.94); }
.tl-arrow.hidden { opacity: 0 !important; pointer-events: none !important; }

.tl-arrow-up   { top: 100px; }
.tl-arrow-down { bottom: 100px; }

@media (max-height: 600px) {
    .tl-arrow-up   { top: 60px; }
    .tl-arrow-down { bottom: 60px; }
}

/* ---- Story counter ---- */
.tl-counter {
    position: absolute;
    right: 20px; bottom: 20px;
    z-index: 100;  /* Increased to match arrows */
    color: rgba(255,255,255,.5);
    font-size: .78rem;
    letter-spacing: .06em;
    pointer-events: none;
}


/* ============================================================
   MOBILE (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {

    #experience {
        flex-direction: column;
        height: calc(100vh - var(--navbar-h));
        max-height: none;
    }

    .tl-sidebar {
        width: 100%; min-width: unset;
        height: auto; flex-shrink: 0;
        flex-direction: row; flex-wrap: nowrap; align-items: center;
        padding: 0 12px; gap: 0;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,.15);
        overflow-x: auto; overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        pointer-events: auto;
    }
    .tl-sidebar::-webkit-scrollbar { display: none; }
    .tl-sidebar-heading { display: none; }

    .tl-nav-item {
        flex: 0 0 auto;
        border-left: none;
        border-bottom: 3px solid transparent;
        border-radius: 0;
        padding: 10px 14px;
        white-space: nowrap;
    }
    .tl-nav-item.active { border-bottom-color: #667eea; background: transparent; }
    .tl-nav-title { font-size: .8rem; white-space: nowrap; margin-bottom: 2px; }
    .tl-nav-meta  { font-size: .7rem; }

    .tl-scroll-pane { flex: 1; min-height: 0; }

    .tl-overlay {
        background: linear-gradient(
            to bottom,
            rgba(0,0,0,.82)  0%,
            rgba(0,0,0,.55) 55%,
            rgba(0,0,0,.2)  100%
        );
    }
    /* Revert to cover on mobile — portrait-shaped panels suit it well */
    .tl-bg img { object-fit: cover; object-position: 50% 0%; }

    /* Override contain→cover for portrait panels (higher specificity needed) */
    .tl-panel[data-index="1"] .tl-bg img,
    .tl-panel[data-index="2"] .tl-bg img,
    .tl-panel[data-index="5"] .tl-bg img,
    .tl-panel[data-index="6"] .tl-bg img { object-fit: cover; object-position: 50% 0%; }

    /* Per-panel mobile overrides */
    .tl-panel[data-index="0"] .tl-bg img { object-position: 50% 65%; }   /* NYC street, show lower */
    .tl-panel[data-index="2"] .tl-bg img { object-position: 55% 0%; }    /* Adelphi selfie, face slightly right */
    .tl-panel[data-index="3"] .tl-bg img { object-position: 50% 55%; }   /* Epic campus building */
    .tl-panel[data-index="4"] .tl-bg img { object-position: 50% 45%; }   /* Atlantis hotel over water */
    .tl-panel[data-index="6"] .tl-bg img { object-position: 48% 0%; }    /* Bulgaria full-body, nudge left */
    .tl-panel[data-index="7"] .tl-bg img { object-position: 55% 10%; }   /* AML laptop, keep Bryant visible */

    .tl-content { width: 88%; margin-left: 6%; }
    .tl-title   { font-size: clamp(1.4rem, 5.5vw, 1.9rem); }
    .tl-text    { font-size: .9rem; line-height: 1.7; }

    .tl-arrow { left: 50%; width: 44px; height: 44px; }
    .tl-arrow svg { width: 18px; height: 18px; }
    .tl-arrow-up   { top: 70px; }
    .tl-arrow-down { bottom: 20px; }

    .tl-counter { right: 12px; bottom: 12px; }
}

/* ============================================================
   Language switcher dropdown
   ============================================================ */

/* Toggle button — inherits navbar text color, no background */
.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: rgba(255,255,255,.75);
    font-weight: 500;
    font-size: .9rem;
    background: transparent;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 6px;
    padding: 4px 10px !important;
    line-height: 1.5;
    transition: color .15s, border-color .15s;
}
.lang-toggle:hover,
.lang-toggle:focus,
.lang-toggle[aria-expanded="true"] {
    color: #fff;
    border-color: rgba(255,255,255,.5);
    background: transparent;
    box-shadow: none;
    outline: none;
}

/* Chevron icon */
.lang-chevron {
    transition: transform .2s;
    flex-shrink: 0;
}
.lang-toggle[aria-expanded="true"] .lang-chevron {
    transform: rotate(180deg);
}

/* Dropdown menu */
.lang-menu {
    background: #212529;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px;
    padding: 4px;
    min-width: 140px;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.lang-menu .lang-option {
    color: rgba(255,255,255,.8);
    border-radius: 5px;
    padding: 7px 12px;
    font-size: .88rem;
    font-weight: 500;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    transition: background .15s, color .15s;
}
.lang-menu .lang-option:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}
.lang-menu .lang-option.active {
    color: #fff;
    background: rgba(13,110,253,.35);
}
