/* ============================================================
   namu.systems — Bauhaus dashboard for tree systems
   Palette: deep burgundy, Kandinsky primaries, hand-drawn earth
   Type: Lora (serif), IBM Plex Mono
   ============================================================ */

:root {
    /* Palette */
    --burgundy-deep: #3A1020;
    --panel-dark: #2A0818;
    --bauhaus-yellow: #E8C840;
    --bauhaus-blue: #3870B0;
    --bauhaus-red: #C83838;
    --system-cream: #F0EBD8;
    --root-brown: #8A6840;

    /* Cursor coords */
    --mx: 50%;
    --my: 50%;

    /* Typography */
    --font-serif: 'Lora', Georgia, serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

    /* Spacing */
    --gap: 12px;
    --gap-lg: 24px;
}

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

html, body {
    height: 100%;
}

body {
    background: var(--burgundy-deep);
    color: var(--system-cream);
    font-family: var(--font-serif);
    font-size: clamp(14px, 1vw, 16px);
    line-height: 1.75;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* ============================================================
   Cursor-follow Spotlight (cream radial illuminating dark)
   ============================================================ */
.spotlight {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: radial-gradient(
        circle 220px at var(--mx) var(--my),
        rgba(240, 235, 216, 0.10) 0%,
        rgba(240, 235, 216, 0.05) 35%,
        rgba(240, 235, 216, 0.00) 70%
    );
    mix-blend-mode: screen;
    transition: background 80ms linear;
}

/* Sit content above spotlight */
.hero,
.panels-section,
.diagram-section,
.projection-section,
.site-footer {
    position: relative;
    z-index: 2;
}

/* ============================================================
   Hero — System Overview (100vh)
   ============================================================ */
.hero {
    min-height: 100vh;
    padding: 32px 48px 24px;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse at 50% 100%, rgba(232, 200, 64, 0.04), transparent 60%),
        var(--burgundy-deep);
    border-bottom: 1px solid rgba(240, 235, 216, 0.08);
}

.hero-frame {
    flex: 1;
    display: grid;
    grid-template-rows: auto auto auto 1fr auto;
    gap: 24px;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
}

.hero-meta {
    display: flex;
    gap: 32px;
    border-bottom: 1px solid rgba(240, 235, 216, 0.12);
    padding-bottom: 12px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.meta-label {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(240, 235, 216, 0.55);
}

.meta-value {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 14px;
    color: var(--system-cream);
    font-variant-numeric: tabular-nums;
}

.status-ok {
    color: var(--bauhaus-yellow);
}

.status-ok::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bauhaus-yellow);
    margin-right: 6px;
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(232, 200, 64, 0.6);
    animation: pulse-dot 1800ms ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 0.6; box-shadow: 0 0 6px rgba(232, 200, 64, 0.4); }
    50%      { opacity: 1.0; box-shadow: 0 0 14px rgba(232, 200, 64, 0.9); }
}

.hero-title-block {
    margin-top: 12px;
    opacity: 0;
    transform: translateY(8px);
    animation: fade-in-up 1200ms ease-out 0.6s forwards;
}

@keyframes fade-in-up {
    to { opacity: 1; transform: translateY(0); }
}

.system-name {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: clamp(40px, 6vw, 88px);
    line-height: 1.0;
    letter-spacing: -0.01em;
    color: var(--system-cream);
}

.system-name .dot {
    color: var(--bauhaus-yellow);
}

.system-tagline {
    margin-top: 14px;
    font-family: var(--font-serif);
    font-size: clamp(15px, 1.25vw, 18px);
    line-height: 1.55;
    color: rgba(240, 235, 216, 0.78);
    max-width: 64ch;
    font-style: italic;
}

/* Header dashboard metrics */
.hero-dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap-lg);
    padding: 16px 0;
    border-top: 1px solid rgba(240, 235, 216, 0.10);
    border-bottom: 1px solid rgba(240, 235, 216, 0.10);
}

.header-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0;
    border-left: 2px solid rgba(240, 235, 216, 0.10);
    padding-left: 16px;
}

.header-metric:nth-child(1) { border-left-color: var(--bauhaus-yellow); }
.header-metric:nth-child(2) { border-left-color: var(--bauhaus-blue); }
.header-metric:nth-child(3) { border-left-color: var(--bauhaus-red); }
.header-metric:nth-child(4) { border-left-color: var(--root-brown); }

.metric-label {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(240, 235, 216, 0.6);
}

.metric-value {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: clamp(24px, 2.4vw, 36px);
    color: var(--system-cream);
    font-variant-numeric: tabular-nums;
    line-height: 1.05;
}

