/* --- 1. BASE & TYPOGRAPHY (Modern Dark Theme) --- */
:root {
    --color-primary: #e0e0e0;
    --color-background: #0a0a0a;
    --color-accent: #ff3333;
    --color-secondary-bg: #1a1a1a;
    --color-border: #333333;
    --font-primary: 'Inter', sans-serif;
    /* 🏎️ Added Porsche-style font variable */
    --font-porsche: '911 Porscha', sans-serif;
    --font-porsche-bold: '911 Porscha Bold', sans-serif;
}

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

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

/* Base Headings */
h1,
h2,
h3 {
    font-weight: 700;
    text-transform: uppercase;
}

h2 {
    /* 🏎️ Applied Porsche-style font to H2 */
    font-family: var(--font-porsche);
    color: var(--color-accent);
    border-bottom: 2px solid var(--color-accent);
    display: inline-block;
    padding-bottom: 0.5rem;
    margin-top: 4rem;
    margin-bottom: 2rem;
    font-size: 2rem;
    letter-spacing: 0.1em;
}

section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
    border-bottom: 1px solid var(--color-border);
    position: relative;
}

/* --- 2. HEADER & PARALLAX EFFECT (DESKTOP) --- */

.hero-parallax-section {
    position: relative;
    background-image: url('https://cdn.elferspot.com/wp-content/uploads/2021/04/CSW7547-2000x1333-1.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    /* Parallax enabled for DESKTOP */
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: inset 0 0 0 2000px rgba(0, 0, 0, 0.6);
}

.hero-content {
    color: #fff;
    z-index: 10;
    padding: 2rem;
}

.project-title {
    /* 🏎️ Applied Porsche-style font to Project Title */
    font-family: var(--font-porsche-bold);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 900;
    letter-spacing: 0.25em;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.project-tagline {
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 300;
    margin-bottom: 2.5rem;
}

/* CTA Button - Modernized Red */
.cta-button {
    display: inline-block;
    padding: 0.75rem 2.5rem;
    background-color: var(--color-accent);
    color: var(--color-secondary-bg);
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0.1em;
    border: 2px solid var(--color-accent);
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
    border-radius: 4px;
}

.cta-button:hover {
    background-color: transparent;
    color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 51, 51, 0.4);
}

/* --- 3. IMAGES & MEDIA --- */
.image-grid {
    display: grid;
    /* Ensures 2 columns on desktop, scaling down */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.image-grid p {
    grid-column: 1 / -1;
    text-align: center;
    font-style: italic;
    color: #aaa;
}

.image-grid img {
    width: 100%;
    max-width: none;
    border: 3px solid var(--color-accent);
    border-radius: 8px;
    height: auto;
    object-fit: cover;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.3);
}

.image-grid img:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255, 51, 51, 0.6);
}

/* Video Demonstration Container */
#video-ratio-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

#video-link-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid var(--color-accent);
    background-color: var(--color-secondary-bg);
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.3s;
}

#video-link-container:hover {
    box-shadow: 0 0 25px rgba(255, 51, 51, 0.7);
}

#video-link-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* --- 4. 3D VIEWER & CONTROLS --- */
#stl-viewer-section {
    background-color: var(--color-secondary-bg);
    box-shadow: 0 0 25px rgba(255, 51, 51, 0.7);
    border-radius: 12px;
}

#stl-viewer-container {
    width: 100%;
    max-width: 900px;
    height: 500px;
    border: 3px solid var(--color-accent);
    border-radius: 12px;
    margin: 2rem auto;
    background-color: #0a0a0a;
    box-shadow: 0 0 25px rgba(255, 51, 51, 0.7);
    overflow: hidden;
}

/* Model Controls - Updated for Flexibility */
#model-controls {
    text-align: left;
    margin: 1rem auto;
    padding: 15px;
    background-color: var(--color-secondary-bg);
    border-radius: 10px;
    border: 1px solid var(--color-border);

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px 25px;
    align-items: center;
    max-width: 900px;
}

#model-controls>div:last-child {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

#model-controls label {
    color: var(--color-accent);
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 5px;
}

/* Swatch Buttons */
.swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid var(--color-primary);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    transition: transform 0.15s ease, border-color 0.15s ease;
    background-color: currentColor;
}

.swatch:hover {
    transform: scale(1.15);
    border-color: var(--color-accent);
}

/* Range Slider Styling (Metallic Slider) */
input[type="range"] {
    width: 100%;
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--color-accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(255, 51, 51, 0.5);
}

.note {
    font-size: 0.75rem;
    color: #999;
    margin-top: 5px;
    font-style: italic;
}


/* --- 5. TEAM & RESULTS (Clean Grid) --- */

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.team-member {
    padding: 1.5rem;
    background-color: var(--color-secondary-bg);
    border: 1px solid var(--color-border);
    border-left: 5px solid var(--color-accent);
    border-radius: 4px;
    transition: box-shadow 0.3s;
}

.team-member:hover {
    box-shadow: 0 0 15px rgba(255, 51, 51, 0.4);
}

