:root {
    --bg-color: #1E1E1E;
    --text-color: #EBF0F4;
    --font-main: 'JetBrains Mono', monospace;
    --spacing-unit: 1rem;
    --transition-speed: 0.4s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    line-height: 1.6;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* No scrollbars on page */
    padding: 2rem;
}

/* Header/Logo */
header {
    display: flex;
    justify-content: center;
    padding-top: 4vh;
    /* Use vh for responsive vertical spacing */
    margin-bottom: 2vh;
    animation: fadeInDown 1s ease-out;
    flex-shrink: 0;
    /* Prevent header compression */
}

.logo {
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-align: center;
}

.logo-img {
    height: 8vh;
    /* Responsive height based on viewport */
    max-height: 80px;
    /* Cap it */
    min-height: 40px;
    filter: invert(1);
    display: block;
    cursor: pointer;

    width: auto;
    /* Maintain aspect ratio */
}

/* Main Layout */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center the whole Hero+Nav block vertically */
    width: 100%;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    padding-bottom: 0.5vh;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* When expanded, anchor content to top instead of center */
body.nav-expanded main {
    justify-content: flex-start;
    padding-top: 5vh;
    /* Safe buffer from logo */
}

/* Hero Section */
#hero {
    flex: 1 0 auto;
    /* Explicit start state */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: opacity 0.7s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.7s cubic-bezier(0.25, 1, 0.5, 1), flex 0.7s cubic-bezier(0.25, 1, 0.5, 1), height 0.7s cubic-bezier(0.25, 1, 0.5, 1), padding 0.7s cubic-bezier(0.25, 1, 0.5, 1);
    padding: 0 5%;
    position: relative;
    /* For star positioning */
}

.star {
    position: absolute;
    width: 3px;
    /* Much smaller, realistic star size */
    height: 3px;
    opacity: 0;
    /* Hidden initially */
    transition: opacity 0.1s ease, filter 0.1s ease;
    /* Faster transition for responsive trail */
    /* If the star SVG is black, we need to invert it too */
    filter: invert(1);
    pointer-events: none;
    /* Let mouse interaction be handled by container for trail */
    will-change: opacity, filter;
    z-index: 5;
}

/* Active/Shining state controlled by JS */
.star.active {
    opacity: 1;
    filter: invert(1) drop-shadow(0 0 8px rgba(255, 255, 255, 1));
}

/* State when navigation is active */
/* State when navigation is active */
body.nav-expanded #hero {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

body.nav-expanded #navigation {
    /* Move to top position */
    bottom: auto;
    top: 0;
    left: 8%;
    /* Match default #navigation left offset */
    transform: none;
    margin-left: 0;
    width: auto;
    /* Match default width: auto */
    max-width: 100%;
    padding-left: 0;
    /* Remove manual padding */
    text-align: left;
}

h1 {
    font-size: 4rem;
    font-weight: 700;
    font-style: italic;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.2;
}

/* Navigation System */
#navigation {
    position: relative;
    /* Part of document flow - prevents overlap */
    width: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    flex: 0 0 auto;
    /* Explicit start state */
    height: auto;
    margin-top: 5vh;
    /* Nominal gap from hero */
    margin-bottom: 2vh;
    left: 8%;
    /* Keep alignment */
    align-self: flex-start;
    /* Align within flex column */
    transition: all 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}

.nav-list {
    list-style: none;
    border-left: 1px solid rgba(235, 240, 244, 0.15);
    /* More subtle border */
    padding-left: 1.5rem;
    /* Slightly tighter */
    /* Structural Fix: List must be flex container for items to grow */
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: flex-end;
    /* Default bottom alignment */
}

.nav-item {
    margin-bottom: 0.5vh;
    /* Tighter spacing */
    position: relative;
    /* Context for absolute content */
    min-height: 2em;
    /* Fixed height to prevent jumping */
    transition: flex-grow 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 14pt;
    /* Smaller, more subtle */
    font-weight: 300;
    cursor: pointer;
    text-align: left;
    padding: 0;
    transition: font-size 0.5s ease, font-weight 0.5s ease, opacity 0.3s ease;
    opacity: 0.6;
    /* More subtle */
    display: flex;
    align-items: center;
}

