/* nonri.org — Dark-mode Botanical Dashboard */
/* Color Palette — Cool Grays with Botanical Accents */
:root {
    --midnight-soil: #0d1117;
    --slate-planter: #161b22;
    --wet-stone: #21262d;
    --dark-moss: #30363d;
    --mist-white: #e6edf3;
    --fog-gray: #8b949e;
    --fern-green: #3fb950;
    --petal-blush: #d4a574;
    --rain-blue: #58a6ff;
    --moss-glow: #238636;
    --lavender-bloom: #bc8cff;
    --vine-color: #5a7a5a;
    --leaf-active: #7ab87a;
    --wet-stone-light: #1c2129;
    --dark-moss-border: #3a4a3a;

    /* Dawn shift */
    --accent-warm-shift: #e8a87c;
    --accent-green-shift: #4ac95f;
}

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

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

body {
    font-family: 'Varela Round', sans-serif;
    background: var(--midnight-soil);
    color: var(--mist-white);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.65;
}

/* Opening Overlay — Door Opens */
#opening-overlay {
    position: fixed;
    inset: 0;
    background: #000000;
    z-index: 9999;
    pointer-events: none;
    animation: doorOpen 2s ease-out forwards;
}

@keyframes doorOpen {
    0% { opacity: 1; }
    70% { opacity: 0.3; }
    100% { opacity: 0; visibility: hidden; }
}

/* Fireflies */
#fireflies {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.firefly {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--fern-green);
    opacity: 0.15;
    animation: fireflyPulse 4s ease-in-out infinite alternate;
}

.firefly:nth-child(2) { animation-delay: 0.6s; }
.firefly:nth-child(3) { animation-delay: 1.2s; }
.firefly:nth-child(4) { animation-delay: 1.8s; }
.firefly:nth-child(5) { animation-delay: 2.4s; }
.firefly:nth-child(6) { animation-delay: 3.0s; }
.firefly:nth-child(7) { animation-delay: 3.6s; }
.firefly:nth-child(8) { animation-delay: 0.3s; }

@keyframes fireflyPulse {
    0% { opacity: 0.05; transform: scale(0.8); }
    50% { opacity: 0.25; transform: scale(1.2); }
    100% { opacity: 0.08; transform: scale(0.9); }
}

/* Canopy Bar */
#canopy-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--slate-planter);
    border-bottom: 1px solid var(--dark-moss);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    opacity: 0;
    animation: fadeSlideDown 0.8s ease-out 2.5s forwards;
}

@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.canopy-identity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.leaf-tag {
    animation: leafDangle 3s ease-in-out infinite;
    transform-origin: top center;
}

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

.site-name {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--mist-white);
    letter-spacing: 0.01em;
    text-transform: lowercase;
}

.canopy-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--wet-stone);
    border-radius: 999px;
    padding: 6px 16px;
    border: 1px solid var(--dark-moss);
    transition: border-color 0.3s ease;
}

.canopy-search:focus-within {
    border-color: var(--fern-green);
}

.search-icon {
    flex-shrink: 0;
}

#search-input {
    background: none;
    border: none;
    outline: none;
    color: var(--mist-white);
    font-family: 'Varela Round', sans-serif;
    font-size: 0.875rem;
    width: 200px;
}

#search-input::placeholder {
    color: var(--fog-gray);
}

.canopy-time {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--fog-gray);
    font-variant-numeric: tabular-nums;
}

/* Greenhouse Layout */
#greenhouse {
    display: flex;
    padding-top: 64px;
    min-height: 100vh;
    position: relative;
    z-index: 2;
}

/* Trellis Navigation */
#trellis-nav {
    width: 240px;
    min-height: calc(100vh - 64px);
    position: fixed;
    top: 64px;
    left: 0;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 50;
}

.vine-svg {
    position: absolute;
    left: 50%;
    top: 24px;
    width: 40px;
    height: calc(100% - 48px);
    transform: translateX(-50%);
    z-index: 0;
}

#vine-path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    animation: vineGrow 1.5s ease-out 2s forwards;
}

@keyframes vineGrow {
    to { stroke-dashoffset: 0; }
}

.nav-items {
    list-style: none;
    position: relative;
    z-index: 1;
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    padding: 0 16px;
}

.nav-leaf {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 999px;
    color: var(--fog-gray);
    cursor: pointer;
    transition: all 0.3s ease;
    transform: scale(0) rotate(-45deg);
    opacity: 0;
    font-size: 0.9rem;
}

