/* iggi.dev — terminal command-line meets forest nature */

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

:root {
    --bg: #0c100c;
    --bg-sidebar: #080c08;
    --text-primary: #b8d4a8;
    --code-accent: #5ace5a;
    --text-secondary: #7a8a70;
    --gold: #c4a840;
    --link: #4aae5c;
    --border: #1a2a1a;
    --growth-active: #2ae060;
    --growth-mid: #1a8a2a;
    --glow: rgba(90, 206, 90, 0.05);
}

html, body {
    height: 100%;
}

body {
    background: var(--bg);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    overflow-x: hidden;
}

code, pre, .install-cmd, .api-name {
    font-family: 'Fira Code', monospace;
}

/* Header */
.header {
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    padding: 0.9rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: 'Fira Code', monospace;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--code-accent);
    letter-spacing: 0.02em;
}

.logo-dot {
    color: var(--growth-active);
    animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; text-shadow: 0 0 8px var(--growth-active); }
}

.nav {
    display: flex;
    gap: 1.75rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-family: 'Fira Code', monospace;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--code-accent);
}

/* Layout */
.main-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
}

.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 1.75rem 1.25rem;
    position: sticky;
    top: 49px;
    height: calc(100vh - 49px);
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 1.75rem;
}

.nav-title {
    font-family: 'Crimson Pro', serif;
    font-style: italic;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--gold);
    margin-bottom: 0.6rem;
    padding-left: 0.5rem;
}

