/* ============================================
   continua.quest - Styles
   Palette: Analogous Green-Gold-Terracotta
   ============================================ */

/* CSS Custom Properties */
:root {
    --deep-thicket: #2d3a28;
    --sage-breath: #7a8c5a;
    --honeyed-straw: #d4a843;
    --terracotta-blush: #c17a52;
    --linen-morning: #f4efe6;
    --evening-brick: #3a2e26;
    --meadow-mist: #e8e2d4;
    --clover-shadow: #b8c49e;
    --dark-surface: #4a3e36;
    --body-dark: #3e4a38;
    --text-on-dark: #dbd4c7;

    --font-display: 'Zilla Slab', serif;
    --font-body: 'Source Serif 4', serif;
    --font-accent: 'Kalam', cursive;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--linen-morning);
    color: var(--deep-thicket);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.7;
    letter-spacing: 0.005em;
    overflow-x: hidden;
}

/* SVG Filters - Hidden */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ============================================
   Navigation Dots
   ============================================ */
.nav-dots {
    position: fixed;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.nav-dot {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--sage-breath);
    opacity: 0.5;
    transition: opacity 300ms ease, transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1), color 300ms ease;
    position: relative;
    display: flex;
    align-items: center;
    padding: 4px;
}

.nav-dot:hover {
    opacity: 0.85;
    transform: scale(1.15);
}

.nav-dot.active {
    opacity: 1;
    color: var(--honeyed-straw);
}

.nav-dot svg {
    display: block;
}

.nav-label {
    position: absolute;
    left: 44px;
    white-space: nowrap;
    font-family: var(--font-accent);
    font-size: 0.85rem;
    color: var(--sage-breath);
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 200ms ease, transform 200ms ease;
    pointer-events: none;
}

.nav-dot:hover .nav-label {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   Continuum Line
   ============================================ */
.continuum-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 500vh;
    z-index: 5;
    pointer-events: none;
    opacity: 0.6;
}

.leaf-branch, .geo-branch {
    opacity: 0;
    transition: opacity 600ms ease;
}

.leaf-branch.visible, .geo-branch.visible {
    opacity: 1;
}

/* ============================================
   Sections - General
   ============================================ */
.perspective-container {
    perspective: 1200px;
}

.section {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.section-content {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
}

/* ============================================
   Typography
   ============================================ */
.heading-display {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.01em;
    line-height: 1.2;
    color: var(--deep-thicket);
}

.subtitle-accent {
    font-family: var(--font-accent);
    font-weight: 400;
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    color: var(--sage-breath);
    margin-top: 0.5rem;
}

.body-prose {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.7;
    letter-spacing: 0.005em;
    color: var(--body-dark);
}

/* Body prose on dark backgrounds */
.section-city .city-content > .body-prose,
.section-city .city-heading + .body-prose {
    color: var(--text-on-dark);
}

/* ============================================
   Content Cards
   ============================================ */
.content-card {
    background-color: var(--meadow-mist);
    padding: 2rem 2.5rem;
    border-radius: 4px;
    position: relative;
    box-shadow: 0 4px 12px rgba(45, 58, 40, 0.08);
    transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 300ms ease;
}

.content-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 4px;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    pointer-events: none;
}

.card-rotate-left {
    transform: rotate(-2deg);
}

.card-rotate-right {
    transform: rotate(2deg);
}

.content-card:hover {
    transform: translateY(-6px) rotate(0deg);
    box-shadow: 0 12px 24px rgba(45, 58, 40, 0.15);
}

/* ============================================
   Section 1: The Meadow
   ============================================ */
.section-meadow {
    background-color: var(--linen-morning);
    display: flex;
    align-items: center;
    min-height: 100vh;
}

.meadow-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 6rem;
    min-height: 100vh;
}

.meadow-text {
    flex: 0 0 45%;
    padding-right: 2rem;
}

.meadow-text .heading-display {
    font-size: clamp(3rem, 7vw, 5.5rem);
    opacity: 0;
    transform: translateY(20px);
    animation: meadow-title-in 1.2s cubic-bezier(0.25, 0.1, 0.25, 1) 0.5s forwards;
}

.meadow-text .subtitle-accent {
    font-size: clamp(1rem, 2vw, 1.3rem);
    opacity: 0;
    transform: translateY(15px);
    animation: meadow-title-in 1s cubic-bezier(0.25, 0.1, 0.25, 1) 1s forwards;
}

