/* ─── Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    background: linear-gradient(135deg, #f0f0f0 0%, #fafafa 50%, #e8e8e8 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow-x: hidden;
    margin: 0;
}

html { scrollbar-width: none; -ms-overflow-style: none; }
::-webkit-scrollbar { display: none; }

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.container-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    padding: 0.5rem;
}

/* ─── Profile Card (desktop) ─────────────────────────────────────────────── */
.profile-card {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 0.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.8);
    max-width: 380px;
    width: 100%;
    transform-style: preserve-3d;
    position: relative;
    overflow: hidden;
    /* will-change applied dynamically by JS on mouseenter only */
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    transition: left 0.55s ease;
    pointer-events: none;
}
.profile-card:hover::before { left: 100%; }

.profile-card-inner { transform-style: preserve-3d; }

.profile-image-container {
    background: rgba(255,255,255,0.3);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    transform: translateZ(40px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.profile-image { width: 100%; height: auto; display: block; }

.profile-header {
    text-align: center;
    margin-bottom: 1.5rem;
    transform: translateZ(20px);
}

.profile-name {
    font-size: 1.75rem;
    font-weight: 500;
    color: #1a1a1a;
    margin: 0;
}

.profile-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateZ(30px);
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    border: 1px solid rgba(255,255,255,0.5);
    color: rgba(0,0,0,0.7);
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.social-icon:hover {
    background: rgba(255,255,255,0.7);
    transform: translateY(-2px) scale(1.08);
}
.social-icon svg { width: 20px; height: 20px; }

.add-member-btn {
    margin: 1rem auto;
    background: #0a0a0a;
    color: white;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    padding: 0.65rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.add-member-btn:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.add-member-btn:active { transform: translateY(0); }

.shine {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: radial-gradient(circle at var(--mouse-x,50%) var(--mouse-y,50%), rgba(255,255,255,0.28) 0%, transparent 55%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.profile-card:hover .shine { opacity: 1; }

/* ─── Modal overlay ──────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.modal-overlay.visible { opacity: 1; pointer-events: all; }

/* ─── Member panel (desktop modal) ──────────────────────────────────────── */
.member-panel {
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.6);
    padding: 2.5rem;
    box-shadow: 0 16px 48px rgba(0,0,0,0.14);
    width: 60vw;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.97) translateY(12px);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
    opacity: 0;
}
.modal-overlay.visible .member-panel {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* drag handle — hidden on desktop */
.drag-handle { display: none; }

/* mobile tabs — hidden on desktop */
.mobile-tabs { display: none; }

.panel-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 1rem;
}

.close-btn {
    background: rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 50%;
    width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    font-size: 1.5rem;
    color: #333;
    line-height: 1;
}
.close-btn:hover {
    background: rgba(255,255,255,0.8);
    transform: rotate(90deg);
}

/* ─── Panel content ──────────────────────────────────────────────────────── */
.profile-header-section { margin-bottom: 2rem; }

.profile-main-name {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #333 0%, #666 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 0.25rem;
    line-height: 1.2;
}

.profile-subtitle {
    font-size: 1rem;
    color: rgba(0,0,0,0.65);
    margin: 0;
}

.profile-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2rem;
}

.profile-left-column,
.profile-right-column {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.profile-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.section-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(0,0,0,0.9);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.section-text {
    font-size: 0.9rem;
    color: rgba(0,0,0,0.75);
    line-height: 1.6;
    margin: 0;
}

.about-items { display: flex; flex-direction: column; gap: 0.75rem; }

.about-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: rgba(0,0,0,0.8);
    word-break: break-all;
}

.icon-circle {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.cert-list { display: flex; flex-direction: column; gap: 0.5rem; }

.cert-tag {
    font-size: 0.85rem;
    color: rgba(0,0,0,0.75);
    padding: 0.4rem 0.75rem;
    background: rgba(255,255,255,0.5);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    line-height: 1.4;
}

.experience-list { display: flex; flex-direction: column; gap: 1.5rem; }

.experience-item {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.experience-item:last-child { border-bottom: none; padding-bottom: 0; }

.experience-header { margin-bottom: 0.75rem; }

.experience-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(0,0,0,0.9);
    margin-bottom: 0.2rem;
}

.experience-company {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(0,0,0,0.65);
    margin-bottom: 0.5rem;
}

.experience-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.experience-duration,
.experience-location {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    background: rgba(255,255,255,0.4);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
    font-size: 0.75rem;
    color: rgba(0,0,0,0.6);
}

.experience-responsibilities {
    list-style: none;
    padding: 0; margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.experience-responsibilities li {
    font-size: 0.875rem;
    color: rgba(0,0,0,0.72);
    line-height: 1.5;
    padding-left: 1.2rem;
    position: relative;
}
.experience-responsibilities li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: rgba(0,0,0,0.4);
}

.read-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 1rem;
    padding: 0.7rem 1rem;
    background: rgba(255,255,255,0.4);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(0,0,0,0.75);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}
.read-more-btn:hover { background: rgba(255,255,255,0.65); transform: translateY(-1px); }
.read-more-btn svg { flex-shrink: 0; }

.action-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.portfolio-btn,
.github-btn,
.papers-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem 1rem;
    background: rgba(255,255,255,0.4);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(0,0,0,0.75);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}
.portfolio-btn:hover,
.github-btn:hover,
.papers-btn:hover { background: rgba(255,255,255,0.65); transform: translateY(-1px); }
.portfolio-btn svg, .github-btn svg, .papers-btn svg { flex-shrink: 0; }

.profile-summary {
    display: flex;
    gap: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.1);
    margin-top: 1rem;
}

