/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #040404;
    --panel: #0a0a0a;
    --panel-soft: #0f0f10;
    --text: #f2f2f2;
    --muted: #b5b5b5;
    --border: rgba(255,255,255,0.22);
    --border-soft: rgba(255,255,255,0.11);
    --glow: rgba(255,255,255,0.3);
    --shadow: 0 20px 60px rgba(0,0,0,0.5);
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background:
        linear-gradient(135deg, #010101 0%, #050505 30%, #0a0a0b 68%, #020202 100%),
        radial-gradient(circle at 85% 10%, rgba(255,255,255,0.05), transparent 40%),
        radial-gradient(circle at 10% 90%, rgba(255,255,255,0.03), transparent 36%);
    background-size: 200% 200%;
    animation: bgPulse 30s ease infinite;
    scroll-behavior: smooth;
    min-height: 100vh;
    padding-left: 320px;
    position: relative;
}

@keyframes bgPulse {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@media (max-width: 1100px) {
    body {
        padding-left: 0;
        padding-top: 70px; /* Increased from 60px for better spacing */
    }
}

#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    min-height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 1;
}

/* Keep particles visible on mobile with a soft fade */
@media (max-width: 768px) {
    #particles-js {
        opacity: 0.8;
    }
}

@media (max-width: 480px) {
    #particles-js {
        opacity: 0.9;
    }
}

#particles-js canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.page-grid {
    display: block;
    position: relative;
    z-index: 1;
}

a {
    color: inherit;
    text-decoration: none;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    height: 100vh;
    background: linear-gradient(180deg, rgba(2,2,3,0.9) 0%, rgba(7,7,8,0.9) 55%, rgba(12,12,13,0.9) 100%);
    backdrop-filter: blur(6px);
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid var(--border-soft);
    box-shadow: inset -1px 0 0 rgba(255,255,255,0.07), 8px 0 30px rgba(0,0,0,0.45);
    z-index: 10;
}

@media (max-width: 1100px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: auto;
        max-height: 70px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-right: none;
        border-bottom: 2px solid var(--border-soft);
        padding: 12px 20px;
        overflow: hidden;
        transition: max-height 0.4s ease, padding 0.4s ease;
        background: linear-gradient(180deg, rgba(2,2,3,0.95) 0%, rgba(7,7,8,0.95) 100%);
        backdrop-filter: blur(10px);
    }

    .sidebar.menu-open {
        max-height: 100vh;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 70px 20px 30px 20px;
        background: linear-gradient(180deg, rgba(2,2,3,0.98) 0%, rgba(7,7,8,0.98) 100%);
    }

    .sidebar.menu-open .sidebar-top {
        width: 100%;
        margin-bottom: 18px;
    }

    .sidebar.menu-open .sidebar-nav {
        display: flex;
        width: 100%;
    }

    .sidebar.menu-open .social-links {
        display: flex;
        justify-content: flex-start;
        width: 100%;
        margin-top: 18px;
    }
}


.main-content {
    margin: 0 auto;
    max-width: 960px;
}

.sidebar-top {
    text-align: center;
    margin-bottom: 16px;
}

@media (max-width: 1100px) {
    .sidebar-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 0;
        width: 100%;
        flex: 1;
    }

    .sidebar-top p {
        display: none;
    }
}

@media (max-width: 1100px) and (min-width: 768px) {
    .sidebar-top {
        min-width: 0;
    }
}

.sidebar-avatar {
    width: 136px;
    height: 136px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.9);
    box-shadow: 0 0 0 5px rgba(255,255,255,0.08), 0 0 28px rgba(255,255,255,0.12);
    margin-bottom: 18px;
}

@media (max-width: 1100px) {
    .sidebar-avatar {
        width: 40px;
        height: 40px;
        margin-bottom: 0;
        flex-shrink: 0;
    }
}

.sidebar-top h1 {
    font-size: 1.9rem;
    margin-bottom: 6px;
}

