/* =============================================================================
   heisei.day - Complete Design System
   Digital Time Capsule for the Heisei Era (1989-2019)
   ============================================================================= */

/* ============================================================================
   VARIABLES & COLOR PALETTE
   ============================================================================ */

:root {
    /* Dark Neon Palette */
    --void-black: #0D0221;
    --signal-dark: #150535;
    --neon-magenta: #FF2E97;
    --cyber-cyan: #00F0FF;
    --matrix-green: #39FF14;
    --phosphor-white: #E8E0F0;
    --ghost-gray: #8B7FA8;
    --glitch-red: #FF0844;

    /* Typography */
    --font-body: 'Nunito', sans-serif;
    --font-display: 'Varela Round', sans-serif;
    --font-mono: 'Space Mono', monospace;

    /* Spacing & Sizing */
    --nav-height: 48px;
    --section-height: 100vh;
    --interference-height: 20vh;
}

/* ============================================================================
   GLOBAL STYLES
   ============================================================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--phosphor-white);
    background: linear-gradient(135deg, var(--void-black), var(--signal-dark));
    overflow-x: hidden;
    position: relative;
}

/* Scan line overlay - global effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.08) 2px,
        rgba(0, 0, 0, 0.08) 3px
    );
    pointer-events: none;
    z-index: 9998;
}

/* ============================================================================
   NAVIGATION BAR
   ============================================================================ */

.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(13, 2, 33, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    border-bottom: 1px solid var(--neon-magenta);
    border-bottom-color: rgba(255, 46, 151, 0.3);
}

.nav-container {
    display: flex;
    gap: 40px;
    align-items: center;
    height: 100%;
    padding: 0 40px;
    max-width: 1440px;
    margin: 0 auto;
}

.nav-label {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--phosphor-white);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.nav-label:hover,
.nav-label.active {
    color: var(--neon-magenta);
    text-shadow: 0 0 8px var(--neon-magenta), 0 0 20px rgba(255, 46, 151, 0.3);
}

/* ============================================================================
   SECTIONS & PARALLAX
   ============================================================================ */

.section {
    position: relative;
    height: var(--section-height);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: var(--nav-height);
}

.section-content {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0 40px;
}

.plane {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 5;
}

.plane[data-plane="0"] {
    background: linear-gradient(135deg, var(--void-black), var(--signal-dark));
}

.plane[data-plane="1"] {
    opacity: 0.15;
}

/* ============================================================================
   SECTION 01: SIGNAL ACQUIRED
   ============================================================================ */

.signal-void {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.signal-title {
    width: 300px;
    height: 150px;
    filter: drop-shadow(0 0 20px rgba(255, 46, 151, 0.3));
}

.signal-title text {
    font-family: var(--font-display);
    font-size: 120px;
    font-weight: 400;
    fill: none;
    stroke: var(--neon-magenta);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    letter-spacing: -0.02em;
}

.kanji-stroke {
    animation: strokeDraw 0.6s ease-out forwards;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

.kanji-stroke[data-char="1"] {
    animation-delay: 0s;
}

.kanji-stroke[data-char="2"] {
    animation-delay: 0.6s;
}

.kanji-stroke[data-char="3"] {
    animation-delay: 0s;
}

.kanji-stroke[data-char="4"] {
    animation-delay: 0.4s;
}

.kanji-stroke[data-char="5"] {
    animation-delay: 0.8s;
}

.kanji-stroke[data-char="6"] {
    animation-delay: 1.2s;
}

@keyframes strokeDraw {
    to {
        stroke-dashoffset: 0;
    }
}

.signal-subtitle {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 400;
    color: var(--cyber-cyan);
    letter-spacing: 1px;
    text-shadow: 0 0 8px var(--cyber-cyan), 0 0 20px rgba(0, 240, 255, 0.3);
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
    animation-delay: 1.5s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* ============================================================================
   SECTION 02: DECODE TRANSMISSION
   ============================================================================ */

.section-title {
    font-family: var(--font-display);
    font-size: 96px;
    font-weight: 400;
    color: var(--cyber-cyan);
    letter-spacing: -0.02em;
    margin-bottom: 60px;
    text-shadow: 0 0 12px var(--cyber-cyan), 0 0 30px rgba(0, 240, 255, 0.4);
}

.glitch-text {
    position: relative;
}

.diagram-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 40px;
    width: 100%;
    max-width: 1000px;
    margin-top: 40px;
}

.diagram-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.diagram-card:hover {
    transform: scale(1.05);
}

.diagram {
    width: 100%;
    height: auto;
    max-width: 200px;
    filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.5));
}

.diagram-card[data-device="walkman"] .diagram {
    filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.5));
}

.diagram-card[data-device="gameboy"] .diagram {
    filter: drop-shadow(0 0 10px rgba(255, 46, 151, 0.5));
}

.diagram-card[data-device="minidisc"] .diagram {
    filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.5));
}

.diagram-card[data-device="flipphone"] .diagram {
    filter: drop-shadow(0 0 10px rgba(255, 46, 151, 0.5));
}

.blueprint-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 400;
    color: var(--phosphor-white);
    letter-spacing: 1px;
    opacity: 0.8;
    margin-top: 10px;
}

/* ============================================================================
   SECTION 03: ARCHIVE RECONSTRUCTED
   ============================================================================ */

.timeline-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--matrix-green);
    transform: translateX(-50%);
    box-shadow: 0 0 15px var(--matrix-green), 0 0 30px rgba(57, 255, 20, 0.5);
}

.timeline-node {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    cursor: pointer;
}

