/* ============================================================
   MUJUN.IO - Cottagecore Technical Design
   ============================================================ */

/* Root Variables */
:root {
    /* Colors from DESIGN.md */
    --color-dark-brown: #2C1810;
    --color-candy-rose: #D64B8A;
    --color-soft-pink: #FFF0F5;
    --color-sage-green: #5A9A60;
    --color-warm-beige: #8A7060;
    --color-plum: #6B2D5B;
    --color-aged-paper: #F8F0E0;
    --color-cream: #FFF8F0;

    /* Typography */
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Source Serif 4', serif;
    --font-code: 'Fira Code', monospace;

    /* Spacing */
    --sidebar-width: 280px;
    --content-padding: 3rem;
    --section-gap: 4rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-dark-brown);
    background-color: #FFFBF5;
    overflow-x: hidden;
}

/* ============================================================
   SIDEBAR - THE GARDEN INDEX
   ============================================================ */

#sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(
        180deg,
        var(--color-cream) 0%,
        var(--color-aged-paper) 50%,
        rgba(248, 240, 224, 0.95) 100%
    );
    border-right: 1px solid rgba(44, 24, 16, 0.1);
    overflow-y: auto;
    z-index: 10;
    box-shadow: inset -2px 0 8px rgba(0, 0, 0, 0.02);
    padding-bottom: 2rem;
}

/* Sidebar Header */
.sidebar-header {
    padding: 2rem 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(44, 24, 16, 0.08);
    margin-bottom: 1.5rem;
}

.sidebar-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-plum);
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}

.sidebar-title .dot {
    color: var(--color-candy-rose);
    font-weight: 600;
}

.sidebar-tagline {
    font-size: 0.85rem;
    color: var(--color-warm-beige);
    font-family: var(--font-body);
    font-style: italic;
}

/* Navigation - Botanical Specimens */
#garden-nav {
    padding: 0 1rem;
}

#garden-nav ul {
    list-style: none;
}

.nav-item {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
    color: var(--color-dark-brown);
    font-size: 0.95rem;
}

.nav-item:hover {
    background-color: rgba(212, 75, 138, 0.08);
    color: var(--color-candy-rose);
}

.nav-item.active {
    background-color: rgba(212, 75, 138, 0.15);
    color: var(--color-candy-rose);
    border-left: 3px solid var(--color-candy-rose);
    padding-left: calc(1rem - 3px);
}

.nav-item.active .nav-icon {
    animation: bloom 0.6s ease-out;
}

.nav-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.nav-item.active .nav-icon {
    stroke: var(--color-candy-rose);
    filter: drop-shadow(0 0 4px rgba(212, 75, 138, 0.3));
}

.nav-label {
    font-weight: 500;
}

@keyframes bloom {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Sidebar Vine */
.sidebar-vine {
    width: 100%;
    height: 400px;
    margin-top: 2rem;
    opacity: 0.5;
    pointer-events: none;
}

/* Mobile Toggle */
#mobile-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    background: var(--color-aged-paper);
    border: 1px solid rgba(44, 24, 16, 0.2);
    border-radius: 8px;
    cursor: pointer;
    z-index: 11;
    align-items: center;
    justify-content: center;
}

#mobile-toggle svg {
    width: 24px;
    height: 24px;
}

/* ============================================================
   MAIN CONTENT AREA
   ============================================================ */

#main-content {
    margin-left: var(--sidebar-width);
    background-color: #FFFBF5;
}

/* Content Sections */
.content-section {
    padding: var(--content-padding);
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}

.content-section.outdoor {
    background: linear-gradient(135deg, rgba(255, 240, 245, 0.4) 0%, rgba(248, 240, 224, 0.2) 100%);
}

.content-section.indoor {
    background: linear-gradient(135deg, rgba(255, 251, 245, 0.6) 0%, rgba(255, 248, 240, 0.3) 100%);
}

.section-inner {
    width: 100%;
    max-width: 900px;
}

/* Headings */
h1 {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 6vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--color-candy-rose);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

