/* gabs.ai - Opulent Generative Garden */

:root {
    --loam: #1e1209;
    --umber: #2d1b0e;
    --burnished-copper: #d4a574;
    --ember: #e07a3a;
    --honeycomb: #f2c078;
    --vellum: #f5e6d3;
    --rose-quartz: #e8a4b8;
    --twilight-plum: #6b4c6e;
    --sunset-drift: linear-gradient(135deg, #f2c078, #e07a3a, #6b4c6e);
    --petal-glow: radial-gradient(circle, #e8a4b8 0%, #f2c078 40%, transparent 70%);
    --root-fade: linear-gradient(to bottom, #2d1b0e, #1e1209);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--loam);
    overflow-x: hidden;
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: var(--vellum);
}

/* ===== Section 1: The Atrium Entrance ===== */
.section-atrium {
    position: relative;
    width: 100%;
    height: 100vh;
    background: var(--sunset-drift);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#generative-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

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

.site-title {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: clamp(4rem, 12vw, 9rem);
    letter-spacing: 0.15em;
    color: var(--vellum);
    margin-bottom: 1.5rem;
    position: relative;
}

.site-title .letter {
    display: inline-block;
    position: relative;
    animation: letterReveal 1.2s ease-out forwards;
    opacity: 0;
}

.site-title .letter[data-index="0"] { animation-delay: 0.1s; }
.site-title .letter[data-index="1"] { animation-delay: 0.2s; }
.site-title .letter[data-index="2"] { animation-delay: 0.3s; }
.site-title .letter[data-index="3"] { animation-delay: 0.4s; }
.site-title .letter[data-index="4"] { animation-delay: 0.5s; }
.site-title .letter[data-index="5"] { animation-delay: 0.6s; }
.site-title .letter[data-index="6"] { animation-delay: 0.7s; }

@keyframes letterReveal {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.tagline {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.2rem;
    color: var(--vellum);
    opacity: 0;
    animation: fadeIn 1.5s ease-in 1.2s forwards;
    letter-spacing: 0.03em;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 0.7; }
}

.seed-scroll-hint {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    animation: seedDrift 3s ease-in-out infinite;
    opacity: 0;
    animation: seedDrift 3s ease-in-out infinite, fadeIn 2s ease-in 2s forwards;
}

@keyframes seedDrift {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(12px); }
}

.seed-icon {
    opacity: 0.6;
}

.pollen-container,
.seeds-container,
.petals-container,
.global-seeds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.global-seeds {
    position: fixed;
    z-index: 100;
}

.pollen-particle {
    position: absolute;
    border-radius: 50%;
    background: var(--honeycomb);
    filter: blur(1px);
    will-change: transform;
}

.seed-pod {
    position: absolute;
    will-change: transform;
    opacity: 0.4;
}

.seed-pod svg {
    width: 100%;
    height: 100%;
}

.detached-petal {
    position: absolute;
    will-change: transform;
    opacity: 0.3;
}

/* ===== Section 2: The Specimen Wall ===== */
.section-specimen {
    position: relative;
    background: var(--vellum);
    padding: clamp(2rem, 4vw, 4rem);
    min-height: 100vh;
}

.specimen-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(120px, auto);
    gap: clamp(6px, 1vw, 12px);
    max-width: 1400px;
    margin: 0 auto;
}

.block-1 { grid-column: 1 / 7; grid-row: 1 / 3; }
.block-2 { grid-column: 7 / 10; grid-row: 1 / 2; }
.block-3 { grid-column: 10 / 13; grid-row: 1 / 2; }
.block-4 { grid-column: 7 / 10; grid-row: 2 / 4; }
.block-5 { grid-column: 10 / 13; grid-row: 2 / 3; }
.block-6 { grid-column: 1 / 5; grid-row: 3 / 4; }
.block-7 { grid-column: 5 / 7; grid-row: 3 / 5; }
.block-8 { grid-column: 10 / 13; grid-row: 3 / 5; }
.block-9 { grid-column: 1 / 5; grid-row: 4 / 5; }

.specimen-block {
    position: relative;
    border: 2px solid var(--burnished-copper);
    box-shadow: 0 0 24px rgba(212, 165, 116, 0.15);
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.6s ease;
    min-height: 140px;
}

.specimen-block.visible {
    opacity: 1;
}

.specimen-block.slide-left { transform: translateX(-80px); }
.specimen-block.slide-right { transform: translateX(80px); }
.specimen-block.slide-top { transform: translateY(-80px); }
.specimen-block.slide-bottom { transform: translateY(80px); }

.specimen-block.animate-in {
    transform: translate(0, 0) !important;
    opacity: 1;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
}

.specimen-counter {
    position: absolute;
    top: 8px;
    right: 10px;
    font-family: 'Space Grotesk', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ember);
    z-index: 5;
    font-variant-numeric: tabular-nums;
    opacity: 0;
    transition: opacity 0.4s ease 0.3s;
}

.specimen-block.animate-in .specimen-counter {
    opacity: 1;
}

.block-illustration {
    background: var(--vellum);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

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

.block-text {
    background: var(--vellum);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.specimen-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(0.95rem, 1.4vw, 1.15rem);
    line-height: 1.75;
    color: var(--umber);
    letter-spacing: 0.01em;
}

.specimen-text .word {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.specimen-text .word.visible {
    opacity: 1;
}

.block-color {
    position: relative;
}

.color-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.color-ember { background: var(--ember); }
.color-plum { background: var(--twilight-plum); }

.floating-element {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--honeycomb);
    opacity: 0.4;
}

.float-1 {
    animation: floatInBlock1 8s ease-in-out infinite;
    top: 20%;
    left: 30%;
}

.float-2 {
    animation: floatInBlock2 10s ease-in-out infinite;
    top: 50%;
    left: 50%;
    background: var(--rose-quartz);
}

@keyframes floatInBlock1 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(20px, -15px); }
    50% { transform: translate(-10px, -25px); }
    75% { transform: translate(15px, 10px); }
}

