/* Background :) ✨*/
.bg {
  position: relative;
  height: 100vh;
  height: 100svh;
  width: 100%;
  overflow: hidden;
}

.bg::before {
  content: "";
  position: absolute;
  inset: 0;

  background: 
    linear-gradient(
        to bottom,
        rgba(14, 13, 13, 0.5) 0%, 
        rgba(13, 13, 13, 0.2) 30%,
        rgba(54, 52, 52, 0.4) 80%, 
        rgba(13, 13, 13, 1) 100% 
    ),
    url('imgs/bgOption2.gif') left / cover no-repeat;

  pointer-events: none;
  z-index: 0;
}

.bg > * {
  position: relative;
  z-index: 1;
}

/* Journal Section ;) 🌟*/
/* Journal Banner ^-^ ✨*/
.journal-banner {
    padding: 0 3vw;
    margin-top: -100px;
    margin-bottom: 60px;
}

.journal-banner:hover .desaturate {
    transition: filter 0.8s ease, transform 1.2s ease;
    filter: grayscale(40%) brightness(0.9);
    transform: scale(1.05);
}

.banner-wrapper {
    width: 100%;
    height: clamp(200px, 30vw, 300px);
    overflow: hidden;
    border-radius: 4px;

    margin-top: -32vh;
}

.banner-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Journal Entries :3 🌟*/
.journal-format {
    max-width: 1000px;
    margin: 0 auto 50px;
    padding: 0 3vw;
    position: relative;
    z-index: 1;
}

.journal-entry {
    padding: 10px 0;
}

.journal-entry h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 10px;
}

.journal-entry p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.divider {
    border: 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Timeline Section */
.journal-timeline {
    max-width: 1200px;
    margin: -150px auto 100px; /* move timeline up under title */
    padding: 0 3%; /* reduced side padding for more width */
    position: relative;
    z-index: 1;
}

/* Central timeline line */
/* Base faint line (track) */
.journal-timeline::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: rgba(255,255,255,0.1);
}

/* Progress line (fills as you scroll) */
.timeline-progress {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 2px;
    height: 0;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0.6),
        rgba(255, 230, 150, 0.9)
    );
    box-shadow:
        0 0 6px rgba(255, 230, 150, 0.4),
        0 0 12px rgba(255, 230, 150, 0.3);
    transition: height 0.9s ease-out;
    z-index: 2;

    animation: glowPulse 2s ease-in-out infinite alternate;
}

@keyframes glowPulse {
    from {
        box-shadow:
            0 0 6px rgba(255, 230, 150, 0.3),
            0 0 12px rgba(255, 230, 150, 0.2);
    }
    to {
        box-shadow:
            0 0 10px rgba(255, 230, 150, 0.6),
            0 0 18px rgba(255, 230, 150, 0.4);
    }
}

.timeline-indicator {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    padding: 12px 18px;
    border-radius: 20px;

    font-size: 0.9rem;
    letter-spacing: 2px;
    color: var(--text-secondary);

    z-index: 999;
    pointer-events: none;

    transition: all 0.3s ease;
}

.timeline-indicator span {
    display: block;
    text-align: center;
}

.timeline-date {
    position: absolute;
    top: 0;               /* align to top of timeline item */
    right: 0;             /* align to right edge */
    transform: translateY(-10px);

    font-size: 0.75rem;
    letter-spacing: 2px;

    color: rgba(255, 240, 180, 0.95);

    background: rgba(0, 0, 0, 0.9);
    padding: 6px 14px;
    border-radius: 20px;

    border: 1px solid rgba(255, 230, 150, 0.4);

    box-shadow:
        0 0 8px rgba(255, 230, 150, 0.4),
        0 0 16px rgba(255, 230, 150, 0.2);

    backdrop-filter: blur(10px);

    z-index: 10;
    transition: transform 0.8s ease;
}

.timeline-item:hover .timeline-date {
    color: rgba(255, 230, 150, 0.9);
    transform:translateY(-15px) scale(1.1);
}

