/* dilemma.quest - Holographic Circuitry / Hexagonal Honeycomb */

:root {
    --deep-void: #0B0E1A;
    --aurora-green: #00E58A;
    --aurora-violet: #B47AFF;
    --aurora-cyan: #7DF9FF;
    --aurora-pink: #FF6EC7;
    --surface: #1A2138;
    --text-primary: #E8EDF5;
    --text-secondary: #8B95B0;
    --grid-stroke: #2A3B5E;
    --mouse-x: 0.5;
    --mouse-y: 0.5;
    --holo-angle: 0deg;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--deep-void);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Bokeh Background Layers */
#bokeh-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 1.5s ease;
}

#bokeh-container.visible {
    opacity: 1;
}

.bokeh-layer {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    transition: transform 2s ease-out;
}

.bokeh-far {
    transition-duration: 2s;
}

.bokeh-mid {
    transition-duration: 1s;
}

.bokeh-near {
    transition-duration: 0.5s;
}

.bokeh-circle {
    position: absolute;
    border-radius: 50%;
}

/* Cursor Trail */
#cursor-trail {
    position: fixed;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--aurora-cyan) 0%, var(--aurora-green) 40%, transparent 70%);
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    transition: opacity 0.4s ease;
    transform: translate(-50%, -50%);
}

#cursor-trail.active {
    opacity: 0.15;
}

/* Hex Grid Container */
#hex-grid-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 10vh 20px 20vh;
}

/* Hex Cluster */
.hex-cluster {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto 15vh;
    height: 520px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hex-cluster.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-cluster {
    margin-top: 25vh;
    margin-bottom: 20vh;
}

/* Hex Cell */
.hex-cell {
    position: absolute;
    width: 180px;
    height: 156px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    transition: transform 0.3s ease, filter 0.3s ease;
}

.hex-inner {
    width: 100%;
    height: 100%;
    background: var(--surface);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    position: relative;
}

.hex-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(60deg, var(--aurora-green), var(--aurora-cyan), var(--aurora-violet));
    opacity: 0.08;
    transition: opacity 0.3s ease;
}

.hex-cell:hover .hex-inner::before {
    opacity: 0.25;
}

.hex-content {
    padding: 20px 15px;
    text-align: center;
    position: relative;
    z-index: 2;
}

