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

:root {
    --deep-navy: #0b1e2d;
    --dark-teal: #132f3e;
    --slate: #6a8f9c;
    --mint: #3dd9a0;
    --ice: #d8e4e8;
    --warm: #c9a87c;
    --teal-light: #74b9c2;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--deep-navy);
    color: var(--ice);
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* === Film Grain Overlay === */
.film-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    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)'/%3E%3C/svg%3E");
    background-size: 128px 128px;
}

/* === Letterbox Container === */
.letterbox {
    padding-top: 12vh;
    padding-bottom: 12vh;
}

/* === Scene Structure === */
.scene {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 4rem 2rem;
}

.scene-content {
    max-width: 700px;
    width: 100%;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scene-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Typography === */
.domain-name {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.4rem);
    letter-spacing: 0.25em;
    text-transform: lowercase;
    color: var(--ice);
    margin-bottom: 1.5rem;
}

.tagline {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    letter-spacing: 0.15em;
    color: var(--slate);
    text-transform: lowercase;
}

.section-heading {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.2;
    color: var(--ice);
    margin-bottom: 2rem;
    text-transform: lowercase;
}

.narrative-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    line-height: 1.85;
    color: rgba(216, 228, 232, 0.8);
    max-width: 540px;
    margin: 0 auto;
}

.large-text {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    line-height: 1.5;
    font-weight: 400;
    color: var(--ice);
}

.mono-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    color: var(--slate);
}

/* === Monopole Circle (Hero Motif) === */
.monopole-circle {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    margin: 0 auto 3rem;
    background: radial-gradient(circle at 45% 45%, rgba(61, 217, 160, 0.15) 0%, rgba(116, 185, 194, 0.08) 35%, transparent 65%);
    box-shadow:
        0 0 60px 20px rgba(61, 217, 160, 0.06),
        0 0 120px 60px rgba(116, 185, 194, 0.03),
        inset 0 0 80px 40px rgba(11, 30, 45, 0.8);
    border: 1px solid rgba(116, 185, 194, 0.12);
    animation: monopole-pulse 8s ease-in-out infinite;
    position: relative;
}

.monopole-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--mint);
    transform: translate(-50%, -50%);
    box-shadow: 0 0 12px 4px rgba(61, 217, 160, 0.4);
    animation: center-glow 4s ease-in-out infinite alternate;
}

@keyframes monopole-pulse {
    0%, 100% {
        box-shadow:
            0 0 60px 20px rgba(61, 217, 160, 0.06),
            0 0 120px 60px rgba(116, 185, 194, 0.03),
            inset 0 0 80px 40px rgba(11, 30, 45, 0.8);
    }
    50% {
        box-shadow:
            0 0 80px 30px rgba(61, 217, 160, 0.1),
            0 0 160px 80px rgba(116, 185, 194, 0.05),
            inset 0 0 80px 40px rgba(11, 30, 45, 0.7);
    }
}

@keyframes center-glow {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* === Scan Line === */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(116, 185, 194, 0.15), transparent);
    animation: scan 6s linear infinite;
}

@keyframes scan {
    0% { top: 0; }
    100% { top: 100%; }
}

/* === Coil Visual === */
.coil-visual {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}

.coil-svg {
    width: 100%;
    max-width: 400px;
    height: auto;
}

.coil-path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 2s ease-out;
}

.scene-machine .scene-content.visible .coil-path {
    stroke-dashoffset: 0;
}

/* === Tech Grid === */
.tech-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem 4rem;
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
}

.tech-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.tech-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: lowercase;
    color: var(--slate);
}

.tech-value {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 1rem;
    color: var(--ice);
    letter-spacing: 0.02em;
}

/* === Signal Canvas === */
#signal-canvas {
    width: 100%;
    max-width: 600px;
    height: 120px;
    margin: 0 auto 2rem;
    display: block;
}

/* === End Scene === */
.end-domain {
    margin-bottom: 0.5rem;
}

.end-year {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--slate);
}

/* === Scene-specific backgrounds === */
.scene-hero {
    min-height: 100vh;
}

.scene-absence {
    background: linear-gradient(180deg, var(--deep-navy) 0%, rgba(19, 47, 62, 0.3) 50%, var(--deep-navy) 100%);
}

.scene-philosophy {
    min-height: 80vh;
}

.scene-signal {
    min-height: 80vh;
}

/* === Warm accent for philosophy === */
.scene-philosophy .narrative-text {
    color: var(--warm);
}

/* === Responsive === */
@media (max-width: 600px) {
    .letterbox {
        padding-top: 6vh;
        padding-bottom: 6vh;
    }

    .scene {
        padding: 3rem 1.5rem;
    }

    .monopole-circle {
        width: 200px;
        height: 200px;
    }

    .tech-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}
