/* FloraForge article styles. Biology and engine pages share one base theme, with page-specific component sections layered below. */

/* Shared article base. */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --green-deep: #081a0c;
    --green-dark: #132913;
    --green-mid: #1e4d2b;
    --green-bright: #3ecf6e;
    --green-glow: #7cff9f;
    --cream: #f0ede4;
    --sand: #c7b99d;
    --mist: rgba(240, 237, 228, 0.72);
    --panel: rgba(18, 35, 20, 0.72);
    --panel-strong: rgba(11, 24, 13, 0.92);
    --line: rgba(62, 207, 110, 0.14);
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    --code: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

html {
    background: var(--green-deep);
    color: var(--cream);
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: "DM Sans", sans-serif;
    background:
        radial-gradient(circle at top center, rgba(124, 255, 159, 0.16), transparent 38%),
        linear-gradient(180deg, #09190b 0%, #0d1f0f 40%, #08150a 100%);
    color: var(--cream);
    overflow-x: hidden;
    line-height: 1.6;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

a { color: inherit; text-decoration: none; }

.content { position: relative; z-index: 2; }

.wrap { width: min(1120px, 100%); margin: 0 auto; padding: 0 2rem; }

code {
    font-family: var(--code);
    font-size: 0.86em;
    color: var(--green-glow);
    background: rgba(62, 207, 110, 0.08);
    border: 1px solid rgba(62, 207, 110, 0.14);
    border-radius: 6px;
    padding: 0.08em 0.4em;
}

h1, h2, h3 {
    font-family: "Space Grotesk", sans-serif;
    letter-spacing: -0.03em;
}

.accent { color: var(--green-bright); }

/* ---- top bar ---- */
/* Bar look and brand mark live in the shared assets/nav.css; only the
   article-specific spacing around the bar stays here. */
.topbar {
    padding: 1.8rem 0;
}

/* ---- hero ---- */
.hero { padding: 3rem 0 1rem; }

.eyebrow {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--green-bright);
    opacity: 0.84;
}

.hero h1 {
    font-size: clamp(2.6rem, 6vw, 4.4rem);
    line-height: 0.98;
    margin: 1.2rem 0 1.4rem;
}

.hero p {
    max-width: 680px;
    color: var(--sand);
    font-size: clamp(1.04rem, 2.2vw, 1.24rem);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.8rem;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.82rem;
    color: var(--mist);
}

.hero-meta span {
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(62, 207, 110, 0.12);
}

/* ---- biology sub-navigation ---- */
.subnav {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 1.6rem 0 0.4rem;
    padding: 0.35rem;
    border-radius: 999px;
    background: rgba(11, 24, 13, 0.6);
    border: 1px solid var(--line);
}

.subnav a {
    padding: 0.5rem 1.05rem;
    border-radius: 999px;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.86rem;
    letter-spacing: 0.02em;
    color: var(--sand);
    transition: background 140ms ease, color 140ms ease;
}

.subnav a:hover { color: var(--cream); background: rgba(124, 255, 159, 0.08); }

.subnav a.current {
    background: linear-gradient(135deg, rgba(62, 207, 110, 0.32), rgba(124, 255, 159, 0.2));
    color: var(--cream);
}

/* ---- sections ---- */
section.block { padding: 4rem 0; }

.section-label {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--green-bright);
    opacity: 0.84;
}

h2 {
    font-size: clamp(1.8rem, 3.6vw, 2.8rem);
    line-height: 1.1;
    margin: 0.9rem 0 1.2rem;
}

.lead { color: var(--sand); max-width: 760px; font-size: 1.05rem; }

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--green-mid), transparent);
}

/* ---- gallery ---- */
.gallery {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 2.5rem;
}

.shot {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
    min-height: 180px;
}

.shot.feature { grid-row: span 2; }

.shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.shot figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.4rem 1rem 0.85rem;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    color: var(--cream);
    background: linear-gradient(180deg, transparent, rgba(6, 14, 8, 0.82));
}

/* ---- biome cards ---- */
.biome-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.biome {
    border-radius: 22px;
    overflow: hidden;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.biome-swatch {
    height: 8px;
}

.biome-body { padding: 1.6rem 1.6rem 1.8rem; }

.biome h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.biome h3 .dot {
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    flex: none;
}

.biome p { color: var(--sand); font-size: 0.96rem; margin-bottom: 1.2rem; }

.biome dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 0.9rem;
    font-size: 0.86rem;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
}

.biome dt {
    color: var(--mist);
    font-family: "Space Grotesk", sans-serif;
    letter-spacing: 0.02em;
}

.biome dd { color: var(--cream); text-align: right; font-variant-numeric: tabular-nums; }

.biome .flora-line {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    font-size: 0.86rem;
    color: var(--mist);
}

