/* ============================================
   continu.st - A Botanical Archive
   Palette:
     #FDF8F0 - Vellum White (Surface Float)
     #F5EDE0 - Aged Parchment (Ground Light)
     #E8D5B8 - Foxed Linen (Ground Mid)
     #E8DDD0 - (Body text on dark)
     #3B2F2F - Walnut Shell (Ground Dark)
     #2C1810 - Tobacco Ink (Text Primary)
     #4A3728 - Warm Umber (Text Secondary)
     #8B7355 - Tarnished Gold (Text Muted)
     #C4943A - Gilded Amber (Accent Warm)
     #5A7247 - Pressed Fern (Accent Nature)
     #D4864A - Safflower (Accent Bright)
   Fonts:
     Playfair Display - Headlines
     Nunito Sans - Body
     Josefin Sans - Labels / Accent
   ============================================ */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.65;
    letter-spacing: 0.01em;
    color: #4A3728;
    background-color: #F5EDE0;
    overflow-x: hidden;
}

/* --- Skeleton Loading --- */
.skeleton {
    position: relative;
    color: transparent !important;
    overflow: hidden;
    border-radius: 4px;
}

.skeleton * {
    visibility: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, #E8D5B8 25%, #F5EDE0 50%, #E8D5B8 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.revealed {
    color: inherit !important;
    transition: opacity 400ms ease, transform 400ms ease;
}

.revealed::after {
    display: none;
}

.revealed * {
    visibility: visible;
}

/* --- Section Base --- */
.section {
    width: 100%;
    position: relative;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-hero {
    opacity: 1;
    transform: none;
}

.section-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 96px 48px;
}

.section-label {
    display: block;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8B7355;
    margin-bottom: 48px;
}

/* --- Section 1: Hero --- */
.section-hero {
    height: 100vh;
    min-height: 100vh;
    background-color: #F5EDE0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-petal-arcs {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vmin;
    height: 80vmin;
    pointer-events: none;
    opacity: 1;
}

.petal-arc-bg {
    width: 100%;
    height: 100%;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    animation: hero-drift 8s ease-in-out forwards;
}

@keyframes hero-drift {
    0% { transform: translateY(0); }
    100% { transform: translateY(-20px); }
}

