/* ===========================================
   mujun.study - A Holographic Greenhouse of Logical Contradictions
   Colors: #3D2215, #F5A623, #5B2C6F, #4A3728, #E8734A, #B48EAD, #F4C4A1, #FDF6EC
   Fonts: Bricolage Grotesque, IBM Plex Mono, Inter
   =========================================== */

:root {
    --deep-bark: #3D2215;
    --amber: #F5A623;
    --plum: #5B2C6F;
    --warm-brown: #4A3728;
    --coral: #E8734A;
    --lavender: #B48EAD;
    --peach: #F4C4A1;
    --cream: #FDF6EC;
}

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

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

body {
    background-color: var(--cream);
    color: var(--warm-brown);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ===========================================
   ZONE COMMON STYLES
   =========================================== */

.zone {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
}

.zone-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    z-index: 2;
}

.zone-number {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 300;
    color: var(--coral);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 12px;
    opacity: 0.7;
}

.zone-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 600;
    color: var(--deep-bark);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    font-variation-settings: 'wdth' 90;
}

.zone-desc {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    font-weight: 300;
    color: var(--lavender);
    letter-spacing: 0.02em;
}

/* ===========================================
   HOLOGRAPHIC BORDERS
   =========================================== */

.holographic-border {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 10;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--coral) 15%,
        var(--amber) 30%,
        var(--lavender) 50%,
        var(--plum) 70%,
        var(--coral) 85%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: holoBorderShift 8s ease-in-out infinite;
    opacity: 0.7;
}

.border-top {
    top: 0;
}

.border-bottom {
    bottom: 0;
}

@keyframes holoBorderShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ===========================================
   ZONE 1: TITLE CANOPY
   =========================================== */

#title-canopy {
    background: radial-gradient(ellipse at 50% 30%, var(--cream) 0%, #f8eed8 60%, #f0e0c4 100%);
    overflow: hidden;
}

.canopy-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.impossible-flower.flower-hero {
    position: absolute;
    width: 50vmin;
    height: 50vmin;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.15;
    animation: heroFlowerSpin 120s linear infinite;
}

.impossible-flower.flower-secondary {
    position: absolute;
    width: 20vmin;
    height: 20vmin;
    opacity: 0.1;
}

.flower-left {
    top: 20%;
    left: 8%;
    animation: floatLeft 20s ease-in-out infinite;
}

.flower-right {
    bottom: 25%;
    right: 10%;
    animation: floatRight 25s ease-in-out infinite;
}

@keyframes heroFlowerSpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes floatLeft {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(10px, -15px) rotate(5deg); }
}

@keyframes floatRight {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-8px, 12px) rotate(-3deg); }
}

.canopy-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.domain-label {
    margin-bottom: 8px;
}

.label-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    font-weight: 400;
    color: var(--coral);
    letter-spacing: 0.2em;
    text-transform: lowercase;
    padding: 6px 16px;
    border: 1px solid var(--peach);
    border-radius: 2px;
}

.hero-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: clamp(48px, 7vw, 120px);
    font-weight: 800;
    color: var(--deep-bark);
    line-height: 1.1;
    letter-spacing: -0.03em;
    font-variation-settings: 'wdth' 75;
    transition: font-variation-settings 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-title.expanded {
    font-variation-settings: 'wdth' 100;
}

.hero-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: clamp(14px, 2vw, 20px);
    font-weight: 300;
    color: var(--warm-brown);
    opacity: 0.8;
    max-width: 500px;
    letter-spacing: 0.01em;
}

.hero-kanji-gloss {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 16px;
}

.kanji-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.kanji {
    font-size: clamp(32px, 4vw, 56px);
    color: var(--deep-bark);
    line-height: 1;
}

.romaji {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 300;
    color: var(--lavender);
    letter-spacing: 0.1em;
}

.kanji-divider {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    color: var(--coral);
    opacity: 0.5;
}

.scroll-indicator {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: scrollPulse 3s ease-in-out infinite;
}

.scroll-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 300;
    color: var(--warm-brown);
    letter-spacing: 0.15em;
    opacity: 0.5;
}

.scroll-arrow {
    opacity: 0.6;
}

@keyframes scrollPulse {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50% { transform: translateY(8px); opacity: 0.5; }
}

/* ===========================================
   ZONE 2: SPECIMEN DASHBOARD
   =========================================== */

#specimen-dashboard {
    background: linear-gradient(180deg, var(--cream) 0%, #faf2e4 50%, var(--cream) 100%);
    padding-top: 100px;
    padding-bottom: 100px;
}

.specimen-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1100px;
    width: 100%;
    position: relative;
    z-index: 2;
}

.specimen-card {
    background: rgba(253, 246, 236, 0.9);
    border: 1px solid var(--peach);
    border-radius: 4px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
    opacity: 0;
    transform: translateY(30px);
}

.specimen-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.specimen-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(61, 34, 21, 0.08);
}