.biome .flora-line strong { color: var(--green-bright); font-weight: 500; }

.tag {
    display: inline-block;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.55rem;
    margin: 0.2rem 0.25rem 0 0;
    border-radius: 999px;
    background: rgba(62, 207, 110, 0.1);
    border: 1px solid rgba(62, 207, 110, 0.18);
    color: var(--cream);
}

/* ---- climate diagram ---- */
.climate-card {
    margin-top: 2.5rem;
    padding: 2rem;
    border-radius: 24px;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.climate-svg { width: 100%; height: auto; display: block; }
.climate-svg text { font-family: "Space Grotesk", sans-serif; }

.climate-caption {
    margin-top: 1.2rem;
    color: var(--mist);
    font-size: 0.92rem;
    text-align: center;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

/* ---- species cards ---- */
.species-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.species {
    border-radius: 22px;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.species-head {
    display: flex;
    gap: 1rem;
    padding: 1.4rem 1.4rem 1rem;
    align-items: flex-end;
    background:
        radial-gradient(circle at 18% 0%, rgba(124, 255, 159, 0.12), transparent 60%),
        linear-gradient(180deg, rgba(30, 77, 43, 0.22), transparent);
}

.species-art {
    width: 88px;
    height: 116px;
    flex: none;
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(140, 196, 235, 0.16) 0%, rgba(30, 77, 43, 0.1) 56%, rgba(10, 29, 11, 0.3) 100%);
    border: 1px solid var(--line);
}

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

.species-titles { padding-bottom: 0.3rem; }

.species-titles .kind {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--green-bright);
    opacity: 0.85;
}

.species-titles h3 { font-size: 1.4rem; margin-top: 0.2rem; }
.species-titles .latin { color: var(--mist); font-size: 0.86rem; font-style: italic; }

.species-body { padding: 0.4rem 1.4rem 1.5rem; }

.species-body > p { color: var(--sand); font-size: 0.94rem; margin: 0.6rem 0 1.1rem; }

.species dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.4rem 0.9rem;
    font-size: 0.85rem;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
}

.species dt { color: var(--mist); font-family: "Space Grotesk", sans-serif; }
.species dd { color: var(--cream); text-align: right; }

.swatches { display: inline-flex; gap: 0.35rem; justify-content: flex-end; }
.swatches i {
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: inline-block;
}

.species-biomes {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

/* ---- read-more / trait callouts ---- */
.note {
    margin-top: 2.2rem;
    padding: 1.4rem 1.6rem;
    border-radius: 18px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--green-bright);
    background: rgba(30, 77, 43, 0.14);
    color: var(--sand);
    font-size: 0.96rem;
    max-width: 820px;
}

.note strong { color: var(--cream); font-weight: 600; }

/* ---- cta ---- */
.cta { text-align: center; padding: 5rem 0 4rem; }
.cta h2 { margin-bottom: 1rem; }
.cta p { color: var(--sand); max-width: 600px; margin: 0 auto 2rem; }

.button {
    display: inline-block;
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    padding: 0.95rem 1.4rem;
    font: inherit;
    font-weight: 500;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.button:hover { transform: translateY(-1px); }

.button-primary {
    background: linear-gradient(135deg, var(--green-bright), var(--green-glow));
    color: #06210e;
    box-shadow: 0 18px 50px rgba(62, 207, 110, 0.25);
}

.button-secondary {
    background: rgba(255, 255, 255, 0.02);
    color: var(--cream);
    border: 1px solid rgba(240, 237, 228, 0.12);
    margin-left: 0.6rem;
}

footer { padding: 2rem 0 3rem; }

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    border-top: 1px solid rgba(62, 207, 110, 0.08);
    padding-top: 1.4rem;
    color: rgba(240, 237, 228, 0.56);
    font-size: 0.92rem;
}

