/* holos.dev - Holographic Atlas of Interconnected Systems */

:root {
    --void-navy: #0D0B1E;
    --obsidian-plum: #1A1530;
    --nebula-glass: #2A2440;
    --star-white: #E0D7FF;
    --mist-lavender: #A89EC8;
    --prism-violet: #7B68EE;
    --refract-blue: #4F8EF7;
    --holoteal: #36D6C4;
    --spectral-gold: #F0C75E;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    background: var(--void-navy);
    color: var(--star-white);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.125rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
}

::selection { background: var(--prism-violet); color: var(--star-white); }

/* === Holographic Shell (Viewport Border) === */
.holo-shell {
    position: fixed;
    inset: 8px;
    border: 2px solid rgba(123, 104, 238, 0.25);
    border-radius: 16px;
    z-index: 200;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.holo-shell.visible { opacity: 1; }

.corner-prism {
    position: absolute;
    width: 16px;
    height: 16px;
    animation: spin-prism 20s linear infinite;
}

.corner-prism.top-left { top: -2px; left: -2px; }
.corner-prism.top-right { top: -2px; right: -2px; }
.corner-prism.bottom-left { bottom: -2px; left: -2px; }
.corner-prism.bottom-right { bottom: -2px; right: -2px; }

@keyframes spin-prism {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* === Grain Overlay === */
.grain-overlay {
    position: fixed;
    inset: 0;
    z-index: 150;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(123, 104, 238, 0.04) 1px, transparent 1px),
        radial-gradient(circle at 80% 70%, rgba(123, 104, 238, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 50% 50%, rgba(79, 142, 247, 0.03) 1px, transparent 1px);
    background-size: 3px 3px, 5px 5px, 7px 7px;
}

.grain-overlay.visible { opacity: 1; }

/* === Nav Indicator === */
.nav-indicator {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.nav-indicator.visible { opacity: 1; }

.nav-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: var(--star-white);
    opacity: 0.15;
    transform: translateX(-50%);
}

.nav-diamond {
    width: 8px;
    height: 8px;
    background: transparent;
    border: 1px solid var(--mist-lavender);
    transform: rotate(45deg);
    position: relative;
    z-index: 1;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
    text-decoration: none;
}

.nav-diamond.active {
    border-color: var(--prism-violet);
    background: var(--prism-violet);
    box-shadow: 0 0 8px var(--prism-violet);
}

/* === Brand Mark === */
.brand-mark {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 300;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.2em;
    text-transform: lowercase;
    color: var(--star-white);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.brand-mark.visible { opacity: 0.4; }

/* === Background Wireframes (Depth Plane 1) === */
.depth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.wireframe-shape {
    position: absolute;
    opacity: 0.15;
}

.wf-1 {
    width: 140px;
    height: 140px;
    top: 15%;
    left: 10%;
    animation: drift-1 30s linear infinite, rotate-slow 25s linear infinite;
}

.wf-2 {
    width: 180px;
    height: 180px;
    top: 50%;
    right: 8%;
    animation: drift-2 40s linear infinite, rotate-slow 35s linear infinite reverse;
}

.wf-3 {
    width: 120px;
    height: 120px;
    bottom: 20%;
    left: 30%;
    animation: drift-3 35s linear infinite, rotate-slow 40s linear infinite;
}

@keyframes drift-1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 20px); }
}

@keyframes drift-2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, 30px); }
}

@keyframes drift-3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -25px); }
}

@keyframes rotate-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* === Sections === */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
}

/* === Hero (The Void) === */
.void-hero {
    z-index: 10;
}

.hero-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.icosahedron {
    width: clamp(200px, 40vw, 300px);
    height: auto;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.icosahedron.visible { opacity: 1; }

.ico-edge {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 1.5s ease;
}

.icosahedron.drawn .ico-edge {
    stroke-dashoffset: 0;
}

.icosahedron.rotating {
    animation: ico-rotate 20s linear infinite;
}

@keyframes ico-rotate {
    from { transform: rotateY(0deg) rotateX(5deg); }
    to { transform: rotateY(360deg) rotateX(5deg); }
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.4rem, 3vw, 2.5rem);
    letter-spacing: 0.2em;
    color: var(--star-white);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.hero-title.visible { opacity: 1; }

.hero-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-style: italic;
    font-size: 14px;
    color: var(--mist-lavender);
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.hero-subtitle.visible { opacity: 1; }

.scroll-diamond {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: pulse-diamond 2s ease-in-out infinite;
}

.scroll-diamond.visible { opacity: 0.6; }

@keyframes pulse-diamond {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
    50% { transform: translateX(-50%) translateY(6px); opacity: 0.3; }
}

/* === Scatter Section === */
.scatter-section {
    z-index: 10;
    padding: 120px 20px;
    min-height: 200vh;
}

.hex-cluster {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
    perspective: 800px;
}

.hex-panel {
    width: 160px;
    min-height: 180px;
    background: rgba(26, 21, 48, 0.7);
    backdrop-filter: blur(12px) saturate(1.4);
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
    border: 1px solid var(--prism-violet);
    border-image: linear-gradient(
        calc(135deg + var(--hue-shift, 0deg)),
        var(--prism-violet),
        var(--refract-blue),
        var(--holoteal)
    ) 1;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px 16px;
    opacity: 0;
    transform: scale(0.85) translateY(40px);
    transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
    transition-delay: var(--delay, 0s);
    position: relative;
}

.hex-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: 1px solid;
    border-image: linear-gradient(
        calc(135deg + var(--hue-shift, 0deg)),
        var(--prism-violet),
        var(--refract-blue),
        var(--holoteal)
    ) 1;
    opacity: 0.4;
    pointer-events: none;
}

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

