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

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

body.undo {
    background-color: #f2ece0;
    color: #4a3928;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* ===== LINEN TEXTURE OVERLAY ===== */
.linen-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.04;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            #4a3928 2px,
            #4a3928 3px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            #4a3928 2px,
            #4a3928 3px
        );
}

/* ===== FALLING LEAVES ===== */
.falling-leaves {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.falling-leaf {
    position: absolute;
    top: -40px;
    opacity: 0;
    animation: leafFall linear infinite;
}

@keyframes leafFall {
    0% {
        opacity: 0;
        transform: translateX(0) rotate(0deg);
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        opacity: 0;
        transform: translateX(80px) rotate(360deg);
        top: 110vh;
    }
}

/* ===== VINE BORDERS ===== */
.vine-border {
    position: fixed;
    top: 0;
    width: 40px;
    height: 100%;
    z-index: 998;
    pointer-events: none;
}

.vine-border--left {
    left: 0;
    background: linear-gradient(to right, rgba(90, 122, 82, 0.08), transparent);
    border-right: 1px solid rgba(90, 122, 82, 0.1);
}

.vine-border--right {
    right: 0;
    background: linear-gradient(to left, rgba(90, 122, 82, 0.08), transparent);
    border-left: 1px solid rgba(90, 122, 82, 0.1);
}

/* ===== TYPOGRAPHY ===== */
.section-heading {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(2.2rem, 5vw, 4rem);
    letter-spacing: 0.02em;
    color: #1e3a2f;
    margin-bottom: 0.5em;
}

.section-command {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 0.95rem;
    color: #7a8c6e;
    margin-bottom: 2rem;
}

code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.85em;
    background: rgba(90, 122, 82, 0.1);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    color: #2d4a3e;
}

/* ===== GARDEN BED (common) ===== */
.garden-bed {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    position: relative;
}

