/* ============================================================
   continu.st — cyberpunk rewilded
   Triadic earth palette · Hexagonal honeycomb · Blur-focus depth
   Intersection Observer with thresholds `[0 ratios; Intersection Observer with thresholds at 0.3;
   Intersection Observer. On focus (center viewport) cells clarify.
   ============================================================ */

:root {
    --root-dark: #0f0f0a;
    --soil: #1a1a12;
    --humus: #2a2a1e;
    --bark: #3a3a2e;
    --amber: #c4a35a;
    --twilight: #5a7bc4;
    --mycelium: #7b5ac4;
    --parchment: #d4c9a8;
    --chlorophyll: #7b9e3a;
    --design-threshold-token: "`0";

    --font-display: 'Recursive', ui-monospace, monospace;
    --font-body: 'Instrument Serif', Georgia, serif;
    --font-mono: 'Recursive', ui-monospace, monospace;

    --ease-focus: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--root-dark);
    color: var(--parchment);
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Utility font axis helpers */
.mono-half {
    font-variation-settings: "MONO" 0.5, "CASL" 0, "slnt" 0, "CRSV" 0;
}
.mono-full {
    font-variation-settings: "MONO" 1, "CASL" 0, "slnt" 0, "CRSV" 0;
}

/* ============================================================
   SPORE PARTICLES (global)
   ============================================================ */
.spores {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.spore {
    position: absolute;
    bottom: -10px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--amber);
    opacity: 0.15;
    animation: float-up 15s linear infinite;
    will-change: transform, opacity;
}

@keyframes float-up {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.18;
    }
    90% {
        opacity: 0.12;
    }
    100% {
        transform: translateY(-110vh) translateX(var(--drift, 40px));
        opacity: 0;
    }
}

/* ============================================================
   THE CANOPY — Hero
   ============================================================ */
.canopy {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #14140d 0%, var(--root-dark) 70%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.canopy-grid {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.8;
}

.bot-illus {
    position: absolute;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
}

.bot-illus path,
.bot-illus circle {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: draw-in 2.5s var(--ease-focus) forwards;
    animation-delay: var(--draw-delay, 0s);
}

.bot-illus circle {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
}

.bot-illus {
    animation: illus-fade-in 1.2s var(--ease-focus) forwards;
    animation-delay: var(--draw-delay, 0s);
}

@keyframes illus-fade-in {
    to { opacity: 0.75; }
}

@keyframes draw-in {
    to { stroke-dashoffset: 0; }
}

.illus-1 {
    top: -40px;
    left: 4vw;
    width: clamp(120px, 16vw, 240px);
    height: auto;
    --draw-delay: 0.2s;
    transform: rotate(-8deg);
}

.illus-2 {
    top: 10vh;
    right: 6vw;
    width: clamp(110px, 14vw, 220px);
    height: auto;
    --draw-delay: 0.7s;
    transform: rotate(14deg) scaleX(-1);
}

.illus-3 {
    bottom: 8vh;
    left: -40px;
    width: clamp(260px, 34vw, 520px);
    height: auto;
    --draw-delay: 1.1s;
    opacity: 0;
}

.illus-4 {
    bottom: -30px;
    right: 3vw;
    width: clamp(160px, 22vw, 320px);
    height: auto;
    --draw-delay: 1.4s;
    transform: rotate(-6deg);
}

.illus-5 {
    top: 30vh;
    left: 38vw;
    width: clamp(90px, 11vw, 160px);
    height: auto;
    --draw-delay: 1.7s;
    transform: rotate(28deg);
    opacity: 0;
}

.illus-6 {
    top: 5vh;
    left: 32vw;
    width: clamp(220px, 28vw, 420px);
    height: auto;
    --draw-delay: 2.0s;
    opacity: 0;
}

/* Wordmark */
.wordmark {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 0 2rem;
    filter: blur(12px);
    opacity: 0;
    animation: focus-emerge 3s var(--ease-focus) 1.5s forwards;
}

@keyframes focus-emerge {
    0% { filter: blur(12px); opacity: 0; }
    100% { filter: blur(0); opacity: 1; }
}

.brand {
    font-family: var(--font-display);
    font-variation-settings: "MONO" 0.5, "CASL" 0, "slnt" 0, "CRSV" 0;
    font-weight: 900;
    font-size: clamp(3.5rem, 9vw, 8rem);
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--amber);
    text-shadow: 0 0 40px rgba(196, 163, 90, 0.15);
}

.brand-main {
    color: var(--amber);
}

