:root {
    /* Palette - Deep Void */
    --color-bg: #050505;
    --color-text-primary: #F5F5F7;
    --color-text-secondary: #86868b;
    --color-accent: #D4AF37;
    /* Muted Gold */

    /* Typography */
    --font-serif: 'Cormorant Garamond', serif;
    --font-sans: 'Inter', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --transition-slow: 1.2s var(--ease-out-expo);
    --transition-fast: 0.4s var(--ease-out-expo);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
    /* Custom cursor handling */
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
}

/* Offset anchors for header clearance */
section[id],
header[id] {
    scroll-margin-top: 30px;
}

#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

#trail-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
    /* Just below cursor (9999) */
    pointer-events: none;
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    /* Hidden until first mousemove */
    will-change: transform;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background-color: var(--color-text-primary);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(245, 245, 247, 0.3);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

/* Click Pulse Animation */
@keyframes cursorPulse {
    0% {
        border-color: rgba(245, 245, 247, 0.3);
        box-shadow: none;
    }

    40% {
        border-color: rgba(245, 245, 247, 0.9);
        box-shadow: 0 0 12px rgba(245, 245, 247, 0.4);
    }

    100% {
        border-color: rgba(245, 245, 247, 0.3);
        box-shadow: none;
    }
}

.cursor-outline.cursor-click {
    animation: cursorPulse 0.4s ease-out;
}

/* Typography Helpers */
h1,
h2,
h3,
h4 {
    font-family: var(--font-serif);
    font-weight: 400;
    letter-spacing: -0.02em;
}

/* Hero Section */
.hero-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: var(--spacing-md);
}

.hero-title {
    font-size: clamp(3rem, 8vw, 10rem);
    line-height: 1.1;
    display: flex;
    flex-direction: row;
    gap: 0.25em;
    align-items: center;
    justify-content: center;
    mix-blend-mode: difference;
    flex-wrap: wrap;
}

.hero-subtitle {
    margin-top: var(--spacing-md);
    font-family: var(--font-serif);
    font-size: 1.25rem;
    /* Slightly larger for the serif */
    font-weight: 600;
    /* Cormorant is thin, needs weight at small sizes */
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    /* Adjusted for serif */
    text-align: center;
}

/* Navigation */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    mix-blend-mode: difference;
    transition: background-color 0.4s, padding 0.4s, transform 0.4s;
}

.nav-overlay.scrolled {
    background: rgba(5, 5, 5, 0.6);
    backdrop-filter: blur(10px);
    mix-blend-mode: normal;
    /* Restore colors on dark background */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: var(--spacing-sm) var(--spacing-md);
    /* Shrink slightly */
}

.nav-overlay.hidden {
    transform: translateY(-100%);
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--color-text-primary);

    /* Circular Design */
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    /* Reduced from 60px */
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);

    /* Center text perfectly */
    line-height: 1;
    padding-top: 2px;
    /* Visual adjustment for serif font baseline */

    /* Musical Dust Texture Background */
    background-image: url('../assets/musical_dust.png');
    background-size: cover;
    background-position: center;
    background-color: rgba(255, 255, 255, 0.02);
    /* Slight tint */

    transition: all 0.3s ease;
}

.logo:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
    /* Subtle grow */
}

.nav-links {
    list-style: none;
    display: flex;
    gap: var(--spacing-md);
}

.nav-item {
    color: var(--color-text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    transition: color 0.3s ease;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0%;
    height: 1px;
    background-color: var(--color-accent);
    transition: width 0.3s var(--ease-out-expo);
}

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

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

/* ... Mobile Menu Styles ... */

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    cursor: none;
    z-index: 200;
}

.hamburger .line {
    width: 100%;
    height: 2px;
    background-color: var(--color-text-primary);
    transition: all 0.3s ease;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(5, 5, 5, 0.95);
    backdrop-filter: blur(20px);
    z-index: 150;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-menu-close {
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 3rem;
    color: var(--color-text-primary);
    cursor: none;
    line-height: 1;
    z-index: 160;
}

.mobile-nav-links {
    list-style: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.mobile-nav-item {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--color-text-primary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.mobile-footer-info {
    position: absolute;
    bottom: 50px;
    font-family: var(--font-sans);
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    opacity: 0.6;
}

/* Hamburger Animation */
.hamburger.open .line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.open .line:nth-child(2) {
    opacity: 0;
}

.hamburger.open .line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Mobile Responsive */
@media (max-width: 768px) {

    /* Navbar Adjustment */
    .nav-links {
        display: none;
        /* Hide Desktop Links */
    }

    .hamburger {
        display: flex;
        /* Show Hamburger */
    }

    /* Footer Hiding */
    .footer-section {
        display: none !important;
    }

    /* Hero Text Fix */
    .hero-title {
        font-size: clamp(2.5rem, 10vw, 5rem);
        /* Smaller on mobile */
    }

    .hero-subtitle {
        font-size: 1rem;
        padding: 0 var(--spacing-sm);
        white-space: normal;
        /* Allow wrap if absolutely needed */
    }

    /* HIDE Custom Cursor on Touch */
    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }

    /* Revert global cursor:none for accessibility on touch interactions */
    *,
    *::before,
    *::after {
        cursor: auto;
    }
}

.scroll-indicator {
    position: absolute;
    bottom: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    opacity: 0.6;
}

.scroll-indicator span {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.scroll-indicator .line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--color-text-primary), transparent);
}