.metric-trend {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    color: rgba(240, 235, 216, 0.55);
}

.trend-up   { color: var(--bauhaus-yellow); }
.trend-down { color: var(--bauhaus-red); }
.trend-flat { color: var(--bauhaus-blue); }

/* Root network SVG */
.hero-rootnet {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-top: 8px;
}

.rootnet {
    width: 100%;
    max-width: 1200px;
    height: auto;
    max-height: 360px;
    overflow: visible;
}

.root-line {
    fill: none;
    stroke: var(--root-brown);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-dasharray: 1500;
    stroke-dashoffset: 1500;
    animation: draw-root 1800ms ease-out forwards;
}

.root-line.trunk {
    stroke: var(--system-cream);
    stroke-width: 2.4;
    animation-delay: 0ms;
}

.root-line:nth-child(2) { animation-delay: 200ms; }
.root-line:nth-child(3) { animation-delay: 250ms; }
.root-line:nth-child(4) { animation-delay: 300ms; }
.root-line:nth-child(5) { animation-delay: 350ms; }
.root-line:nth-child(6) { animation-delay: 500ms; }
.root-line:nth-child(7) { animation-delay: 550ms; }
.root-line:nth-child(8) { animation-delay: 600ms; }
.root-line:nth-child(9) { animation-delay: 650ms; }
.root-line.fine { stroke-width: 1.2; opacity: 0.7; animation-delay: 800ms; }

.myco-line {
    fill: none;
    stroke: var(--system-cream);
    stroke-width: 1;
    stroke-dasharray: 2 5;
    opacity: 0.35;
    stroke-dashoffset: 1500;
    animation: draw-myco 2200ms ease-out 1100ms forwards;
}

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

@keyframes draw-myco {
    to { stroke-dashoffset: 0; opacity: 0.42; }
}

.rootnet-nodes .node {
    fill: var(--root-brown);
    stroke: var(--system-cream);
    stroke-width: 1;
    opacity: 0;
    animation: pop-node 400ms ease-out forwards;
}

.node-seed { fill: var(--system-cream); animation-delay: 100ms; }
.rootnet-nodes .node:nth-child(2) { animation-delay: 700ms; }
.rootnet-nodes .node:nth-child(3) { animation-delay: 900ms; }
.rootnet-nodes .node:nth-child(4) { animation-delay: 950ms; }
.rootnet-nodes .node:nth-child(5) { animation-delay: 1000ms; }
.rootnet-nodes .node:nth-child(6) { animation-delay: 1050ms; }
.node-yellow { fill: var(--bauhaus-yellow); animation-delay: 1300ms !important; }
.node-blue   { fill: var(--bauhaus-blue);   animation-delay: 1350ms !important; }
.node-red    { fill: var(--bauhaus-red);    animation-delay: 1400ms !important; }

@keyframes pop-node {
    0%   { opacity: 0; transform: scale(0); transform-origin: center; }
    60%  { opacity: 1; transform: scale(1.4); }
    100% { opacity: 1; transform: scale(1); }
}

.hero-coords {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    color: rgba(240, 235, 216, 0.45);
    text-transform: uppercase;
    padding-top: 12px;
    border-top: 1px solid rgba(240, 235, 216, 0.08);
}

.coord-sep {
    color: rgba(240, 235, 216, 0.25);
}

/* ============================================================
   Section header (shared)
   ============================================================ */
.section-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 0 0 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(240, 235, 216, 0.10);
    flex-wrap: wrap;
}

.section-marker {
    width: 14px;
    height: 14px;
    background: var(--bauhaus-yellow);
    transform: translateY(2px);
    flex-shrink: 0;
    animation: marker-pulse 3s ease-in-out infinite;
}

@keyframes marker-pulse {
    0%, 100% { opacity: 0.7; transform: translateY(2px) rotate(0deg); }
    50%      { opacity: 1.0; transform: translateY(2px) rotate(45deg); }
}

.section-title {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: clamp(22px, 2.4vw, 36px);
    color: var(--system-cream);
    letter-spacing: -0.005em;
}

.section-meta {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(240, 235, 216, 0.5);
    margin-left: auto;
}

/* ============================================================
   Panels — Bauhaus-bordered dashboard cards
   ============================================================ */
.panels-section {
    padding: 96px 48px;
    background: var(--burgundy-deep);
    border-bottom: 1px solid rgba(240, 235, 216, 0.08);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(220px, auto);
    gap: var(--gap);
    max-width: 1440px;
    margin: 0 auto;
    grid-template-areas:
        "canopy   rootnet  rootnet  soil"
        "biodiv   myco     feed     feed";
}