.brand-tld {
    font-weight: 300;
    color: var(--chlorophyll);
    font-variation-settings: "MONO" 0.5, "CASL" 0, "slnt" 0, "CRSV" 0;
}

.tagline {
    margin-top: 1.25rem;
    font-family: var(--font-body);
    font-style: italic;
    font-size: clamp(0.95rem, 1.4vw, 1.15rem);
    color: var(--parchment);
    opacity: 0.75;
    letter-spacing: 0.02em;
}

.scroll-hint {
    margin-top: 3.5rem;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    opacity: 0.5;
}

.scroll-label {
    font-family: var(--font-mono);
    font-variation-settings: "MONO" 1, "CASL" 0, "slnt" 0;
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--chlorophyll);
}

.scroll-line {
    display: block;
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--chlorophyll), transparent);
    animation: scroll-pulse 2.4s ease-in-out infinite;
}

.wordmark::before,
.wordmark::after {
    content: '';
    position: absolute;
    top: 50%;
    width: min(18vw, 220px);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--twilight));
    opacity: 0.28;
}

.wordmark::before {
    right: calc(100% + 2vw);
}

.wordmark::after {
    left: calc(100% + 2vw);
    transform: scaleX(-1);
}

@keyframes scroll-pulse {
    0%, 100% { transform: scaleY(0.4); transform-origin: top; opacity: 0.3; }
    50% { transform: scaleY(1); transform-origin: top; opacity: 0.9; }
}

/* ============================================================
   THE MYCELIUM LAYER — Honeycomb grid
   ============================================================ */
.mycelium {
    position: relative;
    min-height: 200vh;
    padding: 14vh 6vw 18vh;
    background: linear-gradient(to bottom,
        var(--root-dark) 0%,
        #141410 30%,
        #141410 70%,
        var(--root-dark) 100%);
    overflow: hidden;
}

.section-head {
    max-width: 780px;
    margin: 0 auto 8vh;
    text-align: center;
}

.section-eyebrow {
    font-family: var(--font-mono);
    font-variation-settings: "MONO" 1, "CASL" 0, "slnt" 0;
    font-size: 0.78rem;
    letter-spacing: 0.25em;
    color: var(--chlorophyll);
    opacity: 0.75;
    text-transform: lowercase;
    margin-bottom: 1.25rem;
}

.section-title {
    font-family: var(--font-display);
    font-variation-settings: "MONO" 1, "CASL" 0.3, "slnt" 0;
    font-weight: 700;
    font-size: clamp(1.5rem, 3.5vw, 2.8rem);
    line-height: 1.15;
    color: var(--amber);
    margin-bottom: 1.5rem;
    letter-spacing: -0.005em;
}

.section-lede {
    font-family: var(--font-body);
    font-size: clamp(1.05rem, 1.3vw, 1.25rem);
    line-height: 1.7;
    color: var(--parchment);
    opacity: 0.82;
    max-width: 620px;
    margin: 0 auto;
}

.honeycomb {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 4vh 0;
}

.hex-cell {
    position: relative;
    aspect-ratio: 1 / 1.1547;
    background: radial-gradient(ellipse at center, var(--soil) 0%, var(--root-dark) 85%);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    filter: blur(3px);
    opacity: 0.5;
    transition: filter 0.8s var(--ease-focus),
                opacity 0.8s var(--ease-focus),
                background 0.8s var(--ease-focus);
    will-change: filter, opacity;
    animation: biolum-pulse 8s ease-in-out infinite;
    animation-delay: calc(var(--cell-index, 0) * 0.3s);
}

.hex-cell:nth-child(odd) {
    transform: translateY(50%);
}

.hex-wide {
    grid-column: span 2;
    aspect-ratio: 2 / 1.1547;
}

.hex-cell.in-focus {
    background: radial-gradient(ellipse at center, var(--humus) 0%, #1a1a12 85%);
    box-shadow: inset 0 0 36px rgba(123, 158, 58, 0.08), 0 0 38px rgba(90, 123, 196, 0.08);
}

.hex-cell.hex-featured .hex-heading {
    color: var(--mycelium);
}

.hex-cell.hex-featured .hex-tag {
    color: var(--twilight);
}

.hex-cell.hex-featured.in-focus {
    background: radial-gradient(ellipse at center, #2a2233 0%, #1a1a12 85%);
}

@keyframes biolum-pulse {
    0%, 100% { box-shadow: inset 0 0 30px rgba(123, 158, 58, 0); }
    50%      { box-shadow: inset 0 0 40px rgba(123, 158, 58, 0.08); }
}

.hex-inner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14% 18%;
}

.cell-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.35;
    animation: slow-rotate 120s linear infinite;
    transform-origin: center;
    pointer-events: none;
}