/* Shared Section Styles */
.section {
    min-height: 50vh;
    /* Default min-height prevents collapse */
    padding: var(--spacing-xl) var(--spacing-md);
    position: relative;
}

.section-header {
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: var(--spacing-sm);
    display: inline-block;
}

.section-label {
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 1rem;
    color: var(--color-accent);
}

/* About Section */
.about-section {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center text flow */
    text-align: center;
}

.about-section .section-header {
    border-bottom: none;
    /* Remove line for cleaner centered look */
    margin-bottom: var(--spacing-xs);
    /* Tighter spacing */
    align-self: center;
}

.about-content {
    margin-left: auto;
    /* Right align content for variety */
    margin-right: auto;
    max-width: 800px;
}

.about-content p {
    color: var(--color-text-primary);
    font-family: var(--font-serif);
    /* Switch to Serif for narrative feel */
    line-height: 1.6;
    /* Adjusted for Serif */
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    /* Larger size for Cormorant */
    font-weight: 400;
}

/* Tools Logo Strip */
.tools-strip {
    margin-top: var(--spacing-lg);
    text-align: center;
}

.tools-label {
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.7rem;
    color: rgba(245, 245, 247, 0.6);
    display: block;
    margin-bottom: var(--spacing-md);
    opacity: 0.3;
    transition: opacity 0.6s ease;
}

.tools-strip.in-view .tools-label {
    opacity: 1;
}

.tools-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.tools-logos img {
    height: 36px;
    width: auto;
    object-fit: contain;
    filter: grayscale(100%) brightness(0.5);
    opacity: 0.3;
    transition: filter 0.8s ease, opacity 0.8s ease, transform 0.3s ease;
}

/* Staggered reveal per logo */
.tools-logos img:nth-child(1) {
    transition-delay: 0s;
}

.tools-logos img:nth-child(2) {
    transition-delay: 0.08s;
}

.tools-logos img:nth-child(3) {
    transition-delay: 0.16s;
}

.tools-logos img:nth-child(4) {
    transition-delay: 0.24s;
}

.tools-logos img:nth-child(5) {
    transition-delay: 0.32s;
}

.tools-logos img:nth-child(6) {
    transition-delay: 0.4s;
}

/* Scroll into view — reveal full color */
.tools-strip.in-view .tools-logos img {
    filter: grayscale(0%) brightness(1);
    opacity: 0.85;
}

.tools-logos img:hover {
    opacity: 1;
    transform: scale(1.1);
}

.tools-logos img:nth-child(2),
.tools-logos img:nth-child(6) {
    border-radius: 8px;
}

/* Audio Player Bar */
.audio-player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    transform: translateY(100%);
    /* Hidden by default */
    transition: transform 0.6s var(--ease-out-expo);
}

.audio-player-bar.active {
    transform: translateY(0);
}

/* Controls */
.player-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--color-text-primary);
    cursor: none;
    font-size: 1.2rem;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    /* Generous hit area around the icon */
}

.control-btn:hover {
    color: var(--color-accent);
}

.play-pause-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

/* Optical centering for the play triangle */
.play-pause-btn .icon-play {
    padding-left: 2px;
}

.play-pause-btn:hover {
    border-color: var(--color-accent);
    transform: scale(1.05);
}

