/* =========================================
   SUN QUEST — LIFE TIMELINE
========================================= */

:root {
    --bg: #05070b;
    --bg-light: #0b1018;
    --gold: #d6b15e;
    --gold-light: #f0d78a;
    --white: #f5f5f5;
    --muted: #9da3ad;
    --line: rgba(214, 177, 94, 0.35);
    --card: rgba(15, 20, 29, 0.82);
}


/* =========================================
   RESET
========================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--white);
    font-family: "Inter", Arial, sans-serif;
    overflow-x: hidden;
}


/* =========================================
   BACKGROUND
========================================= */

.background-glow {
    position: fixed;
    width: 700px;
    height: 700px;

    top: -300px;
    left: 50%;

    transform: translateX(-50%);

    background: radial-gradient(
        circle,
        rgba(214, 177, 94, 0.08),
        transparent 65%
    );

    pointer-events: none;
    z-index: -2;
}

.road-lines {
    position: fixed;
    inset: 0;

    background-image:
        linear-gradient(
            90deg,
            transparent 49.8%,
            rgba(255,255,255,0.015) 50%,
            transparent 50.2%
        );

    background-size: 160px 160px;

    opacity: 0.4;

    pointer-events: none;
    z-index: -3;
}


/* =========================================
   NAVIGATION
========================================= */

.top-nav {
    position: fixed;

    top: 0;
    left: 0;
    width: 100%;

    padding: 24px 5vw;

    display: flex;
    justify-content: space-between;
    align-items: center;

    background: rgba(5, 7, 11, 0.75);

    backdrop-filter: blur(15px);

    border-bottom: 1px solid rgba(255,255,255,0.05);

    z-index: 1000;
}

.back-home {
    color: var(--white);
    text-decoration: none;

    font-size: 13px;
    letter-spacing: 1px;

    padding: 10px 18px;

    border: 1px solid rgba(214,177,94,0.4);

    transition: 0.3s;
}

.back-home:hover {
    background: var(--gold);
    color: #050505;
}

.nav-logo {
    font-family: "Cinzel", serif;

    font-size: 15px;
    letter-spacing: 3px;

    color: var(--gold);
}

.nav-logo span {
    display: block;

    font-family: "Inter", sans-serif;

    font-size: 7px;
    letter-spacing: 3px;

    text-align: right;

    margin-top: 3px;

    color: var(--muted);
}


/* =========================================
   HERO
========================================= */

.hero {
    min-height: 100vh;

    display: flex;
    flex-direction: column;

    justify-content: center;

    padding: 140px 8vw 80px;

    position: relative;
}

.eyebrow {
    color: var(--gold);

    font-size: 11px;
    letter-spacing: 4px;
    text-transform: uppercase;

    margin-bottom: 25px;
}

.hero h1 {
    font-family: "Cinzel", serif;

    font-size: clamp(55px, 9vw, 125px);

    line-height: 0.95;

    font-weight: 500;

    max-width: 1000px;
}

.hero h1 span,
.timeline-header h2 span,
.ending h2 span {
    color: var(--gold);
}

.hero-description {
    max-width: 600px;

    margin-top: 35px;

    color: var(--muted);

    line-height: 1.8;

    font-size: 16px;
}

