/* ============================================
   continua.club - Styles
   Cottagecore-Luxury | Gold-on-Black | Timeline-Vertical
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #0A0A0A;
    --bg-secondary: #141210;
    --accent-primary: #C6A34E;
    --accent-secondary: #E8D5A3;
    --text-primary: #D4C9A8;
    --text-secondary: #8B7A50;
    --decorative-amber: #7A5C1F;
    --highlight-gold: #F5E6B8;
    --card-hover-bg: #181614;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Golden Thread (Central Timeline Spine) --- */
#golden-thread {
    position: fixed;
    left: 50%;
    top: 0;
    width: 2px;
    height: 0;
    background: linear-gradient(to bottom, var(--accent-primary) calc(100% - 60px), transparent 100%);
    transform: translateX(-50%);
    z-index: 1;
    pointer-events: none;
}

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

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

.hero-title {
    font-family: 'Fraunces', serif;
    font-weight: 800;
    font-variation-settings: 'opsz' 144;
    font-size: clamp(4rem, 10vw, 8rem);
    color: var(--accent-primary);
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 0.1em;
}

.hero-subtitle {
    font-family: 'Fraunces', serif;
    font-weight: 400;
    font-style: italic;
    font-variation-settings: 'opsz' 72;
    font-size: clamp(1.6rem, 4vw, 3.2rem);
    color: var(--accent-secondary);
    letter-spacing: 0.05em;
}

.hero-dot {
    color: var(--accent-primary);
}

/* --- Lens Flare System --- */
.lens-flare {
    position: absolute;
    clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
    background: radial-gradient(circle, var(--highlight-gold) 0%, transparent 70%);
    mix-blend-mode: screen;
    pointer-events: none;
    animation: breathe 8s ease-in-out infinite;
}

.lens-flare-hero {
    width: 200px;
    height: 200px;
    top: 12%;
    right: 18%;
    opacity: 0.15;
}

.lens-flare-small {
    width: 50px;
    height: 50px;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
}

.lens-flare-small.revealed {
    opacity: 0.15;
}

@keyframes breathe {
    0%, 100% {
        opacity: var(--flare-base-opacity, 0.15);
        transform: scale(0.95);
    }
    50% {
        opacity: var(--flare-peak-opacity, 0.22);
        transform: scale(1.05);
    }
}

/* --- Scroll Arrow --- */
.scroll-arrow {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    animation: pulse-arrow 2s ease-in-out infinite;
    opacity: 0.6;
    transition: opacity 0.8s ease-out;
    z-index: 5;
}

.scroll-arrow.hidden {
    opacity: 0;
    pointer-events: none;
}

@keyframes pulse-arrow {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
        opacity: 0.6;
    }
    50% {
        transform: translateX(-50%) translateY(8px);
        opacity: 0.9;
    }
}

/* --- Timeline Container --- */
#timeline {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10vh 20px 30vh;
    z-index: 2;
}

/* --- Timeline Nodes --- */
.timeline-node {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 60vh;
    opacity: 0;
    transition: none;
}

.timeline-node.revealed {
    opacity: 1;
}

/* Left node: card on the left, medallion at center */
.node-left {
    justify-content: flex-start;
    padding-right: 50%;
}

/* Right node: card on the right, medallion at center */
.node-right {
    justify-content: flex-end;
    padding-left: 50%;
}

/* --- Connector Lines --- */
.connector-line {
    position: absolute;
    top: 30px;
    height: 2px;
    background: var(--accent-primary);
    clip-path: inset(0 100% 0 0);
    transition: none;
}

.node-left .connector-line {
    right: calc(50% - 8px);
    width: 60px;
    clip-path: inset(0 100% 0 0);
}

.node-right .connector-line {
    left: calc(50% - 8px);
    width: 60px;
    clip-path: inset(0 0 0 100%);
}

.timeline-node.revealed .connector-line {
    animation: draw-connector-ltr 400ms ease-out forwards;
}

.node-right.revealed .connector-line {
    animation: draw-connector-rtl 400ms ease-out forwards;
}

@keyframes draw-connector-ltr {
    from { clip-path: inset(0 100% 0 0); }
    to   { clip-path: inset(0 0 0 0); }
}

@keyframes draw-connector-rtl {
    from { clip-path: inset(0 0 0 100%); }
    to   { clip-path: inset(0 0 0 0); }
}

/* --- Medallions --- */
.medallion {
    position: absolute;
    left: 50%;
    top: 22px;
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--accent-primary);
    border-radius: 50%;
    background: transparent;
    transform: translateX(-50%) scale(0);
    z-index: 3;
    transition: background 0.3s ease;
}