/* Holographic Shimmer */
.holo-shimmer {
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: conic-gradient(from var(--holo-angle), var(--aurora-green), var(--aurora-cyan), var(--aurora-violet), var(--aurora-pink), var(--aurora-green));
    opacity: 0.05;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.hex-cell:hover .holo-shimmer {
    opacity: 0.12;
}

/* Center Hex positions */
.center-hex {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

/* Satellite positions around center hex */
.sat-0 { left: 50%; top: 0; transform: translate(-50%, 0); }
.sat-1 { left: calc(50% + 140px); top: 25%; transform: translate(-50%, -50%); }
.sat-2 { left: calc(50% + 140px); top: 75%; transform: translate(-50%, -50%); }
.sat-3 { left: 50%; top: 100%; transform: translate(-50%, -100%); }
.sat-4 { left: calc(50% - 140px); top: 75%; transform: translate(-50%, -50%); }
.sat-5 { left: calc(50% - 140px); top: 25%; transform: translate(-50%, -50%); }

/* Bloom effect on cluster hover */
.hex-cluster:hover .sat-0 { transform: translate(-50%, -4px); }
.hex-cluster:hover .sat-1 { transform: translate(calc(-50% + 4px), calc(-50% - 2px)); }
.hex-cluster:hover .sat-2 { transform: translate(calc(-50% + 4px), calc(-50% + 2px)); }
.hex-cluster:hover .sat-3 { transform: translate(-50%, calc(-100% + 4px)); }
.hex-cluster:hover .sat-4 { transform: translate(calc(-50% - 4px), calc(-50% + 2px)); }
.hex-cluster:hover .sat-5 { transform: translate(calc(-50% - 4px), calc(-50% - 2px)); }

/* Typography */
.site-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 42px;
    letter-spacing: -0.02em;
    background: linear-gradient(60deg, var(--aurora-green), var(--aurora-cyan), var(--aurora-violet));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 28px;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.2;
}

.tagline-fragment {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.hex-cluster.visible .tagline-fragment {
    opacity: 1;
}

.mono-label {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: 13px;
    letter-spacing: 0.03em;
    color: var(--aurora-cyan);
    margin-bottom: 8px;
}

p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.footer-text {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

/* Circuit Traces SVG */
.circuit-traces {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.trace {
    fill: none;
    stroke: url(#aurora-gradient);
    stroke-width: 1.5;
    opacity: 0.4;
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: opacity 0.3s ease;
}

.hex-cluster.visible .trace {
    animation: traceDraw 1.2s ease forwards;
}

.hex-cluster:hover .trace {
    opacity: 1;
}

@keyframes traceDraw {
    to { stroke-dashoffset: 0; }
}

.junction {
    fill: var(--aurora-green);
    opacity: 0;
}

.hex-cluster.visible .junction {
    animation: junctionPulse 0.6s ease forwards 0.8s;
}

@keyframes junctionPulse {
    0% { opacity: 0; r: 0; }
    50% { opacity: 1; r: 5; }
    100% { opacity: 0.8; r: 3; }
}

/* Junction continuous pulse */
.hex-cluster.visible .junction {
    animation: junctionPulse 0.6s ease forwards 0.8s, junctionBreathe 2s ease-in-out infinite 1.4s;
}

@keyframes junctionBreathe {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Footer fading hexes */
.fade-80 { opacity: 0.8; }
.fade-60 { opacity: 0.6; }
.fade-40 { opacity: 0.4; }
.fade-20 { opacity: 0.2; }
.fade-10 { opacity: 0.1; }

/* Open terminal traces */
.open-terminal {
    stroke-dasharray: 4 8;
}

.footer-traces .trace {
    opacity: 0.2;
}

/* Ghost hex field */
#ghost-hex-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.ghost-hex {
    position: absolute;
    width: 180px;
    height: 156px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: 1px solid rgba(42, 59, 94, 0.2);
    background: linear-gradient(60deg, var(--aurora-green), var(--aurora-cyan), var(--aurora-violet));
    opacity: 0.03;
}

/* SVG gradient definition - added via JS */

/* Staggered parallax columns */
.hex-cluster:nth-child(odd) {
    transform-origin: center;
}

/* Responsive */
@media (max-width: 768px) {
    .hex-cluster {
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 20px 0;
    }

    .hex-cell {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        width: 90%;
        max-width: 320px;
        height: auto;
        min-height: 120px;
        clip-path: none;
        border-radius: 24px;
        background: var(--surface);
    }

    .hex-inner {
        clip-path: none;
        border-radius: 24px;
        min-height: 120px;
    }

    .hex-inner::before {
        clip-path: none;
        border-radius: 24px;
    }

    .holo-shimmer {
        clip-path: none;
        border-radius: 24px;
    }

    .hex-content {
        padding: 24px 20px;
    }

    .center-hex {
        transform: none;
    }

    .sat-0, .sat-1, .sat-2, .sat-3, .sat-4, .sat-5 {
        transform: none;
    }

    .hex-cluster:hover .sat-0,
    .hex-cluster:hover .sat-1,
    .hex-cluster:hover .sat-2,
    .hex-cluster:hover .sat-3,
    .hex-cluster:hover .sat-4,
    .hex-cluster:hover .sat-5 {
        transform: none;
    }

    .circuit-traces {
        display: none;
    }

    .site-title {
        font-size: 32px;
    }

    h2 {
        font-size: 24px;
    }

    #ghost-hex-field {
        display: none;
    }

    .hero-cluster {
        margin-top: 10vh;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 26px;
    }

    h2 {
        font-size: 20px;
    }

    .hex-content {
        padding: 18px 14px;
    }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    .bokeh-layer {
        transition: none;
    }

    .trace {
        stroke-dashoffset: 0;
        animation: none;
    }

    .junction {
        opacity: 0.8;
        animation: none;
    }

    .hex-cluster {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .tagline-fragment {
        opacity: 1;
        transition: none;
    }

    #cursor-trail {
        display: none;
    }
}