.nav-list {
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.32rem 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    border-left: 2px solid transparent;
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.nav-item:hover {
    color: var(--code-accent);
    border-left-color: var(--growth-mid);
    background: rgba(90, 206, 90, 0.04);
}

.nav-icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    fill: none;
    stroke: var(--text-secondary);
    stroke-width: 1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-item:hover .nav-icon {
    stroke: var(--code-accent);
}

/* Content */
.content {
    padding: 2.5rem 3.5rem 4rem;
    max-width: 920px;
    margin: 0 auto;
    width: 100%;
}

/* Hero terminal */
.hero-terminal {
    background: #0c100c;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 3rem;
    box-shadow: 0 0 60px var(--glow), inset 0 0 30px rgba(90, 206, 90, 0.03);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.terminal-dots {
    display: flex;
    gap: 0.45rem;
}

.dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    opacity: 0.6;
}

.dot-r { background: #4a3a3a; }
.dot-y { background: #4a463a; }
.dot-g { background: var(--growth-mid); opacity: 0.8; }

.terminal-title {
    font-family: 'Fira Code', monospace;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.terminal-body {
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.terminal-line {
    color: var(--code-accent);
    white-space: pre-wrap;
}

.prompt-sym {
    color: var(--growth-active);
}

.cursor {
    color: var(--code-accent);
    animation: blink 1s steps(1) infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.cursor.done {
    animation: blink 1.3s steps(1) infinite;
    opacity: 0.5;
}

.terminal-output {
    margin: 0.9rem 0;
    color: var(--code-accent);
    font-size: 0.8rem;
    line-height: 1.35;
    white-space: pre;
    overflow-x: auto;
    min-height: 9rem;
    text-shadow: 0 0 6px rgba(90, 206, 90, 0.15);
}

.terminal-meta {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.terminal-meta .ok { color: var(--growth-active); }

/* Intro block */
.intro-block {
    margin-bottom: 3.5rem;
}

.page-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.lede {
    color: var(--text-secondary);
    font-size: 1.02rem;
    max-width: 60ch;
    margin-bottom: 1.25rem;
}

.install-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.install-cmd {
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-left: 3px solid var(--growth-mid);
    border-radius: 5px;
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
    color: var(--code-accent);
}

.install-or {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-style: italic;
}

/* Doc sections */
.doc-section {
    margin-bottom: 3.5rem;
    scroll-margin-top: 70px;
}

.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    color: var(--text-primary);
    margin-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.4rem;
}

.botanic {
    font-family: 'Crimson Pro', serif;
    font-style: italic;
    font-weight: 400;
    color: var(--gold);
}

.section-description {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    max-width: 64ch;
}

.section-description code,
.api-entry p code {
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.05rem 0.3rem;
    font-size: 0.82em;
    color: var(--code-accent);
}

.section-description em {
    color: var(--code-accent);
    font-style: italic;
}

/* Code block */
.code-block {
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-left: 3px solid var(--link);
    border-radius: 6px;
    padding: 1.1rem 1.3rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.code-block pre {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-primary);
}

.code-block .kw { color: #c4a840; }
.code-block .str { color: var(--growth-active); }
.code-block .num { color: var(--code-accent); }
.code-block .fn { color: var(--code-accent); }
.code-block .cmt { color: var(--text-secondary); font-style: italic; }

/* Growth demo */
.growth-demo {
    position: relative;
    background: #080c08;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
    box-shadow: inset 0 0 24px rgba(90, 206, 90, 0.03);
    overflow: hidden;
}

.growth-grid {
    display: grid;
    grid-template-columns: repeat(40, 1fr);
    gap: 2px;
    position: relative;
    z-index: 1;
}

.growth-cell {
    aspect-ratio: 1;
    background: var(--bg);
    border-radius: 1px;
    transition: background 0.45s ease, box-shadow 0.45s ease;
    cursor: crosshair;
}

.growth-cell.growing {
    background: var(--growth-mid);
}

.growth-cell.active {
    background: var(--growth-active);
    box-shadow: 0 0 6px rgba(42, 224, 96, 0.5);
}

.growth-cell.senescent {
    background: #2a3a26;
    box-shadow: none;
}

.growth-cursor-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

.trail-dot {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--growth-active);
    box-shadow: 0 0 5px rgba(42, 224, 96, 0.7);
    transform: translate(-50%, -50%);
    animation: trail-fade 0.55s ease-out forwards;
}

@keyframes trail-fade {
    from { opacity: 0.8; }
    to { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
}

.demo-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.9rem;
    flex-wrap: wrap;
}

.demo-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: 'Fira Code', monospace;
    font-size: 0.78rem;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.demo-btn:hover {
    color: var(--code-accent);
    border-color: var(--growth-mid);
    background: rgba(90, 206, 90, 0.05);
}

.demo-hint {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-style: italic;
}

/* Feature list */
.feature-list {
    list-style: none;
}

.feature-list li {
    padding: 0.4rem 0 0.4rem 1.4rem;
    position: relative;
    color: var(--text-primary);
}

.feature-list li::before {
    content: '└─';
    position: absolute;
    left: 0;
    color: var(--growth-mid);
    font-family: 'Fira Code', monospace;
}

/* API reference */
.api-reference {
    display: grid;
    gap: 0.9rem;
}

.api-entry {
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold);
    border-radius: 6px;
    padding: 0.95rem 1.2rem;
}

.api-name {
    display: block;
    color: var(--code-accent);
    font-size: 0.86rem;
    margin-bottom: 0.35rem;
}

.api-entry p {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

/* Spore visualization */
.spore-visualization {
    position: relative;
    height: 280px;
    background: radial-gradient(ellipse at 50% 100%, rgba(90, 206, 90, 0.06), transparent 60%), #080c08;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.spore-particle {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--growth-active);
    box-shadow: 0 0 8px rgba(42, 224, 96, 0.6);
}

.spore-particle.dispersing {
    animation: spore-float 4s ease-out forwards;
}

@keyframes spore-float {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--tx, 80px), var(--ty, -160px)) scale(0.3); }
}

/* Ecosystem */
.ecosystem-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    padding-top: 0.5rem;
}

.eco-card {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.6rem 0.95rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.82rem;
    color: var(--text-primary);
    margin-top: var(--jitter, 0px);
    transition: border-color 0.3s ease, color 0.3s ease;
}

.eco-card:hover {
    border-color: var(--growth-mid);
    color: var(--code-accent);
}

.eco-icon {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: var(--growth-mid);
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    background: var(--bg-sidebar);
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-family: 'Fira Code', monospace;
}

.footer-sub {
    margin-top: 0.4rem;
    opacity: 0.7;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-sidebar); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--growth-mid); }

/* Responsive */
@media (max-width: 920px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: relative;
        top: auto;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem 1.5rem;
    }
    .content {
        padding: 2rem 1.5rem 3rem;
    }
    .growth-grid {
        gap: 1px;
    }
}

@media (max-width: 560px) {
    .header {
        flex-direction: column;
        gap: 0.6rem;
        padding: 0.8rem 1rem;
    }
    .nav {
        gap: 1.1rem;
    }
    .sidebar {
        grid-template-columns: 1fr;
    }
    .content {
        padding: 1.5rem 1rem 2.5rem;
    }
    .terminal-output {
        font-size: 0.7rem;
    }
}