.hero-botanical {
    position: relative;
    width: 200px;
    height: 40vh;
    max-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-leaf {
    position: absolute;
}

.hero-leaf-main {
    width: 80px;
    height: auto;
    transform: scale(0);
    animation: leaf-grow 2s cubic-bezier(0.34, 1.56, 0.64, 1) 500ms forwards,
               leaf-sway 6s ease-in-out 3.5s infinite;
}

.hero-leaf-left {
    width: 55px;
    height: auto;
    left: -10px;
    bottom: 20%;
    transform: scale(0) rotate(-30deg);
    transform-origin: bottom right;
    animation: leaf-branch-left 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 2.5s forwards;
}

.hero-leaf-right {
    width: 55px;
    height: auto;
    right: -10px;
    bottom: 20%;
    transform: scale(0) rotate(30deg);
    transform-origin: bottom left;
    animation: leaf-branch-right 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 2.7s forwards;
}

@keyframes leaf-grow {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

@keyframes leaf-branch-left {
    0% { transform: scale(0) rotate(-30deg); }
    100% { transform: scale(1) rotate(-30deg); }
}

@keyframes leaf-branch-right {
    0% { transform: scale(0) rotate(30deg); }
    100% { transform: scale(1) rotate(30deg); }
}

@keyframes leaf-sway {
    0%, 100% { transform: scale(1) rotate(-2deg); }
    50% { transform: scale(1) rotate(2deg); }
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 72px;
    font-weight: 700;
    color: #2C1810;
    letter-spacing: 0.02em;
    line-height: 1.05;
    opacity: 0;
    animation: fade-in 800ms ease 3.5s forwards;
    order: -1;
    margin-bottom: 24px;
}

.hero-subtitle {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 14px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #8B7355;
    opacity: 0;
    animation: fade-in 800ms ease 3.8s forwards;
    margin-top: 16px;
}

@keyframes fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* --- Botanical CSS Animations --- */
.seed-pod {
    animation: seed-bob 4s ease-in-out infinite;
}

.seed-pod-2 {
    animation-delay: 1.3s;
}

.seed-pod-3 {
    animation-delay: 2.7s;
}

@keyframes seed-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* --- Section 2: Thesis --- */
.section-thesis {
    min-height: 90vh;
    background-color: #E8D5B8;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.thesis-content {
    max-width: 540px;
    padding: 96px 48px;
    position: relative;
    z-index: 1;
}

.thesis-heading {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    font-weight: 700;
    color: #2C1810;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin-bottom: 48px;
}

.thesis-body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.65;
    color: #4A3728;
    margin-bottom: 24px;
    max-width: 38em;
}

.thesis-seeds {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.seed-pod-1 {
    position: absolute;
    width: 60px;
    top: 15%;
    right: 10%;
}

.seed-pod-2 {
    position: absolute;
    width: 50px;
    top: 55%;
    left: 8%;
}

.seed-pod-3 {
    position: absolute;
    width: 40px;
    bottom: 15%;
    right: 15%;
}

/* Spore dots */
.spore-dots {
    position: absolute;
    pointer-events: none;
}

.spore-dots-left {
    left: 3%;
    top: 10%;
    width: 120px;
    height: 300px;
}

.spore-dots-right {
    right: 3%;
    top: 20%;
    width: 120px;
    height: 300px;
}

/* --- Section 3: Gallery --- */
.section-gallery {
    min-height: 120vh;
    background-color: #F5EDE0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.section-gallery .section-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
    padding: 96px 48px;
}

.gallery-frame {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16 / 9;
    background-color: #FDF8F0;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-composition {
    width: 100%;
    height: 100%;
}

.gallery-leaf-border {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    overflow: hidden;
    pointer-events: none;
}

.gallery-leaf-border svg {
    width: 100%;
    height: 100%;
}

/* --- Section 4: Manifesto --- */
.section-manifesto {
    min-height: 100vh;
    background-color: #3B2F2F;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.manifesto-border-top,
.manifesto-border-bottom {
    position: absolute;
    left: 0;
    right: 0;
    height: 60px;
    overflow: hidden;
    pointer-events: none;
}

.manifesto-border-top {
    top: 0;
}

.manifesto-border-bottom {
    bottom: 0;
}

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

.manifesto-content {
    max-width: 700px;
    text-align: center;
    padding: 96px 48px;
}

.manifesto-heading {
    font-family: 'Playfair Display', serif;
    font-size: 56px;
    font-weight: 700;
    color: #F5EDE0;
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin-bottom: 48px;
}

.manifesto-text {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.65;
    color: #E8DDD0;
    margin-bottom: 24px;
    max-width: 38em;
    margin-left: auto;
    margin-right: auto;
}

/* Skeleton on dark background */
.section-manifesto .skeleton::after {
    background: linear-gradient(90deg, #4A3728 25%, #5A4738 50%, #4A3728 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* --- Section 5: Colophon --- */
.section-colophon {
    min-height: 60vh;
    background-color: #3B2F2F;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Subtle divider between manifesto and colophon */
.section-colophon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background-color: #8B7355;
    opacity: 0.2;
}

.colophon-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 96px 48px;
}

.colophon-leaf {
    width: 50px;
    height: auto;
    margin-bottom: 48px;
    animation: colophon-pulse 7s ease-in-out infinite;
}

@keyframes colophon-pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

.colophon-date {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 14px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #8B7355;
    margin-bottom: 24px;
}

.colophon-credit {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.65;
    color: #E8DDD0;
    margin-bottom: 24px;
}

.colophon-exit {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: 20px;
    color: #F5EDE0;
    font-style: italic;
    opacity: 0.7;
}

/* Skeleton on dark colophon */
.section-colophon .skeleton::after {
    background: linear-gradient(90deg, #4A3728 25%, #5A4738 50%, #4A3728 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* --- Compass Navigation --- */
.compass-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.compass-button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid #C4943A;
    background-color: #FDF8F0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 300ms ease, box-shadow 300ms ease;
    position: relative;
    z-index: 2;
}

.compass-button:hover {
    border-color: #D4864A;
    box-shadow: 0 2px 12px rgba(196, 148, 58, 0.2);
}

.compass-star {
    width: 20px;
    height: 20px;
    transition: transform 300ms ease;
}

.compass-button:hover .compass-star {
    transform: rotate(45deg);
}

.compass-menu {
    position: absolute;
    bottom: 60px;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8) translateY(10px);
    transform-origin: bottom right;
    transition: opacity 400ms cubic-bezier(0.34, 1.56, 0.64, 1), transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.compass-menu.open {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateY(0);
}

.compass-link {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8B7355;
    text-decoration: none;
    padding: 6px 14px;
    background-color: #FDF8F0;
    border-radius: 20px;
    border: 1px solid #E8D5B8;
    white-space: nowrap;
    transition: color 200ms ease, border-color 200ms ease, background-color 200ms ease;
}

.compass-link:hover {
    color: #2C1810;
    border-color: #C4943A;
    background-color: #F5EDE0;
}

/* --- Root Tendril Drawing Animation --- */
.root-tendril {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2s ease;
}

.root-tendril.drawn {
    stroke-dashoffset: 0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .section-inner {
        padding: 48px 24px;
    }

    .hero-title {
        font-size: 42px;
    }

    .hero-subtitle {
        font-size: 12px;
    }

    .hero-leaf-main {
        width: 60px;
    }

    .hero-leaf-left,
    .hero-leaf-right {
        width: 40px;
    }

    .thesis-heading {
        font-size: 28px;
    }

    .thesis-content {
        padding: 48px 24px;
    }

    .manifesto-heading {
        font-size: 36px;
    }

    .manifesto-content {
        padding: 48px 24px;
    }

    .gallery-frame {
        max-width: 100%;
    }

    .seed-pod-1 {
        right: 5%;
        width: 40px;
    }

    .seed-pod-2 {
        left: 3%;
        width: 35px;
    }

    .seed-pod-3 {
        right: 5%;
        width: 30px;
    }

    .section-label {
        margin-bottom: 32px;
    }

    .spore-dots-left,
    .spore-dots-right {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 36px;
    }

    .thesis-heading {
        font-size: 24px;
    }

    .manifesto-heading {
        font-size: 28px;
    }

    .manifesto-text,
    .thesis-body {
        font-size: 16px;
    }
}
