@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* ===== CSS Custom Properties ===== */
:root {
    --deep-plum: #2D1B3D;
    --mauve-accent: #8B6BA8;
    --pale-lavender: #F5E6F5;
    --candy-pink: #FF6B9D;
    --coral-spring: #FF8A65;
    --citrus-yellow: #FFD700;
    --soft-orchid: #E4B5F7;
    --mint-fresh: #A8E6CF;
    --sky-blue: #87CEEB;
    --cream-base: #FFFBF0;
    --deep-sage: #4A6F5E;
    --text-body: #3B2B4D;
}

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

html {
    scroll-behavior: smooth;
}

html, body {
    width: 100%;
    overflow-x: hidden;
}

/* ===== Base Typography ===== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw + 0.25rem, 1.15rem);
    line-height: 1.7;
    color: var(--text-body);
    background-color: var(--cream-base);
}

/* Paper grain overlay on body */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3 {
    font-family: 'Crimson Text', 'Georgia', serif;
}

h1 {
    font-size: clamp(2.4rem, 6.5vw, 5.2rem);
    font-weight: 700;
    color: var(--deep-plum);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

h2 {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    font-weight: 700;
    color: var(--deep-plum);
    letter-spacing: -0.01em;
    line-height: 1.15;
}

h3 {
    font-size: clamp(1.1rem, 2.8vw, 1.8rem);
    font-weight: 400;
    color: var(--deep-plum);
    line-height: 1.3;
}

p {
    margin-bottom: 0.75rem;
}

/* Small/Caption style */
.label-category,
.label-latin,
.closing-attribution {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--mauve-accent);
}

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

/* ===== Pollinator ===== */
.pollinator {
    position: fixed;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    will-change: transform;
}

.pollinator.visible {
    opacity: 1;
}

/* ===== Garden Rooms (Sections) ===== */
.garden-room {
    position: relative;
    min-height: 100vh;
    padding: clamp(3rem, 6vw, 6rem) clamp(1.5rem, 4vw, 4rem);
    overflow: hidden;
}

/* Room number watermarks */
.room-number-watermark {
    position: absolute;
    top: 0.5rem;
    right: 2rem;
    font-family: 'Crimson Text', 'Georgia', serif;
    font-weight: 700;
    font-size: clamp(3.5rem, 10vw, 7.5rem);
    color: var(--pale-lavender);
    opacity: 0.18;
    line-height: 1;
    pointer-events: none;
    z-index: 0;
    user-select: none;
}

.room-header {
    max-width: 700px;
    margin-bottom: clamp(2rem, 4vw, 4rem);
    position: relative;
    z-index: 1;
}

.room-title {
    margin-bottom: 0.75rem;
}

.room-intro {
    color: var(--text-body);
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    max-width: 600px;
}

/* ===== Entrance Garden (Room 1) ===== */
.entrance-garden {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: clamp(4rem, 8vw, 8rem);
}

.specimen-label-frame {
    margin-bottom: clamp(3rem, 5vw, 5rem);
    position: relative;
    z-index: 1;
}

.label-category {
    display: block;
    margin-bottom: 1rem;
}

.site-title {
    font-size: clamp(3rem, 8vw, 6rem);
    margin-bottom: 0.5rem;
}

.label-subtitle {
    font-family: 'Crimson Text', 'Georgia', serif;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--deep-sage);
    margin-bottom: 1.5rem;
}

.label-divider {
    width: 60px;
    height: 2px;
    background: var(--mauve-accent);
    margin: 0 auto 1rem;
}

.label-latin {
    font-style: italic;
}

/* Hero Grid (3 cards at entrance) */
.hero-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1100px;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* ===== Portfolio Grid ===== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Card spanning */
.card-wide {
    grid-column: span 2;
}

.card-tall {
    grid-row: span 2;
}

/* ===== Specimen Cards ===== */
.specimen-card {
    background: var(--cream-base);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: clamp(1.2rem, 2vw, 2rem);
    position: relative;
    overflow: hidden;
    cursor: default;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.35s ease;
    /* Entry animation initial state */
    opacity: 0;
    transform: scale(0.8);
}