.nav-btn:hover {
    opacity: 1;
}

.nav-number {
    margin-right: 0.8rem;
    /* Slightly tighter */
    opacity: 0.5;
    font-weight: 300;
    /* Same size as title text - removed font-size override */
}

/* Active State Styles controlled by body class */
body.nav-expanded .logo-img {
    height: 4vh;
    /* Shrink logo to half size (8vh -> 4vh) */
    transition: height 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}

body.nav-expanded #hero {
    /* Smooth collapse instead of display: none */
    flex: 0;
    height: 0;
    opacity: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
    /* Prevent content spill during collapse */
    pointer-events: none;
}

/* body.nav-expanded main ruleset removed (empty) */

body.nav-expanded #navigation {
    flex: 1 0 auto;
    /* Explicit expansion */
    height: auto;
    margin-top: 0;
    margin-bottom: 0.5vh;
    /* Match footer spacing */
    justify-content: flex-start;
    /* transform: translateZ(0); REMOVED to allow fixed children */
}

/* Active item grows to fill space, pushing title to top */
/* Active item grows to fill space, pushing title to top */
body.nav-expanded .nav-item.open {
    flex-grow: 1 !important;
    /* Force growth to take available space */
    margin-bottom: auto;
    /* Push subsequent items to bottom */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Push non-active items to the bottom */
body.nav-expanded .nav-item:not(.open) {
    flex-grow: 0;
}

/* Active button - double the size */
body.nav-expanded .nav-btn.active {
    font-size: 28pt;
    /* 2x of 14pt */
    font-weight: 400;
    opacity: 1;
    margin-bottom: 2rem;
    /* Space before content */
}

/* Keep other nav items subtle */
body.nav-expanded .nav-item:not(.open) .nav-btn {
    opacity: 0.4;
}

/* Highlight State (Active but not Open) */
body.nav-expanded .nav-btn.highlight {
    opacity: 1 !important;
    /* Override the 0.4 opacity above */
    font-weight: 300;
    /* Keep weight light */
    /* Font size remains at default 14pt (no change needed) */
}

/* State 1 Highlight (Hero view, no nav-expanded) */
/* Dim others when one is highlighted in Hero view */
body.highlight-active .nav-item .nav-btn {
    opacity: 0.4;
    transition: opacity 0.5s ease;
}

body.highlight-active .nav-item .nav-btn.highlight {
    opacity: 1;
    font-weight: 300;
}

/* Accordion Content */
/* Accordion Content */
.nav-content {
    /* Position below title - remove absolute positioning */
    position: relative;
    left: auto;
    top: auto;
    margin-left: 0;

    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.7s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.7s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 0;
    width: 100%;
    /* Span entire section */

    font-size: 1.1rem;
    max-width: 90%;
    /* Leave some right margin */
    text-align: left;
    padding-left: 0;
    font-weight: 300;
    line-height: 1.6;
}

.nav-inner {
    overflow: hidden;
}

.nav-item.open .nav-content {
    grid-template-rows: 1fr;
    /* Animates to full height smoothly */
    opacity: 1;
}

.nav-item.open .nav-btn {
    opacity: 1;
}

/* Footer */
footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    font-size: 0.7rem;
    /* Slightly smaller */
    padding-bottom: 0.5vh;
    /* Much more compact */
    padding-top: 0.5vh;
    opacity: 0.5;
    /* More subtle */
    border-top: 1px solid rgba(235, 240, 244, 0.05);
    margin-top: 0;
    flex-shrink: 0;
    width: 100%;
    padding-left: 2rem;
    padding-right: 2rem;
}


.footer-left {
    display: flex;
    align-items: center;
}

.footer-icon {
    height: 14px;
    width: 14px;
    margin-right: 0.5rem;
    object-fit: contain;
}

.footer-right a {
    color: var(--text-color);
    text-decoration: none;
    margin-left: 1.5rem;
    transition: opacity 0.2s;
}

