/* ============================================
   prototype.st - Generative Botanical Design
   ============================================ */

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

:root {
    --deep-teal: #1A6B5A;
    --warm-coral: #D9654C;
    --canvas-cream: #FAF5EE;
    --branch-brown: #5C4A3A;
    --leaf-emerald: #3D8B6E;
    --petal-peach: #F2C9B8;
    --soil-dark: #2C2118;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.75;
    color: var(--branch-brown);
    background-color: var(--canvas-cream);
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--soil-dark);
}

h2 {
    font-size: clamp(28px, 4.5vw, 56px);
}

h3 {
    font-family: 'Zilla Slab', serif;
    font-weight: 400;
    font-size: clamp(20px, 2.5vw, 28px);
}

/* --- Genesis Canvas (Hero) --- */
#genesis-canvas {
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: var(--canvas-cream);
    overflow: hidden;
}

#tree-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#genesis-wordmark {
    position: absolute;
    top: 35%;
    left: 12%;
    z-index: 10;
    pointer-events: none;
}

.wordmark {
    font-family: 'Zilla Slab', serif;
    font-size: clamp(40px, 7vw, 90px);
    font-weight: 700;
    color: var(--soil-dark);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.wordmark .dot {
    color: var(--warm-coral);
}

.tagline {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    font-weight: 400;
    color: var(--deep-teal);
    margin-top: 12px;
    letter-spacing: 0.05em;
    opacity: 0;
    animation: fadeInTagline 1s ease 3.5s forwards;
}

@keyframes fadeInTagline {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Wave Dividers --- */
.wave-divider {
    width: 100%;
    height: 80px;
    overflow: hidden;
    position: relative;
}

.wave-divider svg {
    width: 100%;
    height: 100%;
    display: block;
}

.wave-fill {
    fill: var(--leaf-emerald);
    opacity: 0.05;
}

.wave-stroke {
    stroke: var(--deep-teal);
    stroke-width: 1;
}

#wave-1 {
    background-color: var(--canvas-cream);
}

#wave-2 {
    background-color: var(--canvas-cream);
}

#wave-3 {
    background-color: var(--canvas-cream);
}

/* --- Broken Grid Section --- */
#broken-grid-section {
    padding: 80px 5% 100px;
    background-color: var(--canvas-cream);
    overflow: visible;
}

.broken-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(5, auto);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.grid-block {
    padding: 40px 36px;
    border-radius: 4px;
    transform: rotate(var(--rot, 0deg));
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    position: relative;
}

.grid-block:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 0 12px 40px rgba(44, 33, 24, 0.12);
    z-index: 10;
}

.grid-block h2 {
    font-size: clamp(22px, 3vw, 32px);
    margin-bottom: 16px;
}

.grid-block p {
    line-height: 1.75;
}

.block-warm {
    background-color: var(--petal-peach);
    color: var(--soil-dark);
}

.block-warm h2 {
    color: var(--warm-coral);
}

.block-cool {
    background-color: rgba(26, 107, 90, 0.08);
    color: var(--soil-dark);
    border: 1px solid rgba(26, 107, 90, 0.15);
}

.block-cool h2 {
    color: var(--deep-teal);
}

/* --- Specimens Section --- */
#specimens-section {
    padding: 80px 5% 100px;
    background-color: var(--canvas-cream);
}

.section-heading {
    text-align: center;
    margin-bottom: 60px;
    color: var(--soil-dark);
    font-size: clamp(28px, 4.5vw, 56px);
}

.specimens-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
}

.card-wrapper {
    perspective: 1000px;
    transform: rotate(var(--rot, 0deg));
    transition: transform 0.3s ease;
}

.card-wrapper:hover {
    transform: rotate(0deg);
}

.card {
    position: relative;
    width: 100%;
    padding-top: 130%;
    transition: transform 0.5s ease;
    transform-style: preserve-3d;
}

.card-wrapper:hover .card {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 6px;
    overflow: hidden;
}

.card-front {
    background-color: var(--canvas-cream);
    border: 1px solid rgba(92, 74, 58, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.specimen-canvas {
    width: 80%;
    height: 70%;
    display: block;
}

.specimen-label {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    font-weight: 400;
    color: var(--branch-brown);
    margin-top: 12px;
    letter-spacing: 0.05em;
}

.card-back {
    background-color: var(--soil-dark);
    color: var(--canvas-cream);
    transform: rotateY(180deg);
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-back h3 {
    color: var(--petal-peach);
    margin-bottom: 20px;
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: 22px;
}

.spec-detail {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    font-weight: 400;
    line-height: 2;
    color: var(--canvas-cream);
    opacity: 0.85;
}

.spec-key {
    color: var(--leaf-emerald);
    font-family: 'Fira Code', monospace;
    font-weight: 400;
}

/* --- Botanical Section --- */
#botanical-section {
    padding: 80px 5% 100px;
    background-color: var(--canvas-cream);
}

.botanical-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    max-width: 1100px;
    margin: 0 auto;
    align-items: center;
}

.botanical-text h2 {
    margin-bottom: 24px;
    color: var(--soil-dark);
    font-size: clamp(28px, 4vw, 48px);
}

.botanical-text p {
    margin-bottom: 20px;
    color: var(--branch-brown);
}

.code-snippet {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    font-weight: 400;
    color: var(--deep-teal);
    background-color: rgba(26, 107, 90, 0.06);
    padding: 20px 24px;
    border-radius: 4px;
    border-left: 3px solid var(--deep-teal);
    line-height: 2.2;
}

.botanical-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
}

#botanical-detail-svg {
    width: 100%;
    max-width: 400px;
    height: auto;
}

/* --- Footer --- */
#site-footer {
    background-color: var(--soil-dark);
    padding: 40px 5%;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
}

.footer-wordmark {
    font-family: 'Zilla Slab', serif;
    font-weight: 700;
    font-size: 20px;
    color: var(--canvas-cream);
    letter-spacing: -0.01em;
}

.footer-wordmark .dot {
    color: var(--warm-coral);
}

.footer-note {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    font-weight: 400;
    color: var(--branch-brown);
    letter-spacing: 0.03em;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .broken-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .grid-block {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
    }

    .specimens-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .botanical-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 600px) {
    .specimens-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        max-width: 320px;
    }

    .card {
        padding-top: 140%;
    }

    #genesis-wordmark {
        left: 8%;
        top: 30%;
    }
}