.panel {
    position: relative;
    background: var(--panel-dark);
    border: 2px solid rgba(240, 235, 216, 0.12);
    padding: 18px 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 220px;
    transition: border-color 320ms ease, transform 320ms ease, box-shadow 320ms ease;
    opacity: 0;
    transform: translateY(16px);
}

.panel.in-view {
    animation: panel-enter 720ms cubic-bezier(0.2, 0.8, 0.25, 1) forwards;
}

@keyframes panel-enter {
    0%   { opacity: 0; transform: translateY(16px); }
    20%  { opacity: 1; }
    40%  { border-color: var(--flash-color, var(--system-cream)); }
    100% { opacity: 1; transform: translateY(0); }
}

.panel-1x1 { /* default */ }
.panel-2x1 { grid-column: span 2; }
.panel-1x2 { grid-row: span 2; }

[data-panel="canopy"]       { grid-area: canopy; }
[data-panel="rootnet"]      { grid-area: rootnet; }
[data-panel="soil"]         { grid-area: soil; }
[data-panel="biodiversity"] { grid-area: biodiv; }
[data-panel="myco"]         { grid-area: myco; }
[data-panel="feed"]         { grid-area: feed; }

.panel-yellow { border-color: rgba(232, 200, 64, 0.7); --flash-color: var(--bauhaus-yellow); --accent: var(--bauhaus-yellow); }
.panel-blue   { border-color: rgba(56, 112, 176, 0.7); --flash-color: var(--bauhaus-blue);   --accent: var(--bauhaus-blue); }
.panel-red    { border-color: rgba(200, 56, 56, 0.7);  --flash-color: var(--bauhaus-red);    --accent: var(--bauhaus-red); }

.panel:hover {
    transform: translateY(-2px);
    border-color: var(--accent, var(--system-cream));
    box-shadow: 0 0 28px rgba(0, 0, 0, 0.4);
    animation: border-pulse 400ms ease-in-out;
}

@keyframes border-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.7; }
}

/* Bauhaus geometric corner ornaments */
.panel-corners {
    position: absolute;
    inset: -2px;
    pointer-events: none;
}
.panel-corners span {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--accent, var(--system-cream));
}
.panel-corners span:nth-child(1) { top: -4px; left: -4px; border-radius: 50%; }
.panel-corners span:nth-child(2) { top: -4px; right: -4px; }
.panel-corners span:nth-child(3) { bottom: -4px; left: -4px; transform: rotate(45deg); }
.panel-corners span:nth-child(4) { bottom: -4px; right: -4px; border-radius: 2px; }

.panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px dashed rgba(240, 235, 216, 0.18);
    padding-bottom: 8px;
}

.panel-cat {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--accent, var(--system-cream));
    opacity: 0.85;
}

.panel-name {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--system-cream);
    text-align: right;
}

.panel-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    min-height: 0;
}

.panel-foot {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    border-top: 1px dashed rgba(240, 235, 216, 0.18);
    padding-top: 8px;
}

.foot-key {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: rgba(240, 235, 216, 0.55);
}

.foot-val {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 12px;
    color: var(--system-cream);
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   Gauges (conic gradient)
   ============================================================ */
.gauge {
    position: relative;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    --gauge-current: 0;
    background:
        conic-gradient(
            var(--accent, var(--bauhaus-yellow)) calc(var(--gauge-current) * 1%),
            rgba(240, 235, 216, 0.08) calc(var(--gauge-current) * 1%)
        );
    transition: filter 320ms ease, box-shadow 320ms ease;
    flex-shrink: 0;
}

.gauge-small  { width: 130px; height: 130px; }
.gauge-medium { width: 150px; height: 150px; }

.gauge-track {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: var(--panel-dark);
    box-shadow: inset 0 0 0 1px rgba(240, 235, 216, 0.1);
}

.gauge-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2px;
}