.track-info {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    min-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Seek Bar */
.seek-container {
    flex-grow: 1;
    margin: 0 var(--spacing-lg);
    height: 30px;
    /* Expanded interaction area */
    display: flex;
    /* Center the visual bar */
    align-items: center;
    cursor: none;
    position: relative;
    /* Removed background/border-radius from here to separate interaction from visual */
}

/* The Visual Track Background */
.seek-container::before {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 4px;
    /* Thin visual line */
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    transition: height 0.2s, background-color 0.2s;
}

.seek-container:hover::before {
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
}

/* The Progress Bar */
.seek-bar {
    width: 0%;
    height: 4px;
    /* Match visual track */
    background: var(--color-accent);
    position: absolute;
    /* Overlay on track */
    left: 0;
    border-radius: 2px;
    z-index: 2;
    pointer-events: none;
    /* Let clicks pass to container */
    transition: height 0.2s;
}

.seek-container:hover .seek-bar {
    height: 6px;
}

/* Seek Handle */
.seek-bar::after {
    content: '';
    position: absolute;
    right: -6px;
    /* Slightly larger offset */
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 14px;
    /* Larger handle */
    height: 14px;
    background: var(--color-text-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Pop effect */
}

.seek-container:hover .seek-bar::after {
    transform: translateY(-50%) scale(1);
}

/* =========================================
   Volume Control
   ========================================= */

.volume-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-right: var(--spacing-md);
    position: relative;
}

.volume-btn {
    font-size: 1.2rem;
    padding: 5px;
    opacity: 0.7;
    transition: opacity 0.3s, color 0.3s;
}

.volume-btn:hover {
    opacity: 1;
    color: var(--color-accent);
}

.volume-btn .volume-icon {
    pointer-events: none;
    display: block;
    width: 20px;
    height: 20px;
}

.volume-slider-wrapper {
    width: 80px;
    height: 30px;
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
}

/* Override global cursor:none for the entire slider area */
.volume-slider-wrapper,
.volume-slider-wrapper * {
    cursor: pointer !important;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    /* Standard property for compatibility */
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    transition: background 0.2s;
}

.volume-slider:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Slider Thumb (Webkit) */
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--color-text-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: scale(0);
}

/* Show Thumb on Hover */
.volume-slider-wrapper:hover .volume-slider::-webkit-slider-thumb {
    transform: scale(1);
}

/* Slider Thumb (Firefox) */
.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--color-text-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s;
    transform: scale(0);
}

.volume-slider-wrapper:hover .volume-slider::-moz-range-thumb {
    transform: scale(1);
}

/* Mobile: Hide Volume Slider to save space */
@media (max-width: 768px) {
    .volume-container {
        display: none;
    }
}

/* Waveform Visualizer */
.waveform-visualizer {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 30px;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.wave-bar {
    width: 3px;
    height: 100%;
    background: var(--color-accent);
    animation: wave 1s infinite ease-in-out;
    border-radius: 2px;
}

.wave-bar:nth-child(2) {
    animation-delay: 0.1s;
}

.wave-bar:nth-child(3) {
    animation-delay: 0.2s;
}

.wave-bar:nth-child(4) {
    animation-delay: 0.3s;
}

.wave-bar:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes wave {

    0%,
    100% {
        height: 20%;
    }

    50% {
        height: 100%;
    }
}

@media (max-width: 768px) {

    /* About section: no scroll dimming on mobile */
    .about-section .scroll-animate {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }

    .about-content {
        max-width: 100%;
        position: relative;
    }

    .about-content p {
        font-size: 1.1rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }

    /* Collapsed state — clip via max-height */
    .about-content.collapsed {
        max-height: 280px;
        overflow: hidden;
    }

    /* Gradient fade wrapper — sticky when collapsed */
    .about-read-more-wrapper {
        display: flex;
        justify-content: center;
        padding: 2rem 0 0.5rem;
        z-index: 5;
    }

    .about-content.collapsed .about-read-more-wrapper {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 4rem 0 0.5rem;
        background: linear-gradient(to bottom,
                transparent 0%,
                rgba(5, 5, 5, 0.6) 30%,
                rgba(5, 5, 5, 0.95) 60%,
                var(--color-bg) 100%);
    }

    .about-read-more {
        display: block;
        background: none;
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 20px;
        color: var(--color-text-secondary);
        font-family: var(--font-sans);
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.15em;
        padding: 8px 24px;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .about-read-more:hover {
        color: var(--color-text-primary);
        border-color: rgba(255, 255, 255, 0.3);
    }

    .audio-player-bar {
        flex-direction: column;
        gap: var(--spacing-xs);
        padding-bottom: 20px;
        /* Safe area */
    }

    .seek-container {
        width: 100%;
        margin: var(--spacing-xs) 0;
    }

    .waveform-visualizer {
        display: none;
        /* Hide visualizer on mobile to save space */
    }

    /* Volume slider always shows thumb on mobile (no hover) */
    .volume-slider::-webkit-slider-thumb {
        transform: scale(1);
    }

    .volume-slider::-moz-range-thumb {
        transform: scale(1);
    }

    .volume-slider-wrapper {
        width: 80px;
    }

    /* Ensure volume container visible on mobile */
    .volume-container {
        justify-content: center;
        margin-right: 0;
    }

    /* Seek bar thumb always visible on mobile (no hover) */
    .seek-bar::after {
        transform: translateY(-50%) scale(1) !important;
    }

    /* Tools strip responsive */
    .tools-logos {
        gap: 1.5rem;
    }

    .tools-logos img {
        height: 28px;
    }
}