.nav-leaf:nth-child(1) { animation: leafSprout 0.4s ease-out 3.5s forwards; }
.nav-leaf:nth-child(2) { animation: leafSprout 0.4s ease-out 3.6s forwards; }
.nav-leaf:nth-child(3) { animation: leafSprout 0.4s ease-out 3.7s forwards; }
.nav-leaf:nth-child(4) { animation: leafSprout 0.4s ease-out 3.8s forwards; }
.nav-leaf:nth-child(5) { animation: leafSprout 0.4s ease-out 3.9s forwards; }

@keyframes leafSprout {
    from { transform: scale(0) rotate(-45deg); opacity: 0; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}

.nav-leaf:hover {
    color: var(--mist-white);
    background: var(--wet-stone);
}

.nav-leaf:hover .leaf-icon {
    transform: rotate(8deg);
}

.leaf-icon {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.nav-leaf.active {
    color: var(--leaf-active);
    background: rgba(63, 185, 80, 0.1);
}

.nav-leaf.active .leaf-icon {
    color: var(--fern-green);
}

/* Garden Bed — Main Content */
#garden-bed {
    margin-left: 240px;
    padding: clamp(16px, 2vw, 28px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    align-content: start;
    width: calc(100% - 240px);
}

/* Planter Widgets */
.planter {
    background: var(--slate-planter);
    border-radius: 24px;
    border: 2px solid var(--dark-moss-border);
    padding: clamp(16px, 2vw, 28px);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: widgetFadeIn 0.5s ease-out forwards;
}

/* Stagger entrance delays */
.planter:nth-child(1) { animation-delay: 3.5s; }
.planter:nth-child(2) { animation-delay: 3.65s; }
.planter:nth-child(3) { animation-delay: 3.8s; }
.planter:nth-child(4) { animation-delay: 3.95s; }
.planter:nth-child(5) { animation-delay: 4.1s; }
.planter:nth-child(6) { animation-delay: 4.25s; }
.planter:nth-child(7) { animation-delay: 4.4s; }
.planter:nth-child(8) { animation-delay: 4.55s; }
.planter:nth-child(9) { animation-delay: 4.7s; }
.planter:nth-child(10) { animation-delay: 4.85s; }
.planter:nth-child(11) { animation-delay: 5.0s; }

@keyframes widgetFadeIn {
    to { opacity: 1; transform: translateY(0); }
}

/* Growth Offset Stagger */
.planter:nth-child(even) {
    margin-top: 32px;
}

/* Widget Sizes */
.canopy-size {
    grid-column: span 2;
}

.bush-size {
    grid-column: span 1;
}

.seedling-size {
    grid-column: span 1;
}

/* Widget Hover — Tending */
.planter:hover {
    border-color: var(--fern-green);
    background: #1c2129;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 20px rgba(63, 185, 80, 0.08);
}

.planter:hover .bg-monstera path {
    opacity: 0.35;
}

/* Breathing Animation */
.planter {
    animation: widgetFadeIn 0.5s ease-out forwards, breathe 6s ease-in-out infinite 6s;
}

@keyframes breathe {
    0%, 100% { border-opacity: 1; }
    50% { opacity: 0.92; }
}

/* Planter Header */
.planter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 8px;
}

.planter-header h1 {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: 0.01em;
    color: var(--mist-white);
    text-transform: lowercase;
}

.planter-header h3 {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--mist-white);
    text-transform: lowercase;
}

.planter-label {
    font-size: 0.8rem;
    color: var(--fog-gray);
}

.planter-badge {
    font-size: 0.75rem;
    color: var(--fern-green);
    background: rgba(63, 185, 80, 0.1);
    padding: 3px 10px;
    border-radius: 999px;
}

/* Hero Content */
.hero-content p {
    color: var(--fog-gray);
    max-width: 500px;
    margin-bottom: 24px;
    font-size: 1rem;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    gap: 32px;
}

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

.stat-value {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 2rem;
    color: var(--fern-green);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--fog-gray);
    text-transform: lowercase;
}

/* Monstera Background SVG */
.bg-monstera {
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 260px;
    height: 260px;
    transform: rotate(-12deg);
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* Metric Display */
.metric-display {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.metric-value {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 2.4rem;
    color: var(--mist-white);
    font-variant-numeric: tabular-nums;
}

.metric-value.green-glow {
    color: var(--fern-green);
    text-shadow: 0 0 20px rgba(63, 185, 80, 0.3);
}

/* Vine Progress Bars */
.vine-progress {
    height: 8px;
    background: var(--dark-moss);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 8px;
    position: relative;
}

.vine-fill {
    height: 100%;
    width: var(--fill-percent, 0%);
    background: var(--fern-green);
    border-radius: 999px;
    position: relative;
    transition: width 1s ease-out;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
}

.vine-fill.blush {
    background: var(--petal-blush);
}

.vine-fill.blue {
    background: var(--rain-blue);
}

.vine-progress.warm .vine-fill {
    background: var(--petal-blush);
}

.vine-progress.blue .vine-fill {
    background: var(--rain-blue);
}

.leaf-bud {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    flex-shrink: 0;
}

/* Light Ring */
.light-ring-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 12px;
}

.light-ring {
    width: 100%;
    height: 100%;
}

.light-progress {
    transition: stroke-dashoffset 1s ease-out;
}

.light-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 1.4rem;
    color: var(--petal-blush);
    font-variant-numeric: tabular-nums;
}

