/* Palette: #1E1410 #2A201C #3D2E26 #A0785C #B87A5E #C48C6C #D4B8A0 #E8A878 #F2E0D0 */
/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
    background: #1E1410;
    color: #D4B8A0;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
}

body {
    background: #1E1410;
    overflow-x: hidden;
    position: relative;
}

/* === SIGNAL FIELD (Background Grid) === */
#signal-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 800ms ease;
    background-image:
        repeating-linear-gradient(to right, rgba(196, 140, 108, 0.06) 0px, rgba(196, 140, 108, 0.06) 1px, transparent 1px, transparent 8px),
        repeating-linear-gradient(to bottom, rgba(196, 140, 108, 0.06) 0px, rgba(196, 140, 108, 0.06) 1px, transparent 1px, transparent 8px);
}

#signal-field.visible {
    opacity: 1;
}

/* === WAVEFORM CANVAS === */
#waveform-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* === MAIN CONTENT === */
#content {
    position: relative;
    z-index: 2;
}

/* === ZONES === */
.zone {
    min-height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === GRID CONTAINER (12-col Swiss) === */
.grid-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: clamp(16px, 3vw, 48px);
    width: 100%;
    max-width: 1400px;
    padding: 0 clamp(16px, 3vw, 48px);
}

/* === PANELS === */
.panel {
    background: rgba(42, 32, 28, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(196, 140, 108, 0.12);
    border-radius: 2px;
    padding: clamp(24px, 4vw, 48px);
    transition: border-color 200ms ease;
}

.panel:hover {
    border-color: rgba(196, 140, 108, 0.3);
}

/* Panel positioning */
.panel-left { grid-column: 2 / 7; }
.panel-right { grid-column: 7 / 11; }

.panel-narrow:nth-child(1) { grid-column: 1 / 4; }
.panel-narrow:nth-child(2) { grid-column: 5 / 8; }
.panel-narrow:nth-child(3) { grid-column: 9 / 12; }

.panel-wide { grid-column: 1 / 9; }
.panel-center { grid-column: 2 / 9; }

.decorative-wave {
    grid-column: 10 / 13;
    display: flex;
    align-items: center;
}

.decorative-wave svg {
    width: 100%;
    height: 80%;
}

.deco-wave-path {
    stroke: #C48C6C;
    stroke-width: 1.5;
    fill: none;
    opacity: 0.3;
}

/* === BOUNCE ANIMATION === */
.bounce-target {
    transform: translateY(30px);
    opacity: 0;
    transition: none;
}

.bounce-target.entered {
    animation: bounceEnter 500ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes bounceEnter {
    0% { transform: translateY(30px); opacity: 1; }
    70% { transform: translateY(-4px); }
    100% { transform: translateY(0); opacity: 1; }
}

/* === TYPOGRAPHY === */
.display-text {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #F2E0D0;
    line-height: 1.2;
    margin-bottom: 0.5em;
}

.body-text {
    color: #D4B8A0;
    margin-bottom: 1em;
}

.annotation {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.65rem, 1vw, 0.78rem);
    color: #A0785C;
    letter-spacing: 0.04em;
}

/* === HERO (Noise Floor) === */
#noise-floor {
    flex-direction: column;
    gap: 1rem;
}

#hero-title {
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.12em;
    position: relative;
    z-index: 3;
    overflow: hidden;
    white-space: nowrap;
}

#hero-title .char {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
}

#hero-title .char.visible {
    animation: charBounce 400ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes charBounce {
    0% { transform: translateY(100%); opacity: 0; }
    50% { opacity: 1; }
    70% { transform: translateY(-6px); }
    100% { transform: translateY(0); opacity: 1; }
}

#hero-annotation {
    opacity: 0;
    transition: opacity 600ms ease;
}

#hero-annotation.visible {
    opacity: 1;
}

/* === ZERO LINE === */
.zero-line {
    position: absolute;
    top: 50%;
    left: 50%;
    height: 1px;
    background: #C48C6C;
    transform: translateX(-50%);
    width: 0;
    z-index: 2;
    transition: opacity 400ms ease;
}

.zero-line.drawn {
    animation: drawLine 600ms ease-out forwards;
}

@keyframes drawLine {
    to { width: 100vw; }
}

.final-zero-line {
    position: absolute;
    bottom: 20%;
    left: 0;
    width: 100%;
    height: 1px;
    background: #C48C6C;
    opacity: 0.5;
}

/* === SIGNAL BARS === */
.signal-bars {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 44px;
    margin-bottom: 1.2em;
}

.signal-bars .bar {
    width: 3px;
    background: #C48C6C;
    border-radius: 1px 1px 0 0;
    height: 0;
    transition: height 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.signal-bars.animated .bar {
    height: var(--bar-height);
}

/* === PHASE INDICATORS === */
.phase-indicator {
    width: 16px;
    height: 16px;
    margin-bottom: 1em;
}

.phase-indicator svg {
    width: 16px;
    height: 16px;
}

.phase-indicator circle.track {
    fill: none;
    stroke: #3D2E26;
    stroke-width: 2;
}

.phase-indicator circle.progress {
    fill: none;
    stroke: #E8A878;
    stroke-width: 2;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 800ms ease;
}

/* === SIGNAL FADE ZONE === */
#signal-fade .fade-text {
    opacity: 0.7;
}

#signal-fade .panel {
    border-color: rgba(196, 140, 108, 0.06);
}

/* === MOBILE === */
@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(4, 1fr);
    }

    .panel-left,
    .panel-right,
    .panel-narrow,
    .panel-narrow:nth-child(1),
    .panel-narrow:nth-child(2),
    .panel-narrow:nth-child(3),
    .panel-wide,
    .panel-center {
        grid-column: 1 / -1;
    }

    .decorative-wave {
        display: none;
    }

    #hero-title {
        font-size: clamp(2rem, 12vw, 4rem);
    }

    #frequency-bands .grid-container {
        gap: 1rem;
    }
}
