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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    color: #1c1c22;
    background: #1c1c22;
    overflow-x: hidden;
}

/* === Typography === */
h1, h2, .log-title, .arrival-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-style: italic;
    letter-spacing: 0.02em;
    line-height: 1.15;
}

.log-date, .site-caption, .greenhouse-label, .arrival-date {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 1.2vw, 0.82rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* === Scene: Departure === */
.scene-departure {
    height: 100vh;
    background: #1c1c22;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Gingham curtains */
.curtain {
    position: absolute;
    top: 0;
    width: 20%;
    height: 100%;
    background: repeating-linear-gradient(0deg, transparent, transparent 12px, #e8e0d0 12px, #e8e0d0 13px),
                repeating-linear-gradient(90deg, transparent, transparent 12px, #e8e0d0 12px, #e8e0d0 13px);
    opacity: 0.35;
    z-index: 2;
}

.curtain-left {
    left: 5%;
    animation: curtainSway 6s ease-in-out infinite;
}

.curtain-right {
    right: 5%;
    animation: curtainSway 6s ease-in-out infinite 3s;
}

@keyframes curtainSway {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

/* Porthole */
.porthole-frame {
    width: 320px;
    height: 380px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #c48b5c, #d4d4d8, #c48b5c, #d4d4d8, #c48b5c);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 3;
    box-shadow: 0 0 60px rgba(196, 139, 92, 0.2), inset 0 0 20px rgba(0,0,0,0.3);
}

.porthole {
    width: 88%;
    height: 88%;
    border-radius: 50%;
    background: linear-gradient(180deg, #1c1c22 0%, #2a2a3a 40%, #9b8bb4 80%, #c48b5c 100%);
    position: relative;
    overflow: hidden;
}

.aurora-band {
    position: absolute;
    width: 150%;
    height: 30px;
    border-radius: 50%;
    opacity: 0.1;
    background: #9b8bb4;
    animation: auroraFloat 8s ease-in-out infinite;
}

.aurora-band-1 { top: 30%; left: -25%; animation-delay: 0s; }
.aurora-band-2 { top: 50%; left: -30%; animation-delay: 2.5s; }
.aurora-band-3 { top: 70%; left: -20%; animation-delay: 5s; }

@keyframes auroraFloat {
    0%, 100% { transform: translateX(0) rotate(-5deg); }
    50% { transform: translateX(30px) rotate(5deg); }
}

/* Steam */
.steam-container {
    position: absolute;
    bottom: 25%;
    left: 55%;
    width: 60px;
    height: 100px;
    z-index: 4;
    opacity: 0.4;
}

.steam-svg {
    width: 100%;
    height: 100%;
}

.steam-path {
    fill: none;
    stroke: #d4d4d8;
    stroke-width: 1.5;
    stroke-linecap: round;
    animation: steamRise 4s ease-in-out infinite;
}

.steam-2 { animation-delay: 1.3s; }
.steam-3 { animation-delay: 2.6s; }

@keyframes steamRise {
    0% { opacity: 0; transform: translateY(10px); }
    30% { opacity: 0.6; }
    100% { opacity: 0; transform: translateY(-20px); }
}

/* Hero text */
.hero-text {
    position: relative;
    z-index: 5;
    text-align: center;
    margin-top: 2rem;
    animation: fadeSlideUp 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.2s both;
}

.site-title {
    font-size: clamp(2.2rem, 6vw, 4.8rem);
    color: #faf5ee;
    text-shadow: 0 2px 20px rgba(155, 139, 180, 0.3);
}

.site-caption {
    color: #a0a0a8;
    margin-top: 0.8rem;
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Star clusters */
.star-cluster {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #d4d4d8;
    border-radius: 50%;
    box-shadow:
        8px 5px 0 1px #d4d4d8,
        -3px 12px 0 0px #d4d4d8,
        15px -4px 0 0.5px #d4d4d8,
        -8px -6px 0 1.5px #d4d4d8;
}

.cluster-1 { top: 15%; left: 10%; }
.cluster-2 { top: 30%; right: 12%; }
.cluster-3 { bottom: 20%; left: 8%; }
.cluster-4 { top: 20%; right: 15%; }
.cluster-5 { bottom: 30%; left: 12%; }

/* === Scene: Transit === */
.scene-transit {
    background: #faf5ee;
    position: relative;
    padding: clamp(4rem, 10vw, 8rem) 0;
    min-height: 100vh;
}

/* Timeline rail */
.timeline-rail {
    position: absolute;
    left: 15%;
    top: 0;
    width: 4px;
    height: 100%;
    z-index: 1;
}

.timeline-path {
    stroke: #d4d4d8;
    stroke-width: 2;
    fill: none;
    vector-effect: non-scaling-stroke;
}

/* Log entries */
.log-entry {
    position: relative;
    max-width: 820px;
    margin: 0 auto;
    padding: clamp(2rem, 5vw, 4rem) 0;
    display: flex;
    align-items: flex-start;
}

.entry-left {
    justify-content: flex-start;
    padding-left: 20%;
}

.entry-right {
    justify-content: flex-end;
    padding-right: 5%;
    padding-left: 20%;
}

.entry-right .log-card {
    margin-left: auto;
}

/* Timeline nodes */
.timeline-node {
    position: absolute;
    left: 15%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #e8e8ec 0%, #a0a0a8 80%);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    z-index: 3;
}

.ripple-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
}

.ripple {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid #9b8bb4;
    border-radius: 50%;
    animation: ripple 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes ripple {
    from { transform: scale(0.5); opacity: 0.6; }
    to { transform: scale(3); opacity: 0; }
}

/* Log cards */
.log-card {
    max-width: 55%;
    background: #faf5ee;
    border: 1px solid #d4d4d8;
    border-radius: 12px;
    padding: clamp(1.2rem, 3vw, 2rem);
    box-shadow: inset 0 2px 8px rgba(28, 28, 34, 0.04);
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.log-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: repeating-linear-gradient(0deg, transparent, transparent 12px, rgba(232, 224, 208, 0.03) 12px, rgba(232, 224, 208, 0.03) 13px),
                repeating-linear-gradient(90deg, transparent, transparent 12px, rgba(232, 224, 208, 0.03) 12px, rgba(232, 224, 208, 0.03) 13px);
    pointer-events: none;
}

.log-entry.revealed .log-card {
    opacity: 1;
    transform: translateY(0);
}

.log-date {
    color: #6b6b73;
    margin-bottom: 0.5rem;
}

.log-title {
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    color: #1c1c22;
    margin-bottom: 0.8rem;
}

.log-body {
    color: #2a2a3a;
    margin-bottom: 1rem;
}

.entry-curve {
    width: 100%;
    height: 40px;
}

.entry-curve path {
    fill: none;
    stroke: #9b8bb4;
    stroke-width: 1.5;
    stroke-linecap: round;
}

/* Cat silhouette */
.cat-silhouette {
    position: absolute;
    left: 18%;
    top: 45%;
    width: 30px;
    height: 24px;
    background: #1c1c22;
    clip-path: polygon(10% 100%, 15% 50%, 0% 20%, 5% 0%, 20% 15%, 35% 10%, 50% 5%, 65% 10%, 80% 15%, 95% 0%, 100% 20%, 85% 50%, 90% 100%);
    opacity: 0.7;
    animation: catFloat 5s ease-in-out infinite;
    z-index: 2;
}

@keyframes catFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(3deg); }
}

/* Waypoints */
.waypoint {
    position: absolute;
    left: 15%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    z-index: 2;
}

.waypoint-star {
    background: #d4d4d8;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.waypoint-planet {
    background: #9b8bb4;
    border-radius: 50%;
    box-shadow: 3px 0 0 -1px #d4d4d8;
}

.waypoint-comet {
    background: #c48b5c;
    border-radius: 50%;
    width: 6px;
    height: 6px;
    box-shadow: 4px 2px 8px 1px rgba(196, 139, 92, 0.4);
}

/* === Scene: Greenhouse === */
.scene-greenhouse {
    min-height: 100vh;
    background: linear-gradient(180deg, #faf5ee, #e8efe9);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 4rem 2rem;
}

.greenhouse-label {
    color: #6b6b73;
    margin-bottom: 3rem;
    text-align: center;
}

.greenhouse-illustration {
    display: flex;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: flex-end;
    position: relative;
    z-index: 2;
}

.planter {
    width: clamp(80px, 15vw, 140px);
    height: 50px;
    background: #6b6b73;
    border-radius: 4px 4px 8px 8px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1), inset 0 2px 4px rgba(255,255,255,0.1);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    padding-bottom: 5px;
}

.plant {
    width: 12px;
    height: 12px;
    background: #7a9a7e;
    border-radius: 50%;
    position: relative;
    bottom: 40px;
    box-shadow: 0 0 4px rgba(122, 154, 126, 0.4);
}

.plant-1 { width: 14px; height: 14px; bottom: 45px; }
.plant-2 { width: 10px; height: 10px; bottom: 55px; background: #8baa8e; }
.plant-3 { width: 12px; height: 12px; bottom: 48px; }
.plant-4 { width: 16px; height: 16px; bottom: 50px; }
.plant-5 { width: 11px; height: 11px; bottom: 60px; background: #6d8d71; }
.plant-6 { width: 13px; height: 13px; bottom: 44px; }
.plant-7 { width: 10px; height: 10px; bottom: 52px; background: #8baa8e; }
.plant-8 { width: 15px; height: 15px; bottom: 47px; }

.vine-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.vine {
    fill: none;
    stroke: #7a9a7e;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scene-greenhouse.revealed .vine {
    stroke-dashoffset: 0;
}

/* Soil pattern */
.scene-greenhouse::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-conic-gradient(rgba(122, 154, 126, 0.03) 0% 25%, transparent 0% 50%) 0 0 / 20px 20px;
    pointer-events: none;
}

/* === Scene: Arrival === */
.scene-arrival {
    min-height: 100vh;
    background: #1c1c22;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 4rem 2rem;
}

.porthole-frame-large {
    width: min(450px, 70vw);
    height: min(500px, 75vw);
}

.porthole-arrival {
    background: linear-gradient(180deg, #7a9a7e 0%, #c48b5c 50%, #9b8bb4 100%);
}

/* Rain streaks */
.rain-streak {
    position: absolute;
    width: 1.5px;
    height: 40px;
    background: linear-gradient(180deg, transparent, rgba(255,255,255,0.5), transparent);
    transform: rotate(10deg);
    animation: rainFall 2s linear infinite;
}

.rain-1 { left: 15%; top: -40px; animation-delay: 0s; }
.rain-2 { left: 30%; top: -40px; animation-delay: 0.3s; }
.rain-3 { left: 50%; top: -40px; animation-delay: 0.7s; }
.rain-4 { left: 70%; top: -40px; animation-delay: 1.1s; }
.rain-5 { left: 85%; top: -40px; animation-delay: 0.5s; }
.rain-6 { left: 25%; top: -40px; animation-delay: 1.5s; }
.rain-7 { left: 60%; top: -40px; animation-delay: 0.9s; }
.rain-8 { left: 40%; top: -40px; animation-delay: 1.8s; }

@keyframes rainFall {
    0% { transform: rotate(10deg) translateY(-40px); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: rotate(10deg) translateY(400px); opacity: 0; }
}

/* Arrival text */
.arrival-text {
    position: relative;
    z-index: 5;
    text-align: center;
    max-width: 600px;
    margin-top: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.arrival-text.revealed {
    opacity: 1;
    transform: translateY(0);
}

.arrival-title {
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    color: #faf5ee;
    margin-bottom: 1rem;
}

.arrival-body {
    color: #a0a0a8;
    margin-bottom: 1.5rem;
}

.arrival-date {
    color: #c48b5c;
}

/* Journey line */
.journey-line {
    position: absolute;
    right: 10%;
    top: 0;
    width: 40px;
    height: 100%;
    z-index: 1;
}

.journey-path {
    fill: none;
    stroke: #9b8bb4;
    stroke-width: 1.5;
    stroke-dasharray: 8 6;
    stroke-linecap: round;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scene-arrival.revealed .journey-path {
    stroke-dashoffset: 0;
}

/* === Dot grid on hero === */
.scene-departure::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, #a0a0a8 0.5px, transparent 0.5px);
    background-size: 24px 24px;
    opacity: 0.08;
    pointer-events: none;
}

/* === Mobile adjustments === */
@media (max-width: 768px) {
    .timeline-rail {
        left: 8%;
    }

    .timeline-node {
        left: 8%;
    }

    .entry-left, .entry-right {
        padding-left: 15%;
        padding-right: 5%;
    }

    .log-card {
        max-width: 85%;
    }

    .entry-right .log-card {
        margin-left: 0;
    }

    .curtain {
        width: 15%;
    }

    .cat-silhouette {
        left: 12%;
    }

    .waypoint {
        left: 8%;
    }

    .porthole-frame {
        width: 250px;
        height: 300px;
    }
}