.garden-bed__content {
    max-width: 900px;
    width: 100%;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.garden-bed__content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== GARDEN BED 1: THE GATE ===== */
.garden-bed--gate {
    background: radial-gradient(ellipse at center, #faf6ed 0%, #f5efe6 40%, #f2ece0 70%);
}

.terminal-prompt {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 1.1rem;
    color: #5a7a52;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
}

.prompt-symbol {
    color: #7a8c6e;
}

.cursor {
    animation: blink 1s step-end infinite;
    color: #5a7a52;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.site-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.02em;
    color: #1e3a2f;
    line-height: 1.1;
    margin-bottom: 0.3em;
}

.site-subtitle {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: #7a8c6e;
    margin-bottom: 2rem;
}

.gate-botanical {
    margin: 2rem auto;
    max-width: 400px;
}

.leaf-arch {
    width: 100%;
    height: auto;
}

.scroll-hint {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: gentleBob 3s ease-in-out infinite;
}

.scroll-hint__text {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 0.9rem;
    color: #7a8c6e;
}

@keyframes gentleBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* ===== GARDEN BED 2: HERBS ===== */
.garden-bed--herbs {
    background: linear-gradient(180deg, #f2ece0 0%, #f0e6d6 50%, #f2ece0 100%);
}

.herb-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.herb-card {
    perspective: 800px;
    cursor: pointer;
    height: 280px;
}

.herb-card__front,
.herb-card__back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    transition: transform 0.7s ease;
}

.herb-card__front {
    background: #f5efe6;
    border: 1px solid rgba(90, 122, 82, 0.2);
    box-shadow: 0 2px 12px rgba(74, 57, 40, 0.06);
}

.herb-card__back {
    background: #f0e6d6;
    border: 1px solid rgba(200, 144, 122, 0.3);
    transform: rotateY(180deg);
}

.herb-card.flipped .herb-card__front {
    transform: rotateY(180deg);
}

.herb-card.flipped .herb-card__back {
    transform: rotateY(0deg);
}

.herb-illustration {
    width: 80px;
    height: 112px;
    margin-bottom: 1rem;
}

.herb-card__name {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: #1e3a2f;
}

.herb-card__latin {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 0.9rem;
    color: #7a8c6e;
    margin-bottom: 1rem;
}

.herb-card__note {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #4a3928;
    line-height: 1.6;
}

/* ===== GARDEN BED 3: PRESSING BOOK ===== */
.garden-bed--pressing {
    background: radial-gradient(ellipse at 30% 50%, #f5efe6 0%, #f2ece0 60%);
}

.pressing-book {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-top: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.book-page {
    flex: 1;
    padding: 2.5rem;
    position: relative;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.book-page--left {
    background: #f5efe6;
    border-radius: 8px 0 0 8px;
    border: 1px solid rgba(90, 122, 82, 0.15);
    border-right: none;
    text-align: left;
}

.book-page--right {
    background: #f0e6d6;
    border-radius: 0 8px 8px 0;
    border: 1px solid rgba(200, 144, 122, 0.15);
    border-left: none;
    text-align: left;
}

.book-spine {
    width: 4px;
    background: linear-gradient(180deg, #c8907a, #4a3928, #c8907a);
    opacity: 0.3;
}

.pressed-leaf {
    position: absolute;
    opacity: 0.15;
    pointer-events: none;
}

.pressed-leaf--1 {
    top: 10px;
    right: 10px;
    width: 80px;
}

.pressed-leaf--2 {
    bottom: 10px;
    left: 10px;
    width: 60px;
}

.book-quote {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 1.3rem;
    line-height: 1.6;
    color: #1e3a2f;
    border-left: 2px solid #c8907a;
    padding-left: 1rem;
}

.book-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: #4a3928;
    margin-bottom: 1rem;
    line-height: 1.8;
}

/* ===== GARDEN BED 4: POTTING SHED ===== */
.garden-bed--shed {
    background: linear-gradient(180deg, #f2ece0 0%, #f0e6d6 100%);
}

.shed-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tool-item {
    background: #f5efe6;
    border: 1px solid rgba(90, 122, 82, 0.15);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(74, 57, 40, 0.08);
}

.tool-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
}

.tool-icon svg {
    width: 100%;
    height: 100%;
}

.tool-name {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: #1e3a2f;
    margin-bottom: 0.5rem;
}

.tool-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #7a8c6e;
    line-height: 1.6;
}

/* ===== GARDEN BED 5: EXIT ===== */
.garden-bed--exit {
    background: radial-gradient(ellipse at center bottom, #f0e6d6 0%, #f2ece0 70%);
}

.exit-terminal {
    margin: 2rem auto;
    max-width: 500px;
}

.terminal-window {
    background: #1e3a2f;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(30, 58, 47, 0.2);
}

.terminal-header {
    background: #2d4a3e;
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-dot--red { background: #c8907a; }
.terminal-dot--yellow { background: #f0e6d6; }
.terminal-dot--green { background: #5a7a52; }

.terminal-title {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.75rem;
    color: #7a8c6e;
    margin-left: auto;
    margin-right: auto;
}

.terminal-body {
    padding: 1.5rem;
    text-align: left;
}

.terminal-line {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.85rem;
    color: #7a8c6e;
    margin-bottom: 0.4rem;
    line-height: 1.6;
}

.terminal-output {
    color: #5a7a52;
    padding-left: 1rem;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.terminal-output.visible {
    opacity: 1;
    transform: translateY(0);
}

.terminal-output--highlight {
    color: #c8907a;
}

.cursor-exit {
    animation: blink 1s step-end infinite;
    color: #5a7a52;
}

.exit-message {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: #1e3a2f;
    margin-top: 2.5rem;
    margin-bottom: 2rem;
}

.exit-leaf {
    width: 80px;
    margin: 0 auto;
    opacity: 0.6;
    animation: gentleSway 4s ease-in-out infinite;
}

@keyframes gentleSway {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

/* ===== SECTION DIVIDERS ===== */
.garden-bed + .garden-bed::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #c8907a 30%, #5a7a52 50%, #c8907a 70%, transparent);
    opacity: 0.3;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .garden-bed {
        padding: 3rem 1.2rem;
    }

    .pressing-book {
        flex-direction: column;
    }

    .book-page--left {
        border-radius: 8px 8px 0 0;
        border: 1px solid rgba(90, 122, 82, 0.15);
        border-bottom: none;
    }

    .book-page--right {
        border-radius: 0 0 8px 8px;
        border: 1px solid rgba(200, 144, 122, 0.15);
        border-top: none;
    }

    .book-spine {
        width: 100%;
        height: 2px;
    }

    .herb-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .herb-card {
        height: 240px;
    }

    .vine-border {
        display: none;
    }
}