.specimen-card.card-visible {
    opacity: 1;
    transform: scale(1) rotate(var(--card-rotation, 0deg));
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.specimen-card:hover {
    transform: translateY(-4px) scale(1) rotate(0deg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.specimen-card:hover .card-illustration .botanical-svg {
    transform: scale(1.02);
}

.specimen-card:hover .tech-tooltip {
    opacity: 1;
    transform: translateY(0);
}

/* Card Accent Backgrounds (candy-bright, watercolor wash) */
.card-accent-pink {
    background: radial-gradient(ellipse at 30% 20%, rgba(255, 107, 157, 0.12) 0%, var(--cream-base) 70%);
}

.card-accent-mint {
    background: radial-gradient(ellipse at 30% 20%, rgba(168, 230, 207, 0.15) 0%, var(--cream-base) 70%);
}

.card-accent-yellow {
    background: radial-gradient(ellipse at 30% 20%, rgba(255, 215, 0, 0.1) 0%, var(--cream-base) 70%);
}

.card-accent-orchid {
    background: radial-gradient(ellipse at 30% 20%, rgba(228, 181, 247, 0.15) 0%, var(--cream-base) 70%);
}

.card-accent-sky {
    background: radial-gradient(ellipse at 30% 20%, rgba(135, 206, 235, 0.12) 0%, var(--cream-base) 70%);
}

.card-accent-coral {
    background: radial-gradient(ellipse at 30% 20%, rgba(255, 138, 101, 0.12) 0%, var(--cream-base) 70%);
}

.card-accent-lavender {
    background: radial-gradient(ellipse at 50% 30%, rgba(245, 230, 245, 0.5) 0%, var(--cream-base) 60%);
}

/* Card Illustration */
.card-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    min-height: 120px;
    position: relative;
}

.botanical-svg {
    width: 100%;
    max-width: 200px;
    height: auto;
    transition: transform 0.4s ease;
}

.card-wide .botanical-svg {
    max-width: 300px;
}

.card-tall .botanical-svg {
    max-width: 160px;
}

.card-tall .card-illustration {
    min-height: 200px;
}

/* Card Title */
.card-title {
    font-family: 'Crimson Text', 'Georgia', serif;
    font-weight: 400;
    font-size: clamp(1.1rem, 2.8vw, 1.5rem);
    color: var(--deep-plum);
    margin-bottom: 0.4rem;
}

/* Card Description */
.card-desc {
    font-size: clamp(0.85rem, 1.2vw, 0.95rem);
    line-height: 1.6;
    color: var(--text-body);
    margin-bottom: 0;
}

/* Tech Tooltip */
.tech-tooltip {
    display: block;
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--mauve-accent);
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.tooltip-icon {
    display: inline-block;
    animation: tooltipSpin 1.2s linear infinite;
    animation-play-state: paused;
    margin-right: 0.3em;
    font-size: 0.9em;
}

.specimen-card:hover .tooltip-icon {
    animation-play-state: running;
}

@keyframes tooltipSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== Leaf Cross-Section (Interactive) ===== */
.leaf-illustration {
    position: relative;
}

.leaf-cross-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    clip-path: circle(0% at 50% 50%);
    transition: clip-path 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: var(--cream-base);
    padding: 0.5rem;
}

.leaf-card.cross-section-active .leaf-cross-section {
    clip-path: circle(75% at 50% 50%);
}

.cross-section-label {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.7rem;
    color: var(--mauve-accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.5rem;
    text-align: center;
}

.leaf-card[data-cross-section="true"] {
    cursor: pointer;
}

/* ===== Pollinator Visitors ===== */
.pollinator-visitor {
    position: absolute;
    top: 15%;
    right: 10%;
    opacity: 0;
    transition: opacity 0.5s ease, transform 2s ease;
    pointer-events: none;
}

.pollinator-card:hover .pollinator-visitor {
    opacity: 0.8;
}

.pollinator-card:hover .butterfly-visitor {
    animation: butterflyFloat 3s ease-in-out infinite;
}

.pollinator-card:hover .bee-visitor {
    animation: beeHover 2s ease-in-out infinite;
}

@keyframes butterflyFloat {
    0%, 100% { transform: translate(0, 0) rotate(-5deg); }
    25% { transform: translate(8px, -12px) rotate(5deg); }
    50% { transform: translate(-5px, -8px) rotate(-3deg); }
    75% { transform: translate(10px, -15px) rotate(8deg); }
}

@keyframes beeHover {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(3px, -5px); }
    50% { transform: translate(-2px, -8px); }
    75% { transform: translate(5px, -3px); }
}

/* ===== Soil Divider ===== */
.soil-divider {
    width: 100%;
    max-width: 400px;
    height: 3px;
    margin: 2rem auto;
    background-image: radial-gradient(circle, var(--deep-sage) 1px, transparent 1px);
    background-size: 6px 3px;
    opacity: 0.4;
}

/* ===== Section Dividers ===== */
.garden-room + .garden-room {
    border-top: 1px solid rgba(74, 111, 94, 0.15);
}

/* ===== Room 5: Closing ===== */
.garden-closing {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100vh;
}

.closing-content {
    max-width: 700px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.closing-card {
    margin-bottom: 3rem;
}

.closing-card .card-illustration {
    min-height: 160px;
}

.closing-svg {
    max-width: 240px;
}

.closing-title {
    font-family: 'Crimson Text', 'Georgia', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--deep-plum);
    margin-bottom: 1rem;
}

.closing-text {
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    color: var(--text-body);
    line-height: 1.8;
    max-width: 550px;
    margin: 0 auto 1.5rem;
}

.closing-attribution {
    font-size: 0.8rem;
    opacity: 0.6;
}

/* ===== Spring Growth Entry Animation ===== */
@keyframes springGrow {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(var(--card-rotation, 0deg));
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(var(--card-rotation, 0deg));
    }
}