@keyframes floatInBlock2 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-15px, 20px); }
    50% { transform: translate(10px, -10px); }
    75% { transform: translate(-20px, -15px); }
}

.block-counter {
    background: var(--vellum);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.counter-display {
    font-family: 'Jost', sans-serif;
    font-size: 5rem;
    font-weight: 500;
    color: var(--ember);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.counter-label {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--umber);
    margin-top: 0.5rem;
}

/* ===== Section 3: The Root Network ===== */
.section-roots {
    position: relative;
    min-height: 40vh;
    background: var(--root-fade);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 3rem 2rem;
    overflow: hidden;
}

.root-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60%;
    pointer-events: none;
}

.root-text-container {
    position: relative;
    z-index: 2;
    max-width: 42ch;
    text-align: center;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.root-text-container.visible {
    opacity: 1;
}

.root-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem;
    line-height: 1.75;
    color: var(--burnished-copper);
    letter-spacing: 0.01em;
}

/* ===== Section 4: The Counting Garden ===== */
.section-counting {
    background: var(--umber);
    min-height: 30vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
}

.counting-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    max-width: 1000px;
    gap: 2rem;
}

.counting-item {
    position: relative;
    text-align: center;
    flex: 1;
    max-width: 280px;
}

.botanical-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.frame-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2s ease-in-out;
}

.counting-item.visible .frame-path {
    stroke-dashoffset: 0;
}

.counting-content {
    position: relative;
    z-index: 2;
    padding: 1.5rem 1rem;
}

.counting-number {
    display: block;
    font-family: 'Space Grotesk', monospace;
    font-weight: 500;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    color: var(--ember);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.counting-label {
    display: block;
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--vellum);
    margin-top: 0.5rem;
}

/* ===== Section 5: The Seed Vault ===== */
.section-vault {
    background: var(--loam);
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    overflow: hidden;
}

.vault-block {
    position: relative;
    width: 50vw;
    max-width: 600px;
    height: 40vh;
    max-height: 400px;
    animation: levitate 6s ease-in-out infinite alternate;
}

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

.vault-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.vault-border-path {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 2s ease-in-out;
}

.vault-block.visible .vault-border-path {
    stroke-dashoffset: 0;
}

.vault-botanical {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    padding: 1rem;
}

.vault-signature {
    font-family: 'Jost', sans-serif;
    font-weight: 200;
    font-size: 1rem;
    letter-spacing: 0.2em;
    color: var(--burnished-copper);
    opacity: 0.4;
    margin-top: 2rem;
}

/* ===== SVG Drawing Animations ===== */
.botanical-svg path,
.botanical-svg line {
    stroke-dasharray: var(--path-length, 500);
    stroke-dashoffset: var(--path-length, 500);
    transition: stroke-dashoffset 2.5s ease-in-out;
}

.specimen-block.animate-in .botanical-svg path,
.specimen-block.animate-in .botanical-svg line {
    stroke-dashoffset: 0;
}

.vault-block.visible .vault-botanical path,
.vault-block.visible .vault-botanical line {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 5s ease-in-out;
}

/* Root SVG lines */
.root-svg path {
    stroke-dasharray: var(--path-length, 800);
    stroke-dashoffset: var(--path-length, 800);
    transition: stroke-dashoffset 4s ease-in-out;
}

.section-roots.visible .root-svg path {
    stroke-dashoffset: 0;
}

/* ===== Responsive: Tablet ===== */
@media (max-width: 1024px) {
    .specimen-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    .block-1 { grid-column: 1 / 4; grid-row: 1 / 3; }
    .block-2 { grid-column: 4 / 7; grid-row: 1 / 2; }
    .block-3 { grid-column: 4 / 7; grid-row: 2 / 3; }
    .block-4 { grid-column: 1 / 4; grid-row: 3 / 5; }
    .block-5 { grid-column: 4 / 7; grid-row: 3 / 4; }
    .block-6 { grid-column: 4 / 7; grid-row: 4 / 5; }
    .block-7 { grid-column: 1 / 4; grid-row: 5 / 6; }
    .block-8 { grid-column: 4 / 7; grid-row: 5 / 6; }
    .block-9 { grid-column: 1 / 7; grid-row: 6 / 7; }
}

/* ===== Responsive: Mobile ===== */
@media (max-width: 768px) {
    .specimen-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }
    .block-1, .block-2, .block-3, .block-4, .block-5,
    .block-6, .block-7, .block-8, .block-9 {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .specimen-block {
        min-height: 180px;
    }

    .counting-row {
        flex-direction: column;
        gap: 2rem;
    }

    .vault-block {
        width: 85vw;
        height: 50vh;
    }

    .counter-display {
        font-size: 3rem;
    }
}