.scroll-indicator {
    position: absolute;

    bottom: 50px;
    left: 8vw;

    display: flex;
    align-items: center;
    gap: 18px;

    color: var(--muted);

    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.scroll-line {
    width: 80px;
    height: 1px;

    background: var(--gold);

    animation: pulseLine 2s infinite;
}

@keyframes pulseLine {

    0%,100% {
        opacity: 0.3;
        transform: scaleX(0.5);
        transform-origin: left;
    }

    50% {
        opacity: 1;
        transform: scaleX(1);
    }
}


/* =========================================
   TIMELINE SECTION
========================================= */

.timeline-section {
    padding: 120px 0 180px;
}

.timeline-header {
    max-width: 850px;

    padding: 0 8vw;

    margin-bottom: 100px;
}

.timeline-header h2 {
    font-family: "Cinzel", serif;

    font-size: clamp(40px, 6vw, 80px);

    line-height: 1.05;

    font-weight: 500;
}

.timeline-header > p:last-child {
    max-width: 600px;

    margin-top: 25px;

    color: var(--muted);

    line-height: 1.8;
}


/* =========================================
   HORIZONTAL TIMELINE
========================================= */

.timeline-wrapper {

    position: relative;

    width: 100%;

    /* THIS makes the horizontal scrolling work */
    overflow-x: auto;
    overflow-y: hidden;

    overscroll-behavior-x: contain;

    -webkit-overflow-scrolling: touch;

    scrollbar-width: thin;
    scrollbar-color: var(--gold) transparent;

    cursor: grab;
}

.timeline-wrapper.dragging {

    cursor: grabbing;

    user-select: none;
}

.timeline-wrapper:focus-visible {

    outline: 1px solid var(--gold);

    outline-offset: -1px;
}

.timeline-wrapper::-webkit-scrollbar {
    height: 6px;
}

.timeline-wrapper::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 3px;
}

.timeline-inner {

    position: relative;

    width: max-content;

    min-width: 100%;

    padding: 100px 8vw 180px;

    display: flex;
    align-items: flex-start;

    gap: 80px;
}


/* Timeline line */

.timeline-track {

    position: absolute;

    left: 8vw;
    right: 8vw;

    top: 140px;

    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            var(--gold),
            var(--line),
            var(--gold),
            transparent
        );

    z-index: 0;
}


/* =========================================
   WALKING PERSON
========================================= */

.walker {

    position: absolute;

    top: 108px;
    left: 8vw;

    width: 55px;
    height: 55px;

    display: flex;
    justify-content: center;
    align-items: center;

    z-index: 5;

    transition:
        left 1s cubic-bezier(0.4, 0, 0.2, 1);

    pointer-events: none;
}

.walker-body {
    font-size: 34px;

    filter:
        grayscale(1)
        brightness(1.4);

    animation: walking 0.7s infinite alternate;
}

.walker-shadow {
    position: absolute;

    bottom: 2px;

    width: 32px;
    height: 6px;

    border-radius: 50%;

    background: rgba(0,0,0,0.7);

    filter: blur(3px);
}

@keyframes walking {

    from {
        transform: translateY(0) rotate(-3deg);
    }

    to {
        transform: translateY(-5px) rotate(3deg);
    }
}


/* =========================================
   TIMELINE ITEM
========================================= */

.timeline-item {

    position: relative;

    width: 300px;

    flex: 0 0 300px;

    z-index: 2;
}


/* Dot */

.timeline-dot {

    width: 15px;
    height: 15px;

    position: absolute;

    top: 33px;
    left: 50%;

    transform: translateX(-50%);

    border-radius: 50%;

    background: var(--bg);

    border: 2px solid var(--gold);

    box-shadow:
        0 0 0 5px rgba(214,177,94,0.05),
        0 0 20px rgba(214,177,94,0.2);

    transition: 0.4s;
}

.timeline-item:hover .timeline-dot,
.timeline-item.active .timeline-dot {

    background: var(--gold);

    box-shadow:
        0 0 0 8px rgba(214,177,94,0.08),
        0 0 30px rgba(214,177,94,0.5);
}


/* =========================================
   CARD
========================================= */

.timeline-card {

    margin-top: 80px;

    padding: 28px;

    min-height: 280px;

    background: var(--card);

    border: 1px solid rgba(255,255,255,0.08);

    backdrop-filter: blur(12px);

    position: relative;

    transition:
        transform 0.4s,
        border 0.4s,
        background 0.4s;
}

.timeline-card::before {

    content: "";

    position: absolute;

    top: -1px;
    left: 25px;
    right: 25px;

    height: 1px;

    background: var(--gold);

    opacity: 0.6;
}

