/* layer2.id -- Generative Isometric Identity */

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

:root {
    --void-indigo: #0D1F3C;
    --nebula-purple: #1A0A2E;
    --abyss-teal: #0A2F2F;
    --midnight-ink: #1B2A4A;
    --pale-silver: #C8D6E5;
    --muted-slate: #7B8FA3;
    --aurora-mint: #4AEDC4;
    --signal-violet: #8B5CF6;
    --plasma-rose: #F472B6;
    --phosphor-green: #34D399;
    --hex-clip: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    --font-display: 'Chakra Petch', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --font-data: 'Share Tech Mono', monospace;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--void-indigo);
    color: var(--pale-silver);
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 17px;
    line-height: 1.72;
    overflow-x: hidden;
}

/* ---- Aurora Background ---- */
.aurora-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(135deg, var(--void-indigo) 0%, var(--nebula-purple) 40%, var(--abyss-teal) 70%, var(--void-indigo) 100%);
    background-size: 400% 400%;
    animation: aurora-drift 40s linear infinite;
}

@keyframes aurora-drift {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 50%; }
    50% { background-position: 100% 0%; }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 50%; }
}

/* ---- Hex Grid Layer ---- */
.hex-grid-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ---- Navigation ---- */
.nav-logo {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 100;
}

.logo-hex {
    width: 48px;
    height: 42px;
}

.nav-pips {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    gap: 0.5rem;
    z-index: 100;
}

.pip {
    width: 20px;
    height: 20px;
    background: none;
    border: 1px solid var(--midnight-ink);
    clip-path: var(--hex-clip);
    cursor: pointer;
    padding: 0;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.pip span {
    display: block;
    width: 100%;
    height: 100%;
    background: transparent;
    transition: background 0.3s ease;
}

.pip.active {
    border-color: var(--aurora-mint);
}

.pip.active span {
    background: rgba(74, 237, 196, 0.2);
}

/* ---- Sections ---- */
.hex-section {
    min-height: 100vh;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

/* ---- Hex Clusters ---- */
.hex-cluster {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 1000px;
}

/* ---- Hex Cells ---- */
.hex-cell {
    width: 280px;
    height: 242px;
    clip-path: var(--hex-clip);
    background: rgba(13, 31, 60, 0.4);
    border: none;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hex-cell.entered {
    opacity: 1;
    transform: scale(1);
}

.hex-cell::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: var(--hex-clip);
    border: 1px solid var(--midnight-ink);
    opacity: 0.4;
    pointer-events: none;
    transition: border-color 0.4s ease, opacity 0.4s ease;
}

.hex-cell.pulsing::before {
    border-color: var(--aurora-mint);
    opacity: 0.8;
    border-width: 2px;
}

.hex-content {
    padding: 2rem;
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Frosted glass effect */
.frosted {
    backdrop-filter: blur(8px) saturate(1.3);
    -webkit-backdrop-filter: blur(8px) saturate(1.3);
    background: rgba(13, 31, 60, 0.55);
}

/* ---- Identity Node ---- */
.identity-node {
    width: 120px;
    height: 104px;
    filter: drop-shadow(0 0 12px rgba(74, 237, 196, 0.25));
}

.identity-node.breathing {
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(74, 237, 196, 0.25)); }
    50% { filter: drop-shadow(0 0 16px rgba(74, 237, 196, 0.5)); }
}

.outer-hex, .inner-hex, .spoke {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 1.2s ease;
}

.identity-node.drawn .outer-hex { stroke-dashoffset: 0; transition-duration: 1.2s; }
.identity-node.drawn .spoke { stroke-dashoffset: 0; transition-duration: 0.6s; transition-delay: 1.2s; }
.identity-node.drawn .inner-hex { stroke-dashoffset: 0; transition-duration: 0.6s; transition-delay: 1.8s; }

/* ---- Typography ---- */
.site-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(36px, 8vw, 72px);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
}

.title-layer2 {
    color: var(--pale-silver);
}