.timeline-node[data-year="1989"] {
    top: 10%;
}

.timeline-node[data-year="1995"] {
    top: 25%;
}

.timeline-node[data-year="2000"] {
    top: 40%;
}

.timeline-node[data-year="2008"] {
    top: 55%;
}

.timeline-node[data-year="2012"] {
    top: 70%;
}

.timeline-node[data-year="2019"] {
    top: 85%;
}

.year-label {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    color: var(--matrix-green);
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--matrix-green);
}

.timeline-vignette {
    width: 80px;
    height: 80px;
    transition: all 0.4s ease;
}

.timeline-node:hover .timeline-vignette {
    transform: scale(1.2);
    filter: drop-shadow(0 0 15px currentColor);
}

.vignette-text {
    font-family: var(--font-display);
    font-size: 48px;
    fill: var(--neon-magenta);
    text-anchor: middle;
}

/* ============================================================================
   SECTION 04: SIGNAL LOST
   ============================================================================ */

.signal-lost {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.signal-lost-title {
    width: 500px;
    height: 180px;
    filter: drop-shadow(0 0 20px rgba(255, 46, 151, 0.5));
}

.signal-lost-title text {
    font-family: var(--font-display);
    font-size: 96px;
    font-weight: 400;
    fill: none;
    stroke: var(--neon-magenta);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    letter-spacing: -0.02em;
}

.signal-lost-title text[data-char="3"],
.signal-lost-title text[data-char="4"],
.signal-lost-title text[data-char="5"],
.signal-lost-title text[data-char="6"] {
    animation: rgbSplit 3s ease-in-out forwards;
}

.signal-lost-title text[data-char="3"] {
    animation-delay: 0s;
}

.signal-lost-title text[data-char="4"] {
    animation-delay: 0.2s;
}

.signal-lost-title text[data-char="5"] {
    animation-delay: 0.4s;
}

.signal-lost-title text[data-char="6"] {
    animation-delay: 0.6s;
}

@keyframes rgbSplit {
    0% {
        transform: translate(0, 0);
        opacity: 1;
    }
    50% {
        transform: translate(var(--translate-offset, 0), 0);
        opacity: 1;
    }
    100% {
        transform: translate(var(--translate-offset, 0), 0);
        opacity: 0.3;
    }
}

.signal-lost-subtitle {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 400;
    color: var(--cyber-cyan);
    letter-spacing: 2px;
    text-shadow: 0 0 8px var(--cyber-cyan), 0 0 20px rgba(0, 240, 255, 0.3);
}

/* ============================================================================
   CANVAS OVERLAY
   ============================================================================ */

#ripple-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 1024px) {
    .nav-container {
        gap: 20px;
        padding: 0 20px;
    }

    .nav-label {
        font-size: 11px;
        letter-spacing: 1px;
    }

    .section-title {
        font-size: 72px;
    }

    .signal-title {
        width: 250px;
        height: 120px;
    }

    .signal-title text {
        font-size: 100px;
    }

    .diagram-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 768px) {
    :root {
        --nav-height: 40px;
    }

    .nav-container {
        gap: 15px;
        padding: 0 15px;
    }

    .nav-label {
        font-size: 10px;
        letter-spacing: 0.5px;
    }

    .section {
        margin-top: var(--nav-height);
    }

    .section-content {
        padding: 0 20px;
    }

    .section-title {
        font-size: 48px;
        margin-bottom: 40px;
    }

    .signal-title {
        width: 200px;
        height: 100px;
    }

    .signal-title text {
        font-size: 80px;
    }

    .signal-subtitle {
        font-size: 12px;
    }

    .diagram-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .diagram {
        max-width: 150px;
    }

    .timeline-node {
        gap: 10px;
    }

    .year-label {
        font-size: 14px;
    }

    .timeline-vignette {
        width: 60px;
        height: 60px;
    }

    .signal-lost-title {
        width: 100%;
        height: auto;
        max-width: 400px;
    }

    .signal-lost-title text {
        font-size: 60px;
    }

    .signal-lost-subtitle {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    :root {
        --nav-height: 36px;
    }

    .nav-container {
        gap: 10px;
        padding: 0 10px;
    }

    .nav-label {
        font-size: 9px;
        letter-spacing: 0.25px;
    }

    .section-content {
        padding: 0 15px;
    }

    .section-title {
        font-size: 36px;
        margin-bottom: 30px;
    }

    .signal-title {
        width: 150px;
        height: 80px;
    }

    .signal-title text {
        font-size: 60px;
    }

    .diagram-grid {
        gap: 15px;
    }

    .diagram {
        max-width: 120px;
    }

    .blueprint-label {
        font-size: 9px;
    }

    .timeline-line {
        width: 1px;
    }

    .year-label {
        font-size: 12px;
    }

    .timeline-vignette {
        width: 50px;
        height: 50px;
    }

    .signal-lost-title {
        max-width: 300px;
    }

    .signal-lost-title text {
        font-size: 48px;
    }

    .signal-lost-subtitle {
        font-size: 11px;
        letter-spacing: 1px;
    }
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes glitch {
    0%, 100% {
        text-shadow: 0 0 0 var(--phosphor-white);
    }
    50% {
        text-shadow:
            3px 0 0 var(--glitch-red),
            -3px 0 0 var(--cyber-cyan);
    }
}

@keyframes scan-line-pulse {
    0%, 100% {
        opacity: 0.08;
    }
    50% {
        opacity: 0.15;
    }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.glow-effect {
    text-shadow: 0 0 8px currentColor, 0 0 20px rgba(255, 46, 151, 0.3);
}

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