/* Timeline Items */
.timeline-item {
    display: flex;
    justify-content: space-between;
    align-items: stretch; /* 🔥 KEY: makes children same height */
    gap: 60px;
    margin-bottom: 140px;
    flex-wrap: wrap;
    position: relative;

    opacity: 0;
    transform: translateY(40px) scale(1); /* include scale */
    transition: 
        opacity 0.95s ease,
        transform 0.9s ease,
        box-shadow 0.4s ease; /* keep hover smooth */
    will-change: transform, opacity;

    z-index: 5;
}

/* Hover animation for entire entry */
.timeline-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
}

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

.timeline-item.fade-out {
    opacity: 0.3;
    transform: translateY(20px) scale(0.98);
}

/* Timeline dot - default subtle pale yellow with glow */
.timeline-item::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 200, 0.3); /* pale yellow */
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 255, 200, 0.4); /* subtle glow */
    z-index: 2;
    transition: all 0.3s ease;
}

/* Hover effect: yellow 8-point star with stronger glow */
.timeline-item:hover::before {
    width: 18px; /* slightly bigger */
    height: 18px;
    transform: translateX(-50%) scale(1.6); /* bigger than before */
    background: rgba(255, 255, 180, 0.95); /* warmer yellow */
    box-shadow: 
        0 0 12px rgba(255, 255, 180, 0.8), 
        0 0 20px rgba(255, 255, 180, 0.5),
        0 0 30px rgba(255, 255, 180, 0.3); /* more glow layers */
    border-radius: 0; /* remove circle */
    clip-path: polygon(
        50% 0%, 
        61% 35%, 
        98% 35%, 
        68% 57%, 
        79% 91%, 
        50% 70%, 
        21% 91%, 
        32% 57%, 
        2% 35%, 
        39% 35%
    ); /* 8-point star */
}

/* Optional: smooth transition for star transformation */
.timeline-item::before,
.timeline-item:hover::before {
    transition: all 0.3s ease;
}

/* Timeline Text Box - vertical centering of subtext */
.timeline-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* 🔥 splits top + center area */

    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    padding: 25px 30px;
    border-radius: 12px;

    max-width: 600px;
    min-width: 400px;
    min-height: 300px;

    flex: 1 1 500px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}

/* Keep title at the top, vertical center only subtext */
.timeline-content h2 {
    margin-bottom: 15px; /* pushes text a bit down from top */
}

.timeline-text {
    display: flex;
    flex-direction: column;
    justify-content: center; /* 🔥 centers text vertically */
    flex: 1; /* fills remaining space */
}

/* Timeline Image Box */
.timeline-image {
    flex: 1 1 450px;
    min-width: 450px; /* keeps landscape proportion */
    max-width: 550px;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease;

    display: flex;
}

.timeline-image img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 12px;
    object-fit: cover;
    transition: transform 0.8s, filter 0.5s ease;
}

.timeline-image img:hover {
    transform: scale(1.05);
    filter: grayscale(40%) brightness(0.95);
}

/* Alternating layout */
.timeline-item:nth-child(odd) {
    flex-direction: row; /* text left, image right */
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse; /* image left, text right */
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .journal-banner {
        margin-top: -100px;
    }

    .timeline-item {
        flex-direction: column;
        align-items: center;
        margin-bottom: 80px;
    }

    .timeline-image, .timeline-content {
        max-width: 90%;
        min-width: unset;
        min-height: unset; /* remove min-height for small screens */
        margin: 15px 0;
    }

    .journal-timeline::before {
        left: 20px; /* line on left for mobile */
    }

    .timeline-item::before {
        left: 20px; /* dot aligned with left line */
    }
}

@media (min-width:480px) and (max-width: 768px) {
    .journal-banner {
        margin-top: -35vh;
    }
}

@media (max-width: 480px) {
    .name-title,
    .about-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    .journal-banner {
        margin-top: -30vh;
    }
}