.timeline-card:hover {

    transform: translateY(-10px);

    border-color: rgba(214,177,94,0.4);

    background: rgba(20, 25, 34, 0.95);
}

.chapter-number {

    display: block;

    font-family: "Cinzel", serif;

    color: var(--gold);

    font-size: 13px;

    letter-spacing: 3px;

    margin-bottom: 18px;
}

.timeline-card h3 {

    font-family: "Cinzel", serif;

    font-size: 24px;

    font-weight: 500;

    margin-bottom: 10px;
}

.timeline-year {

    color: var(--gold);

    font-size: 10px;

    letter-spacing: 2px;

    text-transform: uppercase;
}

.timeline-card p {

    margin-top: 22px;

    color: var(--muted);

    line-height: 1.7;

    font-size: 14px;
}

.open-story {

    margin-top: 25px;

    padding: 10px 0;

    background: none;

    border: none;

    color: var(--white);

    font-family: "Inter", sans-serif;

    font-size: 11px;

    letter-spacing: 2px;

    cursor: pointer;

    transition: 0.3s;
}

.open-story:hover {

    color: var(--gold);

    transform: translateX(5px);
}


/* =========================================
   FINAL CARD
========================================= */

.final-card {

    border-color: rgba(214,177,94,0.35);

    background:
        linear-gradient(
            145deg,
            rgba(214,177,94,0.08),
            rgba(10,14,20,0.9)
        );
}


/* =========================================
   STORY MODAL
========================================= */

.story-modal {

    position: fixed;

    inset: 0;

    background: rgba(0,0,0,0.88);

    backdrop-filter: blur(12px);

    display: flex;

    justify-content: center;
    align-items: center;

    padding: 30px;

    opacity: 0;

    visibility: hidden;

    transition: 0.4s;

    z-index: 2000;
}

.story-modal.show {

    opacity: 1;

    visibility: visible;
}

.story-window {

    width: min(950px, 100%);

    max-height: 90vh;

    overflow-y: auto;

    background:
        linear-gradient(
            145deg,
            #10151d,
            #070a0f
        );

    border: 1px solid rgba(214,177,94,0.35);

    position: relative;

    transform: translateY(30px);

    transition: 0.4s;
}

.story-modal.show .story-window {

    transform: translateY(0);
}

.story-content {

    padding: 60px;
}

.close-modal {

    position: absolute;

    top: 20px;
    right: 25px;

    width: 40px;
    height: 40px;

    border: 1px solid rgba(255,255,255,0.2);

    background: rgba(0,0,0,0.3);

    color: white;

    font-size: 25px;

    cursor: pointer;

    z-index: 5;

    transition: 0.3s;
}

.close-modal:hover {

    background: var(--gold);

    color: black;
}

.modal-chapter {

    color: var(--gold);

    font-size: 11px;

    letter-spacing: 4px;
}

.modal-year {

    display: block;

    color: var(--muted);

    font-size: 12px;

    margin-top: 10px;
}

.story-content h2 {

    font-family: "Cinzel", serif;

    font-size: clamp(38px, 6vw, 70px);

    font-weight: 500;

    margin-top: 18px;
}

.story-divider {

    width: 80px;

    height: 1px;

    background: var(--gold);

    margin: 30px 0;
}


/* Story text */

.story-text {

    color: #c4c8ce;

    line-height: 1.9;

    font-size: 16px;

    margin-bottom: 20px;
}

.story-text strong {

    color: var(--gold);
}


/* =========================================
   MEDIA
========================================= */

.media-area {

    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 20px;

    margin-top: 45px;
}

.media-placeholder {

    min-height: 220px;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    background:
        linear-gradient(
            135deg,
            #151a22,
            #090c11
        );

    border: 1px dashed rgba(214,177,94,0.35);

    color: var(--gold);

    letter-spacing: 3px;

    font-size: 11px;
}

.media-placeholder small {

    color: var(--muted);

    letter-spacing: 1px;

    margin-top: 10px;
}