.footer-right a:hover {
    opacity: 0.7;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 1.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    #navigation {
        left: 5%;
        font-size: 18pt;
    }

    body {
        padding: 1rem;
        font-size: 0.9rem;
        /* Reduce font size for mobile */
        overflow-y: auto;
        /* Ensure homepage can scroll if content runs long */
    }

    footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding-bottom: 4rem;
        /* Increase padding to prevent cutoff */
    }

    .footer-right {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin-left: 0;
        /* Reset */
    }

    .footer-right a {
        margin-left: 0;
    }

    .logo-img {
        height: 6vh;
    }
}

/* Product Card Styling */
.product-card {
    display: flex;
    align-items: center;
    border: 1px solid #EBF0F4;
    border-radius: 16px;
    padding: 1rem;
    /* 16px gap */
    /* background: transparent; */
    background: linear-gradient(0deg, rgba(100, 85, 143, 0.25), rgba(100, 85, 143, 0.25)), #1E1E1E;
    /* Multi-layer fill */
    width: 100%;
    max-width: 700px;
    gap: 1.5rem;
    margin-top: 1rem;
}

.card-icon {
    width: 100px;
    height: 100px;
    /* background-color: rgba(100, 85, 143, 0.25); REMOVED */
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    overflow: hidden;
    /* Ensure image respects border radius */
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.card-icon img {
    width: 100%;
    /* Fill container */
    height: 100%;
    /* Fill container */
    object-fit: cover;
}

.card-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
}