.hex-panel:hover {
    box-shadow: 0 0 20px rgba(123, 104, 238, 0.2), 4px 4px 12px rgba(79, 142, 247, 0.1);
}

.hex-panel.mini {
    width: 90px;
    min-height: 100px;
    padding: 16px 8px;
}

.hex-inner {
    position: relative;
    z-index: 1;
}

.hex-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    letter-spacing: -0.02em;
    color: var(--star-white);
    margin-bottom: 8px;
}

.hex-desc {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 12px;
    color: var(--mist-lavender);
    line-height: 1.5;
}

.hex-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.8rem, 1.4vw, 0.95rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #C4B5FD;
    text-shadow: 0 0 6px rgba(123, 104, 238, 0.25);
}

/* === Holographic Labels (Foreground Plane) === */
.holo-label {
    position: absolute;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.8rem, 1.4vw, 0.95rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #C4B5FD;
    text-shadow: 0 0 6px rgba(123, 104, 238, 0.25);
    opacity: 0;
    transition: opacity 0.6s ease;
    z-index: 20;
}

.holo-label.visible { opacity: 0.7; }

/* === Convergence Section === */
.convergence-section {
    z-index: 10;
    position: relative;
    overflow: hidden;
}

.convergence-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: -0.02em;
    color: var(--star-white);
    text-align: center;
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.convergence-heading.visible {
    opacity: 1;
    transform: translateY(0);
}

.converged { gap: 12px; }

/* === Spectral Flare === */
.spectral-flare {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--prism-violet), var(--refract-blue), var(--holoteal), transparent);
    opacity: 0;
    z-index: 30;
    pointer-events: none;
    transition: none;
}

.spectral-flare.sweep {
    animation: flare-sweep 0.8s ease-out forwards;
}

@keyframes flare-sweep {
    0% { top: 0; opacity: 0.8; }
    100% { top: 100%; opacity: 0; }
}

/* === Lattice Lines === */
.lattice-svg {
    width: 100%;
    max-width: 600px;
    height: auto;
    margin-top: 24px;
}

.lattice-line {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 0.6s ease;
}

.lattice-line.drawn {
    stroke-dashoffset: 0;
}

/* === Deep Dive Section === */
.deep-dive-section {
    z-index: 10;
    min-height: auto;
    padding: 100px 20px;
    gap: 60px;
}

.content-block {
    max-width: 720px;
    width: 100%;
}

.frosted-panel {
    background: rgba(42, 36, 64, 0.6);
    backdrop-filter: blur(12px) saturate(1.4);
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
    border: 1px solid rgba(123, 104, 238, 0.15);
    border-radius: 8px;
    padding: 40px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.frosted-panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.4rem, 3vw, 2.5rem);
    letter-spacing: -0.02em;
    color: var(--star-white);
    margin-bottom: 16px;
}

.body-text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.125rem);
    line-height: 1.72;
    color: var(--mist-lavender);
}

.mini-hex-cluster {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* === Resolution Section === */
.resolution-section {
    z-index: 10;
    position: relative;
    overflow: hidden;
    gap: 32px;
}

.icosahedron-final {
    width: clamp(200px, 40vw, 300px);
    height: auto;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 1s ease, transform 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icosahedron-final.visible {
    opacity: 1;
    transform: scale(1);
}

.icosahedron-final.rotating {
    animation: ico-rotate 20s linear infinite;
}

.resolution-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--mist-lavender);
    text-align: center;
    max-width: 600px;
    letter-spacing: 0.02em;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.resolution-text.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Responsive === */
@media (max-width: 768px) {
    .hex-panel { width: 130px; min-height: 150px; padding: 24px 12px; }
    .hex-panel.mini { width: 75px; min-height: 85px; }
    .hex-cluster { gap: 12px; }
    .frosted-panel { padding: 24px; }
    .nav-indicator { right: 12px; }
    .holo-shell { inset: 4px; }
    .brand-mark { top: 16px; left: 16px; font-size: 12px; }
    .holo-label { display: none; }
}