/* =========================================
   ENDING
========================================= */

.ending {

    min-height: 100vh;

    display: flex;

    justify-content: center;

    align-items: center;

    text-align: center;

    padding: 120px 30px;

    border-top: 1px solid rgba(255,255,255,0.05);
}

.ending-content {

    max-width: 800px;
}

.ending h2 {

    font-family: "Cinzel", serif;

    font-size: clamp(55px, 9vw, 110px);

    line-height: 0.95;

    font-weight: 500;
}

.ending p {

    max-width: 600px;

    margin: 35px auto 0;

    color: var(--muted);

    line-height: 1.8;
}

.ending-quote {

    font-family: "Cinzel", serif;

    font-size: 18px;

    color: #d7d7d7 !important;

    font-style: italic;
}

.signature {

    margin-top: 55px;

    font-family: "Cinzel", serif;

    font-size: 25px;

    color: var(--gold);
}

.signature span {

    display: block;

    margin-top: 5px;

    font-family: "Inter", sans-serif;

    font-size: 9px;

    letter-spacing: 4px;

    color: var(--muted);
}

.motto {

    margin-top: 50px;

    font-size: 9px;

    letter-spacing: 6px;

    color: var(--gold);
}


/* =========================================
   RESPONSIVE
========================================= */

.timeline-item {
    -webkit-tap-highlight-color: transparent;
}

.top-nav {
    padding-top: max(24px, env(safe-area-inset-top));
}


/* Touch devices: no hover lift, snap cards while swiping */

@media (hover: none) {

    .timeline-card:hover {
        transform: none;
    }

    .timeline-wrapper {
        scroll-snap-type: x proximity;
        cursor: default;
    }

    .timeline-item {
        scroll-snap-align: center;
    }
}


@media (max-width: 900px) {

    .media-area {
        grid-template-columns: 1fr;
    }

    .story-content {
        padding: 40px 25px;
    }
}


@media (max-width: 600px) {

    .top-nav {
        padding: 14px 20px;
        padding-top: max(14px, env(safe-area-inset-top));
    }

    .nav-logo {
        display: none;
    }

    .back-home {
        padding: 12px 18px;
    }


    /* Hero */

    .hero {
        min-height: 100svh;
        padding: 110px 25px 50px;
    }

    .hero h1 {
        font-size: clamp(42px, 14vw, 64px);
    }

    .hero-description {
        font-size: 15px;
        margin-top: 25px;
    }

    .scroll-indicator {
        position: static;
        margin-top: 45px;
    }


    /* Timeline */

    .timeline-section {
        padding: 70px 0 100px;
    }

    .timeline-header {
        padding: 0 25px;
        margin-bottom: 40px;
    }

    .timeline-inner {
        padding: 90px 25px 120px;
        gap: 24px;
    }

    .timeline-track {
        left: 25px;
        right: 25px;
    }

    .timeline-item {
        width: min(280px, 78vw);
        flex-basis: min(280px, 78vw);
    }

    .timeline-card {
        padding: 24px;
        min-height: 260px;
    }

    .open-story {
        padding: 14px 0;
        font-size: 12px;
    }


    /* Story popup: full-width sheet */

    .story-modal {
        padding: 0;
        align-items: flex-end;
    }

    .story-window {
        width: 100%;
        max-height: 92vh;
        max-height: 92dvh;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .story-content {
        padding: 70px 22px 40px;
    }

    .close-modal {
        position: sticky;
        top: 12px;

        float: right;

        margin: 12px 12px -56px 0;

        width: 44px;
        height: 44px;

        background: rgba(0,0,0,0.7);
    }

    .story-text {
        font-size: 15px;
        line-height: 1.8;
    }

    .media-placeholder {
        min-height: 160px;
    }


    /* Ending */

    .ending {
        padding: 90px 25px;
    }

    .ending h2 {
        font-size: clamp(44px, 14vw, 70px);
    }
}