.gauge-value {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 28px;
    color: var(--system-cream);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.gauge-sub {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(240, 235, 216, 0.5);
}

.panel:hover .gauge {
    box-shadow: 0 0 24px var(--accent, var(--system-cream));
}

/* ============================================================
   Bar indicators (soil)
   ============================================================ */
.bars-body {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
    padding: 0 4px;
}

.bar-row {
    display: grid;
    grid-template-columns: 24px 1fr 36px;
    align-items: center;
    gap: 10px;
}

.bar-label {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 11px;
    color: var(--accent, var(--system-cream));
    letter-spacing: 0.04em;
}

.bar-track {
    position: relative;
    height: 8px;
    background: rgba(240, 235, 216, 0.07);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: 0;
    background: var(--accent, var(--bauhaus-red));
    transition: width 800ms cubic-bezier(0.2, 0.8, 0.25, 1);
}

.in-view .bar-fill { width: var(--fill); }

.bar-value {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 11px;
    color: var(--system-cream);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

/* ============================================================
   Counts (biodiversity)
   ============================================================ */
.counts-body {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
    padding: 0 4px;
}

.count-row {
    display: grid;
    grid-template-columns: 60px 1fr;
    align-items: center;
    gap: 12px;
    border-bottom: 1px dotted rgba(240, 235, 216, 0.12);
    padding: 4px 0;
}

.count-row:last-child { border-bottom: none; }

.count-num {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 22px;
    color: var(--bauhaus-yellow);
    font-variant-numeric: tabular-nums;
    text-align: right;
    line-height: 1;
}

.count-cat {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: rgba(240, 235, 216, 0.7);
}

/* ============================================================
   Node map (root network panel)
   ============================================================ */
.node-map {
    width: 100%;
    height: auto;
    max-height: 220px;
}

.net-link {
    fill: none;
    stroke: var(--root-brown);
    stroke-width: 1.5;
    stroke-linecap: round;
    opacity: 0.85;
}

.net-link.myco {
    stroke: var(--system-cream);
    stroke-width: 1;
    stroke-dasharray: 2 4;
    opacity: 0.4;
}

.net-node {
    fill: var(--root-brown);
    stroke: var(--system-cream);
    stroke-width: 1;
}

.net-node-yellow { fill: var(--bauhaus-yellow); }
.net-node-blue   { fill: var(--bauhaus-blue); }
.net-node-red    { fill: var(--bauhaus-red); }
.net-node-small  { fill: var(--system-cream); opacity: 0.7; }

.panel:hover .net-node {
    transition: r 300ms ease;
}

/* ============================================================
   Mycorrhizal panel body
   ============================================================ */
.myco-body {
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    gap: 18px;
    padding-top: 14px;
}

.myco-stats {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px dotted rgba(240, 235, 216, 0.15);
    padding-top: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    border-bottom: 1px dotted rgba(240, 235, 216, 0.10);
    padding-bottom: 6px;
}

.stat-row:last-child { border-bottom: none; }

.stat-key {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(240, 235, 216, 0.6);
}

.stat-val {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 13px;
    color: var(--bauhaus-blue);
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   Feed panel
   ============================================================ */
.feed-body {
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    overflow: hidden;
}

.feed-list {
    list-style: none;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.feed-item {
    display: grid;
    grid-template-columns: 70px 12px 1fr;
    align-items: center;
    gap: 10px;
    padding: 5px 4px;
    border-bottom: 1px dotted rgba(240, 235, 216, 0.10);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--system-cream);
}

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

.feed-time {
    font-weight: 600;
    color: rgba(240, 235, 216, 0.55);
    font-variant-numeric: tabular-nums;
    font-size: 11px;
}

.feed-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--system-cream);
    justify-self: center;
}

.dot-yellow { background: var(--bauhaus-yellow); box-shadow: 0 0 6px rgba(232, 200, 64, 0.6); }
.dot-blue   { background: var(--bauhaus-blue);   box-shadow: 0 0 6px rgba(56, 112, 176, 0.6); }
.dot-red    { background: var(--bauhaus-red);    box-shadow: 0 0 6px rgba(200, 56, 56, 0.6); }

.feed-msg {
    font-weight: 400;
    font-size: 12px;
    color: rgba(240, 235, 216, 0.85);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-item.feed-new {
    animation: feed-flash 800ms ease-out;
}

@keyframes feed-flash {
    0%   { background: rgba(232, 200, 64, 0.15); }
    100% { background: transparent; }
}

/* ============================================================
   Diagram section (hand-drawn full-width)
   ============================================================ */
.diagram-section {
    padding: 96px 48px;
    background: linear-gradient(
        180deg,
        var(--burgundy-deep) 0%,
        #2D0816 100%
    );
    border-bottom: 1px solid rgba(240, 235, 216, 0.08);
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 64px;
    align-items: start;
    max-width: 1440px;
    margin: 0 auto;
}

.diagram-meta {
    position: sticky;
    top: 32px;
}

.diagram-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.10em;
    color: var(--bauhaus-yellow);
    border: 1px solid var(--bauhaus-yellow);
    padding: 3px 9px;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.diagram-title {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: clamp(24px, 2.6vw, 38px);
    color: var(--system-cream);
    line-height: 1.15;
    margin-bottom: 14px;
}

.diagram-caption {
    font-family: var(--font-serif);
    font-size: 15px;
    line-height: 1.7;
    color: rgba(240, 235, 216, 0.78);
    font-style: italic;
}

.diagram-canvas {
    background: rgba(42, 8, 24, 0.45);
    border: 1px solid rgba(240, 235, 216, 0.10);
    padding: 24px;
}

.diagram-svg {
    width: 100%;
    height: auto;
    display: block;
}

.d-line {
    fill: none;
    stroke: var(--root-brown);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
}

.d-trunk { stroke: var(--system-cream); }
.d-root { opacity: 0.85; }

.d-canopy {
    fill: rgba(138, 104, 64, 0.15);
    stroke: var(--root-brown);
    stroke-width: 1.6;
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
}

.d-canopy-2 {
    fill: rgba(138, 104, 64, 0.08);
    stroke-width: 1.2;
    opacity: 0.7;
}

.d-myco {
    fill: none;
    stroke: var(--system-cream);
    stroke-width: 1;
    stroke-dasharray: 2 5;
    opacity: 0.5;
}

.diagram-section.in-view .d-line,
.diagram-section.in-view .d-canopy {
    animation: draw-progress 1800ms ease-out forwards;
}

.diagram-section.in-view .d-line:nth-child(odd) { animation-delay: 200ms; }
.diagram-section.in-view .d-line:nth-child(even) { animation-delay: 400ms; }
.diagram-section.in-view .d-canopy { animation-delay: 600ms; }

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

.d-node {
    fill: var(--root-brown);
    stroke: var(--system-cream);
    stroke-width: 1;
    opacity: 0;
    transition: r 300ms ease;
}

.diagram-section.in-view .d-node {
    animation: pop-node 500ms ease-out 1500ms forwards;
}

.d-node-yellow { fill: var(--bauhaus-yellow); }
.d-node-blue   { fill: var(--bauhaus-blue); }
.d-node-red    { fill: var(--bauhaus-red); }

.d-anno {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.10em;
    fill: rgba(240, 235, 216, 0.5);
    text-anchor: middle;
}

/* ============================================================
   Projection section
   ============================================================ */
.projection-section {
    padding: 96px 48px;
    background: var(--burgundy-deep);
    border-bottom: 1px solid rgba(240, 235, 216, 0.08);
}

.projection-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--gap);
    max-width: 1440px;
    margin: 0 auto;
}

