/* =========================================
   CSS Reset & Base Styles
========================================= */
:root {
    --bg-color: #050505;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-color: #bf00ff;
    --accent-glow: rgba(191, 0, 255, 0.4);
    --glass-bg: rgba(20, 20, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --font-heading: 'Expletus Sans', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Background Grid Effect */
.bg-grid {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    pointer-events: none;
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

h1, h2, h3, .nav-item, .btn {
    font-family: var(--font-heading);
    font-weight: 600;
}

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

/* =========================================
   Navigation
========================================= */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    /* Hong-Kong style neon glow following transparent contours */
    filter: 
        drop-shadow(0 0 2px #ffffff)
        drop-shadow(0 0 6px #bf00ff)
        drop-shadow(0 0 15px #bf00ff)
        drop-shadow(0 0 25px rgba(191, 0, 255, 0.7));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.logo:hover img {
    transform: scale(1.08);
    filter: 
        drop-shadow(0 0 3px #ffffff)
        drop-shadow(0 0 8px #d033ff)
        drop-shadow(0 0 22px #bf00ff)
        drop-shadow(0 0 35px rgba(191, 0, 255, 0.95));
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-item {
    font-size: 1.1rem;
    letter-spacing: 1px;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.nav-item:hover {
    color: var(--accent-color);
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 0%; height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
    box-shadow: 0 0 8px var(--accent-color);
}

.nav-item:hover::after {
    width: 100%;
}

/* =========================================
   Buttons & UI Elements
========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 2rem;
    border-radius: 99px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn i {
    font-size: 1.4rem;
}

.btn-icon {
    width: 60px;
    height: 60px;
    padding: 0;
    border-radius: 50%;
    background: rgba(221, 0, 255, 0.05);
    border: 1px solid var(--accent-color);
    box-shadow: inset 0 0 10px rgba(255,255,255,0.1), 0 0 15px var(--accent-glow);
    color: var(--text-primary);
}

.btn-icon:hover {
    background: var(--accent-color);
    box-shadow: inset 0 0 10px rgba(255,255,255,0.3), 0 0 25px var(--accent-color);
    transform: translateY(-3px);
}

.btn-text {
    background: transparent;
    color: var(--text-primary);
    font-size: 1.5rem;
}
.btn-text:hover {
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-glow);
}

.btn-glass {
    background: rgba(191, 0, 255, 0.05);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        inset 1px 1px 2px rgba(255,255,255,0.2), 
        inset -1px -2px 2px rgba(255,255,255,0.05),
        0 4px 15px rgba(0,0,0,0.5);
    color: var(--text-primary);
}

.btn-glass:hover {
    background: rgba(191, 0, 255, 0.15);
    border-color: var(--accent-color);
    box-shadow: 
        inset 1px 1px 2px rgba(255,255,255,0.3), 
        0 0 20px var(--accent-glow);
    transform: translateY(-2px);
}

.btn-glass.lg {
    padding: 1rem 3rem;
    font-size: 1.5rem;
}

.btn-pill {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 99px;
    padding: 0.6rem 2.5rem;
    color: var(--text-primary);
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    height: 56px;
    box-shadow: inset 0 0 10px rgba(255,255,255,0.1), 0 4px 15px rgba(0,0,0,0.5);
}
.btn-pill:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(255,255,255,0.2), 0 4px 15px rgba(0,0,0,0.5);
    transform: translateY(-2px);
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* =========================================
   Hero Section
========================================= */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: 180px;
    padding-bottom: 120px;
}

.split-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    z-index: -1;
    overflow: hidden;
}

.split-bg::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('./images/dither_pattern.png');
    background-repeat: repeat;
    background-size: 150px;
    filter: invert(1) contrast(1.2); /* Inverts the white background to black for a dark mode look */
    opacity: 0.5;
}

.pane-left, .pane-center, .pane-right {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
}

.pane-left img, .pane-center img, .pane-right img {
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

.pane-left {
    clip-path: polygon(0 0, 30% 0, 15% 100%, 0 100%);
}

.pane-center {
    clip-path: polygon(31% 0, 75% 0, 60% 100%, 16% 100%);
}

.pane-right {
    clip-path: polygon(76% 0, 100% 0, 100% 100%, 61% 100%);
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(30, 10, 60, 0.6) 0%, rgba(5, 5, 5, 0.95) 100%);
    pointer-events: none;
}

.hero-content {
    text-align: center;
    max-width: 900px;
    padding: 0 2rem;
    z-index: 1;
    animation: slideUpFade 1s ease forwards;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    letter-spacing: 2px;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 0%, #d4d4d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 30px rgba(255,255,255,0.1);
}

.hero-subtitle {
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: var(--text-primary);
    margin-bottom: 3rem;
    font-weight: 500;
    text-shadow: 0 4px 15px rgba(0,0,0,0.8);
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

/* =========================================
   Sections & Layout
========================================= */
.section {
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    letter-spacing: 2px;
    position: relative;
}

.section-title::before {
    content: '';
    position: absolute;
    top: -10px; left: -10px;
    width: 40px; height: 40px;
    background: var(--accent-glow);
    border-radius: 50%;
    filter: blur(20px);
    z-index: -1;
}

.section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* =========================================
   Projects
========================================= */
.projects-container {
    display: flex;
    flex-direction: column;
    gap: 5rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    padding: 2.5rem;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.7), 0 0 20px rgba(191, 0, 255, 0.1);
}

@media (min-width: 900px) {
    .project-card {
        flex-direction: row;
        align-items: center;
        padding: 3rem;
    }
    .project-card.reverse {
        flex-direction: row-reverse;
    }
    .project-image-wrapper {
        flex: 1;
        max-width: 50%;
    }
    .project-info {
        flex: 1;
        padding: 0 2rem;
    }
}

.project-image-wrapper {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
}

.project-image {
    width: 100%;
    height: auto;
    border-radius: 16px;
    display: block;
    transition: transform 0.5s ease;
}

.project-card:hover .project-image {
    transform: scale(1.03);
}

.image-glow {
    position: absolute;
    top: 50%; left: 50%;
    width: 80%; height: 80%;
    transform: translate(-50%, -50%);
    background: var(--accent-color);
    filter: blur(60px);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.5s ease;
}

.project-card:hover .image-glow {
    opacity: 0.3;
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.project-title {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.project-details {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.project-details strong {
    color: var(--text-primary);
    font-weight: 500;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.project-links .btn {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

/* =========================================
   About Me
========================================= */
.about-container {
    padding: 4rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    position: relative;
}

@media (min-width: 900px) {
    .about-container {
        flex-direction: row;
        align-items: flex-start;
    }
    .about-header {
        flex: 0 0 300px;
        position: sticky;
        top: 100px;
    }
}

.about-header {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-avatar-wrapper {
    position: relative;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, var(--accent-color), transparent);
}

.about-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg-color);
}

.about-title {
    font-size: 3rem;
}

.about-text {
    flex: 1;
    font-size: 1.15rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-text p:first-child {
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* =========================================
   Contact & Footer
========================================= */
.contact-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.footer {
    background: #020202;
    padding: 3rem 2rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: var(--text-secondary);
}

.footer-email {
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.footer-email:hover {
    color: var(--accent-color);
}

/* =========================================
   Animations
========================================= */
@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    /* Tablet Adjustments */
    .hero-title {
        font-size: clamp(3rem, 5vw, 4rem);
    }
    .nav-links {
        gap: 1.5rem;
    }
    .project-title {
        font-size: 2.5rem;
    }
    .about-header {
        position: static;
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    /* Phone Adjustments */
    .navbar {
        padding: 0.5rem 0;
    }
    .nav-container {
        flex-direction: column;
        gap: 0.8rem;
        padding: 0.5rem 1rem;
        justify-content: center;
    }
    .logo img {
        width: 45px;
        height: 45px;
    }
    .nav-links {
        display: flex;
        gap: 1.2rem;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    .nav-item {
        font-size: 0.9rem;
    }

    /* Hero Content */
    .hero {
        padding-top: 140px;
        padding-bottom: 80px;
    }
    .hero-title {
        font-size: clamp(2.2rem, 8vw, 3rem);
    }
    .hero-subtitle {
        font-size: 1.2rem;
        margin-bottom: 2rem;
    }
    .hero-actions {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
        width: 100%;
    }
    .btn-pill {
        width: 100%;
        max-width: 300px;
    }

    /* Sections */
    .section {
        padding: 4rem 1.5rem;
    }
    .section-header {
        margin-bottom: 2rem;
        justify-content: center;
    }
    .section-title {
        font-size: 2rem;
    }
    
    /* Projects & Cards */
    .project-card, .about-container {
        padding: 1.5rem;
    }
    .project-title {
        font-size: 2rem;
        text-align: center;
    }
    .project-links {
        justify-content: center;
        width: 100%;
    }
    .project-card .btn-glass {
        width: 100%;
        text-align: center;
    }
    .project-details {
        text-align: center;
    }

    /* About Me */
    .about-header {
        align-items: center;
        text-align: center;
    }
    .about-avatar-wrapper {
        width: 180px;
        height: 180px;
    }
    .about-title {
        font-size: 2.2rem;
    }
    .about-text p {
        text-align: center;
    }

    /* Contact Links */
    .contact-links .btn-glass.lg {
        width: 100%;
        font-size: 1.2rem;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    /* Very Small Phones */
    .nav-links {
        gap: 0.8rem;
    }
    .nav-item {
        font-size: 0.8rem;
    }
    .hero-title {
        font-size: clamp(1.8rem, 10vw, 2.5rem);
    }
    .project-title {
        font-size: 1.8rem;
    }
    .about-avatar-wrapper {
        width: 140px;
        height: 140px;
    }
}