/* ===== Vignette on card illustrations ===== */
.card-illustration::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, transparent 60%, rgba(255, 251, 240, 0.4) 100%);
    pointer-events: none;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .portfolio-grid,
    .hero-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .card-wide {
        grid-column: span 2;
    }

    .card-tall {
        grid-row: span 1;
    }

    .card-tall .card-illustration {
        min-height: 140px;
    }

    .card-tall .botanical-svg {
        max-width: 140px;
    }
}

@media (max-width: 600px) {
    .portfolio-grid,
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card-wide {
        grid-column: span 1;
    }

    .garden-room {
        padding: clamp(2rem, 4vw, 3rem) clamp(1rem, 3vw, 2rem);
    }

    .room-number-watermark {
        font-size: clamp(3rem, 15vw, 5rem);
        right: 1rem;
    }

    .tech-tooltip {
        font-size: 0.7rem;
    }

    .closing-card .card-desc {
        font-size: 0.9rem;
    }
}

@media (min-width: 1200px) {
    .portfolio-grid {
        gap: 32px;
    }

    .hero-grid {
        gap: 32px;
    }
}

/* ===== Pressed Flower Watermarks ===== */
.entrance-garden::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 5%;
    width: 200px;
    height: 200px;
    background: radial-gradient(ellipse at center, var(--candy-pink) 0%, transparent 70%);
    opacity: 0.06;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.entrance-garden::after {
    content: '';
    position: absolute;
    bottom: 15%;
    right: 8%;
    width: 150px;
    height: 150px;
    background: radial-gradient(ellipse at center, var(--citrus-yellow) 0%, transparent 70%);
    opacity: 0.06;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.spring-blooms::before {
    content: '';
    position: absolute;
    top: 20%;
    right: 3%;
    width: 180px;
    height: 250px;
    background: radial-gradient(ellipse at center, var(--soft-orchid) 0%, transparent 70%);
    opacity: 0.07;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.leaf-architecture::before {
    content: '';
    position: absolute;
    bottom: 10%;
    left: 5%;
    width: 220px;
    height: 180px;
    background: radial-gradient(ellipse at center, var(--mint-fresh) 0%, transparent 70%);
    opacity: 0.08;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.pollinator-paradise::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 10%;
    width: 160px;
    height: 160px;
    background: radial-gradient(ellipse at center, var(--citrus-yellow) 0%, transparent 70%);
    opacity: 0.06;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

/* Polaroid-style border on select cards */
.card-wide {
    border: 8px solid var(--cream-base);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08), inset 0 0 0 1px rgba(74, 111, 94, 0.08);
}

.card-wide:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), inset 0 0 0 1px rgba(74, 111, 94, 0.12);
}
