/* ============================================
   namu.land - Skeuomorphic Honeycomb Takeover
   ============================================ */
:root {
    --aged-carbon: #2B2D2F;
    --tarnished-alloy: #4A4D50;
    --worn-chrome: #7B7F83;
    --oxidized-brass: #8A7D62;
    --phosphor-cream: #D4CFC2;
    --faded-sage: #9EA393;
    --organism-chartreuse: #A8C256;
    --spore-teal: #56A89A;
    --mycelium-amber: #C2A64E;
    --incubation-rose: #C27B6E;
    --darkroom-black: #1A1B1D;
    --lichen-pale: #D4E8B8;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    background: var(--darkroom-black);
    color: var(--phosphor-cream);
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.7;
    letter-spacing: 0.06em;
    overflow-x: hidden;
}

/* ==============================
   SCENES
   ============================== */
.scene {
    position: relative;
    overflow: hidden;
}
.scene--deck {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--darkroom-black);
}
.scene--cracks {
    min-height: 100vh;
    padding: clamp(4rem, 8vw, 8rem) clamp(1rem, 5vw, 3rem);
    background: var(--darkroom-black);
    position: relative;
}
.scene--growth {
    min-height: 200vh;
    padding: clamp(4rem, 8vw, 8rem) clamp(1rem, 5vw, 3rem);
    background: var(--darkroom-black);
    position: relative;
}
.scene--roots {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--darkroom-black);
    position: relative;
    padding: 4rem 2rem;
}

/* ==============================
   HEX GRID
   ============================== */
.hex-grid--deck {
    position: relative;
    width: 90vw;
    max-width: 700px;
    height: 70vh;
    max-height: 600px;
}
.hex {
    position: absolute;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}
.hex-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.hex--large {
    width: 40%;
    aspect-ratio: 1 / 1.1547;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
}
.hex--med {
    width: 22%;
    aspect-ratio: 1 / 1.1547;
    z-index: 2;
}
.hex--sm {
    width: 16%;
    aspect-ratio: 1 / 1.1547;
    z-index: 1;
}
.hex--tl { top: 5%; left: 8%; }
.hex--tr { top: 5%; right: 8%; }
.hex--ml { top: 42%; left: 2%; }
.hex--mr { top: 42%; right: 2%; }
.hex--bl { bottom: 5%; left: 15%; }
.hex--br { bottom: 5%; right: 15%; }

/* Panel Surface */
.panel {
    background: var(--aged-carbon);
    box-shadow: 4px 4px 12px rgba(0,0,0,0.6), inset 1px 1px 2px rgba(123,127,131,0.3);
    padding: 1rem;
}
.gauge-bezel {
    background: radial-gradient(circle at 40% 35%, var(--worn-chrome), var(--tarnished-alloy) 60%, var(--aged-carbon));
    box-shadow: 4px 4px 16px rgba(0,0,0,0.7), inset 1px 1px 3px rgba(123,127,131,0.4);
}
.gauge-face {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    background: var(--aged-carbon);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}
.gauge-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 3vw, 2.2rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--phosphor-cream);
    text-align: center;
}

/* Mini Gauges */
.gauge-mini {
    text-align: center;
}
.gauge-mini-face {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--darkroom-black);
    margin: 0 auto 0.5rem;
    position: relative;
    box-shadow: inset 0 0 8px rgba(0,0,0,0.5);
    overflow: hidden;
}
.gauge-needle {
    position: absolute;
    bottom: 50%;
    left: 50%;
    width: 2px;
    height: 20px;
    margin-left: -1px;
    background: var(--incubation-rose);
    transform-origin: bottom center;
    transform: rotate(-30deg);
    transition: transform 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.gauge-label {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 0.55rem;
    letter-spacing: 0.15em;
    color: var(--faded-sage);
    text-transform: uppercase;
}
.gauge-value {
    display: block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    color: var(--organism-chartreuse);
    margin-top: 0.25rem;
}

/* Toggle Switches */
.toggle-cluster {
    display: flex;
    gap: 8px;
    align-items: center;
}
.toggle {
    width: 24px;
    height: 12px;
    border-radius: 6px;
    background: var(--darkroom-black);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
    position: relative;
    cursor: pointer;
}
.toggle-head {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, var(--worn-chrome), var(--tarnished-alloy));
    box-shadow: 1px 1px 3px rgba(0,0,0,0.4);
    transition: left 0.15s ease;
}
.toggle.active .toggle-head {
    left: 13px;
    background: radial-gradient(circle at 40% 35%, var(--organism-chartreuse), #7A9A3E);
}

/* Panel Labels */
.panel-label {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 0.5rem;
    letter-spacing: 0.15em;
    color: var(--faded-sage);
    text-transform: uppercase;
}
.panel-status {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: var(--organism-chartreuse);
}

/* Blob Seed */
.blob-seed {
    display: flex;
    align-items: center;
    justify-content: center;
}
.blob-svg {
    width: 50px;
    height: 50px;
    animation: blobPulse 3s ease-in-out infinite;
}
@keyframes blobPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.15); opacity: 1; }
}