.summary-item { display: flex; flex-direction: column; gap: 0.2rem; }

.summary-value {
    font-size: 2rem;
    font-weight: 700;
    color: rgba(0,0,0,0.9);
    line-height: 1;
}
.summary-value.highlight {
    background: linear-gradient(135deg, #333 0%, #666 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.summary-label {
    font-size: 0.8rem;
    color: rgba(0,0,0,0.6);
}

/* ─── Tablet (≤1024px) ───────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .member-panel { width: 80vw; padding: 2rem; }
    .profile-main-name { font-size: 2rem; }
    .profile-content { grid-template-columns: 1fr; gap: 1.5rem; }
    .profile-summary { flex-direction: row; gap: 1.5rem; }
}

/* ─── Mobile (≤768px) — bottom sheet + tab components ───────────────────── */
@media (max-width: 768px) {
    body { align-items: flex-start; padding: 0; background: #f2f2f7; }

    /* ── Profile card: full-width native mobile card ── */
    .container-wrapper {
        min-height: 100vh;
        align-items: center;
        padding: 1.25rem;
    }

    .profile-card {
        max-width: 100%;
        background: #ffffff;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: none;
        border-radius: 20px;
        box-shadow: 0 2px 16px rgba(0,0,0,0.1);
        padding: 0;
        overflow: hidden;
    }
    .profile-card::before { display: none; }
    .profile-card:hover {
        background: #ffffff;
        transform: none;
        box-shadow: 0 2px 16px rgba(0,0,0,0.1);
    }

    .profile-image-container {
        border-radius: 0;
        margin-bottom: 0;
        transform: none;
        border: none;
        background: #f2f2f7;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .profile-card-inner { padding: 1.25rem; }

    .profile-header { margin-bottom: 0.75rem; }

    .profile-name { font-size: 1.5rem; font-weight: 600; }

    .social-icons { gap: 0.75rem; margin-top: 0.5rem; }

    .social-icon {
        width: 44px; height: 44px;
        background: #f2f2f7;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: none;
        box-shadow: none;
    }
    .social-icon:hover { background: #e5e5ea; transform: none; }

    .add-member-btn {
        width: 100%;
        justify-content: center;
        padding: 0.85rem 1rem;
        border-radius: 14px;
        font-size: 1rem;
        margin: 0.75rem 0 0;
    }

    /* ── Modal: bottom sheet ── */
    .modal-overlay {
        align-items: flex-end;
        background: rgba(0,0,0,0.4);
    }

    .member-panel {
        width: 100%;
        max-width: 100%;
        height: 90vh;
        max-height: 90vh;
        border-radius: 20px 20px 0 0;
        padding: 0;
        background: #ffffff;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: none;
        box-shadow: 0 -4px 32px rgba(0,0,0,0.15);
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .modal-overlay.visible .member-panel { transform: translateY(0); }

    /* ── Drag handle ── */
    .drag-handle {
        display: block;
        width: 36px; height: 4px;
        background: rgba(0,0,0,0.15);
        border-radius: 2px;
        margin: 0 auto;
        flex-shrink: 0;
    }

    .panel-header {
        padding: 0.75rem 1.25rem 0;
        flex-direction: row-reverse;
        justify-content: space-between;
        align-items: center;
        flex-shrink: 0;
    }

    .close-btn {
        background: #f2f2f7;
        border: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
        width: 30px; height: 30px;
        font-size: 1.25rem;
        color: #666;
    }
    .close-btn:hover { background: #e5e5ea; transform: none; }

    /* ── Scrollable body inside sheet ── */
    .profile-header-section {
        padding: 0.5rem 1.25rem 0;
        flex-shrink: 0;
        margin-bottom: 0;
    }

    .profile-main-name { font-size: 1.4rem; }
    .profile-subtitle { font-size: 0.8rem; margin-top: 0.2rem; }

    /* ── Tab bar — mobile-only component ── */
    .mobile-tabs {
        display: flex;
        border-bottom: 1px solid rgba(0,0,0,0.08);
        padding: 0 1.25rem;
        margin-top: 1rem;
        flex-shrink: 0;
        gap: 0;
    }

    .mobile-tab {
        flex: 1;
        padding: 0.75rem 0;
        background: none;
        border: none;
        border-bottom: 2px solid transparent;
        font-size: 0.9rem;
        font-weight: 500;
        color: rgba(0,0,0,0.45);
        cursor: pointer;
        transition: color 0.2s, border-color 0.2s;
        margin-bottom: -1px;
    }
    .mobile-tab.active {
        color: #0a0a0a;
        border-bottom-color: #0a0a0a;
    }

    /* ── Tab panels ── */
    .profile-content {
        display: block;
        flex: 1;
        overflow-y: auto;
        padding: 1.25rem;
        margin-bottom: 0;
    }

    /* On mobile, columns are tab panels — only active one shows */
    .profile-left-column,
    .profile-right-column {
        display: none;
        gap: 1.25rem;
    }
    .profile-left-column.tab-active,
    .profile-right-column.tab-active {
        display: flex;
    }

    .profile-section { gap: 0.6rem; }
    .section-title { font-size: 0.65rem; }
    .section-text { font-size: 0.875rem; }

    .about-item { font-size: 0.875rem; word-break: break-word; }

    .icon-circle {
        width: 30px; height: 30px;
        background: #f2f2f7;
        border: none;
        box-shadow: none;
    }
    .icon-circle svg { width: 14px; height: 14px; }

    .cert-tag {
        background: #f2f2f7;
        border: none;
        font-size: 0.825rem;
    }

    .experience-item { padding-bottom: 1.25rem; }
    .experience-title { font-size: 0.9rem; }
    .experience-company { font-size: 0.825rem; }
    .experience-meta { flex-direction: column; gap: 0.35rem; }
    .experience-duration,
    .experience-location {
        background: #f2f2f7;
        border: none;
        font-size: 0.75rem;
        align-self: flex-start;
    }
    .experience-responsibilities li { font-size: 0.825rem; }

    .portfolio-btn,
    .github-btn,
    .papers-btn,
    .read-more-btn {
        background: #f2f2f7;
        border: none;
        font-size: 0.9rem;
        padding: 0.8rem 1rem;
        border-radius: 14px;
    }
    .portfolio-btn:hover,
    .github-btn:hover,
    .papers-btn:hover,
    .read-more-btn:hover { background: #e5e5ea; transform: none; }

    /* Summary pinned at bottom of sheet */
    .profile-summary {
        flex-shrink: 0;
        padding: 1rem 1.25rem;
        margin: 0;
        border-top: 1px solid rgba(0,0,0,0.08);
        gap: 1.5rem;
        flex-direction: row;
    }
    .summary-value { font-size: 1.5rem; }
    .summary-label { font-size: 0.75rem; }
}

/* ─── Small mobile (≤480px) ─────────────────────────────────────────────── */
@media (max-width: 480px) {
    .profile-name { font-size: 1.35rem; }
    .profile-main-name { font-size: 1.25rem; }
    .member-panel { height: 93vh; max-height: 93vh; }
}

/* ─── Dark mode ──────────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    body { background: #1c1c1e; }

    .profile-card {
        background: rgba(30,30,30,0.7);
        border: 1px solid rgba(255,255,255,0.1);
        box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.08);
    }
    .profile-card:hover { background: rgba(38,38,38,0.8); }
    .profile-name { color: #f0f0f0; }

    .profile-image-container {
        background: rgba(40,40,40,0.5);
        border-color: rgba(255,255,255,0.1);
    }

    .social-icon {
        background: rgba(44,44,46,0.8);
        border-color: rgba(255,255,255,0.12);
        color: #e0e0e0;
    }
    .social-icon:hover { background: rgba(58,58,60,0.9); color: #fff; }

    .add-member-btn {
        background: rgba(255,255,255,0.12);
        border-color: rgba(255,255,255,0.2);
        color: #f0f0f0;
    }
    .add-member-btn:hover { background: rgba(255,255,255,0.18); }

    .modal-overlay { background: rgba(0,0,0,0.6); }

    .member-panel {
        background: rgba(28,28,30,0.92);
        border-color: rgba(255,255,255,0.1);
        box-shadow: 0 24px 64px rgba(0,0,0,0.6);
    }

    .close-btn {
        background: rgba(44,44,46,0.8);
        border-color: rgba(255,255,255,0.15);
        color: #e0e0e0;
    }
    .close-btn:hover { background: rgba(58,58,60,0.9); }

    .drag-handle { background: rgba(255,255,255,0.2); }

    .profile-main-name {
        background: linear-gradient(135deg, #e8e8e8 0%, #aaa 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    .profile-subtitle { color: rgba(255,255,255,0.5); }

    .mobile-tab { color: rgba(255,255,255,0.4); }
    .mobile-tab.active { color: #f0f0f0; border-bottom-color: #f0f0f0; }
    .mobile-tabs { border-bottom-color: rgba(255,255,255,0.1); }

    .section-title { color: rgba(255,255,255,0.85); border-bottom-color: rgba(255,255,255,0.1); }
    .section-text { color: rgba(255,255,255,0.7); }
    .about-item { color: rgba(255,255,255,0.7); }

    .icon-circle {
        background: rgba(44,44,46,0.8);
        border-color: rgba(255,255,255,0.12);
        color: #e0e0e0;
    }

    .cert-tag {
        background: rgba(44,44,46,0.8);
        border-color: rgba(255,255,255,0.1);
        color: rgba(255,255,255,0.7);
    }

    .experience-title { color: rgba(255,255,255,0.9); }
    .experience-company { color: rgba(255,255,255,0.6); }
    .experience-duration,
    .experience-location {
        background: rgba(44,44,46,0.8);
        border-color: rgba(255,255,255,0.1);
        color: rgba(255,255,255,0.6);
    }
    .experience-responsibilities li { color: rgba(255,255,255,0.65); }
    .experience-responsibilities li::before { color: rgba(255,255,255,0.35); }

    .portfolio-btn,
    .github-btn,
    .papers-btn,
    .read-more-btn {
        background: rgba(44,44,46,0.8);
        border-color: rgba(255,255,255,0.12);
        color: rgba(255,255,255,0.8);
    }
    .portfolio-btn:hover,
    .github-btn:hover,
    .papers-btn:hover,
    .read-more-btn:hover { background: rgba(58,58,60,0.9); }

    .profile-summary { border-top-color: rgba(255,255,255,0.1); }
    .summary-value { color: rgba(255,255,255,0.9); }
    .summary-value.highlight {
        background: linear-gradient(135deg, #e8e8e8 0%, #aaa 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    .summary-label { color: rgba(255,255,255,0.5); }

    /* Dark mobile overrides */
    @media (max-width: 768px) {
        body { background: #000; }
        .profile-card { background: #1c1c1e; box-shadow: none; border: none; }
        .profile-image-container { background: #2c2c2e; }
        .social-icon { background: #2c2c2e; }
        .social-icon:hover { background: #3a3a3c; }
        .member-panel { background: #1c1c1e; }
        .close-btn { background: #2c2c2e; }
        .mobile-tabs { border-bottom-color: rgba(255,255,255,0.1); }
        .icon-circle { background: #2c2c2e; }
        .cert-tag { background: #2c2c2e; }
        .experience-duration,
        .experience-location { background: #2c2c2e; }
        .portfolio-btn,
        .github-btn,
        .papers-btn,
        .read-more-btn { background: #2c2c2e; }
        .profile-summary { border-top-color: rgba(255,255,255,0.1); }
    }
}

/* ─── Portfolio page ─────────────────────────────────────────────────────── */
.portfolio-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.portfolio-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.portfolio-title {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #333 0%, #666 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.portfolio-subtitle {
    font-size: 1.2rem;
    color: rgba(0,0,0,0.7);
}

.back-button {
    position: fixed;
    top: 2rem; left: 2rem;
    z-index: 100;
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    color: rgba(0,0,0,0.8);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.back-button:hover { background: rgba(255,255,255,0.7); transform: translateY(-2px); }

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.portfolio-card {
    background: rgba(255,255,255,0.4);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.5);
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.portfolio-card:hover { transform: translateY(-5px); box-shadow: 0 20px 60px rgba(0,0,0,0.12); }

.portfolio-card-title { font-size: 1.25rem; font-weight: 600; color: rgba(0,0,0,0.9); margin-bottom: 0.75rem; }
.portfolio-card-description { font-size: 0.9rem; color: rgba(0,0,0,0.7); line-height: 1.6; margin-bottom: 1.25rem; }

.portfolio-card-tech { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }

.tech-tag {
    padding: 0.2rem 0.65rem;
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 10px;
    font-size: 0.78rem;
    color: rgba(0,0,0,0.65);
}

.portfolio-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(0,0,0,0.75);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: gap 0.2s ease, color 0.2s ease;
}
.portfolio-card-link:hover { color: rgba(0,0,0,0.95); gap: 0.65rem; }

@media (max-width: 768px) {
    .portfolio-container { padding: 1rem; padding-top: 4rem; }
    .portfolio-header { margin-bottom: 2rem; padding: 1rem 0; }
    .portfolio-title { font-size: 2rem; }
    .portfolio-subtitle { font-size: 1rem; }
    .back-button { top: 1rem; left: 1rem; padding: 0.5rem 1rem; font-size: 0.9rem; }
    .portfolio-grid { grid-template-columns: 1fr; gap: 1.25rem; }
    .portfolio-card { padding: 1.5rem; }
}

@media (max-width: 480px) {
    .portfolio-container { padding: 0.75rem; padding-top: 3.5rem; }
    .portfolio-title { font-size: 1.75rem; }
    .back-button { top: 0.75rem; left: 0.75rem; padding: 0.4rem 0.8rem; font-size: 0.85rem; }
    .portfolio-card { padding: 1.25rem; border-radius: 16px; }
}

@media (prefers-color-scheme: dark) {
    .portfolio-title {
        background: linear-gradient(135deg, #e0e0e0 0%, #b0b0b0 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    .portfolio-subtitle { color: #b0b0b0; }
    .back-button { background: rgba(40,40,40,0.7); border-color: rgba(255,255,255,0.15); color: #e0e0e0; }
    .back-button:hover { background: rgba(55,55,55,0.9); color: #fff; }
    .portfolio-card { background: rgba(30,30,30,0.7); border-color: rgba(255,255,255,0.1); box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
    .portfolio-card-title { color: #e0e0e0; }
    .portfolio-card-description { color: #c0c0c0; }
    .tech-tag { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.12); color: #b0b0b0; }
    .portfolio-card-link { color: #d0d0d0; }
    .portfolio-card-link:hover { color: #fff; }
}

/* ─── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
    .profile-card::before { display: none; }
    .shine { display: none; }
}