h2 {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 600;
    color: var(--color-dark-brown);
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-dark-brown);
    margin-bottom: 0.75rem;
}

/* Subtitles & Body */
.subtitle {
    font-size: 1.3rem;
    color: var(--color-warm-beige);
    font-family: var(--font-body);
    margin-bottom: 2rem;
    font-weight: 400;
}

p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-dark-brown);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

code {
    font-family: var(--font-code);
    font-size: 0.9em;
    background-color: rgba(44, 24, 16, 0.05);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    color: var(--color-plum);
}

/* ============================================================
   GREENHOUSE SECTION - 3D ISOMETRIC BLOCKS
   ============================================================ */

.greenhouse-scene {
    margin: 3rem 0;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    perspective: 1200px;
}

.iso-cluster {
    position: relative;
    width: 400px;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
}

.iso-block {
    position: absolute;
    width: 80px;
    height: 80px;
    transform-style: preserve-3d;
    animation: float 4s ease-in-out infinite;
}

.iso-block[style*="--x: 0"] {
    animation-delay: 0s;
}

.iso-block[style*="--x: 1"] {
    animation-delay: 0.2s;
}

.iso-block[style*="--y: 1"] {
    animation-delay: 0.4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotateX(-35deg) rotateY(45deg);
    }
    50% {
        transform: translateY(-20px) rotateX(-35deg) rotateY(45deg);
    }
}

