/* sbom.wiki - Neomorphic Hexagonal Honeycomb Design */
/* Palette:
   Cloud Milk (bg): #E8E0F0
   Frosted Lilac (raised): #D4C8E8
   Dusty Wisteria (shadow): #B8A8D0
   Peach Sunrise (primary accent): #F5C6A8
   Mint Circuit (secondary accent): #A8E0D0
   Deep Grape (text primary): #3A2E58
   Muted Plum (text secondary): #6B5E88
   Canary Soft (highlight): #F5E8A0
   Coral Blush (error): #E89090
   Neomorphic light: #F0E8F8
   Neomorphic dark: #C0B4D8
*/

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #E8E0F0;
    color: #3A2E58;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* ========== Background Decorations ========== */

.hex-bg-rings {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 200vmax;
    height: 200vmax;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
    animation: ringRotate 120s linear infinite;
}

@keyframes ringRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.circuit-traces {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.dot-matrix-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background-image: radial-gradient(circle, #B8A8D0 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.05;
}

/* ========== Section Base ========== */

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

.section-heading {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: 0.04em;
    color: #3A2E58;
    margin-bottom: 3rem;
    text-align: center;
}

/* ========== Hexagonal Cell Base ========== */

.hex-cell {
    position: relative;
    width: clamp(160px, 24vw, 320px);
    height: clamp(185px, 27.7vw, 370px);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: #D4C8E8;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.hex-cell::before {
    content: '';
    position: absolute;
    inset: 4px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: #E8E0F0;
    z-index: 1;
}

.hex-inner {
    position: absolute;
    inset: 8px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: #D4C8E8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 6px 6px 12px #C0B4D8, -6px -6px 12px #F0E8F8;
}

.hex-screen {
    position: relative;
    width: 80%;
    height: 80%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.5rem;
    background: linear-gradient(145deg, #E8E0F0, #D4C8E8);
    border-radius: 12px;
    overflow: hidden;
}

/* CRT convex glass curvature effect */
.hex-screen::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 50%;
    background: radial-gradient(ellipse at 50% 0%, rgba(240, 232, 248, 0.35), transparent 70%);
    pointer-events: none;
    z-index: 5;
}

/* Scanline overlay */
.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(184, 168, 208, 0.03) 2px,
        rgba(184, 168, 208, 0.03) 4px
    );
    z-index: 10;
}

/* ========== Hero Section ========== */

.hero-section {
    min-height: 100vh;
    position: relative;
}

.hero-hex-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hex-hero {
    width: clamp(280px, 40vw, 500px);
    height: clamp(323px, 46.2vw, 577px);
    box-shadow: 12px 12px 24px #C0B4D8, -12px -12px 24px #F0E8F8;
}

.hex-hero .hex-inner {
    box-shadow: 12px 12px 24px #C0B4D8, -12px -12px 24px #F0E8F8;
}

.hex-hero .hex-screen {
    background: linear-gradient(145deg, #EDE6F5, #D8CCE6);
}

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

@keyframes breathe {
    0%, 100% { transform: scale(1.0); }
    50% { transform: scale(1.02); }
}

.site-title {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: clamp(2.2rem, 5vw, 4rem);
    letter-spacing: 0.04em;
    color: #3A2E58;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-family: 'Inconsolata', monospace;
    font-weight: 700;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6B5E88;
    min-height: 1.5em;
}

/* Scroll hint arrow */
.scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollBounce 2s ease-in-out infinite;
    opacity: 0.5;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.5; }
    50% { transform: translateX(-50%) translateY(8px); opacity: 0.8; }
}

/* LED Indicators */
.led-indicators {
    display: flex;
    gap: 8px;
    margin-top: 1rem;
}

.led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    opacity: 0.6;
}

.led-mint {
    background-color: #A8E0D0;
    animation: ledPulse 2s ease-in-out infinite;
}

.led-canary {
    background-color: #F5E8A0;
    animation: ledPulse 2s ease-in-out infinite 0.6s;
}

.led-coral {
    background-color: #E89090;
    animation: ledPulse 2s ease-in-out infinite 1.2s;
}

.led.active {
    opacity: 1;
    box-shadow: 0 0 6px currentColor;
}

@keyframes ledPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ========== Hex Labels (Faux-embossed stamped metal plates) ========== */

.hex-label {
    font-family: 'Inconsolata', monospace;
    font-weight: 700;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6B5E88;
    margin-bottom: 0.5rem;
    display: inline-block;
    padding: 2px 10px;
    background: linear-gradient(145deg, #D4C8E8, #C0B4D8);
    border-radius: 4px;
    box-shadow: inset 1px 1px 2px #F0E8F8, inset -1px -1px 2px #B8A8D0;
    border: 1px solid rgba(192, 180, 216, 0.4);
}

.hex-body {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.65rem, 0.85vw, 0.8rem);
    line-height: 1.5;
    color: #3A2E58;
    padding: 0 0.3rem;
}

