:root {
    --consensus-blue: #4A6FA5;
    --assembly-green: #5A9B6F;
    --collective-orange: #E8A86F;
    --network-indigo: #5B3F7E;
    --harmony-neutral: #E8E4DB;
    --solidarity-gray: #7A7A7A;
    --node-radius: 22px;
    --node-blur: 8px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    background: var(--harmony-neutral);
    color: var(--solidarity-gray);
    line-height: 1.7;
    font-size: clamp(0.95rem, 1.05vw, 1.05rem);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Network canvas background */
#network-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Connection lines SVG overlay */
.connection-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.connection-lines line {
    stroke-width: 1.5;
    opacity: 0.15;
    transition: opacity 0.6s ease, stroke 0.6s ease;
}

.connection-lines line.highlight {
    opacity: 0.45;
    stroke-width: 2;
}

/* Honeycomb container */
.honeycomb-container {
    position: relative;
    z-index: 2;
    min-height: 200vh;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 6vh 3vw 10vh;
}

/* Node base styles */
.node {
    position: absolute;
    left: var(--node-x);
    top: var(--node-y);
    width: clamp(260px, 26vw, 360px);
    padding: 2rem 2.2rem;
    border-radius: var(--node-radius);
    background: rgba(232, 228, 219, 0.88);
    backdrop-filter: blur(var(--node-blur));
    -webkit-backdrop-filter: blur(var(--node-blur));
    border: 1.5px solid rgba(122, 122, 122, 0.18);
    cursor: default;
    opacity: 0;
    transition: opacity 0.7s ease, transform 0.7s ease, box-shadow 0.4s ease, background 0.5s ease, border-color 0.5s ease;
    will-change: transform, opacity;
}

.node.visible {
    opacity: 1;
    transform: translate(0, 0) !important;
}

/* Entry directions */
.node[data-enter="left"] {
    transform: translateX(-80px);
}

.node[data-enter="right"] {
    transform: translateX(80px);
}

.node[data-enter="top"] {
    transform: translateY(-80px);
}

.node[data-enter="bottom"] {
    transform: translateY(80px);
}

/* Node color variants */
.node--blue {
    border-color: rgba(74, 111, 165, 0.3);
}

.node--green {
    border-color: rgba(90, 155, 111, 0.3);
}

.node--orange {
    border-color: rgba(232, 168, 111, 0.3);
}

.node--indigo {
    border-color: rgba(91, 63, 126, 0.3);
}

.node--identity {
    border-color: rgba(74, 111, 165, 0.4);
    background: rgba(232, 228, 219, 0.92);
}

/* Node hover glow */
.node:hover {
    z-index: 10;
}

.node--blue:hover {
    box-shadow: 0 0 24px rgba(74, 111, 165, 0.25);
    border-color: var(--consensus-blue);
}

.node--green:hover {
    box-shadow: 0 0 24px rgba(90, 155, 111, 0.25);
    border-color: var(--assembly-green);
}

.node--orange:hover {
    box-shadow: 0 0 24px rgba(232, 168, 111, 0.3);
    border-color: var(--collective-orange);
}

.node--indigo:hover {
    box-shadow: 0 0 24px rgba(91, 63, 126, 0.25);
    border-color: var(--network-indigo);
}

.node--identity:hover {
    box-shadow: 0 0 30px rgba(74, 111, 165, 0.3);
}

/* Node label */
.node-label {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: clamp(0.75rem, 0.9vw, 0.9rem);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 0.6rem;
}

.node--blue .node-label {
    color: var(--consensus-blue);
}

.node--green .node-label {
    color: var(--assembly-green);
}

.node--orange .node-label {
    color: var(--collective-orange);
}

.node--indigo .node-label {
    color: var(--network-indigo);
}

.node--identity .node-label {
    color: var(--network-indigo);
}

/* Node headings */
.node h2 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    letter-spacing: 0.02em;
    line-height: 1.25;
    margin-bottom: 0.8rem;
}

.node--blue h2 {
    color: var(--consensus-blue);
}

.node--green h2 {
    color: var(--assembly-green);
}

.node--orange h2 {
    color: var(--collective-orange);
}

.node--indigo h2 {
    color: var(--network-indigo);
}

.node--identity h2 {
    color: var(--solidarity-gray);
}

/* Node body text */
.node p {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.05vw, 1.05rem);
    line-height: 1.7;
    color: var(--solidarity-gray);
}

/* Node pulse indicator */
.node-pulse {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    opacity: 0.6;
}

.node--blue .node-pulse {
    background: var(--consensus-blue);
}

.node--green .node-pulse {
    background: var(--assembly-green);
}

.node--orange .node-pulse {
    background: var(--collective-orange);
}

.node--indigo .node-pulse {
    background: var(--network-indigo);
}

.node--identity .node-pulse {
    background: var(--consensus-blue);
    animation: identityPulse 10s linear infinite;
}

@keyframes identityPulse {
    0% { background: var(--consensus-blue); }
    20% { background: var(--assembly-green); }
    40% { background: var(--collective-orange); }
    60% { background: var(--network-indigo); }
    80% { background: var(--solidarity-gray); }
    100% { background: var(--consensus-blue); }
}

/* Active node cycling border */
.node.active-cycle {
    animation: borderCycle 12s linear infinite;
}

@keyframes borderCycle {
    0% { border-color: var(--consensus-blue); }
    20% { border-color: var(--assembly-green); }
    40% { border-color: var(--collective-orange); }
    60% { border-color: var(--network-indigo); }
    80% { border-color: var(--solidarity-gray); }
    100% { border-color: var(--consensus-blue); }
}

/* Subtle grain overlay via pseudo-element on body */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    pointer-events: none;
    opacity: 0.018;
    background-image: 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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* Interactive element underline animation */
.node a {
    color: inherit;
    text-decoration: none;
    position: relative;
    display: inline-block;
}

.node a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: currentColor;
    transition: width 0.4s ease;
}

.node a:hover::after {
    width: 100%;
}

/* Responsive: Tablet */
@media (max-width: 1024px) {
    .honeycomb-container {
        min-height: 280vh;
        padding: 4vh 2vw 8vh;
    }

    .node {
        width: clamp(220px, 42vw, 340px);
    }
}

/* Responsive: Mobile */
@media (max-width: 768px) {
    .honeycomb-container {
        min-height: auto;
        padding: 3vh 4vw 6vh;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .node {
        position: relative;
        left: auto;
        top: auto;
        width: 100%;
        max-width: 100%;
    }

    .node:nth-child(odd) {
        min-height: 220px;
    }

    .node:nth-child(even) {
        min-height: 280px;
    }

    .node:nth-child(3n) {
        min-height: 340px;
    }

    .connection-lines {
        display: none;
    }
}

@media (max-width: 480px) {
    .node {
        padding: 1.5rem 1.4rem;
    }

    .node h2 {
        font-size: 1.4rem;
    }
}