/* Water Drops */
.water-drops {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 12px;
}

.water-drop {
    width: 20px;
    height: 28px;
    border: 2px solid var(--rain-blue);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    opacity: 0.3;
    transition: all 0.3s ease;
}

.water-drop.filled {
    background: var(--rain-blue);
    opacity: 0.7;
}

/* Species List */
.species-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.species-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--dark-moss);
}

.species-item:last-child {
    border-bottom: none;
}

.species-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.species-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--mist-white);
    text-transform: lowercase;
}

.species-status {
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 999px;
    text-transform: lowercase;
}

.species-status.thriving {
    color: var(--fern-green);
    background: rgba(63, 185, 80, 0.1);
}

.species-status.growing {
    color: var(--rain-blue);
    background: rgba(88, 166, 255, 0.1);
}

.species-status.resting {
    color: var(--lavender-bloom);
    background: rgba(188, 140, 255, 0.1);
}

/* Chart Area */
.chart-area {
    width: 100%;
}

.line-chart-svg {
    width: 100%;
    height: 150px;
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--fog-gray);
    text-transform: lowercase;
}

/* Activity Log */
.activity-log {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.activity-entry {
    display: flex;
    align-items: center;
    gap: 10px;
}

.activity-time {
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--fog-gray);
    min-width: 50px;
    font-variant-numeric: tabular-nums;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-dot.green { background: var(--fern-green); }
.activity-dot.blue { background: var(--rain-blue); }
.activity-dot.blush { background: var(--petal-blush); }
.activity-dot.purple { background: var(--lavender-bloom); }

.activity-text {
    font-size: 0.875rem;
    color: var(--mist-white);
}

/* Growth Rings */
.rings-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.rings-svg {
    width: 300px;
    height: 300px;
}

.rings-svg circle {
    transition: opacity 0.3s ease;
}

.rings-container:hover .rings-svg circle {
    opacity: 0.8 !important;
}

.ring-labels {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: none;
}

.ring-label {
    font-size: 0.65rem;
    color: var(--fog-gray);
    opacity: 0.7;
    text-transform: lowercase;
}

/* Soil Bars */
.soil-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.soil-bar {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.soil-label {
    font-size: 0.75rem;
    color: var(--fog-gray);
    text-transform: lowercase;
}

/* CO2 Indicator */
.co2-indicator {
    display: flex;
    justify-content: center;
    margin: 8px 0;
}

.fiddlehead-path {
    stroke-dasharray: 120;
    stroke-dashoffset: 120;
    animation: fiddleheadUnfurl 2s ease-out 4s forwards;
}

@keyframes fiddleheadUnfurl {
    to { stroke-dashoffset: 0; }
}

/* Root Footer */
#root-footer {
    position: relative;
    padding: 40px 0 24px;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

.root-system {
    width: 100%;
    max-width: 800px;
    height: 120px;
    opacity: 0.4;
    margin-bottom: 16px;
}

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

.footer-text {
    font-size: 0.8rem;
    color: var(--fog-gray);
    text-transform: lowercase;
}

.footer-text.dim {
    opacity: 0.5;
    font-size: 0.7rem;
}

/* Dew drops on widget borders */
.planter::before {
    content: '';
    position: absolute;
    top: 12px;
    right: 20px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(88, 166, 255, 0.4), transparent);
    opacity: 0;
    animation: dewShimmer 5s ease-in-out infinite 2s;
}

@keyframes dewShimmer {
    0%, 100% { opacity: 0; }
    40% { opacity: 0.8; }
    60% { opacity: 0.6; }
}

/* Responsive */
@media (max-width: 900px) {
    #trellis-nav {
        display: none;
    }

    #garden-bed {
        margin-left: 0;
        width: 100%;
    }

    #root-footer {
        margin-left: 0;
    }

    .canopy-size {
        grid-column: span 1;
    }

    .canopy-search {
        display: none;
    }
}

@media (max-width: 600px) {
    #garden-bed {
        grid-template-columns: 1fr;
    }

    .planter:nth-child(even) {
        margin-top: 0;
    }

    .hero-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .rings-container {
        min-height: 200px;
    }

    .rings-svg {
        width: 200px;
        height: 200px;
    }
}
