/* ==========================================================================
   reiwa.bar - Retro Timeline Jukebox
   Candy-bright retro styling, vertical timeline, confetti particles
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.7;
    background-color: #FFF0F5;
    color: #2A0A1E;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* --- Confetti Particles --- */
#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.confetti-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: confetti-drift 10s linear infinite;
    opacity: 0.7;
}

@keyframes confetti-drift {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* --- Header --- */
.site-header {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 80px 20px 60px;
}

.site-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: #2A0A1E;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    text-transform: lowercase;
}

.site-tagline {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    font-weight: 400;
    color: #8B0040;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* --- Timeline Section --- */
.timeline-section {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* Central Timeline Line */
.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #8B0040;
    transform: translateX(-50%);
}

/* --- Timeline Node --- */
.timeline-node {
    position: relative;
    width: 45%;
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Alternate left and right */
.timeline-node:nth-child(odd) {
    margin-left: 0;
    margin-right: auto;
    text-align: right;
    padding-right: 40px;
}

.timeline-node:nth-child(even) {
    margin-left: auto;
    margin-right: 0;
    text-align: left;
    padding-left: 40px;
}

/* --- Node Dot (on the timeline line) --- */
.node-dot {
    position: absolute;
    top: 20px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #FF1493;
    border: 3px solid #FFF0F5;
    z-index: 3;
    box-shadow: 0 0 0 2px #8B0040;
}

.timeline-node:nth-child(odd) .node-dot {
    right: -9px;
    transform: translateX(50%);
}

.timeline-node:nth-child(even) .node-dot {
    left: -9px;
    transform: translateX(-50%);
}

/* Position dots relative to timeline center */
.timeline-node:nth-child(odd) .node-dot {
    right: -50px;
}

.timeline-node:nth-child(even) .node-dot {
    left: -50px;
}

/* --- Lens Flare at Node Points --- */
.lens-flare {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 20, 147, 0.4) 0%, rgba(0, 191, 255, 0.2) 40%, transparent 70%);
    pointer-events: none;
    animation: lens-pulse 3s ease-in-out infinite;
}

@keyframes lens-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 1;
    }
}

/* --- Node Content Card --- */
.node-content {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    padding: 28px 24px;
    border: 1px solid rgba(139, 0, 64, 0.15);
    box-shadow: 0 4px 20px rgba(42, 10, 30, 0.08);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.node-content:hover {
    box-shadow: 0 8px 30px rgba(255, 20, 147, 0.15);
    border-color: rgba(255, 20, 147, 0.3);
}

/* --- Skeleton Loading Shimmer --- */
.node-content.skeleton-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.node-content.loaded::before {
    opacity: 0;
    pointer-events: none;
}

@keyframes skeleton-shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* --- Node Year Badge --- */
.node-year {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    color: #FFF0F5;
    background-color: #FF1493;
    padding: 3px 12px;
    border-radius: 20px;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

/* Alternate accent colors for variety */
.timeline-node:nth-child(3n+2) .node-year {
    background-color: #00BFFF;
}

.timeline-node:nth-child(3n) .node-year {
    background-color: #32CD32;
}

/* --- Node Heading --- */
.node-heading {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 700;
    color: #2A0A1E;
    margin-bottom: 10px;
    line-height: 1.3;
}

/* --- Node Text --- */
.node-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    color: #2A0A1E;
    line-height: 1.7;
    opacity: 0.85;
}

/* --- Footer --- */
.site-footer {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 60px 20px 40px;
    border-top: 2px solid #8B0040;
    margin-top: 20px;
}

.footer-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    font-weight: 400;
    color: #8B0040;
    letter-spacing: 0.06em;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .timeline-line {
        left: 30px;
    }

    .timeline-node {
        width: calc(100% - 60px);
        margin-left: 60px !important;
        margin-right: 0 !important;
        text-align: left !important;
        padding-left: 20px !important;
        padding-right: 0 !important;
    }

    .timeline-node:nth-child(odd) .node-dot,
    .timeline-node:nth-child(even) .node-dot {
        left: -50px !important;
        right: auto !important;
        transform: translateX(-50%) !important;
    }

    .site-header {
        padding: 50px 20px 40px;
    }
}

@media (max-width: 480px) {
    .node-content {
        padding: 20px 16px;
    }

    .timeline-node {
        margin-bottom: 40px;
    }
}
