/* ============================================================
   holos.dev - Holographic Infrastructure Design System
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    --void-obsidian: #0A0E1A;
    --nebula-indigo: #111827;
    --holographic-cyan: #67E8F9;
    --refracted-violet: #C4B5FD;
    --spectral-rose: #F9A8D4;
    --holographic-ice: #E0F7FF;
    --lunar-mist: #B8C9D4;
    --aurora-teal: #0D9488;

    --iridescent-gradient: linear-gradient(135deg, #67E8F9 0%, #C4B5FD 40%, #F9A8D4 70%, #67E8F9 100%);

    --font-display: 'Chakra Petch', sans-serif;
    --font-body: 'Nunito Sans', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--void-obsidian);
    color: var(--lunar-mist);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    cursor: default;
}

/* --- Particle Canvas --- */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* --- Cursor Trail --- */
#cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.trail-hex {
    position: absolute;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.trail-hex-1 {
    width: 8px;
    height: 9px;
    background-color: var(--holographic-cyan);
}

.trail-hex-2 {
    width: 6px;
    height: 7px;
    background-color: var(--refracted-violet);
}

.trail-hex-3 {
    width: 4px;
    height: 5px;
    background-color: var(--spectral-rose);
}

/* --- Light Streaks Container --- */
#light-streaks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
}

.light-streak {
    position: absolute;
    width: 4px;
    height: 300px;
    background: var(--iridescent-gradient);
    mix-blend-mode: screen;
    transform: rotate(35deg);
    opacity: 0;
    border-radius: 2px;
    animation: streakFade 2s ease-out forwards;
}

@keyframes streakFade {
    0% { opacity: 0; transform: rotate(35deg) translateY(-50px); }
    15% { opacity: 0.6; }
    100% { opacity: 0; transform: rotate(35deg) translateY(100px); }
}

/* --- Crystalline Facet Overlays --- */
#facet-overlays {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.facet {
    position: absolute;
    background: rgba(196, 181, 253, 0.06);
    border: 1px solid rgba(103, 232, 249, 0.08);
    animation: facetRotate 60s linear infinite;
}

.facet-1 {
    width: 200px;
    height: 200px;
    top: 15%;
    right: -40px;
    clip-path: polygon(30% 0%, 100% 10%, 95% 70%, 60% 100%, 0% 80%, 5% 30%);
}

.facet-2 {
    width: 160px;
    height: 160px;
    bottom: 20%;
    left: -30px;
    clip-path: polygon(20% 0%, 80% 5%, 100% 40%, 90% 90%, 30% 100%, 0% 60%);
    animation-direction: reverse;
    animation-duration: 45s;
}

.facet-3 {
    width: 120px;
    height: 120px;
    top: 60%;
    right: 10%;
    clip-path: polygon(50% 0%, 100% 30%, 85% 90%, 20% 100%, 0% 50%, 15% 10%);
    animation-duration: 75s;
}

@keyframes facetRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Navigation --- */
#hex-nav {
    position: fixed;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 100;
}

.nav-dot {
    width: 6px;
    height: 7px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background-color: rgba(103, 232, 249, 0.3);
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.nav-dot.active {
    background-color: var(--holographic-cyan);
    transform: scale(1.6);
    box-shadow: 0 0 8px rgba(103, 232, 249, 0.5);
}

.nav-dot:hover {
    background-color: var(--holographic-cyan);
    transform: scale(1.4);
}

.nav-label {
    position: absolute;
    left: -8px;
    top: 50%;
    transform: rotate(-90deg) translateX(-50%);
    transform-origin: left center;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--holographic-cyan);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    margin-left: -16px;
}

.nav-dot:hover .nav-label {
    opacity: 1;
}

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

/* --- Gradient Text --- */
.gradient-text {
    background: linear-gradient(135deg, #E0F7FF, #C4B5FD, #67E8F9);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- Iridescent Border Animation --- */
@keyframes iridescentBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ============================================================
   HERO SECTION
   ============================================================ */
#hero {
    min-height: 100vh;
    flex-direction: column;
    overflow: hidden;
}

.hero-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#hero-hexagon {
    width: min(60vh, 500px);
    height: auto;
    animation: heroHexRotate 360s linear infinite;
    opacity: 0;
}

#hero-hexagon.visible {
    opacity: 1;
}

.hero-hex-path {
    stroke-dasharray: 1600;
    stroke-dashoffset: 1600;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-hex-path.drawn {
    stroke-dashoffset: 0;
}

.hero-hex-inner-1 {
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
    transition: stroke-dashoffset 2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s;
}

.hero-hex-inner-1.drawn {
    stroke-dashoffset: 0;
}

.hero-hex-inner-2 {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 2.5s cubic-bezier(0.16, 1, 0.3, 1) 0.6s;
}

.hero-hex-inner-2.drawn {
    stroke-dashoffset: 0;
}

@keyframes heroHexRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hero-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

#hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.2rem, 5vw, 4.5rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 0.5em;
}

