:root {
    --bg-dark: #090d16;
    --bg-lit: #111827;
    --card-dark: #0f172a;
    --card-lit: #1e293b;
    --accent-blue: #3b82f6;
    --lamp-glow: rgba(251, 191, 36, 0.15);
    --text-main: #f8fafc;
    --text-muted: #64748b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.6s ease, border-color 0.6s ease, box-shadow 0.6s ease;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Warm radial lighting overlay when lamp is ON */
body.lights-on {
    background-color: var(--bg-lit);
    background-image: radial-gradient(circle at 50% 120px, rgba(251, 191, 36, 0.18) 0%, transparent 60%);
}

/* --- HEADER NAVIGATION --- */
header {
    width: 100%;
    padding: 1.2rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1e293b;
    z-index: 10;
}

.back-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.back-link:hover {
    text-decoration: underline;
}

/* --- INTERACTIVE HANGING LAMP --- */
.lamp-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%; /* Ensures full viewport centering */
    cursor: pointer;
    margin: 0 auto;
    position: relative;
    z-index: 20;
    padding-bottom: 1.5rem;
}

.wire {
    width: 3px;
    height: 70px;
    background-color: #475569;
    margin: 0 auto;
}

.shade {
    width: 64px;
    height: 26px;
    background: #334155;
    border-radius: 32px 32px 0 0;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.bulb {
    width: 22px;
    height: 22px;
    background-color: #475569;
    border-radius: 50%;
    margin: -8px auto 0 auto; /* Pulls bulb cleanly into shade center */
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

/* Bulb glowing animation when ON */
body.lights-on .bulb {
    background-color: #fbfb24;
    box-shadow: 0 0 25px #facc15, 0 0 60px #f59e0b;
}

.pull-string {
    width: 2px;
    height: 35px;
    background-color: #64748b;
    margin: 0 auto;
}

.pull-handle {
    width: 10px;
    height: 14px;
    background-color: #cbd5e1;
    border-radius: 4px;
    margin: 0 auto;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.lamp-container:hover .pull-handle {
    transform: translateY(4px);
    background-color: #f59e0b;
}
/* --- POPUP / TIP NOTE --- */
.tip-note {
    background: rgba(30, 41, 59, 0.9);
    border: 1px dashed #f59e0b;
    color: #fef08a;
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    font-size: 0.85rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

body.lights-on .tip-note {
    opacity: 0;
    pointer-events: none;
}

/* --- HERO TITLE --- */
.hero-title {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-title h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.4;
    transition: opacity 0.6s ease;
}

body.lights-on .hero-title h1 {
    opacity: 1;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.hero-title p {
    color: var(--text-muted);
}

/* --- PROJECTS GRID --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    width: 85%;
    max-width: 1100px;
    margin-bottom: 4rem;
}

.project-card {
    background-color: var(--card-dark);
    border: 1px solid #1e293b;
    border-radius: 16px;
    padding: 2rem;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    opacity: 0.5;
    transform: scale(0.98);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.lights-on .project-card {
    background-color: var(--card-lit);
    opacity: 1;
    transform: scale(1);
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent-blue);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

body.lights-on .project-card:hover {
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.2);
}

.project-num {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0.5rem 0;
    color: #fff;
}

.project-desc {
    font-size: 0.9rem;
    color: #94a3b8;
    line-height: 1.5;
    flex-grow: 1;
    margin-top: 0.5rem;
}

.project-link-icon {
    align-self: flex-end;
    background: #0f172a;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
    font-weight: bold;
    border: 1px solid #334155;
}

.project-card:hover .project-link-icon {
    background: var(--accent-blue);
    color: #fff;
}

/* --- MOBILE RESPONSIVE TUNING --- */
@media (max-width: 600px) {
    .hero-title h1 {
        font-size: 1.8rem;
    }
    
    .projects-grid {
        width: 90%;
        grid-template-columns: 1fr;
    }
    
    .project-card {
        aspect-ratio: auto;
        min-height: 250px;
    }
}

/* --- MOBILE RESPONSIVE TUNING (Phones under 480px) --- */
@media (max-width: 480px) {
    header {
        flex-direction: column;
        gap: 0.6rem;
        text-align: center;
        padding: 1rem 5%;
    }

    /* Keep the lamp wire slightly shorter on phones so content stays visible above the fold */
    .wire {
        height: 50px;
    }

    /* Scale and wrap tip note cleanly */
    .tip-note {
        font-size: 0.78rem;
        padding: 0.5rem 1rem;
        width: 90%;
        max-width: 320px;
        text-align: center;
        line-height: 1.4;
        justify-content: center;
    }

    .hero-title h1 {
        font-size: 1.8rem;
    }

    .hero-title p {
        font-size: 0.85rem;
        padding: 0 1rem;
    }

    /* Project cards stack cleanly with balanced padding */
    .projects-grid {
        width: 90%;
        gap: 1.2rem;
    }

    .project-card {
        padding: 1.5rem;
        aspect-ratio: auto; /* Removes rigid square constraint on small screens so text fits naturally */
    }
}