@media (max-width: 1100px) {
    .sidebar-top h1 {
        font-size: 1.2rem;
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .sidebar-top {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        width: 100%;
    }

    .sidebar-top h1 {
        display: block;
        font-size: 1rem;
        margin-bottom: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sidebar-top p {
        display: none;
    }

    .sidebar-avatar {
        width: 44px;
        height: 44px;
    }
}

.sidebar-top p {
    color: var(--muted);
    margin-bottom: 18px;
}

@media (max-width: 1100px) {
    .sidebar-top p {
        display: none;
        margin-bottom: 0;
    }
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: auto;
}

@media (max-width: 1100px) {
    .social-links {
        margin-top: 20px;
        margin-bottom: 0;
        width: 100%;
        justify-content: flex-start;
    }
}

.social-links a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--text);
    border: 1px solid var(--border-soft);
    transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.social-links a:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-color: rgba(255,255,255,0.55);
    transform: translateY(-2px);
    box-shadow: 0 0 14px rgba(255,255,255,0.18);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 0;
}

@media (max-width: 1100px) {
    .sidebar-nav {
        width: 100%;
        margin-top: 20px;
        display: none;
    }

    .sidebar.menu-open .sidebar-nav {
        display: flex;
    }

    .social-links {
        display: none;
    }

    .sidebar.menu-open .social-links {
        display: flex;
    }
}

.sidebar-nav a {
    width: 100%;
    padding: 12px 16px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(24,24,25,0.96), rgba(9,9,10,0.96));
    color: #e7e7e7;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.sidebar-nav a:hover {
    background: linear-gradient(180deg, rgba(42,42,44,0.96), rgba(14,14,15,0.96));
    color: #fff;
    border-color: rgba(255,255,255,0.6);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(255,255,255,0.2), 0 8px 22px rgba(0,0,0,0.35);
}

.sidebar-nav a.active {
    background: linear-gradient(180deg, rgba(54,54,56,0.96), rgba(18,18,19,0.96));
    color: #fff;
    border-color: rgba(255,255,255,0.75);
    box-shadow: 0 0 24px rgba(255,255,255,0.26), 0 8px 20px rgba(0,0,0,0.4);
}

.menu-toggle {
    display: none;
    position: fixed;
    top: 15px; /* Adjusted position */
    right: 20px;
    width: 44px; /* Larger touch target */
    height: 44px; /* Larger touch target */
    background: rgba(255,255,255,0.08); /* More visible */
    border: 2px solid var(--border-soft); /* Thicker border */
    border-radius: 10px; /* More rounded */
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    z-index: 11;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2); /* Added shadow */
}

.menu-toggle:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
    transform: scale(1.05); /* Subtle scale effect */
}

.menu-toggle:active {
    transform: scale(0.95); /* Press effect */
}