@media (max-width: 860px) {
    .gallery { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
    .shot.feature { grid-column: span 2; grid-row: auto; }
    .phases { grid-template-columns: 1fr; }
    .layer { grid-template-columns: 1fr; gap: 0.6rem; }
    .wrap { padding: 0 1.2rem; }
}

@media (max-width: 560px) {
    .gallery { grid-template-columns: 1fr; }
    .shot.feature { grid-column: auto; }
    .button-secondary { margin-left: 0; margin-top: 0.6rem; }
}

/* Engine-specific sections. */
/* ---- loop diagram ---- */
.diagram-card {
    margin-top: 2.5rem;
    padding: 2rem;
    border-radius: 24px;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.loop-svg { width: 100%; height: auto; display: block; }
.loop-svg text { font-family: "Space Grotesk", sans-serif; }

.diagram-caption {
    margin-top: 1.4rem;
    color: var(--mist);
    font-size: 0.92rem;
    text-align: center;
}

.legend {
    display: flex;
    gap: 1.6rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1.2rem;
    font-size: 0.85rem;
    color: var(--mist);
}

.legend span { display: inline-flex; align-items: center; gap: 0.5rem; }

.swatch { width: 0.85rem; height: 0.85rem; border-radius: 4px; display: inline-block; }

/* ---- two-column phase breakdown ---- */
.phases {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.phase {
    border-radius: 20px;
    padding: 1.8rem;
    background: rgba(30, 77, 43, 0.14);
    border: 1px solid rgba(62, 207, 110, 0.12);
}

.phase.cpu { border-top: 3px solid var(--green-bright); }
.phase.gpu { border-top: 3px solid #f6c591; }

.phase h3 {
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}

.phase h3 code { font-size: 0.7em; }

.phase .sub { color: var(--mist); font-size: 0.9rem; margin-bottom: 1.3rem; }

ol.steps { list-style: none; counter-reset: step; }

ol.steps li {
    counter-increment: step;
    position: relative;
    padding: 0.7rem 0 0.7rem 2.6rem;
    border-top: 1px solid var(--line);
}

ol.steps li:first-child { border-top: 0; }

ol.steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0.7rem;
    width: 1.7rem;
    height: 1.7rem;
    display: grid;
    place-items: center;
    border-radius: 8px;
    font-family: var(--code);
    font-size: 0.8rem;
    color: var(--green-deep);
    background: linear-gradient(135deg, var(--green-bright), var(--green-glow));
}

.phase.gpu ol.steps li::before {
    background: linear-gradient(135deg, #f6c591, #f0a861);
}

ol.steps strong { color: var(--cream); font-weight: 600; }
ol.steps .note { display: block; color: var(--sand); font-size: 0.9rem; margin-top: 0.15rem; }

/* ---- render pass pipeline ---- */
.passes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.4rem;
    align-items: stretch;
}

.pass-chip {
    flex: 1 1 120px;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: rgba(11, 24, 13, 0.6);
    border: 1px solid rgba(246, 197, 145, 0.18);
    position: relative;
}

.pass-chip b { font-family: "Space Grotesk", sans-serif; display: block; font-size: 0.98rem; }
.pass-chip small { color: var(--sand); font-size: 0.82rem; }

/* ---- state machine ---- */
.states {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.state-card {
    padding: 1.4rem;
    border-radius: 16px;
    background: rgba(30, 77, 43, 0.14);
    border: 1px solid var(--line);
}

.state-card h4 {
    font-family: var(--code);
    font-size: 0.95rem;
    color: var(--green-bright);
    margin-bottom: 0.5rem;
}

.state-card p { color: var(--sand); font-size: 0.9rem; }

.loading-flow {
    margin-top: 2rem;
    padding: 1.6rem;
    border-radius: 18px;
    background: rgba(11, 24, 13, 0.5);
    border: 1px solid var(--line);
}

.loading-flow .pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.9rem;
    font-family: var(--code);
    font-size: 0.8rem;
}

.loading-flow .pills span {
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: rgba(62, 207, 110, 0.08);
    border: 1px solid rgba(62, 207, 110, 0.16);
    color: var(--mist);
}

.loading-flow .pills span.done {
    background: linear-gradient(135deg, rgba(62, 207, 110, 0.3), rgba(124, 255, 159, 0.18));
    color: var(--cream);
}

/* ---- architecture layers ---- */
.layers { display: flex; flex-direction: column; gap: 1rem; margin-top: 2rem; }

.layer {
    padding: 1.6rem 1.8rem;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(30, 77, 43, 0.14);
    display: grid;
    grid-template-columns: minmax(0, 220px) 1fr;
    gap: 1.5rem;
    align-items: center;
}

.layer .tag {
    font-family: var(--code);
    color: var(--green-bright);
    font-size: 0.95rem;
}

.layer .tag small { display: block; color: var(--mist); font-family: "DM Sans", sans-serif; font-size: 0.82rem; margin-top: 0.3rem; }
.layer p { color: var(--sand); font-size: 0.95rem; }

.layer.runtime { border-left: 3px solid var(--green-bright); }
.layer.core { border-left: 3px solid var(--green-glow); }
.layer.render { border-left: 3px solid #f6c591; }

/* ---- callout ---- */
.callout {
    margin-top: 2rem;
    padding: 1.4rem 1.6rem;
    border-radius: 16px;
    background: rgba(62, 207, 110, 0.06);
    border: 1px solid rgba(62, 207, 110, 0.16);
    border-left: 3px solid var(--green-bright);
    color: var(--sand);
    font-size: 0.96rem;
}

.callout strong { color: var(--cream); }