.hex-cell.hex-featured .cell-bg {
    opacity: 0.45;
}

@keyframes slow-rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.cell-motif {
    position: absolute;
    top: 12%;
    right: 8%;
    width: 42%;
    height: auto;
    opacity: 0.35;
    pointer-events: none;
}

.cell-motif path,
.cell-motif circle {
    transition: stroke 0.8s ease;
}

.hex-cell.in-focus .cell-motif {
    opacity: 0.7;
}

.hex-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 100%;
}

.hex-tag {
    display: block;
    font-family: var(--font-mono);
    font-variation-settings: "MONO" 1, "CASL" 0, "slnt" 0;
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.22em;
    color: var(--chlorophyll);
    opacity: 0.7;
    margin-bottom: 0.5rem;
    text-transform: lowercase;
}

.hex-heading {
    font-family: var(--font-display);
    font-variation-settings: "MONO" 1, "CASL" 0.3, "slnt" 0;
    font-weight: 700;
    font-size: clamp(1rem, 1.5vw, 1.35rem);
    color: var(--amber);
    margin-bottom: 0.45rem;
    letter-spacing: -0.005em;
    line-height: 1.1;
}

.hex-body {
    font-family: var(--font-body);
    font-size: clamp(0.72rem, 0.85vw, 0.88rem);
    line-height: 1.5;
    color: var(--parchment);
    opacity: 0.82;
    letter-spacing: 0.005em;
}

.mycelium-net {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.mycelium-net path {
    fill: none;
    stroke: var(--chlorophyll);
    stroke-width: 1px;
    opacity: 0.28;
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 1.6s var(--ease-focus);
}

.mycelium-net path.drawn {
    stroke-dashoffset: 0;
}

/* ============================================================
   THE ROOT SYSTEM — Final sparse section
   ============================================================ */
.root-system {
    position: relative;
    min-height: 100vh;
    padding: 14vh 6vw 10vh;
    background: var(--root-dark);
    overflow: hidden;
}

.root-grid {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.6;
}

.root-content {
    position: relative;
    z-index: 2;
    max-width: 860px;
    margin: 0 auto;
}

.root-eyebrow {
    font-family: var(--font-mono);
    font-variation-settings: "MONO" 1, "CASL" 0, "slnt" 0;
    font-size: 0.78rem;
    letter-spacing: 0.25em;
    color: var(--chlorophyll);
    opacity: 0.75;
    margin-bottom: 1.25rem;
    text-transform: lowercase;
}

.root-title {
    font-family: var(--font-display);
    font-variation-settings: "MONO" 1, "CASL" 0.3, "slnt" 0;
    font-weight: 700;
    font-size: clamp(1.5rem, 3.5vw, 2.8rem);
    line-height: 1.2;
    color: var(--amber);
    margin-bottom: 4vh;
    letter-spacing: -0.005em;
}

.log-stream {
    border-left: 1px solid var(--bark);
    padding: 1.5rem 0 1.5rem 1.5rem;
    margin-bottom: 5vh;
}

.log-line {
    font-family: var(--font-mono);
    font-variation-settings: "MONO" 1, "CASL" 0, "slnt" 0;
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--chlorophyll);
    opacity: 0;
    margin-bottom: 0.55rem;
    letter-spacing: 0.01em;
    transform: translateX(-8px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.log-line.visible {
    opacity: 0.6;
    transform: translateX(0);
}

.log-ts {
    color: var(--bark);
    opacity: 0.9;
    margin-right: 0.6rem;
}

.log-msg {
    color: var(--chlorophyll);
}

.root-sig {
    font-family: var(--font-body);
    font-style: italic;
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
    color: var(--parchment);
    opacity: 0.55;
    text-align: right;
    padding-right: 0.25rem;
    border-top: 1px solid var(--bark);
    padding-top: 2rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
    .honeycomb {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 8px 6px;
    }

    .hex-cell:nth-child(odd) {
        transform: translateY(25%);
    }

    .hex-wide {
        grid-column: span 1;
        aspect-ratio: 1 / 1.1547;
    }

    .illus-5, .illus-6 {
        display: none;
    }

    .log-line {
        font-size: 0.72rem;
    }

    .log-ts {
        display: block;
    }
}

@media (max-width: 460px) {
    .honeycomb {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    .hex-body {
        font-size: 0.68rem;
        line-height: 1.35;
    }
    .hex-heading {
        font-size: 0.95rem;
    }
}