@keyframes meadow-title-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.meadow-illustration {
    flex: 0 0 35%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dandelion-svg {
    width: 100%;
    max-width: 300px;
    height: auto;
    opacity: 0;
    animation: fade-in 2s ease 1.5s forwards;
}

@keyframes fade-in {
    to { opacity: 1; }
}

/* Dandelion seed sway animation */
.seed {
    transform-origin: 150px 190px;
    animation: seed-sway var(--seed-duration, 5s) ease-in-out infinite alternate;
}

@keyframes seed-sway {
    0% { transform: rotate(calc(var(--seed-angle) + 0deg)) translateY(0); }
    50% { transform: rotate(calc(var(--seed-angle) + 2deg)) translateY(-1px); }
    100% { transform: rotate(calc(var(--seed-angle) - 2deg)) translateY(1px); }
}

.meadow-grass {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    opacity: 0.5;
    pointer-events: none;
}

.meadow-grass svg {
    width: 100%;
    height: 100%;
}

/* ============================================
   Section 2: The Path
   ============================================ */
.section-path {
    display: flex;
    align-items: center;
    min-height: 100vh;
}

.path-content {
    display: flex;
    align-items: center;
    min-height: 100vh;
    gap: 3rem;
}

.path-left {
    flex: 1;
    background-color: var(--linen-morning);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.path-left .content-card {
    max-width: 480px;
}

.path-left .content-card .heading-display {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    margin-bottom: 1.5rem;
}

.path-left .content-card .body-prose {
    margin-bottom: 1rem;
}

.path-left .content-card .body-prose:last-child {
    margin-bottom: 0;
}

.path-right {
    flex: 1;
    background-color: var(--meadow-mist);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    min-height: 100vh;
}

.path-illustration svg {
    width: 100%;
    max-width: 350px;
    height: auto;
}

/* Slide animations */
[data-animate="slide-left"] {
    opacity: 0;
    transform: translateX(-40px) rotate(-2deg);
    transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1), transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate="slide-left"].animated {
    opacity: 1;
    transform: translateX(0) rotate(-2deg);
}

[data-animate="slide-left"].animated:hover {
    transform: translateY(-6px) rotate(0deg);
}

[data-animate="slide-right"] {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1), transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate="slide-right"].animated {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   Section 3: The Edge
   ============================================ */
.section-edge {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.edge-upper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 55%;
    background-color: var(--linen-morning);
    clip-path: polygon(0 0, 100% 0, 100% 75%, 0 100%);
    z-index: 1;
}

.edge-lower {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65%;
    background-color: var(--evening-brick);
    clip-path: polygon(0 25%, 100% 0, 100% 100%, 0 100%);
    z-index: 1;
}

.edge-diagonal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.edge-diagonal::after {
    content: '';
    position: absolute;
    top: 35%;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--sage-breath), var(--honeyed-straw), var(--terracotta-blush));
    transform: rotate(-8deg) scaleX(1.2);
    opacity: 0.4;
}

.edge-botanical {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80%;
    opacity: 0.6;
}

.edge-urban {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80%;
    opacity: 0.5;
}

.edge-content {
    position: relative;
    z-index: 10;
    min-height: 100vh;
}

/* Annotation cards */
.annotation-card {
    position: absolute;
    top: var(--card-top);
    left: var(--card-left);
    transform: rotate(var(--card-rotate));
    background-color: rgba(232, 226, 212, 0.92);
    padding: 1rem 1.5rem;
    border-radius: 3px;
    box-shadow: 0 4px 12px rgba(45, 58, 40, 0.1);
    max-width: 320px;
    transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 300ms ease;
    cursor: default;
}

.annotation-card p {
    font-family: var(--font-accent);
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    color: var(--deep-thicket);
    line-height: 1.5;
}

.annotation-card:hover {
    transform: rotate(0deg) translateY(-6px);
    box-shadow: 0 12px 24px rgba(45, 58, 40, 0.15);
}

[data-animate="fade"] {
    opacity: 0;
    transform: rotate(var(--card-rotate, 0deg)) translateY(20px);
    transition: opacity 500ms ease, transform 500ms ease;
}

[data-animate="fade"].animated {
    opacity: 1;
    transform: rotate(var(--card-rotate, 0deg)) translateY(0);
}

[data-animate="fade"].animated:hover {
    transform: rotate(0deg) translateY(-6px);
}

/* ============================================
   Section 4: The City Garden
   ============================================ */