.face {
    position: absolute;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.iso-block.block-rose .face.top {
    background: linear-gradient(135deg, #FF8FB3 0%, #E63B7A 100%);
    transform: rotateX(90deg) translateZ(40px);
}

.iso-block.block-rose .face.left {
    background: linear-gradient(135deg, #D64B8A 0%, #B8206B 100%);
    transform: rotateY(-90deg) translateZ(40px);
}

.iso-block.block-rose .face.front {
    background: linear-gradient(135deg, #FF5FA8 0%, #D64B8A 100%);
    transform: translateZ(40px);
}

.iso-block.block-yellow .face.top {
    background: linear-gradient(135deg, #FFD580 0%, #F0C040 100%);
    transform: rotateX(90deg) translateZ(40px);
}

.iso-block.block-yellow .face.left {
    background: linear-gradient(135deg, #F0C040 0%, #D4A020 100%);
    transform: rotateY(-90deg) translateZ(40px);
}

.iso-block.block-yellow .face.front {
    background: linear-gradient(135deg, #FFE8A8 0%, #F0C040 100%);
    transform: translateZ(40px);
}

.iso-block.block-mint .face.top {
    background: linear-gradient(135deg, #70E8C0 0%, #40C8A0 100%);
    transform: rotateX(90deg) translateZ(40px);
}

.iso-block.block-mint .face.left {
    background: linear-gradient(135deg, #40C8A0 0%, #1E9880 100%);
    transform: rotateY(-90deg) translateZ(40px);
}

.iso-block.block-mint .face.front {
    background: linear-gradient(135deg, #80F0D8 0%, #40C8A0 100%);
    transform: translateZ(40px);
}

.iso-block.block-lilac .face.top {
    background: linear-gradient(135deg, #D0A8E8 0%, #B080D0 100%);
    transform: rotateX(90deg) translateZ(40px);
}

.iso-block.block-lilac .face.left {
    background: linear-gradient(135deg, #B080D0 0%, #8050B0 100%);
    transform: rotateY(-90deg) translateZ(40px);
}

.iso-block.block-lilac .face.front {
    background: linear-gradient(135deg, #E0C8F0 0%, #B080D0 100%);
    transform: translateZ(40px);
}

/* Tropical Fish */
.fish {
    position: absolute;
    animation: swim 6s linear infinite;
    opacity: 0.85;
}

.fish-1 {
    width: 80px;
    height: 40px;
    top: 80px;
    left: 50px;
    animation-duration: 8s;
}

.fish-2 {
    width: 60px;
    height: 30px;
    top: 200px;
    right: 100px;
    animation-duration: 10s;
    animation-direction: reverse;
}

.fish-3 {
    width: 70px;
    height: 35px;
    bottom: 120px;
    left: 100px;
    animation-duration: 7s;
}

.fish-4 {
    width: 50px;
    height: 25px;
    bottom: 80px;
    right: 80px;
    animation-duration: 9s;
    animation-direction: reverse;
}

@keyframes swim {
    0% {
        transform: translateX(-400px);
    }
    100% {
        transform: translateX(800px);
    }
}

.hero-description {
    font-size: 1.1rem;
    color: var(--color-warm-beige);
    font-weight: 500;
    margin-top: 3rem;
}

/* ============================================================
   CODE BLOCKS
   ============================================================ */

.code-block {
    background: linear-gradient(135deg, rgba(44, 24, 16, 0.03) 0%, rgba(107, 45, 91, 0.02) 100%);
    border: 1px solid rgba(212, 75, 138, 0.15);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    overflow-x: auto;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(212, 75, 138, 0.1);
}

.code-lang {
    font-family: var(--font-code);
    font-size: 0.85rem;
    color: var(--color-candy-rose);
    font-weight: 600;
}

.code-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--color-dark-brown);
    font-weight: 600;
}

.code-block pre {
    margin: 0;
    font-family: var(--font-code);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--color-dark-brown);
    overflow-x: auto;
}

.code-block code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* ============================================================
   API REFERENCE CARDS
   ============================================================ */

.api-card {
    background: linear-gradient(135deg, rgba(248, 240, 224, 0.5) 0%, rgba(255, 240, 245, 0.3) 100%);
    border: 1px solid rgba(212, 75, 138, 0.2);
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    transition: all 0.3s ease;
}

.api-card:hover {
    border-color: rgba(212, 75, 138, 0.4);
    box-shadow: 0 8px 24px rgba(212, 75, 138, 0.1);
}

.api-card h3 {
    color: var(--color-plum);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.api-card p {
    margin-bottom: 1.5rem;
}

.api-params {
    background: rgba(255, 255, 255, 0.4);
    border-left: 3px solid var(--color-sage-green);
    padding: 1rem;
    border-radius: 6px;
    margin: 1.5rem 0;
}

.param-row {
    display: grid;
    grid-template-columns: 120px 120px 1fr;
    gap: 1rem;
    margin-bottom: 0.75rem;
    align-items: start;
    font-size: 0.95rem;
}

.param-name {
    font-family: var(--font-code);
    font-weight: 600;
    color: var(--color-candy-rose);
}

.param-type {
    font-family: var(--font-code);
    color: var(--color-warm-beige);
    font-size: 0.9rem;
}

.param-desc {
    color: var(--color-dark-brown);
    font-style: italic;
}

.api-return {
    background: rgba(90, 154, 96, 0.05);
    border-left: 3px solid var(--color-sage-green);
    padding: 1rem;
    border-radius: 6px;
    font-size: 0.95rem;
}

.return-label {
    font-weight: 600;
    color: var(--color-sage-green);
    margin-right: 0.5rem;
}

.api-return code {
    background: transparent;
    color: var(--color-plum);
    padding: 0;
}

/* ============================================================
   HARVEST TABLE
   ============================================================ */

.harvest-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(212, 75, 138, 0.15);
    margin: 2rem 0;
}

.harvest-data {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.5);
}

.harvest-data thead {
    background: linear-gradient(135deg, rgba(212, 75, 138, 0.1) 0%, rgba(107, 45, 91, 0.1) 100%);
}

.harvest-data th {
    padding: 1.25rem;
    text-align: left;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-dark-brown);
    border-bottom: 2px solid rgba(212, 75, 138, 0.2);
}

.harvest-data td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(212, 75, 138, 0.1);
    color: var(--color-dark-brown);
    font-size: 0.95rem;
}

.harvest-data tbody tr:hover {
    background-color: rgba(212, 75, 138, 0.05);
}

.status {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
}

.status-bloom {
    background-color: rgba(90, 154, 96, 0.2);
    color: var(--color-sage-green);
}

.status-grow {
    background-color: rgba(212, 75, 138, 0.2);
    color: var(--color-candy-rose);
}

.status-seed {
    background-color: rgba(138, 112, 96, 0.2);
    color: var(--color-warm-beige);
}

/* ============================================================
   TUTORIAL CARDS
   ============================================================ */

.tutorial-card {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    margin: 2rem 0;
    background: linear-gradient(135deg, rgba(240, 192, 64, 0.08) 0%, rgba(212, 75, 138, 0.08) 100%);
    border: 1px solid rgba(212, 75, 138, 0.15);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.tutorial-card:hover {
    border-color: rgba(212, 75, 138, 0.3);
    box-shadow: 0 8px 24px rgba(212, 75, 138, 0.08);
}

.tutorial-number {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: rgba(212, 75, 138, 0.15);
    min-width: 100px;
    text-align: center;
}

.tutorial-content {
    flex: 1;
}

.tutorial-content h3 {
    color: var(--color-candy-rose);
    margin-bottom: 0.75rem;
}

.tutorial-content p {
    margin-bottom: 1rem;
}

.tutorial-meta {
    font-size: 0.85rem;
    color: var(--color-warm-beige);
    font-style: italic;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
    background: linear-gradient(135deg, var(--color-aged-paper) 0%, var(--color-cream) 100%);
    border-top: 1px solid rgba(44, 24, 16, 0.1);
    padding: 3rem var(--content-padding);
    text-align: center;
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
}

.footer-text {
    font-size: 1rem;
    color: var(--color-dark-brown);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.footer-sub {
    font-size: 0.9rem;
    color: var(--color-warm-beige);
    font-style: italic;
    margin-bottom: 0;
}

/* ============================================================
   STAGGER ANIMATION
   ============================================================ */

.stagger {
    animation: stagger-in 0.6s ease-out;
    animation-fill-mode: both;
}

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

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
        --content-padding: 1.5rem;
    }

    #sidebar {
        position: sticky;
        top: 0;
        width: 100%;
        height: auto;
        bottom: auto;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid rgba(44, 24, 16, 0.1);
        padding: 0;
        z-index: 11;
        overflow-y: visible;
        overflow-x: auto;
    }

    .sidebar-header {
        display: none;
    }

    #garden-nav {
        display: flex;
        flex-direction: row;
        padding: 0.5rem;
        gap: 0.5rem;
    }

    #garden-nav ul {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
    }

    .nav-item {
        white-space: nowrap;
        margin-bottom: 0;
        padding: 0.5rem 0.75rem;
    }

    .sidebar-vine {
        display: none;
    }

    #mobile-toggle {
        display: flex;
    }

    #main-content {
        margin-left: 0;
    }

    .content-section {
        padding: 2rem 1.5rem;
        min-height: auto;
    }

    h1 {
        font-size: clamp(1.6rem, 5vw, 2.8rem);
    }

    h2 {
        font-size: clamp(1.2rem, 3vw, 1.8rem);
    }

    .iso-cluster {
        width: 100%;
        max-width: 300px;
    }

    .iso-block {
        width: 60px;
        height: 60px;
    }

    .iso-block .face {
        width: 60px;
        height: 60px;
    }

    .iso-block .face.top,
    .iso-block .face.left,
    .iso-block .face.front {
        transform: none;
    }

    .greenhouse-scene {
        min-height: 300px;
    }

    .fish {
        width: 40px !important;
        height: 20px !important;
    }

    .tutorial-card {
        flex-direction: column;
        gap: 1rem;
    }

    .tutorial-number {
        font-size: 2rem;
        min-width: auto;
    }

    .api-params,
    .api-return {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .param-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .harvest-data {
        font-size: 0.85rem;
    }

    .harvest-data th,
    .harvest-data td {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    :root {
        --content-padding: 1rem;
    }

    h1 {
        font-size: clamp(1.4rem, 4vw, 2rem);
    }

    h2 {
        font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    }

    .code-block {
        padding: 1rem;
    }

    .code-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .api-card {
        padding: 1.5rem;
    }

    .site-footer {
        padding: 2rem 1rem;
    }
}
