/* lunatic.dev — Moonlit watercolor journal */
/* Colors: #2D3748, #3C4F76, #4A5568, #90CDF4, #BEE3F8, #E2E8F0, #EDF2F7, #F7FAFC, #FED7E2 */
/* Fonts: Playfair Display, Source Sans 3, JetBrains Mono, Space Grotesk */

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

body {
    font-family: 'Source Sans 3', sans-serif;
    background-color: #EDF2F7;
    color: #2D3748;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Paper texture */
.paper-texture {
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(ellipse at 30% 20%, rgba(190, 227, 248, 0.15), transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(254, 215, 226, 0.1), transparent 50%),
        radial-gradient(ellipse at 50% 90%, rgba(144, 205, 244, 0.08), transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* Ink drop animation */
.ink-drop {
    position: fixed;
    top: 10%;
    left: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #3C4F76;
    transform: translate(-50%, -50%) scale(0);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
}

.ink-drop.splash {
    animation: ink-splash 1.2s ease-out forwards;
}

@keyframes ink-splash {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    30% { transform: translate(-50%, -50%) scale(2); opacity: 0.8; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
}

/* Timeline */
.timeline-page {
    position: relative;
    z-index: 5;
    max-width: 800px;
    margin: 0 auto;
    padding: 80px 24px 120px;
    opacity: 0;
    transition: opacity 1s ease;
}

.timeline-page.visible {
    opacity: 1;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    width: 20px;
    height: 100%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 1;
}

/* Station */
.station {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 100px;
    min-height: 100px;
}

/* Moon Nodes */
.moon-node {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    z-index: 3;
    flex-shrink: 0;
}

.moon-new {
    background: transparent;
    border: 1.5px solid #90CDF4;
    box-shadow: 0 0 8px rgba(144, 205, 244, 0.3);
}

.moon-crescent {
    background: linear-gradient(90deg, transparent 40%, #BEE3F8 40%);
    border: 1px solid rgba(144, 205, 244, 0.4);
    box-shadow: 0 0 8px rgba(144, 205, 244, 0.2);
}

.moon-quarter {
    background: linear-gradient(90deg, transparent 50%, #BEE3F8 50%);
    border: 1px solid rgba(144, 205, 244, 0.4);
    box-shadow: 0 0 8px rgba(144, 205, 244, 0.2);
}

.moon-gibbous {
    background: linear-gradient(90deg, transparent 25%, #BEE3F8 25%);
    border: 1px solid rgba(144, 205, 244, 0.4);
    box-shadow: 0 0 8px rgba(144, 205, 244, 0.3);
}

.moon-full {
    background: #E2E8F0;
    border: 1px solid rgba(144, 205, 244, 0.5);
    box-shadow: 0 0 15px rgba(144, 205, 244, 0.4);
    animation: moon-breathe 4s ease-in-out infinite;
}

@keyframes moon-breathe {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.02); }
}

.moon-waning {
    background: linear-gradient(90deg, #BEE3F8 60%, transparent 60%);
    border: 1px solid rgba(144, 205, 244, 0.4);
    box-shadow: 0 0 8px rgba(144, 205, 244, 0.2);
}

.moon-last {
    background: linear-gradient(90deg, #BEE3F8 50%, transparent 50%);
    border: 1px solid rgba(144, 205, 244, 0.4);
    box-shadow: 0 0 8px rgba(144, 205, 244, 0.2);
}

/* Station Content */
.station-content {
    width: calc(50% - 30px);
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.station-left {
    margin-right: auto;
    padding-right: 40px;
    text-align: right;
}

.station-right {
    margin-left: auto;
    padding-left: 40px;
    text-align: left;
}

.station-center {
    width: 100%;
    text-align: center;
    padding: 0 60px;
}

/* Typography */
.headline {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3.8rem);
    color: #2D3748;
    letter-spacing: -0.015em;
    text-shadow: 0 0 8px rgba(45, 55, 72, 0.15);
    line-height: 1.1;
}

.subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: #4A5568;
    text-transform: uppercase;
    margin-top: 8px;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    color: #2D3748;
    letter-spacing: -0.01em;
    text-shadow: 0 0 6px rgba(45, 55, 72, 0.1);
    margin-bottom: 14px;
}

.body-text {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    line-height: 1.8;
    color: #4A5568;
    margin-bottom: 12px;
}

.pull-quote {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-style: italic;
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    line-height: 1.6;
    color: #3C4F76;
    padding: 20px 0;
    border-top: 1px solid rgba(144, 205, 244, 0.3);
    border-bottom: 1px solid rgba(144, 205, 244, 0.3);
}

.code-fragment {
    background: rgba(237, 242, 247, 0.8);
    border-left: 2px solid #90CDF4;
    padding: 12px 16px;
    margin-top: 14px;
}

.code-line {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    color: #3C4F76;
    line-height: 1.8;
}

.meta-text {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: 0.65rem;
    color: #90CDF4;
    letter-spacing: 0.04em;
    margin-top: 12px;
}

.closing-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: #4A5568;
    text-transform: uppercase;
}

/* Watercolor bleed accents */
.station:nth-child(3) .station-content::before {
    content: '';
    position: absolute;
    width: 100px;
    height: 60px;
    background: radial-gradient(ellipse, rgba(190, 227, 248, 0.2), transparent 70%);
    top: -20px;
    right: -30px;
    pointer-events: none;
}

.station:nth-child(5) .station-content::before {
    content: '';
    position: absolute;
    width: 120px;
    height: 80px;
    background: radial-gradient(ellipse, rgba(254, 215, 226, 0.15), transparent 70%);
    bottom: -30px;
    left: -40px;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
    .station-content {
        width: 100%;
        padding: 20px 0 0 !important;
        text-align: left !important;
    }

    .station-left {
        margin-right: 0;
    }

    .timeline-line {
        left: 16px;
    }

    .moon-node {
        left: 16px;
    }

    .station-center {
        padding: 20px 0 0 !important;
    }
}