.projection-card {
    min-height: 280px;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    padding: 48px 48px 24px;
    background: var(--panel-dark);
    border-top: 2px solid var(--bauhaus-yellow);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    max-width: 1440px;
    margin: 0 auto 32px;
}

.foot-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.foot-cat {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bauhaus-yellow);
    margin-bottom: 4px;
}

.foot-line {
    font-family: var(--font-mono);
    font-size: 12px;
    color: rgba(240, 235, 216, 0.7);
    line-height: 1.6;
}

.footer-stamp {
    text-align: center;
    padding-top: 24px;
    border-top: 1px dashed rgba(240, 235, 216, 0.12);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: rgba(240, 235, 216, 0.4);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
    .hero { padding: 24px; }
    .panels-section,
    .diagram-section,
    .projection-section,
    .site-footer { padding-left: 24px; padding-right: 24px; }

    .hero-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-areas:
            "canopy   soil"
            "rootnet  rootnet"
            "biodiv   myco"
            "feed     feed";
    }
    .panel-2x1 { grid-column: span 2; }
    .panel-1x2 { grid-row: span 1; }

    .diagram-section {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .diagram-meta { position: static; }

    .projection-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .hero { padding: 20px; }
    .panels-section,
    .diagram-section,
    .projection-section { padding: 56px 20px; }

    .hero-meta { gap: 18px; }
    .hero-dashboard {
        grid-template-columns: 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "canopy"
            "soil"
            "rootnet"
            "biodiv"
            "myco"
            "feed";
    }
    .panel-2x1, .panel-1x2 { grid-column: span 1; grid-row: span 1; }

    .projection-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 18px; }

    .section-meta { display: none; }

    /* Spotlight bigger on small screens for taps */
    .spotlight {
        background: radial-gradient(
            circle 280px at var(--mx) var(--my),
            rgba(240, 235, 216, 0.08) 0%,
            rgba(240, 235, 216, 0.04) 40%,
            rgba(240, 235, 216, 0.00) 75%
        );
    }
}
