/* ===============================================
   Aurel - Music Tech Engineer CV
   Modern, responsive portfolio with p5.js animation
   =============================================== */

/* ===============================================
   FONTS
   =============================================== */
@font-face {
    font-family: 'ZecchinettaDisplay';
    src: url('../assets/fonts/ZecchinettaDisplay.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* ===============================================
   RESET & ROOT VARIABLES
   =============================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --sc-r: 200;
    --sc-g: 200;
    --sc-b: 210;
}

/* ===============================================
   BASE STYLES
   =============================================== */
body {
    background: #0a0a0f;
    font-family: 'Outfit', sans-serif;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "header"
        "main"
        "footer";
    overflow: hidden;
}

/* ===============================================
   LAYOUT GRID
   =============================================== */
#header {
    grid-area: header;
    z-index: 100;
    padding: 20px;
    text-align: center;
    background: rgba(10, 10, 15, 0.95);
}

#main-body {
    grid-area: main;
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

#footer {
    grid-area: footer;
    z-index: 100;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
}

/* ===============================================
   CANVAS CONTAINER
   =============================================== */
#canvas-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#canvas-container canvas {
    display: block;
}

/* ===============================================
   CONTENT PANEL
   =============================================== */
#content-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 10, 15, 0.96);
    border: 1px solid rgba(var(--sc-r), var(--sc-g), var(--sc-b), 0.3);
    border-radius: 8px;
    padding: 40px;
    max-width: 700px;
    max-height: calc(100vh - 160px); /* Account for header + footer + margins */
    overflow-y: auto;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    box-shadow:
        0 0 60px rgba(var(--sc-r), var(--sc-g), var(--sc-b), 0.1),
        inset 0 0 60px rgba(var(--sc-r), var(--sc-g), var(--sc-b), 0.02);
}

#content-panel.visible {
    opacity: 1;
    pointer-events: auto;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

/* Panel Typography */
#content-panel h2 {
    font-family: 'ZecchinettaDisplay', 'Space Mono', monospace;
    color: rgb(var(--sc-r), var(--sc-g), var(--sc-b));
    font-size: 1.4rem;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

#content-panel .content {
    font-family: 'Space Mono', monospace;
    color: #e0e0e0;
    font-size: 0.9rem;
    line-height: 1.8;
}

#content-panel .content p {
    margin-bottom: 16px;
}

#content-panel .content strong {
    color: rgb(var(--sc-r), var(--sc-g), var(--sc-b));
    font-weight: 600;
}

/* Panel Items */
#content-panel .content .item {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(var(--sc-r), var(--sc-g), var(--sc-b), 0.15);
}

#content-panel .content .item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

#content-panel .content .item-title {
    font-family: 'ZecchinettaDisplay', 'Space Mono', monospace;
    color: rgb(var(--sc-r), var(--sc-g), var(--sc-b));
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 4px;
}

#content-panel .content .item-meta {
    color: rgba(var(--sc-r), var(--sc-g), var(--sc-b), 0.7);
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

/* Panel Lists */
#content-panel .content ul {
    list-style: none;
    padding-left: 0;
}

#content-panel .content ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 6px;
}

#content-panel .content ul li::before {
    content: '\2192';
    position: absolute;
    left: 0;
    color: rgba(var(--sc-r), var(--sc-g), var(--sc-b), 0.6);
}

/* Close Button */
#content-panel .close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid rgba(var(--sc-r), var(--sc-g), var(--sc-b), 0.4);
    border-radius: 50%;
    color: rgb(var(--sc-r), var(--sc-g), var(--sc-b));
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#content-panel .close-btn:hover {
    background: rgba(var(--sc-r), var(--sc-g), var(--sc-b), 0.15);
}

/* Custom Scrollbar */
#content-panel::-webkit-scrollbar {
    width: 6px;
}

#content-panel::-webkit-scrollbar-track {
    background: rgba(var(--sc-r), var(--sc-g), var(--sc-b), 0.05);
}

#content-panel::-webkit-scrollbar-thumb {
    background: rgba(var(--sc-r), var(--sc-g), var(--sc-b), 0.3);
    border-radius: 3px;
}

/* ===============================================
   HEADER
   =============================================== */

#header h1 {
    font-family: 'ZecchinettaDisplay', 'Space Mono', monospace;
    color: #e0e0e0;
    font-size: 1.6rem;
    letter-spacing: 6px;
    text-transform: uppercase;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

#header p {
    font-family: 'ZecchinettaDisplay', 'Space Mono', monospace;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin-top: 8px;
    letter-spacing: 2px;
}

/* ===============================================
   FOOTER & INSTRUCTIONS
   =============================================== */
#instructions {
    color: rgba(255, 255, 255, 0.4);
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-align: center;
    padding: 12px 20px 8px;
}

#footer-info {
    color: rgba(255, 255, 255, 0.25);
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    text-align: center;
    padding: 8px 20px 12px;
}

#footer-info a {
    color: rgba(78, 205, 196, 0.6);
    text-decoration: none;
    transition: color 0.2s;
}

#footer-info a:hover {
    color: rgba(78, 205, 196, 1);
}

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */

/* Tablet and below */
@media (max-width: 768px) {
    #header {
        top: 16px;
    }

    #header h1 {
        font-size: 1.1rem;
        letter-spacing: 3px;
    }

    #header p {
        font-size: 0.7rem;
        letter-spacing: 1px;
    }

    #content-panel {
        padding: 24px 20px;
        max-width: calc(100vw - 32px);
        /* Removed max-height: 70vh - conflicts with mobile query */
        border-radius: 6px;
    }

    #content-panel h2 {
        font-size: 1.1rem;
        letter-spacing: 2px;
        margin-bottom: 16px;
    }

    #content-panel .content {
        font-size: 0.78rem;
        line-height: 1.7;
    }

    #content-panel .content .item-title {
        font-size: 0.9rem;
    }

    #content-panel .content .item-meta {
        font-size: 0.72rem;
    }

    #content-panel .content .item {
        margin-bottom: 20px;
        padding-bottom: 14px;
    }

    #instructions {
        font-size: 0.6rem;
        padding: 10px 16px 6px;
    }

    #footer-info {
        font-size: 0.6rem;
        padding: 6px 16px 10px;
    }
}

/* Mobile and Small Screens - Immersive Panel Experience */
@media (max-width: 600px) {
    #header h1 {
        font-size: 0.9rem;
        letter-spacing: 2px;
    }

    #header p {
        font-size: 0.6rem;
    }

    /* Panel optimized for mobile - no footer overlap */
    #content-panel {
        padding: 20px 16px;
        max-height: calc(100vh - 180px);  /* Account for header + footer + margins */
        max-width: calc(100vw - 32px);  /* Full width with minimal margins */
        width: calc(100vw - 32px);  /* Enforce consistent width */
    }

    #content-panel h2 {
        font-size: 1.05rem;
        margin-bottom: 20px;
    }

    #content-panel .content {
        font-size: 0.8rem;
        line-height: 1.75;
    }

    /* Footer with centered content */
    #footer {
        min-height: 144px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    #instructions {
        font-size: 0.6rem;
        padding: 12px 16px 8px;
        line-height: 1.5;
        text-align: center;
    }

    #footer-info {
        font-size: 0.6rem;
        padding: 8px 16px 12px;
        line-height: 1.5;
        text-align: center;
    }
}
