/* ==============================================
   chloengine.com - Goblincore Circuit-Flora Design
   Colors: #d4e8d0, #14f5c6, #7a8b72, #1a2e1f, #a855f7, #0f1a12, #39ff8e, #d4a847
   Fonts: Recursive, Space Grotesk, Lora, Inter
   ============================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background: #0f1a12;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    color: #d4e8d0;
    background: #0f1a12;
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Recursive', monospace;
    font-variation-settings: 'CASL' 0.5, 'MONO' 0.3;
    line-height: 1.1;
}

.heading-accent {
    color: #39ff8e;
    font-family: 'Recursive', monospace;
    font-variation-settings: 'CASL' 0, 'MONO' 1;
    font-weight: 400;
    opacity: 0.7;
}

/* --- Section Base --- */
.section {
    min-height: 80vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section__inner {
    max-width: 900px;
    width: 100%;
    padding: 80px 24px;
    position: relative;
    z-index: 2;
}

.section__heading {
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #d4e8d0;
}

/* ================================================
   SECTION 1: THE CANOPY (Hero)
   ================================================ */
.section--canopy {
    height: 100vh;
    min-height: 100vh;
    background: radial-gradient(ellipse at 50% 30%, #1a2e1f 0%, #0f1a12 70%);
    flex-direction: column;
    overflow: hidden;
}

.canopy__bg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.canopy__circuit-tree {
    width: 70vw;
    max-width: 700px;
    height: auto;
    opacity: 0.6;
}

.circuit-path {
    fill: none;
    stroke: #39ff8e;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.circuit-path.trunk {
    stroke-width: 3;
    stroke: #14f5c6;
}

.circuit-path.branch {
    stroke-width: 2;
    stroke: #39ff8e;
}

.circuit-path.twig {
    stroke-width: 1.5;
    stroke: #39ff8e;
    opacity: 0.7;
}

.circuit-node {
    fill: #39ff8e;
    filter: drop-shadow(0 0 6px #39ff8e);
}

.circuit-node.node--small {
    fill: #14f5c6;
    filter: drop-shadow(0 0 4px #14f5c6);
}

.circuit-mushroom {
    fill: none;
    stroke: #d4a847;
    stroke-width: 2;
    filter: drop-shadow(0 0 4px #d4a847);
}

/* Circuit tree draw-in animation */
.circuit-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawCircuit 3s ease-out forwards;
}

.circuit-path.trunk { animation-delay: 0s; }
.circuit-path.branch--1 { animation-delay: 0.4s; }
.circuit-path.branch--2 { animation-delay: 0.5s; }
.circuit-path.branch--3 { animation-delay: 0.6s; }
.circuit-path.branch--4 { animation-delay: 0.7s; }
.circuit-path.branch--5 { animation-delay: 0.8s; }
.circuit-path.branch--6 { animation-delay: 0.9s; }
.circuit-path.twig { animation-delay: 1.2s; }

.circuit-node {
    opacity: 0;
    animation: nodeAppear 0.5s ease-out forwards;
    animation-delay: 1.5s;
}

.circuit-mushroom {
    opacity: 0;
    animation: nodeAppear 0.8s ease-out forwards;
    animation-delay: 2s;
}

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

@keyframes nodeAppear {
    from { opacity: 0; transform: scale(0); }
    to { opacity: 1; transform: scale(1); }
}

/* Spore particles */
.spore-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.spore-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #d4a847;
    border-radius: 50%;
    opacity: 0;
    animation: floatSpore linear infinite;
    filter: blur(0.5px);
}

@keyframes floatSpore {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.3; }
    100% { transform: translateY(-200px) translateX(40px); opacity: 0; }
}

/* Canopy content */
.canopy__content {
    position: relative;
    z-index: 3;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.canopy__title {
    font-size: clamp(3.5rem, 10vw, 8rem);
    font-weight: 800;
    font-variation-settings: 'CASL' 0.5, 'MONO' 0.3;
    line-height: 0.9;
    letter-spacing: -0.03em;
}

.title-line {
    display: block;
}

.title-line--1 {
    color: #39ff8e;
    text-shadow: 0 0 40px rgba(57, 255, 142, 0.4);
}

.title-line--2 {
    color: #d4e8d0;
    font-weight: 400;
    font-variation-settings: 'CASL' 0, 'MONO' 0.8;
    font-size: 0.6em;
    letter-spacing: 0.1em;
}

.canopy__tagline {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: #7a8b72;
    max-width: 400px;
}

.canopy__scroll-hint {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: pulseDown 2s ease-in-out infinite;
    animation-delay: 3s;
    opacity: 0;
    animation-fill-mode: forwards;
}

.scroll-hint__text {
    font-family: 'Recursive', monospace;
    font-variation-settings: 'CASL' 0, 'MONO' 1;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #7a8b72;
}

.scroll-hint__arrow {
    color: #39ff8e;
}

@keyframes pulseDown {
    0% { opacity: 0; }
    10% { opacity: 0.6; }
    50% { transform: translateY(8px); opacity: 1; }
    100% { transform: translateY(0); opacity: 0.6; }
}

/* ================================================
   SECTION 2: THE UNDERSTORY (Philosophy)
   ================================================ */
.section--understory {
    background: linear-gradient(180deg, #0f1a12 0%, #1a2e1f 50%, #0f1a12 100%);
    padding: 0;
}

.understory__fern-border {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 80px;
    opacity: 0.3;
    overflow: hidden;
}

.fern-svg {
    width: 100%;
    height: 100%;
}

.fern-stem {
    fill: none;
    stroke: #7a8b72;
    stroke-width: 1.5;
}

.fern-frond {
    fill: none;
    stroke: #39ff8e;
    stroke-width: 1;
    opacity: 0.6;
}

.fern-node {
    fill: #14f5c6;
    opacity: 0.8;
}

.understory__heading {
    margin-bottom: 2rem;
}

.understory__text--lead {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    color: #d4e8d0;
    line-height: 1.8;
    margin-bottom: 3rem;
    max-width: 700px;
}

.understory__pillars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 32px;
}

.pillar {
    background: rgba(26, 46, 31, 0.6);
    border: 1px solid rgba(57, 255, 142, 0.15);
    border-radius: 12px;
    padding: 32px 24px;
    transition: border-color 0.4s ease, transform 0.4s ease;
    opacity: 0;
    transform: translateY(30px);
}

.pillar.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pillar:hover {
    border-color: rgba(57, 255, 142, 0.4);
    transform: translateY(-4px);
}

.pillar__icon {
    margin-bottom: 16px;
}

.pillar-circuit {
    fill: none;
    stroke: #39ff8e;
    stroke-width: 2;
    stroke-linecap: round;
}

.pillar-node {
    fill: #14f5c6;
}

.pillar__title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #d4e8d0;
    margin-bottom: 8px;
    font-variation-settings: 'CASL' 0.3, 'MONO' 0.2;
}

.pillar__desc {
    font-size: 0.95rem;
    color: #7a8b72;
    line-height: 1.6;
}

/* ================================================
   SECTION 3: THE ROOT SYSTEM (Capabilities)
   ================================================ */
.section--roots {
    background: linear-gradient(180deg, #0f1a12 0%, #1a2e1f 30%, #1a2e1f 70%, #0f1a12 100%);
    min-height: 100vh;
}

.roots__bg-pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.08;
}

.roots__intro {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    color: #7a8b72;
    margin-bottom: 3rem;
    max-width: 600px;
}

.roots__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.root-card {
    position: relative;
    background: rgba(15, 26, 18, 0.8);
    border: 1px solid rgba(57, 255, 142, 0.1);
    border-radius: 8px;
    padding: 28px 24px;
    overflow: hidden;
    transition: border-color 0.4s ease, transform 0.4s ease;
    opacity: 0;
    transform: translateY(30px);
}

.root-card.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.root-card:hover {
    border-color: rgba(20, 245, 198, 0.4);
    transform: translateY(-2px);
}

.root-card__trace {
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #39ff8e, #14f5c6, transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.root-card:hover .root-card__trace {
    opacity: 1;
}

.root-card__title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #14f5c6;
    margin-bottom: 8px;
    font-variation-settings: 'CASL' 0.3, 'MONO' 0.5;
}

.root-card__desc {
    font-size: 0.9rem;
    color: #7a8b72;
    line-height: 1.6;
    margin-bottom: 12px;
}

.root-card__tag {
    display: inline-block;
    font-family: 'Recursive', monospace;
    font-variation-settings: 'CASL' 0, 'MONO' 1;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    padding: 4px 10px;
    border: 1px solid rgba(212, 168, 71, 0.4);
    border-radius: 4px;
    color: #d4a847;
    background: rgba(212, 168, 71, 0.08);
}

/* ================================================
   SECTION 4: THE MYCELIUM NETWORK (Community)
   ================================================ */
.section--mycelium {
    background: radial-gradient(ellipse at 50% 80%, #1a2e1f 0%, #0f1a12 60%);
    min-height: 90vh;
}

.mycelium__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.25;
}

.mycelium__intro {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    color: #7a8b72;
    margin-bottom: 3rem;
    max-width: 550px;
}

.mycelium__stats {
    display: flex;
    gap: 48px;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
}

.stat.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat__number {
    font-family: 'Recursive', monospace;
    font-variation-settings: 'CASL' 0, 'MONO' 1;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    color: #39ff8e;
    line-height: 1;
    text-shadow: 0 0 30px rgba(57, 255, 142, 0.3);
}

.stat__label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    color: #7a8b72;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

.mycelium__testimonial {
    opacity: 0;
    transform: translateY(20px);
}

.mycelium__testimonial.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.testimonial {
    border-left: 3px solid #a855f7;
    padding-left: 24px;
    max-width: 600px;
}

.testimonial__text {
    font-family: 'Lora', serif;
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    color: #d4e8d0;
    line-height: 1.7;
    margin-bottom: 12px;
}

.testimonial__cite {
    font-family: 'Recursive', monospace;
    font-variation-settings: 'CASL' 0, 'MONO' 1;
    font-size: 0.85rem;
    color: #a855f7;
    font-style: normal;
}

/* ================================================
   SECTION 5: THE SPORE (CTA)
   ================================================ */
.section--spore {
    background: linear-gradient(180deg, #0f1a12 0%, #1a2e1f 40%, #0f1a12 100%);
    min-height: 80vh;
    text-align: center;
}

.section--spore .section__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.spore__glow {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: sporeGlow 4s ease-in-out infinite alternate;
}

@keyframes sporeGlow {
    from { opacity: 0.5; transform: translate(-50%, -50%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.spore__heading {
    text-align: center;
}

.spore__text {
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    color: #7a8b72;
    max-width: 560px;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.spore__actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 4rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn--primary {
    background: #39ff8e;
    color: #0f1a12;
    box-shadow: 0 0 20px rgba(57, 255, 142, 0.3);
}

.btn--primary:hover {
    background: #14f5c6;
    box-shadow: 0 0 30px rgba(57, 255, 142, 0.5);
    transform: translateY(-2px);
}

.btn--secondary {
    background: rgba(57, 255, 142, 0.1);
    color: #39ff8e;
    border: 1px solid rgba(57, 255, 142, 0.3);
}

.btn--secondary:hover {
    background: rgba(57, 255, 142, 0.2);
    border-color: #39ff8e;
    transform: translateY(-2px);
}

.btn--ghost {
    background: transparent;
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.btn--ghost:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: #a855f7;
    transform: translateY(-2px);
}

.btn__icon {
    display: flex;
    align-items: center;
}

/* Footer */
.spore__footer {
    padding-top: 2rem;
    border-top: 1px solid rgba(122, 139, 114, 0.2);
    width: 100%;
    max-width: 600px;
}

.footer__links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}

.footer-link {
    font-family: 'Recursive', monospace;
    font-variation-settings: 'CASL' 0, 'MONO' 1;
    font-size: 0.8rem;
    color: #7a8b72;
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #39ff8e;
}

.footer__copy {
    font-size: 0.75rem;
    color: rgba(122, 139, 114, 0.5);
    font-family: 'Space Grotesk', sans-serif;
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
    .understory__fern-border {
        display: none;
    }

    .understory__pillars {
        grid-template-columns: 1fr;
    }

    .roots__grid {
        grid-template-columns: 1fr;
    }

    .mycelium__stats {
        gap: 24px;
    }

    .spore__actions {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .section__inner {
        padding: 60px 16px;
    }

    .footer__links {
        gap: 16px;
        flex-wrap: wrap;
    }
}
