/* ===========================================
   relativity.studio — Watercolor Muted Timeline
   =========================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.85;
    color: #4A4438;
    background-color: #FAF6EE;
    overflow-x: hidden;
}

/* Geometric SVG Overlay */
.geometric-cuts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}

/* ===========================================
   Hero Section
   =========================================== */
#hero {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

.hero-content {
    position: relative;
    text-align: center;
    z-index: 2;
}

.timeline-line-intro {
    position: absolute;
    left: 50%;
    top: -40vh;
    width: 2px;
    height: 0;
    background: #A09888;
    transform: translateX(-50%);
    transition: height 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.timeline-line-intro.active {
    height: 35vh;
}

.hero-title {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: clamp(2.8rem, 6vw, 5rem);
    color: #1A1810;
    letter-spacing: 0.04em;
    line-height: 1.1;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s ease 0.8s, transform 1.2s ease 0.8s;
}

.hero-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-dot {
    color: #8A8070;
}

.hero-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.3vw, 1.15rem);
    color: #8A8070;
    margin-top: 1.2rem;
    letter-spacing: 0.06em;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease 1.6s, transform 1s ease 1.6s;
}

.hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-flare {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse at 50% 30%, rgba(200, 180, 140, 0.08) 0%, transparent 40%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 2s ease 1.2s;
    z-index: -1;
}

.hero-flare.visible {
    opacity: 1;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    opacity: 0;
    transition: opacity 1s ease 2.4s;
}

.scroll-indicator.visible {
    opacity: 1;
}

.scroll-text {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: #A09888;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.scroll-arrow {
    width: 1px;
    height: 28px;
    background: #A09888;
    position: relative;
    animation: scrollPulse 2s ease-in-out infinite;
}

.scroll-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 6px;
    height: 6px;
    border-right: 1px solid #A09888;
    border-bottom: 1px solid #A09888;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(6px); }
}

/* ===========================================
   Timeline Section
   =========================================== */
#timeline {
    position: relative;
    padding: 6rem 2rem 8rem;
    z-index: 1;
}

.timeline-container {
    position: relative;
    max-width: 960px;
    margin: 0 auto;
}

/* Central Timeline Line */
.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 0;
    background: #A09888;
    transform: translateX(-50%);
    transition: height 0.05s linear;
    z-index: 1;
}

/* Timeline Events */
.timeline-event {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 4rem;
    width: 100%;
}

.timeline-event:last-child {
    margin-bottom: 0;
}

/* Timeline Dot */
.timeline-dot {
    position: absolute;
    left: 50%;
    top: 28px;
    width: 10px;
    height: 10px;
    background: #8A8070;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 3;
}

.timeline-event.stage-1 .timeline-dot,
.timeline-event.stage-2 .timeline-dot,
.timeline-event.stage-3 .timeline-dot {
    transform: translate(-50%, -50%) scale(1);
}

/* Timeline Card */
.timeline-card {
    position: relative;
    max-width: 420px;
    background: #FEFAF4;
    border: 1px solid #D8CEB8;
    border-radius: 2px;
    padding: 28px;
    overflow: hidden;
}