.team-member .role {
    display: block;
    font-weight: 700;
    font-size: 0.85rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.team-member .name {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--color-primary);
    display: block;
    margin-top: 0.2rem;
}


/* --- 6. FIXED ELEMENTS (Audio Player and Video GIF) - DESKTOP ONLY --- */

/* Fixed GIF/Video Link - Hidden by default on small screens */
#video-link-fixed {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 120px;
    height: 120px;
    z-index: 1000;
    border: 3px solid var(--color-accent);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(255, 51, 51, 0.7);
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
    display: none;
    /* HIDDEN BY DEFAULT on small screens */
}

#video-link-fixed:hover {
    transform: scale(1.02);
}

#gif-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Audio Player - Desktop Position - Hidden by default on small screens */
#media-player-container {
    /* DESKTOP STYLES: FIXED TO BOTTOM RIGHT */
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    background: rgba(17, 17, 17, 0.95);
    backdrop-filter: blur(5px);
    z-index: 100;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--color-accent);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.7);
    display: none;
    /* HIDDEN BY DEFAULT on small screens */
}

.player-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.player-info {
    display: flex;
    align-items: center;
    flex-grow: 1;
    min-width: 0;
}

.song-details {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.player-icon {
    width: 35px;
    height: 35px;
    background-color: var(--color-accent);
    color: var(--color-secondary-bg);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: background-color 0.2s, transform 0.2s;
}

.player-icon:hover {
    background-color: #ff5555;
    transform: scale(1.05);
}

.song-title a {
    color: inherit;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
}

.stream-status {
    font-size: 0.75rem;
    color: #999;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.volume-icon {
    color: var(--color-accent);
    font-size: 1.2rem;
}


/* --- 7. FOOTER (Default styling) --- */

footer {
    background: var(--color-secondary-bg);
    text-align: center;
    padding: 1.5rem;
    border-top: 2px solid var(--color-accent);
    font-size: 0.85rem;
    color: #999;
    /* Use default block flow for desktop */
    display: block;
}


/* ------------------------------------------------------------------- */
/* 💻 DESKTOP ONLY - SHOW FIXED ELEMENTS */
/* ------------------------------------------------------------------- */
@media (min-width: 769px) {

    /* Screens 769px and wider are considered desktop */
    #video-link-fixed,
    #media-player-container {
        display: block;
        /* Show the FIXED version only on desktop */
    }
}


/* ------------------------------------------------------------------- */
/* 📱 8. MOBILE RESPONSIVENESS (AGGRESSIVE FIXES) */
/* ------------------------------------------------------------------- */
@media (max-width: 768px) {

    /* === CRITICAL FIX: REPOSITION RADIO TO BOTTOM OF SCREEN === */
    #media-player-container {
        /* Re-assert fixed positioning relative to viewport */
        position: fixed !important;
        top: auto !important;
        /* Clear any fixed 'top' position it might inherit */
        bottom: 0;
        /* Pin to the bottom edge of the screen */
        left: 0;
        /* Pin to the left edge */
        right: 0;
        /* Pin to the right edge */
        margin: 0;
        /* Remove any centering margins */
        width: 100%;
        /* Full width */
        max-width: none;
        /* Remove max-width constraint */
        border-radius: 0;
        /* Sharp corners for a full-width bottom bar */
        z-index: 9999;
        /* Ensure it stays on top of all content */
        display: block !important;
        /* Make sure it's visible */
    }

    /* FIX: RE-SHOW & RE-POSITION GIF TO BOTTOM-LEFT CORNER */
    #video-link-fixed {
        position: fixed !important;
        /* Make it fixed to the viewport */
        bottom: 75px;
        /* Position it above the radio player bar */
        left: 10px;
        /* Pin it to the left side */
        right: auto;
        top: auto;
        width: 80px;
        /* Smaller size for mobile */
        height: 80px;
        z-index: 9998;
        /* Ensure it is visible, but below the radio player (9999) */
        display: block !important;
        /* Make sure it's visible */
    }

    /* Push the bottom of the body down so content doesn't get hidden behind the fixed player */
    body {
        padding-bottom: 70px;
        /* Still needed for player clearance */
    }

    /* === HERO SECTION FIXES (CRITICAL) === */
    .hero-parallax-section {
        /* FIX: DISABLING PARALLAX and enforcing non-fixed height */
        background-attachment: scroll !important;
        /* Forces the override */
        height: auto;
        padding-top: 80px;
        padding-bottom: 60px;
        justify-content: center;
    }

    /* 2. AGGRESSIVE FONT SIZING AND SPACING */
    .project-title {
        font-size: 1.8rem;
        letter-spacing: 0.05em;
        line-height: 1.1;
        margin-bottom: 0.5rem;
    }

    .project-tagline {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }

    .cta-button {
        padding: 0.75rem 2rem;
        font-size: 0.9rem;
    }

    /* === OTHER SECTIONS (Secondary fixes) === */
    h2 {
        font-size: 1.5rem;
        margin-top: 2rem;
    }

    #stl-viewer-container {
        height: 300px;
    }

    #model-controls {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 15px 10px;
    }
}