/* ==============================
   DATA TICKER
   ============================== */
.data-ticker {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 28px;
    background: var(--aged-carbon);
    border-top: 1px solid var(--tarnished-alloy);
    overflow: hidden;
    z-index: 20;
    display: flex;
    align-items: center;
}
.data-ticker--bio {
    display: none;
}
.data-ticker--bio.active {
    display: flex;
}
.data-ticker--bio .data-ticker:first-of-type {
    display: none;
}
.ticker-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--faded-sage);
    white-space: nowrap;
    animation: tickerScroll 30s linear infinite;
}
.ticker-text--bio {
    color: var(--organism-chartreuse);
}
@keyframes tickerScroll {
    0% { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
}

/* ==============================
   CRACK SVG
   ============================== */
.crack-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}
.crack-line {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    filter: url(#crackGlow);
    transition: stroke-dashoffset 2s ease;
}
.crack-line.drawn {
    stroke-dashoffset: 0;
}

/* ==============================
   BLOB FIELDS
   ============================== */
.blob-field {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}
.bio-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(1px);
    animation: blobFloat 8s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.6s ease;
}
.bio-blob.visible {
    opacity: 1;
}
@keyframes blobFloat {
    0%, 100% { transform: scale(1) translate(0, 0); }
    25% { transform: scale(1.05) translate(3px, -2px); }
    50% { transform: scale(0.97) translate(-2px, 3px); }
    75% { transform: scale(1.03) translate(2px, -1px); }
}

/* ==============================
   PANEL READOUTS
   ============================== */
.panel-readout {
    position: relative;
    z-index: 5;
    max-width: 580px;
    margin: 4rem auto;
    padding: 2rem;
    background: rgba(43, 45, 47, 0.85);
    border: 1px solid var(--tarnished-alloy);
    box-shadow: 4px 4px 12px rgba(0,0,0,0.5), inset 1px 1px 2px rgba(123,127,131,0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.panel-readout.visible {
    opacity: 1;
    transform: translateY(0);
}
.panel-readout--offset {
    margin-left: 15%;
    margin-right: auto;
}
.readout-header {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--mycelium-amber);
    text-transform: uppercase;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--tarnished-alloy);
}
.readout-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--phosphor-cream);
}
.status-bar {
    display: flex;
    gap: 6px;
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--tarnished-alloy);
}
.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--organism-chartreuse);
    opacity: 0.3;
}
.status-dot.blink {
    animation: dotBlink 1.5s ease-in-out infinite;
}
@keyframes dotBlink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* ==============================
   ROOT NETWORK
   ============================== */
.root-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}
.root-node {
    position: relative;
    z-index: 3;
    padding: 1.5rem 2rem;
    background: radial-gradient(circle, rgba(168,194,86,0.12), transparent 70%);
    border-radius: 50%;
    text-align: center;
    margin: 1rem 0;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.root-node.visible {
    opacity: 1;
    transform: scale(1);
}
.root-node--center { margin-bottom: 3rem; }
.root-node--left { align-self: flex-start; margin-left: 10%; }
.root-node--right { align-self: flex-end; margin-right: 10%; }
.node-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.9rem;
    color: var(--spore-teal);
}
.node-text--title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 0.15em;
    color: var(--organism-chartreuse);
}

.final-hex {
    margin-top: 4rem;
    padding: 2rem;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--aged-carbon);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.4);
    text-align: center;
    opacity: 0;
    transition: opacity 1s ease;
    width: 160px;
    aspect-ratio: 1 / 1.1547;
    display: flex;
    align-items: center;
    justify-content: center;
}
.final-hex.visible {
    opacity: 1;
}
.final-hex-text {
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    color: var(--organism-chartreuse);
    text-transform: uppercase;
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 768px) {
    .hex-grid--deck {
        max-width: 95vw;
        height: 60vh;
    }
    .hex--med { width: 26%; }
    .hex--sm { width: 20%; }
    .panel-readout { margin: 3rem 1rem; }
    .panel-readout--offset { margin-left: 1rem; }
    .root-node--left { margin-left: 5%; }
    .root-node--right { margin-right: 5%; }
}