.menu-toggle span {
    width: 20px; /* Slightly wider */
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

@media (max-width: 1100px) {
    .menu-toggle {
        display: flex;
    }
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

.main-content {
    padding: 40px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

@media (max-width: 1100px) {
    .main-content {
        padding: 30px 20px; /* Better padding for tablets */
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px 16px; /* Comfortable padding for mobile */
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 16px 12px; /* Minimal padding for small screens */
    }
}

.content-section {
    width: 100%;
    max-width: 960px;
    /* Removed background, backdrop-filter, border, and box-shadow to make particles visible */
    border-radius: 24px;
    padding: 40px;
    margin-bottom: 32px;
    text-align: center;
    display: none;
    position: relative;
    overflow: hidden;
}

@media (max-width: 1100px) {
    .content-section {
        padding: 32px 24px; /* Better for tablets */
        border-radius: 20px;
        margin-bottom: 28px;
    }
}

@media (max-width: 768px) {
    .content-section {
        padding: 24px 18px; /* Comfortable for mobile */
        border-radius: 16px;
        margin-bottom: 24px;
    }
}

@media (max-width: 480px) {
    .content-section {
        padding: 20px 16px; /* Minimal for small screens */
        border-radius: 12px;
        margin-bottom: 20px;
    }
}

.content-section::before {
    /* Removed background overlay to keep particles visible */
}

.content-section::after {
    /* Removed box-shadow to keep particles visible */
}

#personal-branding {
    display: block;
}

.section-inner {
    max-width: 960px;
    margin: 0 auto;
}

.content-section h2 {
    font-size: 2.4rem;
    margin-bottom: 16px;
}

@media (max-width: 1100px) {
    .content-section h2 {
        font-size: 2.1rem;
        margin-bottom: 14px;
    }
}

@media (max-width: 768px) {
    .content-section h2 {
        font-size: 1.8rem;
        margin-bottom: 12px;
    }
}

@media (max-width: 480px) {
    .content-section h2 {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
}

.section-description {
    color: var(--muted);
    max-width: 720px;
    margin: 0 auto 32px auto;
    line-height: 1.6;
}

@media (max-width: 1100px) {
    .section-description {
        font-size: 1rem;
        margin-bottom: 28px;
    }
}

@media (max-width: 768px) {
    .section-description {
        font-size: 0.95rem;
        margin-bottom: 24px;
        line-height: 1.5;
    }
}

@media (max-width: 480px) {
    .section-description {
        font-size: 0.9rem;
        margin-bottom: 20px;
        line-height: 1.5;
    }
}

.branding-contacts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.contact-tile {
    border-radius: 16px;
    padding: 14px 12px;
    border: 1px solid var(--border-soft);
    background: linear-gradient(165deg, #161618 0%, #0d0d0f 100%);
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: center;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.contact-tile:hover {
    border-color: rgba(255,255,255,0.58);
    box-shadow: 0 0 16px rgba(255,255,255,0.16);
    transform: translateY(-2px);
}

.contact-tile h3 {
    font-size: 1.05rem;
}

.contact-tile p {
    color: var(--muted);
    font-size: 0.95rem;
}

.social-cluster {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}

.hex-link {
    min-height: 88px;
    padding: 12px 10px;
    clip-path: none;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.45);
    background: linear-gradient(160deg, #1a1a1d 0%, #0c0c0e 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-align: center;
    box-shadow: 0 0 14px rgba(255,255,255,0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.hex-link:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.78);
    box-shadow: 0 0 20px rgba(255,255,255,0.22);
}

.hex-link h3 {
    font-size: 1.05rem;
}

.hex-link p {
    color: #d0d0d0;
    font-size: 0.92rem;
}

.icon-link {
    min-height: 88px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.42);
    background: linear-gradient(160deg, #202023 0%, #0d0d0f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    box-shadow: 0 0 16px rgba(255,255,255,0.17);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.icon-link:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.8);
    box-shadow: 0 0 22px rgba(255,255,255,0.24);
}

.branding-footer {
    margin-top: 20px;
    font-size: 0.85rem;
    color: #9b9b9b;
    letter-spacing: 0.3px;
}

.contact-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.contact-panel strong {
    display: block;
    margin-bottom: 8px;
    color: #fff;
}

.contact-panel p {
    color: #ccc;
    margin: 0;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 1100px) {
    .skills-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
}

@media (max-width: 768px) {
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .skills-grid {
        gap: 10px;
    }
}

.skill-category {
    padding: 18px;
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    background: linear-gradient(165deg, rgba(23,23,25,0.6) 0%, rgba(11,11,13,0.6) 100%);
    backdrop-filter: blur(6px);
    text-align: center;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

@media (max-width: 1100px) {
    .skill-category {
        padding: 16px;
        border-radius: 16px;
    }
}

@media (max-width: 768px) {
    .skill-category {
        padding: 14px;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .skill-category {
        padding: 12px;
        border-radius: 10px;
    }
}

.skill-category:hover {
    transform: translateY(-3px);
    border-color: var(--border);
    box-shadow: 0 10px 24px rgba(0,0,0,0.4), 0 0 20px rgba(255,255,255,0.18), 0 0 0 1px var(--glow) inset;
}

.skill-category h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .skill-category h3 {
        font-size: 1rem;
        margin-bottom: 6px;
    }
}

@media (max-width: 480px) {
    .skill-category h3 {
        font-size: 0.9rem;
    }
}

.skill-category p {
    color: var(--muted);
    line-height: 1.5;
}

.projects {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    place-items: center;
    max-width: 760px;
    margin: 0 auto;
}

@media (max-width: 1100px) {
    .achievements-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
}

@media (max-width: 768px) {
    .achievements-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        max-width: 720px;
    }
}

@media (max-width: 480px) {
    .achievements-grid {
        gap: 10px;
        max-width: 100%;
    }
}

.project-card,
.achievement-card {
    padding: 18px;
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    background: linear-gradient(165deg, rgba(23,23,25,0.6) 0%, rgba(11,11,13,0.6) 100%);
    backdrop-filter: blur(6px);
    text-align: center;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

@media (max-width: 1100px) {
    .project-card,
    .achievement-card {
        padding: 16px;
        border-radius: 16px;
    }
}

@media (max-width: 768px) {
    .project-card,
    .achievement-card {
        padding: 14px;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .project-card,
    .achievement-card {
        padding: 12px;
        border-radius: 10px;
    }
}

.project-card:hover,
.achievement-card:hover {
    transform: translateY(-3px);
    border-color: var(--border);
    box-shadow: 0 10px 24px rgba(0,0,0,0.4), 0 0 20px rgba(255,255,255,0.18), 0 0 0 1px var(--glow) inset;
}

.project-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.achievement-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.project-card h3,
.achievement-card h3 {
    margin-bottom: 4px;
}

.project-card p,
.achievement-card p {
    color: var(--muted);
    margin: 0;
    line-height: 1.5;
}

.project-card p:nth-of-type(1),
.project-card p:nth-of-type(2) {
    line-height: 1.4;
}

.project-card p:nth-of-type(3) {
    margin-top: 6px;
    max-width: 62ch;
}

.project-card p:nth-of-type(4) {
    margin-top: 8px;
}

.project-logo {
    width: 92px;
    height: 92px;
    object-fit: contain;
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .project-logo {
        width: 80px;
        height: 80px;
        margin-bottom: 6px;
    }
}

@media (max-width: 480px) {
    .project-logo {
        width: 64px;
        height: 64px;
        margin-bottom: 4px;
    }
}

.card-link {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.card-link:hover h3 {
    color: #ffffff;
    text-shadow: 0 0 12px rgba(255,255,255,0.18);
}

.card-link:hover p {
    color: #e8e8e8;
}

/* Tablet view (768px - 1100px) */
@media (max-width: 1100px) and (min-width: 768px) {
    .section-description {
        font-size: 0.95rem;
    }

    .skill-category p,
    .project-card p,
    .achievement-card p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .branding-contacts {
        grid-template-columns: 1fr;
    }

    .social-cluster {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile view (480px - 768px) */
@media (max-width: 768px) {
    .section-description {
        font-size: 0.9rem;
    }

    .projects {
        grid-template-columns: 1fr;
    }

    .contact-panel {
        grid-template-columns: 1fr;
    }

    .social-cluster {
        grid-template-columns: 1fr 1fr;
    }

    .hex-link {
        min-height: 80px;
        font-size: 0.9rem;
    }

    .hex-link h3 {
        font-size: 0.95rem;
    }

    .skill-category p,
    .project-card p,
    .achievement-card p {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .branding-contacts {
        grid-template-columns: 1fr;
    }
}

/* Small mobile view (< 480px) */
@media (max-width: 480px) {
    .section-description {
        font-size: 0.85rem;
    }

    .projects {
        grid-template-columns: 1fr;
    }

    .contact-panel {
        grid-template-columns: 1fr;
    }

    .social-cluster {
        grid-template-columns: 1fr;
    }

    .hex-link {
        min-height: 72px;
        padding: 10px 8px;
    }

    .hex-link h3 {
        font-size: 0.9rem;
    }

    .hex-link p {
        font-size: 0.8rem;
    }

    .skill-category p,
    .project-card p,
    .achievement-card p {
        font-size: 0.8rem;
        line-height: 1.5;
    }

    .icon-link {
        min-height: 72px;
        font-size: 1.8rem;
    }

    .branding-contacts {
        grid-template-columns: 1fr;
    }
}