/* ========== Honeycomb Cluster Layout ========== */

.honeycomb-cluster {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 1200px;
    transform: rotate(0.5deg);
    position: relative;
}

/* Light leaking between gaps */
.honeycomb-cluster::before {
    content: '';
    position: absolute;
    inset: -20px;
    background: radial-gradient(ellipse at center, rgba(240, 232, 248, 0.3), transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* ========== Concepts Section ========== */

.concepts-section {
    min-height: 100vh;
    padding-top: 6rem;
}

.concepts-cluster {
    gap: 16px;
}

.hex-concept {
    width: clamp(160px, 20vw, 260px);
    height: clamp(185px, 23.1vw, 300px);
    opacity: 0;
    transform: translateY(40px) scale(0.9);
}

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

.hex-concept:hover {
    transform: scale(1.05);
    filter: brightness(1.03);
}

/* ========== Dependency Graph Section ========== */

.graph-section {
    min-height: 100vh;
    padding: 4rem 2rem;
}

.graph-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    background: #D4C8E8;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    padding: 6px;
}

.graph-container-inner {
    position: relative;
    width: 100%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(145deg, #EDE6F5, #DED4EC);
    padding: 2rem;
    overflow: hidden;
}

.dep-graph {
    position: relative;
    width: 100%;
    height: auto;
    z-index: 1;
}

.graph-edges path {
    stroke: #B8A8D0;
    stroke-width: 1.5;
    fill: none;
    opacity: 0.6;
    transition: stroke 0.3s ease, opacity 0.3s ease, stroke-width 0.3s ease;
}

.graph-edges path.highlighted {
    stroke: #F5C6A8;
    opacity: 1;
    stroke-width: 2.5;
}

.graph-nodes polygon {
    fill: #D4C8E8;
    stroke: #B8A8D0;
    stroke-width: 1.5;
    transition: all 0.3s ease;
    cursor: pointer;
}

.graph-nodes polygon:hover {
    fill: #A8E0D0;
    stroke: #3A2E58;
    filter: drop-shadow(0 0 8px rgba(168, 224, 208, 0.5));
}

.graph-nodes polygon.glow-mint {
    animation: nodeGlowMint 3s ease-in-out infinite;
}

.graph-nodes polygon.glow-peach {
    animation: nodeGlowPeach 3s ease-in-out infinite;
}

@keyframes nodeGlowMint {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(168, 224, 208, 0.3)); }
    50% { filter: drop-shadow(0 0 8px rgba(168, 224, 208, 0.7)); }
}

@keyframes nodeGlowPeach {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(245, 198, 168, 0.3)); }
    50% { filter: drop-shadow(0 0 8px rgba(245, 198, 168, 0.7)); }
}

.graph-nodes text {
    font-family: 'Inconsolata', monospace;
    font-size: 9px;
    fill: #3A2E58;
    pointer-events: none;
}

.node-tooltip {
    position: absolute;
    background: #E8E0F0;
    box-shadow: 4px 4px 8px #C0B4D8, -4px -4px 8px #F0E8F8;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 10;
    pointer-events: none;
}

.node-tooltip.active {
    display: flex;
}

.tooltip-label {
    font-family: 'Inconsolata', monospace;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6B5E88;
}

.tooltip-name {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    color: #3A2E58;
}

.tooltip-version {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: #6B5E88;
}

.tooltip-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.tooltip-status-text {
    font-family: 'Inconsolata', monospace;
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6B5E88;
}

/* ========== Standards Section ========== */

.standards-section {
    min-height: 100vh;
}

.standards-cluster {
    gap: 20px;
}

.hex-standard {
    width: clamp(200px, 26vw, 340px);
    height: clamp(231px, 30vw, 393px);
    opacity: 0;
    transform: translateY(40px) scale(0.9);
}

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

.standard-icon {
    margin-bottom: 0.5rem;
}

.icon-svg {
    width: 50px;
    height: 50px;
}

.standard-name {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    letter-spacing: 0.04em;
    color: #3A2E58;
    margin-bottom: 0.3rem;
}

