/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: #120208;
    color: #e8d5d5;
    font-family: 'Albert Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== CANVAS BACKGROUND ===== */
#aurora-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* ===== SCAN LINES OVERLAY ===== */
#scan-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 1px,
        rgba(18, 2, 8, 0.15) 1px,
        rgba(18, 2, 8, 0.15) 2px
    );
}

/* ===== CURSOR TRAIL ===== */
#cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9997;
    pointer-events: none;
    overflow: hidden;
}

.trail-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #c94b7c;
    opacity: 1;
    pointer-events: none;
    animation: trail-fade 800ms ease-out forwards;
}

@keyframes trail-fade {
    0% { opacity: 0.8; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.2); }
}

/* ===== SECTIONS ===== */
.section {
    position: relative;
    width: 100%;
}

/* ===== CONTENT STRIP ===== */
.content-strip {
    position: relative;
    max-width: 520px;
    margin: 0 auto;
    padding: 0 24px;
    z-index: 10;
}

/* ===== SECTION 1: THE SIGNAL ===== */
#the-signal {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.signal-wordmark {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.02em;
    position: relative;
    z-index: 10;
}

.signal-letter {
    font-family: 'Silkscreen', cursive;
    font-weight: 400;
    font-size: clamp(4rem, 20vw, 16rem);
    letter-spacing: 0.15em;
    color: #f5c6c6;
    opacity: 0;
    transition: opacity 0.4s ease;
    text-shadow: 0 0 60px rgba(201, 75, 124, 0.3),
                 0 0 120px rgba(74, 232, 176, 0.1);
}

.signal-letter.visible {
    opacity: 1;
}

/* Shrinking hero watermark on scroll */
.signal-wordmark.scrolled {
    position: fixed;
    top: 24px;
    left: 24px;
    transform-origin: top left;
    z-index: 100;
}

/* ===== SECTION 2: THE FREQUENCY ===== */
#the-frequency {
    min-height: 120vh;
    padding: 20vh 0;
    position: relative;
}

.frequency-strip {
    margin-left: calc(50% - 280px);
}

.freq-block {
    margin-bottom: 40vh;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.freq-block.revealed {
    opacity: 1;
    transform: translateY(0);
}

.section-marker {
    font-family: 'Silkscreen', cursive;
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.15em;
    color: #f5c6c6;
    margin-bottom: 2rem;
}

.freq-block p {
    color: #e8d5d5;
    font-weight: 300;
    max-width: 480px;
}

.freq-block p em,
.freq-block p strong {
    font-weight: 500;
    color: #f5c6c6;
}

/* ===== SECTION 3: THE PATTERN ===== */
#the-pattern {
    height: 100vh;
    position: relative;
    overflow: hidden;
}

#pattern-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
}

/* ===== SECTION 4: THE ARCHIVE ===== */
#the-archive {
    min-height: 80vh;
    padding: 10vh 0;
    position: relative;
}

.archive-strip {
    display: flex;
    flex-direction: column;
    gap: 8vh;
    max-width: 520px;
}

.archive-tile {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    border-radius: 2px;
    box-shadow: 0 0 40px rgba(201, 75, 124, 0.15);
    transition: box-shadow 0.6s ease;
}

.archive-tile:hover {
    box-shadow: 0 0 60px rgba(201, 75, 124, 0.35);
}

.tile-left {
    align-self: flex-start;
    margin-left: -20px;
}

.tile-right {
    align-self: flex-end;
    margin-right: -20px;
}

.tile-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.tile-pattern-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-radial-gradient(
        circle at 50% 50%,
        #7a1b3a 0px,
        #7a1b3a 2px,
        #4a0e1c 2px,
        #4a0e1c 12px,
        #7a1b3a 12px,
        #7a1b3a 14px,
        #2e0a12 14px,
        #2e0a12 24px
    );
}

.tile-noise-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #2e0a12;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.15'/%3E%3C/svg%3E");
    background-size: 128px 128px;
}

.tile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(18, 2, 8, 0.3);
}

.tile-glyph {
    font-family: 'Silkscreen', cursive;
    font-size: 10rem;
    color: #f5c6c6;
    opacity: 0.5;
    text-shadow: 0 0 40px rgba(201, 75, 124, 0.4);
}

.tile-text {
    color: #e8d5d5;
    font-family: 'Albert Sans', sans-serif;
    font-weight: 300;
    font-size: 0.95rem;
    line-height: 1.75;
    mix-blend-mode: screen;
}

.tile-data {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85em;
    letter-spacing: 0.05em;
    color: #c4a47a;
    line-height: 2;
}

/* ===== SECTION 5: THE TRANSMISSION ===== */
#the-transmission {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.transmission-strip {
    text-align: center;
    max-width: 700px;
}

.transmission-domain {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(1.5rem, 4vw, 3rem);
    letter-spacing: 0.05em;
    color: #c4a47a;
    margin-bottom: 3rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
}

.transmission-char {
    opacity: 0;
    display: inline-block;
    transition: text-shadow 0.3s ease;
    position: relative;
}

.transmission-char.typed {
    opacity: 1;
}

.transmission-char.flash {
    text-shadow: 0 0 20px #4ae8b0, 0 0 40px #4ae8b0;
    color: #4ae8b0;
}

.transmission-contact {
    opacity: 0;
    transition: opacity 1s ease;
}

.transmission-contact.visible {
    opacity: 1;
}

.transmission-contact p {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85em;
    color: #c4a47a;
    letter-spacing: 0.05em;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    .trail-dot {
        display: none;
    }
    .signal-letter {
        opacity: 1 !important;
    }
    .freq-block {
        opacity: 1 !important;
        transform: none !important;
    }
    .transmission-char {
        opacity: 1 !important;
    }
    .transmission-contact {
        opacity: 1 !important;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .frequency-strip {
        margin-left: auto;
        margin-right: auto;
    }
    
    .content-strip {
        padding: 0 20px;
    }

    .archive-tile {
        height: 220px;
    }

    .tile-left {
        margin-left: 0;
    }

    .tile-right {
        margin-right: 0;
    }

    .tile-glyph {
        font-size: 6rem;
    }

    .signal-letter {
        letter-spacing: 0.08em;
    }
}