#hero-title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#hero-title .letter.visible {
    opacity: 1;
    transform: translateY(0);
}

#hero-subtitle {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    color: var(--lunar-mist);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
    letter-spacing: 0.04em;
}

#hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Bioluminescent Glow Orbs --- */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.5s ease;
    z-index: 0;
}

.glow-orb.visible {
    opacity: 1;
}

.glow-orb-hero {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.18) 0%, transparent 70%);
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
}

/* ============================================================
   LATTICE SECTION
   ============================================================ */
#lattice {
    min-height: 150vh;
    flex-direction: column;
    padding: 10vh 5vw;
}

.section-header {
    text-align: center;
    margin-bottom: 8vh;
}

.section-header h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.4em;
}

.section-subtitle {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--holographic-cyan);
    letter-spacing: 0.08em;
    text-shadow: 0 0 8px rgba(103, 232, 249, 0.3);
}

/* --- Honeycomb Grid --- */
.honeycomb-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1000px;
    width: 100%;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .honeycomb-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .honeycomb-grid {
        grid-template-columns: 1fr;
    }
}

.hex-cell {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--nebula-indigo);
    padding: 0;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    aspect-ratio: 1 / 1.155;
    position: relative;
}

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

.hex-cell::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(135deg, rgba(103, 232, 249, 0.2), rgba(196, 181, 253, 0.1));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.hex-cell:hover::before {
    background: var(--iridescent-gradient);
    background-size: 200% 200%;
    animation: iridescentBorder 8s ease infinite;
    opacity: 0.15;
}

.hex-cell:hover {
    transform: scale(1) translateY(-4px);
}

.hex-cell:hover .hex-icon {
    animation: hexIconSpin 2s linear infinite;
}

@keyframes hexIconSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hex-cell-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    padding: 25% 12% 20%;
    position: relative;
    z-index: 1;
}

.hex-icon {
    width: 40px;
    height: 46px;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.hex-cell-inner h3 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(0.75rem, 1.2vw, 0.95rem);
    color: var(--holographic-ice);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.hex-cell-inner p {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.65rem, 0.9vw, 0.8rem);
    color: var(--lunar-mist);
    line-height: 1.5;
    opacity: 0.8;
}

.glow-orb-lattice-1 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.15) 0%, transparent 70%);
    top: 30%;
    left: 10%;
}

.glow-orb-lattice-2 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(196, 181, 253, 0.12) 0%, transparent 70%);
    bottom: 15%;
    right: 10%;
}

/* ============================================================
   DEPTH SECTION
   ============================================================ */
#depth {
    min-height: 150vh;
    flex-direction: column;
    background: linear-gradient(180deg, var(--void-obsidian) 0%, var(--nebula-indigo) 50%, var(--void-obsidian) 100%);
}

.depth-perspective-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    min-height: 80vh;
    perspective: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.depth-plane {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.depth-plane-far {
    transform: translateZ(-200px);
    opacity: 0.4;
}

.depth-plane-mid {
    transform: translateZ(0px);
    z-index: 2;
}

.depth-plane-near {
    transform: translateZ(100px);
    opacity: 0.3;
    pointer-events: none;
}

.depth-hex-wireframe {
    width: 80%;
    max-width: 500px;
    height: auto;
    opacity: 0.5;
}

.depth-hex-wireframe-near {
    width: 60%;
    max-width: 300px;
    height: auto;
    opacity: 0.4;
}

.depth-content {
    padding: 5vh 8vw;
    text-align: center;
    max-width: 700px;
}

.depth-content h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.depth-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    color: var(--lunar-mist);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.depth-divider {
    width: 60px;
    height: 2px;
    background: var(--iridescent-gradient);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    margin: 2rem auto;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.depth-divider.visible {
    opacity: 1;
}

.glow-orb-depth {
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.2) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ============================================================
   CONVERGENCE SECTION
   ============================================================ */
#convergence {
    min-height: 150vh;
    flex-direction: column;
    padding: 10vh 5vw;
}

.convergence-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    width: 100%;
}

.convergence-structure-wrapper {
    width: 100%;
    max-width: 500px;
    margin: 4vh 0;
    position: relative;
}

#convergence-svg {
    width: 100%;
    height: auto;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#convergence-svg.visible {
    opacity: 1;
    transform: scale(1);
}

.conv-hex {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    transition: stroke-dashoffset 2s cubic-bezier(0.16, 1, 0.3, 1);
}

.conv-hex.drawn {
    stroke-dashoffset: 0;
}

.conv-hex-mid {
    transition-delay: 0.3s;
}

.conv-hex-inner {
    transition-delay: 0.6s;
}

.conv-hex-core {
    transition-delay: 0.9s;
}

.conv-line {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 1.5s ease 1.2s;
}

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