/* Left events */
.event-left .timeline-card {
    margin-right: auto;
    margin-left: 0;
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.event-left {
    justify-content: flex-start;
    padding-right: calc(50% + 30px);
}

/* Right events */
.event-right .timeline-card {
    margin-left: auto;
    margin-right: 0;
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.event-right {
    justify-content: flex-end;
    padding-left: calc(50% + 30px);
}

/* Progressive Disclosure Stages */

/* Stage 1: Date appears */
.timeline-event.stage-1 .timeline-card {
    opacity: 1;
    transform: translateX(0);
}

.timeline-event .timeline-date {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.timeline-event.stage-1 .timeline-date {
    opacity: 1;
}

/* Stage 2: Heading appears */
.timeline-event .timeline-heading {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease 0.2s, transform 0.6s ease 0.2s;
}

.timeline-event.stage-2 .timeline-heading {
    opacity: 1;
    transform: translateY(0);
}

/* Stage 3: Body appears */
.timeline-event .timeline-body {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease 0.3s, transform 0.6s ease 0.3s;
}

.timeline-event.stage-3 .timeline-body {
    opacity: 1;
    transform: translateY(0);
}

/* Timeline Date */
.timeline-date {
    display: block;
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.8rem;
    color: #8A8070;
    letter-spacing: 0.1em;
    margin-bottom: 0.6rem;
}

/* Timeline Heading */
.timeline-heading {
    font-family: 'Syne', sans-serif;
    font-weight: 600;
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    color: #1A1810;
    margin-bottom: 0.8rem;
    line-height: 1.2;
}

/* Timeline Body */
.timeline-body {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.85;
    color: #4A4438;
}

/* Lens Flare Effect on Milestone Cards */
.lens-flare {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 200px;
    height: 200px;
    background: radial-gradient(ellipse at 50% 30%, rgba(200, 180, 140, 0.08) 0%, transparent 40%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease 0.6s;
    z-index: 0;
}

.timeline-event.stage-2 .lens-flare.milestone {
    opacity: 1;
}

/* ===========================================
   Closing Section
   =========================================== */
#closing {
    position: relative;
    padding: 0 2rem 6rem;
    z-index: 1;
}

.sharp-angle-divider {
    width: 100%;
    margin-bottom: 4rem;
}

.sharp-angle-divider svg {
    display: block;
    width: 100%;
    height: 120px;
}

.closing-content {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

.closing-heading {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: clamp(2rem, 4vw, 3.2rem);
    color: #1A1810;
    margin-bottom: 1.2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.closing-heading.visible {
    opacity: 1;
    transform: translateY(0);
}

.closing-text {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    line-height: 1.85;
    color: #4A4438;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

.closing-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.closing-date {
    display: block;
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: #A09888;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.8s ease 0.6s;
}

.closing-date.visible {
    opacity: 1;
}

/* ===========================================
   Watercolor Texture Overlay
   =========================================== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(200, 180, 140, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 60%, rgba(160, 152, 136, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 90%, rgba(216, 206, 184, 0.04) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* ===========================================
   Sharp-Angle Decorative Elements
   =========================================== */
#timeline::before {
    content: '';
    position: absolute;
    top: 10%;
    left: -5%;
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(112, 104, 88, 0.04) 0%, transparent 50%);
    clip-path: polygon(0 0, 100% 0, 0 100%);
    pointer-events: none;
    z-index: 0;
}

#timeline::after {
    content: '';
    position: absolute;
    bottom: 15%;
    right: -5%;
    width: 250px;
    height: 250px;
    /* Angle Grey: #706858 at low opacity */
    background: linear-gradient(315deg, #706858 0%, transparent 50%);
    opacity: 0.04;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
    pointer-events: none;
    z-index: 0;
}

/* ===========================================
   Responsive
   =========================================== */
@media (max-width: 768px) {
    .timeline-container {
        max-width: 100%;
    }

    .timeline-line {
        left: 24px;
    }

    .timeline-dot {
        left: 24px;
    }

    .event-left,
    .event-right {
        padding-left: 54px;
        padding-right: 0;
        justify-content: flex-start;
    }

    .event-left .timeline-card,
    .event-right .timeline-card {
        max-width: 100%;
        margin: 0;
    }

    .event-left .timeline-card {
        transform: translateX(-20px);
    }

    .event-right .timeline-card {
        transform: translateX(-20px);
    }

    .event-left.stage-1 .timeline-card,
    .event-right.stage-1 .timeline-card {
        transform: translateX(0);
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 3.5rem);
    }

    .geometric-cuts {
        display: none;
    }
}

@media (max-width: 480px) {
    #timeline {
        padding: 4rem 1rem 6rem;
    }

    .timeline-card {
        padding: 20px;
    }

    .timeline-event {
        margin-bottom: 3rem;
    }
}
