/* =========================================================
   misty.day - Styles
   Dark-mode retrofuturism / Haunted signal aesthetic
   ========================================================= */

/* --- CSS Custom Properties --- */
:root {
    --void-black: #08090c;
    --signal-white: #e4edf3;
    --phosphor-cyan: #00d4ff;
    --amber-pulse: #ff8c21;
    --fog-gray: #1a1f26;
    --steel-mid: #6b7d8a;
    --deep-charcoal: #0f1318;
    --interference-red: #ff2d4a;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--phosphor-cyan) var(--fog-gray);
}

html::-webkit-scrollbar {
    width: 4px;
}

html::-webkit-scrollbar-track {
    background: var(--fog-gray);
}

html::-webkit-scrollbar-thumb {
    background: var(--phosphor-cyan);
    border-radius: 0;
}

body {
    background-color: var(--void-black);
    color: var(--signal-white);
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.85;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- SVG Defs (hidden) --- */
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Noise Texture Overlay --- */
#noise-overlay {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    z-index: 1000;
    pointer-events: none;
    opacity: 0.04;
    filter: url(#noiseFilter);
    animation: noiseShift 0.125s steps(1) infinite;
}

@keyframes noiseShift {
    0% { transform: translate(0, 0); }
    10% { transform: translate(-2%, -3%); }
    20% { transform: translate(3%, 1%); }
    30% { transform: translate(-1%, 4%); }
    40% { transform: translate(4%, -2%); }
    50% { transform: translate(-3%, 2%); }
    60% { transform: translate(2%, -4%); }
    70% { transform: translate(-4%, 3%); }
    80% { transform: translate(1%, -1%); }
    90% { transform: translate(3%, 4%); }
    100% { transform: translate(-2%, -2%); }
}

/* --- Scan Lines Overlay --- */
#scan-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(255, 255, 255, 0.03) 2px,
        rgba(255, 255, 255, 0.03) 3px
    );
}

/* --- Hero Section --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Fog Layer */
#fog-layer {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120vw;
    height: 120vh;
    transform: translate(-50%, -50%) scale(1);
    background: radial-gradient(
        ellipse at center,
        var(--fog-gray) 0%,
        var(--void-black) 70%
    );
    filter: blur(80px);
    will-change: transform;
    animation: fogBreathe 12s ease-in-out infinite;
    z-index: 1;
}

@keyframes fogBreathe {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1.0);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.15);
    }
}

/* Hero Content */
#hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

#hero-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(4rem, 12vw, 10rem);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--signal-white);
    text-shadow: 0 0 30px rgba(200, 230, 255, 0.15);
    line-height: 1;
    margin-right: -0.25em;
}

#hero-title .char {
    display: inline-block;
    opacity: 0;
    filter: blur(12px);
    will-change: filter, opacity;
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#hero-title .char.revealed {
    opacity: 1;
    filter: blur(0);
}

#hero-title .char.dot {
    color: var(--phosphor-cyan);
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
}

#hero-title .char.dot.revealed {
    animation: dotPulse 1.5s ease-in-out forwards;
}

@keyframes dotPulse {
    0% {
        opacity: 1;
        text-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
    }
    30% {
        opacity: 1;
        text-shadow: 0 0 40px rgba(0, 212, 255, 1), 0 0 80px rgba(0, 212, 255, 0.5);
    }
    100% {
        opacity: 0.6;
        text-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
    }
}

#hero-subtitle {
    font-family: 'Archivo Narrow', sans-serif;
    font-weight: 400;
    font-size: clamp(0.75rem, 1.5vw, 1rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--steel-mid);
    margin-top: 2rem;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

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

/* --- Breathing Zones --- */
.breathing-zone {
    height: 40vh;
    position: relative;
}

/* --- Content Sections --- */
.content-section {
    position: relative;
    width: 60%;
    max-width: 720px;
    margin: 0 auto;
    padding: 4rem 0;
}

.content-section.drift-left {
    margin-left: calc(50% - 30% - 5vw);
    margin-right: auto;
}

.content-section.drift-right {
    margin-left: calc(50% - 30% + 5vw);
    margin-right: auto;
}

/* Section Marker */
.section-marker {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.waveform {
    width: 60px;
    height: 16px;
    flex-shrink: 0;
}

.section-label {
    font-family: 'Archivo Narrow', sans-serif;
    font-weight: 500;
    font-size: clamp(0.75rem, 1.5vw, 1rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--steel-mid);
}

/* Content Block */
.content-block {
    background-color: var(--deep-charcoal);
    border: 1px dashed var(--fog-gray);
    padding: clamp(2rem, 4vw, 3.5rem);
}

.content-block h2 {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--signal-white);
    text-shadow: 0 0 30px rgba(200, 230, 255, 0.15);
    margin-bottom: 1.5rem;
    margin-right: -0.25em;
}

.content-block p {
    color: #c8d6df;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.85;
    letter-spacing: 0.01em;
    margin-bottom: 1.5rem;
}

.content-block p:last-child {
    margin-bottom: 0;
}

/* Fog Reveal Animation */
.fog-reveal {
    opacity: 0;
    filter: blur(8px);
    will-change: filter, opacity;
    transition: opacity 0.6s ease-out, filter 0.6s ease-out;
}

.fog-reveal.revealed {
    opacity: 1;
    filter: blur(0);
}

/* --- Links / Interactive Elements --- */
a {
    color: var(--signal-white);
    text-decoration: none;
    transition: color 0.3s ease, box-shadow 0.4s ease;
    position: relative;
}

a:hover {
    color: var(--phosphor-cyan);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.2);
}

/* Pulse Attention Animation */
@keyframes pulseAttention {
    0%, 100% {
        box-shadow: 0 0 0px rgba(0, 212, 255, 0);
    }
    50% {
        box-shadow: 0 0 8px rgba(0, 212, 255, 0.2);
    }
}

/* --- Signal Fade / Footer --- */
#signal-fade {
    position: relative;
    height: 30vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        to bottom,
        var(--void-black) 0%,
        #000000 100%
    );
}

#terminal-cursor {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 2rem;
    color: var(--amber-pulse);
    animation: cursorBlink 0.833s step-end infinite;
    text-shadow: 0 0 15px rgba(255, 140, 33, 0.5);
}

@keyframes cursorBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .content-section {
        width: 85%;
    }

    .content-section.drift-left,
    .content-section.drift-right {
        margin-left: auto;
        margin-right: auto;
    }

    .breathing-zone {
        height: 25vh;
    }

    #hero-title {
        letter-spacing: 0.15em;
        margin-right: -0.15em;
    }

    .content-block h2 {
        letter-spacing: 0.15em;
        margin-right: -0.15em;
    }

    .content-block {
        padding: clamp(1.5rem, 3vw, 2.5rem);
    }
}

@media (max-width: 480px) {
    .content-section {
        width: 92%;
    }

    .breathing-zone {
        height: 20vh;
    }
}
