*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #F5EBD8;
    color: #5A4830;
    font-family: 'Merriweather', serif;
    font-weight: 300;
    font-size: 17px;
    line-height: 1.75;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Fixed grid-lines background */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background-image:
        /* Fine horizontal lines every 32px */
        repeating-linear-gradient(
            0deg,
            rgba(139, 115, 85, 0.06) 0px,
            rgba(139, 115, 85, 0.06) 1px,
            transparent 1px,
            transparent 32px
        ),
        /* Fine vertical lines every 32px */
        repeating-linear-gradient(
            90deg,
            rgba(139, 115, 85, 0.06) 0px,
            rgba(139, 115, 85, 0.06) 1px,
            transparent 1px,
            transparent 32px
        ),
        /* Bold horizontal lines every 160px */
        repeating-linear-gradient(
            0deg,
            rgba(139, 115, 85, 0.10) 0px,
            rgba(139, 115, 85, 0.10) 1px,
            transparent 1px,
            transparent 160px
        ),
        /* Bold vertical lines every 160px */
        repeating-linear-gradient(
            90deg,
            rgba(139, 115, 85, 0.10) 0px,
            rgba(139, 115, 85, 0.10) 1px,
            transparent 1px,
            transparent 160px
        );
}

/* Vignette overlays */
.vignette {
    position: fixed;
    left: 0;
    width: 100%;
    height: 20vh;
    z-index: 2;
    pointer-events: none;
}

.vignette-top {
    top: 0;
    background: linear-gradient(to bottom, #F5EBD8, transparent);
}

.vignette-bottom {
    bottom: 0;
    background: linear-gradient(to top, #F5EBD8, transparent);
}

/* Hero section */
.hero-section {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 20px;
}

.hero-card {
    text-align: center;
    opacity: 0;
    animation: fadeInHero 800ms ease-out forwards;
}

@keyframes fadeInHero {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-family: 'Recursive', sans-serif;
    font-weight: 600;
    font-size: 48px;
    color: #3A2818;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.hero-subtitle {
    font-family: 'Merriweather', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 18px;
    color: #5A4830;
    margin-bottom: 24px;
}

/* VU meter needle animation */
.hero-card .vu-needle {
    transform-origin: 12px 18px;
    animation: vuNeedleSwing 600ms ease-out 400ms forwards;
    transform: rotate(-30deg);
}

@keyframes vuNeedleSwing {
    from {
        transform: rotate(-30deg);
    }
    to {
        transform: rotate(0deg);
    }
}

/* Segment sections */
.segment {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 80vh;
    padding: 80px 20px;
    align-items: center;
}

/* Glassmorphic cards */
.glass-card {
    background: rgba(245, 235, 220, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(139, 115, 85, 0.2);
    border-radius: 8px;
    padding: 40px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: transform 200ms ease-out;
    will-change: transform;
    transform: perspective(1000px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
}

/* Meandering alignment */
.glass-card--left {
    width: 70%;
    margin-left: 5%;
    margin-right: auto;
}

.glass-card--right {
    width: 65%;
    margin-left: auto;
    margin-right: 5%;
}

.glass-card--center {
    width: 60%;
    margin-left: auto;
    margin-right: auto;
}

/* Segment reveal animation */
.segment .glass-card {
    opacity: 0;
    transform: perspective(1000px) translateY(60px);
    transition: opacity 500ms ease-out, transform 500ms ease-out;
}

.segment .glass-card.is-visible {
    opacity: 1;
    transform: perspective(1000px) translateY(0) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
}

/* Card header with VU meter and timestamp */
.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.vu-meter {
    flex-shrink: 0;
}

.timestamp {
    font-family: 'Overpass Mono', monospace;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.04em;
    color: #8B7355;
}

/* Segment typography */
.segment-title {
    font-family: 'Recursive', sans-serif;
    font-weight: 600;
    font-size: 36px;
    color: #3A2818;
    margin-bottom: 20px;
    line-height: 1.3;
}

.segment-body {
    font-family: 'Merriweather', serif;
    font-weight: 300;
    font-size: 17px;
    line-height: 1.75;
    color: #5A4830;
    margin-bottom: 16px;
}

.segment-body:last-of-type {
    margin-bottom: 24px;
}

/* Waveform */
.waveform-container {
    width: 100%;
    overflow: hidden;
    margin-top: 16px;
}

.waveform {
    width: 200%;
    height: 30px;
    display: block;
}

.waveform-path {
    animation: waveformScroll 4s linear infinite;
}

@keyframes waveformScroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }

    .segment-title {
        font-size: 26px;
    }

    .glass-card--left,
    .glass-card--right,
    .glass-card--center {
        width: 90%;
        margin-left: auto;
        margin-right: auto;
    }

    .glass-card {
        padding: 24px;
    }

    .segment {
        min-height: auto;
        padding: 40px 16px;
    }

    .hero-section {
        padding: 20px 16px;
    }

    .segment-body {
        font-size: 16px;
    }
}
