/* ── Fade-in scroll (toggled by JS) ───────────────────────── */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.65s cubic-bezier(0.4,0,0.2,1),
                transform 0.65s cubic-bezier(0.4,0,0.2,1);
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Mobile nav open (toggled by JS) ─────────────────────── */
@media (max-width: 767px) {
    #navMenu.nav-open {
        display: flex !important;
        flex-direction: column;
        position: absolute;
        top: 48px;
        left: 0;
        right: 0;
        background: rgba(255,255,255,0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 8px 0 16px;
        border-bottom: 1px solid rgba(0,0,0,0.13);
        gap: 0;
    }
    #navMenu.nav-open li { width: 100%; }
    #navMenu.nav-open a  {
        font-size: 16px;
        padding: 14px 22px;
        display: block;
        width: 100%;
    }
    #navMenu.nav-open a:hover { background: #f5f5f7; }
}

/* ── Landing page gradient blob ───────────────────────────────────── */
.landing::before {
    content: '';
    position: absolute;
    top: -10%;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 900px;
    background: radial-gradient(circle, rgba(0,113,227,0.055) 0%, transparent 65%);
    pointer-events: none;
}

/* ── Marquee mask + hover pause ──────────────────────────── */
.marquee-wrap {
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}
.marquee-wrap:hover .marquee-track {
    animation-play-state: paused;
}

/* ── Timeline vertical line + dot ───────────────────────── */
.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 32px;
    width: 1px;
    background: rgba(0,0,0,0.13);
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 5px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #0071e3;
    box-shadow: 0 0 0 3px rgba(0,113,227,0.15);
}

/* ── Timeline task list bullets ─────────────────────────── */
.task-item {
    position: relative;
}
.task-item::before {
    content: '—';
    position: absolute;
    left: 0;
    color: #86868b;
}

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .fade-in { opacity: 1; transform: none; transition: none; }
    .marquee-track { animation: none !important; }
}

/* ── Mobile: hide timeline pseudo-elements ───────────────── */
@media (max-width: 767px) {
    .timeline::before    { display: none; }
    .timeline-item       { padding-left: 0; }
    .timeline-item::before { display: none; }

    .grid-cols-\[110px_1fr\] {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

/* ── Project modal ───────────────────────────────────────── */
#projectModal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
}
#projectModal.modal-open {
    opacity: 1;
    pointer-events: auto;
}
#modalBackdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
#projectModal .modal-card {
    position: relative;
    background: #fff;
    border-radius: 24px;
    width: 100%;
    max-width: 780px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 40px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.18);
    transform: translateY(16px) scale(0.97);
    transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
#projectModal.modal-open .modal-card {
    transform: translateY(0) scale(1);
}
#modalClose {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f5f5f7;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #86868b;
    transition: color 150ms, background 150ms;
}
#modalClose:hover { color: #1d1d1f; background: #e8e8ed; }
@media (prefers-reduced-motion: reduce) {
    #projectModal, #projectModal .modal-card { transition: none; }
}

/* ── Extra small screens ────────────────────────────────── */
@media (max-width: 480px) {
    #contact .inline-flex.rounded-pill {
        width: 100%;
        max-width: 300px;
    }
}