.title-id {
    color: var(--signal-violet);
}

.section-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(24px, 4vw, 48px);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--pale-silver);
    margin-bottom: 1rem;
}

.body-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 16px;
    line-height: 1.72;
    color: var(--pale-silver);
}

.body-text em {
    font-weight: 500;
    color: var(--aurora-mint);
    font-style: normal;
}

.tagline {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 18px;
    color: var(--muted-slate);
}

/* ---- Data Cells ---- */
.ring-chart {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.ring-svg {
    width: 80px;
    height: 80px;
}

.ring-progress {
    transition: stroke-dashoffset 2s ease;
}

.ring-label {
    font-family: var(--font-data);
    font-size: 13px;
    letter-spacing: 0.08em;
    color: var(--aurora-mint);
}

.ring-caption {
    font-family: var(--font-data);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--muted-slate);
}

.mini-network svg {
    width: 120px;
    height: 104px;
}

/* ---- Network Visualization ---- */
.network-viz-cell {
    width: 400px;
    height: 346px;
}

.network-viz {
    width: 100%;
    height: 100%;
}

.network-viz circle.node {
    fill: var(--aurora-mint);
    cursor: pointer;
    transition: transform 0.3s ease, r 0.3s ease;
    filter: drop-shadow(0 0 6px rgba(74, 237, 196, 0.3));
}

.network-viz circle.node:hover {
    filter: drop-shadow(0 0 12px rgba(74, 237, 196, 0.6));
}

.network-viz path.edge {
    fill: none;
    stroke: var(--midnight-ink);
    stroke-width: 1;
    opacity: 0.6;
    transition: stroke 0.3s ease, opacity 0.3s ease;
}

.network-viz path.edge.highlighted {
    stroke: var(--aurora-mint);
    opacity: 1;
}

/* ---- Contour Lines ---- */
.contour-lines {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 600px;
    z-index: 0;
    pointer-events: none;
}

/* ---- Bedrock ---- */
.bedrock-section .aurora-bg {
    filter: hue-rotate(20deg);
}

.thick-border::before {
    border-width: 2px;
}

.hash-display {
    font-family: var(--font-data);
    font-size: 13px;
    letter-spacing: 0.08em;
    color: var(--aurora-mint);
    word-break: break-all;
}

.hash-display .flicker {
    display: inline;
    animation: charFlicker 0.3s step-end infinite alternate;
}

@keyframes charFlicker {
    0% { opacity: 1; }
    100% { opacity: 0.3; }
}

.closing-statement {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 18px;
    line-height: 1.72;
    color: var(--pale-silver);
}

.closing-statement em {
    font-weight: 500;
    color: var(--aurora-mint);
    font-style: italic;
}

.watermark {
    opacity: 0.06;
    width: 80px;
    height: 70px;
}

.empty-cell {
    background: rgba(13, 31, 60, 0.2);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .hex-cluster {
        flex-direction: column;
        align-items: center;
    }

    .hex-cell {
        width: 90vw;
        max-width: 320px;
        height: auto;
        min-height: 200px;
        clip-path: none;
        border-radius: 12px;
        border: 1px solid var(--midnight-ink);
    }

    .hex-cell::before {
        clip-path: none;
        border-radius: 12px;
    }

    .network-viz-cell {
        width: 90vw;
        max-width: 320px;
        height: 280px;
    }

    .site-title {
        font-size: 2.5rem;
    }

    .nav-pips {
        gap: 0.3rem;
    }

    .travel-dot {
        display: none;
    }
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    .aurora-bg {
        animation: none;
    }

    .identity-node.breathing {
        animation: none;
    }

    .hex-cell {
        opacity: 1;
        transform: scale(1);
        transition: none;
    }

    .outer-hex, .inner-hex, .spoke {
        stroke-dashoffset: 0;
        transition: none;
    }

    .ring-progress {
        transition: none;
    }

    .hash-display .flicker {
        animation: none;
        opacity: 1;
    }

    .travel-dot {
        display: none;
    }
}