.card-border-holo {
    position: absolute;
    inset: 0;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.specimen-card:hover .card-border-holo {
    opacity: 1;
    box-shadow:
        inset 0 0 0 1px var(--coral),
        inset 0 0 0 2px transparent,
        0 0 15px rgba(232, 115, 74, 0.1);
    animation: cardHoloPulse 3s ease-in-out infinite;
}

@keyframes cardHoloPulse {
    0%, 100% {
        box-shadow:
            inset 0 0 0 1px var(--coral),
            0 0 15px rgba(232, 115, 74, 0.1);
    }
    33% {
        box-shadow:
            inset 0 0 0 1px var(--amber),
            0 0 15px rgba(245, 166, 35, 0.1);
    }
    66% {
        box-shadow:
            inset 0 0 0 1px var(--lavender),
            0 0 15px rgba(180, 142, 173, 0.1);
    }
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(244, 196, 161, 0.4);
}

.specimen-id {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    color: var(--coral);
    letter-spacing: 0.1em;
}

.specimen-class {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    font-weight: 300;
    color: var(--lavender);
    letter-spacing: 0.05em;
    font-style: italic;
}

.card-illustration {
    width: 100%;
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.card-illustration svg {
    width: 100%;
    max-width: 200px;
    height: auto;
}

.card-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: clamp(18px, 2.5vw, 24px);
    font-weight: 600;
    color: var(--deep-bark);
    margin-bottom: 10px;
    letter-spacing: -0.01em;
    font-variation-settings: 'wdth' 85;
}

.card-body {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--warm-brown);
    line-height: 1.7;
    margin-bottom: 16px;
    opacity: 0.85;
}

.card-taxonomy {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    font-weight: 400;
    color: var(--plum);
    background: rgba(91, 44, 111, 0.06);
    padding: 3px 10px;
    border-radius: 2px;
    letter-spacing: 0.05em;
    border: 1px solid rgba(91, 44, 111, 0.1);
}

/* ===========================================
   ZONE 3: PARADOX GARDEN
   =========================================== */

#paradox-garden {
    background: linear-gradient(180deg, #faf2e4 0%, #f5e8d4 40%, #efe0c8 100%);
    padding: 100px 40px;
    min-height: 100vh;
}

.garden-landscape {
    position: relative;
    width: 100%;
    max-width: 1200px;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid var(--peach);
    z-index: 2;
}

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

.garden-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px;
    background: linear-gradient(0deg, rgba(253, 246, 236, 0.95) 0%, rgba(253, 246, 236, 0) 100%);
    text-align: center;
}

.garden-quote {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: clamp(18px, 3vw, 28px);
    font-weight: 500;
    color: var(--deep-bark);
    font-style: italic;
    line-height: 1.4;
    margin-bottom: 12px;
    font-variation-settings: 'wdth' 90;
}

.garden-source {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 300;
    color: var(--lavender);
    letter-spacing: 0.1em;
}

/* Spore floating animation */
.spore {
    animation: sporeFloat 15s ease-in-out infinite;
}

.spore:nth-child(2n) { animation-duration: 18s; animation-delay: -3s; }
.spore:nth-child(3n) { animation-duration: 22s; animation-delay: -7s; }
.spore:nth-child(4n) { animation-duration: 16s; animation-delay: -2s; }
.spore:nth-child(5n) { animation-duration: 20s; animation-delay: -5s; }

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

/* Plant sway animation */
.garden-plant {
    animation: plantSway 8s ease-in-out infinite;
    transform-origin: bottom center;
}

.plant-1 { animation-duration: 8s; }
.plant-2 { animation-duration: 10s; animation-delay: -2s; }
.plant-3 { animation-duration: 7s; animation-delay: -4s; }
.plant-4 { animation-duration: 9s; animation-delay: -1s; }

@keyframes plantSway {
    0%, 100% { transform: translate(var(--tx, 0), var(--ty, 0)) rotate(0deg); }
    50% { transform: translate(var(--tx, 0), var(--ty, 0)) rotate(1deg); }
}

/* ===========================================
   ZONE 4: READING ROOM
   =========================================== */

#reading-room {
    background: linear-gradient(180deg, var(--cream) 0%, #f8eed8 100%);
    padding: 100px 40px 80px;
}

.reading-content {
    max-width: 900px;
    width: 100%;
    position: relative;
    z-index: 2;
}

.reading-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-bottom: 80px;
}

.reading-heading {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 600;
    color: var(--deep-bark);
    margin-bottom: 20px;
    font-variation-settings: 'wdth' 88;
}

.reading-text {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: var(--warm-brown);
    line-height: 1.8;
    margin-bottom: 20px;
    opacity: 0.85;
}

.reading-text em {
    font-style: italic;
    color: var(--coral);
}

.reading-footer {
    text-align: center;
    padding-top: 40px;
}

.footer-circuit {
    margin-bottom: 30px;
}

.footer-circuit-svg {
    width: 100%;
    max-width: 600px;
    height: 40px;
}

.footer-domain {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--deep-bark);
    margin-bottom: 8px;
    font-variation-settings: 'wdth' 90;
}

.footer-tagline {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 300;
    color: var(--warm-brown);
    opacity: 0.7;
    margin-bottom: 6px;
}

.footer-note {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 300;
    color: var(--lavender);
    letter-spacing: 0.1em;
    opacity: 0.6;
}

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

@media (max-width: 900px) {
    .specimen-grid {
        grid-template-columns: 1fr 1fr;
    }
    .card-tall {
        grid-row: span 1;
    }
    .reading-columns {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 600px) {
    .zone {
        padding: 60px 20px;
    }
    .specimen-grid {
        grid-template-columns: 1fr;
    }
    .hero-kanji-gloss {
        gap: 16px;
    }
    .garden-landscape {
        aspect-ratio: 1 / 1;
    }
}

/* ===========================================
   ENTRANCE ANIMATIONS
   =========================================== */

.zone-header {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.zone-header.visible {
    opacity: 1;
    transform: translateY(0);
}

.garden-landscape {
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 1s ease, transform 1s ease;
}

.garden-landscape.visible {
    opacity: 1;
    transform: scale(1);
}

.reading-col {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reading-col.visible {
    opacity: 1;
    transform: translateY(0);
}

.reading-col:nth-child(2) {
    transition-delay: 0.2s;
}