.conv-node {
    opacity: 0;
    transition: opacity 0.6s ease 2s;
    animation: none;
}

.conv-node.visible {
    opacity: 1;
    animation: nodePulse 2s ease-in-out infinite;
}

.conv-node-mid {
    transition-delay: 2.3s;
}

@keyframes nodePulse {
    0%, 100% { r: 4; opacity: 0.7; }
    50% { r: 6; opacity: 1; }
}

.convergence-text {
    text-align: center;
    max-width: 600px;
    padding: 4vh 2vw;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}

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

.convergence-text p {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    color: var(--lunar-mist);
    line-height: 1.8;
}

.glow-orb-convergence-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(196, 181, 253, 0.2) 0%, transparent 70%);
    top: 40%;
    left: 20%;
}

.glow-orb-convergence-2 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.18) 0%, transparent 70%);
    bottom: 20%;
    right: 15%;
}

.glow-orb-convergence-3 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(196, 181, 253, 0.15) 0%, transparent 70%);
    top: 25%;
    right: 25%;
}

/* ============================================================
   CLOSING SECTION
   ============================================================ */
#closing {
    min-height: 100vh;
    flex-direction: column;
}

.closing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.closing-glow-point {
    width: 4px;
    height: 4px;
    background: var(--holographic-cyan);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(103, 232, 249, 0.6),
                0 0 60px rgba(103, 232, 249, 0.3),
                0 0 100px rgba(103, 232, 249, 0.1);
    margin-bottom: 4rem;
    animation: glowPointPulse 3s ease-in-out infinite;
}

@keyframes glowPointPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(103, 232, 249, 0.6),
                    0 0 60px rgba(103, 232, 249, 0.3),
                    0 0 100px rgba(103, 232, 249, 0.1);
    }
    50% {
        transform: scale(1.5);
        box-shadow: 0 0 30px rgba(103, 232, 249, 0.8),
                    0 0 80px rgba(103, 232, 249, 0.4),
                    0 0 140px rgba(103, 232, 249, 0.15);
    }
}

.closing-text {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.2rem, 3vw, 2.2rem);
    text-align: center;
    letter-spacing: 0.04em;
    margin-bottom: 4rem;
    max-width: 600px;
    padding: 0 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}

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

/* --- Hexagonal CTA Button --- */
.hex-cta {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 180px;
    height: 208px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hex-cta-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: ctaPulse 2s ease-in-out infinite;
}

@keyframes ctaPulse {
    0%, 100% { opacity: 0.8; filter: drop-shadow(0 0 4px rgba(103, 232, 249, 0.3)); }
    50% { opacity: 1; filter: drop-shadow(0 0 12px rgba(103, 232, 249, 0.6)); }
}

.hex-cta-text {
    position: relative;
    z-index: 2;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--holographic-cyan);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(103, 232, 249, 0.3);
}

.hex-cta:hover {
    transform: scale(1.05);
}

.hex-cta:hover .hex-cta-border {
    animation: ctaPulse 1s ease-in-out infinite;
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .gradient-text {
        animation: none;
    }

    #hero-hexagon {
        animation: none;
    }

    .hero-hex-path,
    .hero-hex-inner-1,
    .hero-hex-inner-2 {
        stroke-dashoffset: 0;
        transition: none;
    }

    #hero-title .letter {
        opacity: 1;
        transform: none;
        transition: none;
    }

    #hero-subtitle {
        opacity: 1;
        transform: none;
        transition: none;
    }

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

    .depth-text {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .conv-hex {
        stroke-dashoffset: 0;
        transition: none;
    }

    .conv-line {
        stroke-dashoffset: 0;
        transition: none;
    }

    .conv-node {
        opacity: 1;
        animation: none;
    }

    .closing-text {
        opacity: 1;
        transform: none;
    }

    #convergence-svg {
        opacity: 1;
        transform: none;
    }

    .convergence-text {
        opacity: 1;
        transform: none;
    }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    #hex-nav {
        left: 10px;
        gap: 14px;
    }

    .nav-dot {
        width: 5px;
        height: 6px;
    }

    .hex-cell-inner {
        padding: 22% 10% 18%;
    }

    .hex-cell-inner h3 {
        font-size: 0.7rem;
    }

    .hex-cell-inner p {
        font-size: 0.6rem;
        line-height: 1.4;
    }

    .depth-content {
        padding: 4vh 6vw;
    }

    .convergence-structure-wrapper {
        max-width: 350px;
    }

    .hex-cta {
        width: 150px;
        height: 173px;
    }

    .facet-1,
    .facet-2,
    .facet-3 {
        display: none;
    }
}

@media (max-width: 480px) {
    #hex-nav {
        display: none;
    }

    .hex-cell-inner {
        padding: 20% 8% 16%;
    }

    .hex-cell-inner p {
        display: none;
    }
}