.product-title {
    font-family: var(--font-main);
    font-size: 1.2rem;
    font-weight: 600;
    /* Semi-bold */
    color: #EBF0F4;
    margin: 0;
    letter-spacing: 0.05em;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.product-desc {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0;
    font-weight: 300;
    line-height: 1.4;
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.play-badge {
    height: 30px;
    width: auto;
    cursor: pointer;
    filter: grayscale(100%) brightness(1.2);
    /* Adjust to match theme if needed */
    transition: filter 0.3s ease;
}

.play-badge:hover {
    filter: none;
}

.availability {
    font-size: 0.8rem;
    opacity: 0.5;
    font-style: italic;
}

.card-expand-btn {
    width: 40px;
    height: 40px;
    background-color: rgba(100, 85, 143, 0.15);
    /* #64558F at 15% */
    border: 1px solid #EBF0F4;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.card-expand-btn:hover {
    background-color: rgba(100, 85, 143, 0.35);
}

.card-expand-btn img {
    width: 50%;
    height: auto;
    /* Source SVG is already #EBF0F4, no filter needed */
    /* filter: none; */
}

/* Product Card Layout Updates */
.product-card {
    display: flex;
    flex-direction: column;
    /* Changed to column to stack header and content */
    align-items: flex-start;
    /* Reset align */
    border: 1px solid #EBF0F4;
    border-radius: 16px;
    padding: 1rem;
    background: #2F2B3A;
    width: 100%;
    max-width: 700px;
    margin-top: 1rem;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    cursor: pointer;
    overflow: hidden;
    /* Hide expanded content initially */
    position: relative;
    /* For z-index context */
}

/* Card Header Wrapper - behaves like the old card row */
.card-header {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 1.5rem;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Expanded Content - Hidden by default */
/* Expanded Content - Hidden by default using max-height for transition */
.card-expanded-content {
    display: block;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0;
    /* Ensure padding also animates */
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.product-card.expanded .card-expanded-content {
    max-height: 50000px;
    /* Huge value to ensure all content fits and triggers scroll */
    opacity: 1;
    overflow: visible;
    /* Prevent internal clipping */
    padding: 0 4vw 2rem 4vw;
    /* Restore padding in expanded state */
}

/* Expanded State */
/* Expanded State */
.product-card.expanded {
    position: fixed;
    top: 24px;
    left: 24px;
    width: calc(100vw - 48px);
    height: calc(100vh - 48px);
    max-width: none;
    z-index: 2000;
    opacity: 1 !important;
    background: #2F2B3A !important;
    /* Solid background */
    border-radius: 16px;
    /* Restore radius */
    border: 1px solid #EBF0F4;
    /* Restore stroke */
    /* Padding moved to children for full-width sticky header */
    padding: 0;
    cursor: auto;
    overflow-y: auto;
    pointer-events: auto;
    /* Ensure interaction */
    display: block;
    /* Override flex from base class to ensure full width layout */
}

/* Header Adjustments in Expanded State */
.product-card.expanded .card-header {
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 10;
    background: #2F2B3A;
    /* Solid background to cover scrolling content */
    padding: 2rem 4vw 1rem 4vw;
    /* Top, Side, Bottom Padding */
    border-bottom: 1px solid rgba(235, 240, 244, 0.05);
}

/* Mobile Responsiveness for Product Card */
@media (max-width: 768px) {
    .product-card {
        padding: 1rem;
        gap: 1rem;
    }

    .card-icon {
        width: 80px;
        height: 80px;
    }

    .product-title {
        font-size: 1.1rem;
    }

    .product-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Expanded State Mobile Overrides */
    .product-card.expanded {
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        border: none;
        padding-bottom: 4rem;
        /* Reduced from 8rem per request */
        box-sizing: border-box;
    }

    .product-card.expanded .card-header {
        padding: 1rem 1.5rem 1rem 1rem;
        /* Extra right padding for button */
        margin-bottom: 1rem;
        gap: 0.75rem;
        width: 100vw;
        /* Explicit viewport width */
        box-sizing: border-box;
        margin-left: 0;
        margin-right: 0;
        left: 0;
        /* Ensure sticky positioning is grounded */
    }

    .product-card.expanded .card-icon {
        width: 48px;
        /* Further reduced from 60px */
        height: 48px;
    }

    .product-card.expanded .product-title {
        font-size: 2rem;
        margin-bottom: 0.2rem;
    }

    .card-expand-btn {
        flex-shrink: 0;
        /* Ensure button never shrinks */
        width: 36px;
        /* Slightly smaller button for mobile */
        height: 36px;
    }

    .card-expanded-content {
        padding: 0 1.5rem 2rem 1.5rem;
        /* Match header padding */
    }

    .card-footer-bar {
        margin-left: -1.5rem;
        margin-right: -1.5rem;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* New Content Wrapper Padding */
.card-expanded-content {
    padding: 0 4vw 2rem 4vw;
}

.product-card.expanded .card-icon {
    width: 100px;
    height: 100px;
}

.product-card.expanded .product-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.product-card.expanded .short-desc {
    display: none;
    /* Hide the summary line in expanded view per reference? Or keep? Reference hides it or moves it. Use display none for now based on image */
}

/* Expand Button Positioning */
.card-expand-btn {
    margin-left: auto;
    /* Push to right */
    /* existing styles... */
    z-index: 2005;
}

/* Expanded Content */
.card-expanded-content {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease 0.3s;
    /* Delay fade in */
    max-width: none;
    /* Allow full width */
}

/* Constrain internal content except footer */
.card-expanded-content>*:not(.card-footer-bar) {
    max-width: 800px;
}

/* Custom Scrollbar for Expanded Card */
.product-card.expanded::-webkit-scrollbar {
    width: 6px;
}

.product-card.expanded::-webkit-scrollbar-track {
    background: #2F2B3A;
    /* Match card background */
}

.product-card.expanded::-webkit-scrollbar-thumb {
    background: rgba(235, 240, 244, 0.2);
    border-radius: 3px;
}

.product-card.expanded::-webkit-scrollbar-thumb:hover {
    background: rgba(235, 240, 244, 0.4);
}

/* Firefox Scrollbar */
.product-card.expanded {
    scrollbar-width: thin;
    scrollbar-color: rgba(235, 240, 244, 0.2) #2F2B3A;
}

.product-card.expanded .card-expanded-content {
    display: block;
    opacity: 1;
}

/* Content Styling */
.hero-desc {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 3rem;
    font-weight: 300;
    white-space: pre-line;
    /* Handle line breaks */
}

.card-expanded-content h4 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    margin-top: 3rem;
    font-family: var(--font-main);
}

.highlight-list {
    display: block;
    margin-top: 1rem;
    opacity: 0.7;
    line-height: 1.8;
}

.feature-item {
    margin-bottom: 2rem;
}

.feature-item strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.feature-item p {
    font-size: 1rem;
    opacity: 0.8;
    font-weight: 300;
}

/* New Footer Bar Styling */
.card-footer-bar {
    margin-top: 6rem;
    /* Extra space above footer */
    padding-top: 2rem;
    border-top: 1px solid rgba(235, 240, 244, 0.5);
    /* 50% opacity border */
    display: flex;
    justify-content: flex-start;
    /* Align left with content */
    align-items: center;
    font-size: 0.9rem;
    color: rgba(235, 240, 244, 0.6);
    /* Stretch to full width */
    margin-left: -4vw;
    margin-right: -4vw;
    padding-left: 4vw;
    padding-right: 4vw;
}

.footer-bar-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-bar-links a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-bar-links a:hover {
    color: #EBF0F4;
}

.separator {
    opacity: 0.3;
    font-weight: 300;
}

/* Contact Form Styling */
.contact-form {
    display: grid;
    grid-template-columns: 1fr auto;
    /* Input column | Button column */
    grid-template-rows: auto 1fr;
    /* Email row | Message row */
    gap: 1rem 0.5rem;
    /* Row Gap | Col Gap */
    max-width: 600px;
    /* Increased max-width for better layout */
    margin-top: 1rem;
    height: 100%;
}

.contact-form input,
.contact-form textarea {
    background: rgba(235, 240, 244, 0.05);
    /* Subtle white overlay */
    border: 1px solid rgba(235, 240, 244, 0.1);
    color: #EBF0F4;
    padding: 1rem;
    font-family: var(--font-main);
    font-size: 1rem;
    border-radius: 8px;
    /* Requested corner radius */
    outline: none;
    transition: border-color 0.3s ease;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: rgba(235, 240, 244, 0.4);
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: rgba(235, 240, 244, 0.3);
}

.contact-form input {
    grid-column: 1 / 2;
    /* First column */
    grid-row: 1 / 2;
    /* First row */
}

.contact-form textarea {
    grid-column: 1 / 2;
    /* First column */
    grid-row: 2 / 3;
    /* Second row */
    height: 120px;
    /* Reduced height to prevent scrolling */
    resize: none;
}

.send-btn {
    grid-column: 2 / 3;
    /* Second column */
    grid-row: 2 / 3;
    /* Second row (aligns with textarea) */
    background: #EBF0F4;
    /* Requested fill */
    border: none;
    border-radius: 8px;
    /* Requested corner radius */
    padding: 0 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    height: 120px;
    /* Force height to match row height (textarea) */
}

.send-btn:hover {
    opacity: 0.9;
}

.send-btn img {
    width: 20px;
    height: 20px;
    /* Ensure icon is #1E1E1E (Dark almost black)  */
    filter: brightness(0) saturate(100%) invert(9%) sepia(8%) saturate(1201%) hue-rotate(202deg) brightness(97%) contrast(92%);
}

.send-btn:hover {
    opacity: 0.9;
}

.send-btn img {
    width: 20px;
    height: 20px;
    /* Ensure icon is #1E1E1E (Dark almost black)  */
    filter: brightness(0) saturate(100%) invert(9%) sepia(8%) saturate(1201%) hue-rotate(202deg) brightness(97%) contrast(92%);
}

@media (max-width: 768px) {
    .contact-form {
        grid-template-columns: 1fr;
        /* Stack vertically */
        grid-template-rows: auto auto auto;
        /* Input, Textarea, Button */
        gap: 1rem;
        padding-bottom: 2rem;
        /* Ensure bottom visibility */
    }

    .contact-form input {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
    }

    .contact-form textarea {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
        height: 100px;
        /* Slightly compact */
    }

    .send-btn {
        grid-column: 1 / 2;
        /* Full width */
        grid-row: 3 / 4;
        height: 50px;
        /* Standard button height */
        width: 100%;
    }
}