/* Toggle Switch (vintage hardware control) */
.toggle-switch {
    width: 44px;
    height: 22px;
    background: linear-gradient(145deg, #C0B4D8, #B8A8D0);
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    margin-top: 0.5rem;
    box-shadow: inset 2px 2px 4px #B8A8D0, inset -2px -2px 4px #D4C8E8;
    transition: background 0.3s ease;
}

.toggle-switch.active {
    background: linear-gradient(145deg, #A8E0D0, #8CCFC0);
}

.toggle-knob {
    width: 18px;
    height: 18px;
    background: #E8E0F0;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    box-shadow: 2px 2px 4px #C0B4D8, -1px -1px 2px #F0E8F8;
    transition: left 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toggle-switch.active .toggle-knob {
    left: 24px;
}

.hex-detail {
    display: none;
    padding: 0.5rem;
    text-align: center;
}

.hex-detail.open {
    display: block;
}

.hex-detail p {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.6rem, 0.75vw, 0.75rem);
    color: #6B5E88;
    line-height: 1.5;
}

/* ========== Ecosystem Section ========== */

.ecosystem-section {
    min-height: 100vh;
}

.ecosystem-cluster {
    gap: 16px;
}

.hex-tool {
    width: clamp(160px, 20vw, 260px);
    height: clamp(185px, 23.1vw, 300px);
    opacity: 0;
    transform: translateY(40px) scale(0.9);
}

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

.hex-tool:hover {
    transform: scale(1.05);
    filter: brightness(1.03);
}

/* ========== Community Section ========== */

.community-section {
    min-height: 100vh;
    padding-bottom: 8rem;
    position: relative;
}

.community-cluster {
    gap: 18px;
}

.hex-resource {
    width: clamp(160px, 22vw, 280px);
    height: clamp(185px, 25.4vw, 323px);
    opacity: 0;
    transform: translateY(40px) scale(0.9);
}

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

.hex-resource.drifting.visible {
    animation: drift 8s ease-in-out infinite;
}

@keyframes drift {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

.hex-resource:hover {
    transform: scale(1.04);
    filter: brightness(1.03);
}

.horizon-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(to bottom, transparent, #E8E0F0);
    pointer-events: none;
}

/* ========== Shake Animation ========== */

@keyframes hexShake {
    0%, 100% { transform: translateX(0); }
    15%, 45%, 75% { transform: translateX(-4px) rotate(-0.5deg); }
    30%, 60%, 90% { transform: translateX(4px) rotate(0.5deg); }
}

.hex-shake {
    animation: hexShake 400ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.hex-shake-border {
    outline: 2px solid #E89090;
    outline-offset: -2px;
}

/* ========== Hex Stagger Animation ========== */

.hex-stagger {
    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-stagger[data-delay="0"] { transition-delay: 0ms; }
.hex-stagger[data-delay="1"] { transition-delay: 60ms; }
.hex-stagger[data-delay="2"] { transition-delay: 120ms; }
.hex-stagger[data-delay="3"] { transition-delay: 180ms; }
.hex-stagger[data-delay="4"] { transition-delay: 240ms; }
.hex-stagger[data-delay="5"] { transition-delay: 300ms; }

/* ========== Hex Cell Neomorphic pressed state ========== */

.hex-cell.pressed .hex-inner {
    box-shadow: inset 4px 4px 8px #C0B4D8, inset -4px -4px 8px #F0E8F8;
}

.hex-cell.pressed .hex-screen {
    background: linear-gradient(145deg, #D4C8E8, #E8E0F0);
}

/* ========== Scroll Compress (exit) ========== */

.hex-cell.compressing {
    transform: scaleY(0.6);
    opacity: 0.3;
    transition: transform 0.6s ease-out, opacity 0.6s ease-out;
}

/* ========== Responsive ========== */

@media (max-width: 1024px) {
    .honeycomb-cluster {
        max-width: 700px;
    }

    .hex-concept,
    .hex-tool,
    .hex-resource {
        width: clamp(140px, 30vw, 240px);
        height: clamp(162px, 34.6vw, 277px);
    }

    .hex-standard {
        width: clamp(180px, 35vw, 300px);
        height: clamp(208px, 40.4vw, 347px);
    }
}

@media (max-width: 640px) {
    .honeycomb-cluster {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .hex-cell {
        width: clamp(220px, 70vw, 300px);
        height: clamp(254px, 80.8vw, 347px);
    }

    .hex-hero {
        width: clamp(250px, 80vw, 340px);
        height: clamp(289px, 92.4vw, 393px);
    }

    .hex-concept,
    .hex-tool,
    .hex-resource {
        width: clamp(220px, 70vw, 300px);
        height: clamp(254px, 80.8vw, 347px);
    }

    .hex-standard {
        width: clamp(240px, 75vw, 320px);
        height: clamp(277px, 86.6vw, 370px);
    }

    .section {
        padding: 3rem 1rem;
    }

    .section-heading {
        font-size: clamp(1.4rem, 6vw, 2rem);
    }

    .graph-container {
        clip-path: none;
        border-radius: 16px;
        padding: 4px;
    }

    .graph-container-inner {
        clip-path: none;
        border-radius: 12px;
        padding: 1rem;
    }

    .scroll-hint {
        display: none;
    }
}