.medallion:hover {
    background: radial-gradient(circle, var(--accent-primary), transparent);
}

.timeline-node.revealed .medallion {
    animation: medallion-pop 200ms 100ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes medallion-pop {
    from { transform: translateX(-50%) scale(0); }
    to   { transform: translateX(-50%) scale(1); }
}

/* --- Timeline Cards --- */
.timeline-card {
    width: 45vw;
    max-width: 520px;
    background: var(--bg-secondary);
    border: 1px solid rgba(198, 163, 78, 0.15);
    border-radius: 2px;
    padding: 2.5rem;
    position: relative;
    transform: translateX(0);
    opacity: 0;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.timeline-card:hover {
    border-color: rgba(198, 163, 78, 0.4);
    background-color: var(--card-hover-bg);
}

/* Lace pattern border overlay */
.timeline-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 6px solid transparent;
    border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Ccircle cx='10' cy='10' r='3' fill='none' stroke='%238B7A50' stroke-width='0.5' opacity='0.3'/%3E%3C/svg%3E") 6 round;
    pointer-events: none;
    border-radius: 2px;
}

.node-left .timeline-card {
    transform: translateX(-30px);
}

.node-right .timeline-card {
    transform: translateX(30px);
}

.timeline-node.revealed .timeline-card {
    animation: card-reveal-left 600ms 200ms ease-out forwards;
}

.node-right.revealed .timeline-card {
    animation: card-reveal-right 600ms 200ms ease-out forwards;
}

@keyframes card-reveal-left {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes card-reveal-right {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* --- Card Content --- */
.card-label {
    font-family: 'Cormorant SC', serif;
    font-weight: 500;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    color: var(--text-secondary);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 1rem;
}

.card-heading {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-variation-settings: 'opsz' 72;
    font-size: clamp(2rem, 6vw, 5rem);
    color: var(--accent-primary);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.card-text {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    color: var(--text-primary);
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    max-width: 38ch;
    margin-bottom: 1.5rem;
}

/* --- Botanical Dividers --- */
.botanical-divider {
    width: 200px;
    height: auto;
    margin-top: 0.5rem;
}

.botanical-svg {
    width: 100%;
    height: auto;
    display: block;
}

.botanical-path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
}

.timeline-node.revealed .botanical-path {
    animation: draw-botanical 800ms 400ms linear forwards;
}

@keyframes draw-botanical {
    from { stroke-dashoffset: 300; }
    to   { stroke-dashoffset: 0; }
}

/* --- City Skyline Silhouettes --- */
.city-skyline {
    position: absolute;
    bottom: -60px;
    left: 0;
    right: 0;
    height: 120px;
    z-index: -1;
    opacity: 0.5;
    pointer-events: none;
}

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

/* --- Responsive: Mobile < 768px --- */
@media (max-width: 768px) {
    #golden-thread {
        left: 24px;
        transform: none;
    }

    #timeline {
        padding: 5vh 16px 20vh;
    }

    .timeline-node {
        margin-bottom: 40vh;
    }

    .node-left,
    .node-right {
        justify-content: flex-end;
        padding-left: 48px;
        padding-right: 0;
    }

    .node-left .connector-line,
    .node-right .connector-line {
        left: 24px;
        right: auto;
        width: 24px;
    }

    .node-left .connector-line {
        clip-path: inset(0 0 0 100%);
    }

    .node-left.revealed .connector-line {
        animation: draw-connector-rtl 400ms ease-out forwards;
    }

    .medallion {
        left: 24px;
        transform: translateX(-50%) scale(0);
    }

    .timeline-card {
        width: calc(100vw - 72px);
        max-width: none;
        padding: 1.5rem;
    }

    .node-left .timeline-card,
    .node-right .timeline-card {
        transform: translateX(30px);
    }

    .timeline-node.revealed .timeline-card,
    .node-right.revealed .timeline-card {
        animation: card-reveal-right 600ms 200ms ease-out forwards;
    }

    .card-heading {
        font-size: clamp(1.5rem, 8vw, 2.5rem);
    }

    .hero-title {
        font-size: clamp(3rem, 12vw, 5rem);
    }

    .hero-subtitle {
        font-size: clamp(1.2rem, 5vw, 2rem);
    }

    .lens-flare-hero {
        width: 120px;
        height: 120px;
        top: 8%;
        right: 8%;
    }

    .city-skyline {
        height: 80px;
    }
}

/* --- Utility: No select on decorative elements --- */
.botanical-divider,
.lens-flare,
.city-skyline,
#golden-thread,
.scroll-arrow {
    user-select: none;
}

/* --- Selection Color --- */
::selection {
    background: rgba(198, 163, 78, 0.3);
    color: var(--accent-secondary);
}