.section-city {
    background-color: var(--evening-brick);
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Subtle brick texture */
.section-city::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 20px,
        rgba(74, 62, 54, 0.08) 20px,
        rgba(74, 62, 54, 0.08) 21px
    ),
    repeating-linear-gradient(
        90deg,
        transparent,
        transparent 40px,
        rgba(74, 62, 54, 0.05) 40px,
        rgba(74, 62, 54, 0.05) 41px
    );
    pointer-events: none;
    z-index: 1;
}

.city-depth-container {
    width: 100%;
    min-height: 100vh;
    position: relative;
    transform-style: preserve-3d;
    perspective: 1200px;
}

.city-plane {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 150ms ease-out;
}

.city-bg {
    z-index: 2;
    transform: translateZ(-200px) scale(1.35);
}

.city-mid {
    z-index: 3;
    transform: translateZ(-100px) scale(1.17);
}

.city-fg {
    z-index: 4;
    position: relative;
}

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

.botanical-overlay {
    width: 100%;
    height: 100%;
}

.city-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 3rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.city-heading {
    color: var(--linen-morning);
    margin-bottom: 2.5rem;
    font-size: clamp(2rem, 5vw, 3.5rem);
}

.city-cards {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.city-card {
    border-left: 4px solid var(--terracotta-blush);
    background-color: var(--meadow-mist);
    max-width: 600px;
}

.city-card:nth-child(2) {
    align-self: flex-end;
    transform: rotate(1deg);
}

.city-card:nth-child(2):hover {
    transform: translateY(-6px) rotate(0deg);
}

.city-card .body-prose {
    color: var(--deep-thicket);
}

/* ============================================
   Section 5: The Continuum
   ============================================ */
.section-continuum {
    background-color: var(--linen-morning);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.continuum-content {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
}

.spiral-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.spiral-svg {
    width: min(80vw, 600px);
    height: min(80vh, 600px);
    opacity: 0.5;
}

#spiralPath {
    stroke-dasharray: 3000;
    stroke-dashoffset: 3000;
    transition: stroke-dashoffset 3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

#spiralPath.drawn {
    stroke-dashoffset: 0;
}

.spiral-icon * {
    transition: opacity 400ms ease;
}

.spiral-icon.visible * {
    opacity: 1 !important;
}

.continuum-text {
    position: relative;
    z-index: 10;
    text-align: center;
}

.continuum-heading {
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--deep-thicket);
}

.continuum-subtitle {
    font-size: clamp(1rem, 2vw, 1.4rem);
    margin-top: 0.75rem;
}

/* ============================================
   Continuum Line Draw Animation
   ============================================ */
#mainLine {
    stroke-dasharray: 6000;
    stroke-dashoffset: 6000;
    animation: draw-line 3s cubic-bezier(0.25, 0.1, 0.25, 1) 0.3s forwards;
}

@keyframes draw-line {
    to {
        stroke-dashoffset: 0;
    }
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 900px) {
    .nav-dots {
        left: 0.75rem;
        gap: 1rem;
    }

    .nav-dot svg {
        width: 24px;
        height: 24px;
    }

    .nav-label {
        display: none;
    }

    .meadow-content {
        flex-direction: column;
        justify-content: center;
        padding-left: 3rem;
        padding-right: 2rem;
        text-align: center;
    }

    .meadow-text {
        flex: none;
        padding-right: 0;
        margin-bottom: 2rem;
    }

    .meadow-illustration {
        flex: none;
    }

    .dandelion-svg {
        max-width: 200px;
    }

    .path-content {
        flex-direction: column;
        padding: 2rem;
    }

    .path-left, .path-right {
        min-height: auto;
        padding: 2rem 1rem;
        flex: none;
        width: 100%;
    }

    .annotation-card {
        position: relative;
        top: auto;
        left: auto;
        margin: 1rem auto;
        max-width: 90%;
    }

    .edge-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 2rem;
    }

    .city-content {
        padding: 3rem 2rem;
    }

    .city-card:nth-child(2) {
        align-self: stretch;
    }

    .continuum-line {
        display: none;
    }
}

@media (max-width: 600px) {
    .meadow-content {
        padding-left: 1.5rem;
    }

    .meadow-text .heading-display {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    .city-content {
        padding: 2rem 1.5rem;
    }

    .content-card {
        padding: 1.5rem;
    }
}

/* ============================================
   Scroll-triggered section backgrounds
   ============================================ */
.section-path {
    background: linear-gradient(90deg, var(--linen-morning) 50%, var(--meadow-mist) 50%);
}

@media (max-width: 900px) {
    .section-path {
        background: var(--linen-morning);
    }
}
