/* ============================================
   senggack.xyz - Cyberpunk Neural Void
   Colors: #00E5FF, #FF006E, #39FF14, #0A0A0F, #12121A, #B0BEC5, #E0F7FA, #FFD600
   Fonts: Orbitron, Rajdhani, Share Tech Mono
   ============================================ */

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

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

body {
    background: radial-gradient(ellipse at center, #0A0A0F 0%, #06060A 100%);
    color: #B0BEC5;
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    line-height: 1.75;
    perspective: 1200px;
    overflow-x: hidden;
    min-height: 900vh;
}

::selection {
    background: #00E5FF;
    color: #0A0A0F;
}

/* --- Overlay Plane (z:2) --- */
#overlay-plane {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
}

#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    opacity: 0.5;
}

#glitch-slice {
    position: absolute;
    left: 0;
    width: 100%;
    height: 4px;
    background: #00E5FF;
    opacity: 0;
    mix-blend-mode: screen;
    transition: none;
}

.glitch-active {
    animation: glitchSlice 200ms steps(3) forwards;
}

@keyframes glitchSlice {
    0% { opacity: 0.7; transform: translateX(0); }
    25% { opacity: 0.9; transform: translateX(20px); }
    50% { opacity: 0.5; transform: translateX(-15px); background: #FF006E; }
    75% { opacity: 0.8; transform: translateX(10px); background: #39FF14; }
    100% { opacity: 0; transform: translateX(0); }
}

/* --- Background Plane (z:0) --- */
#bg-plane {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0;
    transition: opacity 2s ease;
}

#bg-plane.visible {
    opacity: 1;
}

#circuit-bg {
    width: 100%;
    height: 100%;
}

.circuit-traces {
    opacity: 0.04;
}

.trace {
    stroke-dasharray: 8 4;
    stroke-dashoffset: 0;
    animation: tracePulse 20s linear infinite;
}

.trace.illuminated {
    opacity: 1;
    filter: drop-shadow(0 0 4px #00E5FF);
    transition: opacity 0.5s ease, filter 0.5s ease;
}

.pad {
    opacity: 0.3;
}

.pad.illuminated {
    opacity: 1;
    filter: drop-shadow(0 0 6px #00E5FF);
}

@keyframes tracePulse {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -240; }
}

/* --- Hexagonal Navigation --- */
#hex-nav {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 200;
}

#hex-node {
    cursor: pointer;
    animation: hexPulse 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.4));
    transition: filter 0.3s ease;
}

#hex-node:hover {
    filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.8));
}

@keyframes hexPulse {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.3)); }
    50% { filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.6)); }
}

#radial-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transition: opacity 0.3s ease;
}

#radial-menu.hidden {
    opacity: 0;
    pointer-events: none;
}

#radial-menu.visible {
    opacity: 1;
    pointer-events: auto;
}

.radial-link {
    position: absolute;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    color: #00E5FF;
    text-decoration: none;
    letter-spacing: 0.06em;
    white-space: nowrap;
    padding: 4px 10px;
    border: 1px solid rgba(0, 229, 255, 0.3);
    background: rgba(10, 10, 15, 0.9);
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.radial-link:hover {
    background: rgba(0, 229, 255, 0.15);
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
    color: #E0F7FA;
}

/* --- Boot Sequence --- */
.section-boot {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.boot-container {
    text-align: center;
    position: relative;
    z-index: 11;
}

.typed-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: #00E5FF;
}

.cursor-blink {
    color: #00E5FF;
    animation: blink 800ms steps(1) infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.main-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2.5rem, 7vw + 0.5rem, 8rem);
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    -webkit-text-stroke: 1px #00E5FF;
    color: transparent;
    text-shadow: 0 0 40px rgba(0, 229, 255, 0.3);
    transition: color 0.3s ease;
    line-height: 1.1;
}

.main-title:hover {
    color: #00E5FF;
}

.main-title.hidden {
    opacity: 0;
    transform: scale(0.9);
}

.main-title.revealed {
    opacity: 1;
    transform: scale(1);
    animation: titleReveal 1s ease-out forwards;
}

@keyframes titleReveal {
    0% { opacity: 0; transform: scale(0.8) translateY(10px); filter: blur(5px); }
    30% { opacity: 1; filter: blur(0); }
    40% { transform: scale(1.02) translateX(5px); }
    50% { transform: scale(0.98) translateX(-3px); }
    60% { transform: scale(1.01) translateX(2px); }
    100% { opacity: 1; transform: scale(1) translateX(0); filter: blur(0); }
}

.subtitle {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: clamp(1.1rem, 2.5vw, 1.8rem);
    letter-spacing: 0.06em;
    color: #B0BEC5;
    margin-top: 1rem;
}

.subtitle.hidden {
    opacity: 0;
}

.subtitle.revealed {
    animation: subtitleFade 1.5s ease-out forwards;
}

@keyframes subtitleFade {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* --- Icosahedron --- */
.icosahedron {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    height: 200px;
    transform-style: preserve-3d;
    transform: translate(-50%, -50%) translate3d(200px, -100px, 0);
    animation: icoRotate 30s linear infinite;
}

.icosahedron.hidden {
    opacity: 0;
}

.icosahedron.revealed {
    animation: icoReveal 2s ease-out forwards, icoRotate 30s linear infinite;
}

@keyframes icoReveal {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes icoRotate {
    0% { transform: translate(-50%, -50%) translate3d(200px, -100px, 0) rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
    100% { transform: translate(-50%, -50%) translate3d(200px, -100px, 0) rotateX(360deg) rotateY(360deg) rotateZ(180deg); }
}

.ico-face {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    opacity: 0.2;
}

.ico-face.face-1  { border-width: 0 50px 86px 50px; border-color: transparent transparent rgba(0, 229, 255, 0.1) transparent; transform: rotateX(0deg) translateZ(40px); border-bottom-color: transparent; outline: 1px solid #00E5FF; }
.ico-face.face-2  { border-width: 0 50px 86px 50px; border-color: transparent transparent rgba(0, 229, 255, 0.1) transparent; transform: rotateX(72deg) translateZ(40px); }
.ico-face.face-3  { border-width: 0 50px 86px 50px; border-color: transparent transparent rgba(0, 229, 255, 0.1) transparent; transform: rotateX(144deg) translateZ(40px); }
.ico-face.face-4  { border-width: 0 50px 86px 50px; border-color: transparent transparent rgba(0, 229, 255, 0.1) transparent; transform: rotateX(216deg) translateZ(40px); }
.ico-face.face-5  { border-width: 0 50px 86px 50px; border-color: transparent transparent rgba(0, 229, 255, 0.1) transparent; transform: rotateX(288deg) translateZ(40px); }
.ico-face.face-6  { border-width: 0 50px 86px 50px; border-color: transparent transparent rgba(0, 229, 255, 0.05) transparent; transform: rotateY(60deg) translateZ(40px); }
.ico-face.face-7  { border-width: 0 50px 86px 50px; border-color: transparent transparent rgba(0, 229, 255, 0.05) transparent; transform: rotateY(120deg) translateZ(40px); }
.ico-face.face-8  { border-width: 0 50px 86px 50px; border-color: transparent transparent rgba(0, 229, 255, 0.05) transparent; transform: rotateY(180deg) translateZ(40px); }
.ico-face.face-9  { border-width: 0 50px 86px 50px; border-color: transparent transparent rgba(0, 229, 255, 0.05) transparent; transform: rotateY(240deg) translateZ(40px); }
.ico-face.face-10 { border-width: 0 50px 86px 50px; border-color: transparent transparent rgba(0, 229, 255, 0.05) transparent; transform: rotateY(300deg) translateZ(40px); }
.ico-face.face-11 { border-width: 0 50px 86px 50px; border-color: transparent transparent rgba(0, 229, 255, 0.05) transparent; transform: rotateZ(45deg) rotateX(60deg) translateZ(40px); }
.ico-face.face-12 { border-width: 0 50px 86px 50px; border-color: transparent transparent rgba(0, 229, 255, 0.05) transparent; transform: rotateZ(-45deg) rotateX(120deg) translateZ(40px); }

/* --- Concept Modules Section --- */
.section-concepts {
    position: relative;
    height: 300vh;
    z-index: 10;
    padding: 5vh 0;
}

.connector-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.connector {
    stroke: #00E5FF;
    stroke-width: 1;
    stroke-dasharray: 4 8;
    stroke-dashoffset: 0;
    opacity: 0;
    animation: connectorFlow 8s linear infinite;
    transition: opacity 1s ease;
}

.connector.visible {
    opacity: 0.4;
}

@keyframes connectorFlow {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -48; }
}

/* --- Floating Content Modules --- */
.concept-module,
.deep-module {
    position: absolute;
    width: clamp(280px, 35vw, 480px);
    padding: 28px 32px;
    background: #12121A;
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.15), inset 0 0 1px rgba(0, 229, 255, 0.2);
    z-index: 10;
    opacity: 0;
    transform: translateX(20px) translateZ(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    will-change: transform;
}

.concept-module.in-view,
.deep-module.in-view {
    opacity: 1;
    transform: translateX(0) translateZ(30px);
}

.module-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
    pointer-events: none;
}

.module-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(0, 229, 255, 0.25);
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}

.concept-module:hover,
.deep-module:hover {
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.3), inset 0 0 2px rgba(0, 229, 255, 0.3);
}

.concept-module:hover .module-border::before,
.deep-module:hover .module-border::before {
    animation: borderGlitch 150ms steps(3) forwards;
}

@keyframes borderGlitch {
    0% { border-color: #00E5FF; }
    33% { border-color: #FF006E; }
    66% { border-color: #39FF14; }
    100% { border-color: #00E5FF; }
}

.concept-module:hover::after,
.deep-module:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 1px,
        rgba(0, 0, 0, 0.15) 1px,
        rgba(0, 0, 0, 0.15) 2px
    );
    pointer-events: none;
    animation: scanFlash 150ms steps(2) forwards;
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
}

@keyframes scanFlash {
    0% { opacity: 0.8; }
    50% { opacity: 0.4; }
    100% { opacity: 0; }
}

.module-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: clamp(1.1rem, 2.5vw, 1.8rem);
    letter-spacing: 0.06em;
    color: #00E5FF;
    margin-bottom: 12px;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.module-text {
    color: #B0BEC5;
    margin-bottom: 16px;
}

.module-id {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    color: rgba(0, 229, 255, 0.3);
    display: block;
    text-align: right;
}

/* --- Data Stream Section --- */
.section-datastream {
    position: relative;
    height: 100vh;
    z-index: 10;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stream-layer {
    display: flex;
    gap: 60px;
    white-space: nowrap;
    padding: 12px 0;
    overflow: hidden;
}

.stream-line {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.7rem, 1.1vw, 0.9rem);
    display: inline-block;
    flex-shrink: 0;
}

.stream-fast {
    color: #00E5FF;
    animation: streamScroll 15s linear infinite;
}

.stream-medium {
    color: #FF006E;
    animation: streamScroll 25s linear infinite reverse;
}

.stream-slow {
    color: #39FF14;
    animation: streamScroll 35s linear infinite;
}

@keyframes streamScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.stream-overlay-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
}

.stream-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    -webkit-text-stroke: 1px #00E5FF;
    color: transparent;
    opacity: 0.15;
}

/* --- Deep Dive Section --- */
.section-deepdive {
    position: relative;
    height: 300vh;
    z-index: 10;
    padding: 5vh 0;
}

.deep-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.5rem, 3.5vw, 3rem);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    -webkit-text-stroke: 1px #00E5FF;
    color: transparent;
    line-height: 1.2;
    margin-bottom: 16px;
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
    transition: color 0.3s ease;
}

.deep-title:hover {
    color: #00E5FF;
}

.deep-title.break-free {
    transform: translateX(-20px);
}

.gen-canvas {
    width: 100%;
    height: 150px;
    margin-bottom: 16px;
    border: 1px solid rgba(0, 229, 255, 0.15);
    background: rgba(10, 10, 15, 0.8);
}

/* Tron Grid */
.tron-grid {
    position: absolute;
    bottom: 0;
    left: -20%;
    width: 140%;
    height: 40%;
    background:
        repeating-linear-gradient(
            90deg,
            rgba(0, 229, 255, 0.05) 0px,
            rgba(0, 229, 255, 0.05) 1px,
            transparent 1px,
            transparent 60px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(0, 229, 255, 0.05) 0px,
            rgba(0, 229, 255, 0.05) 1px,
            transparent 1px,
            transparent 60px
        );
    transform: rotateX(60deg);
    transform-origin: bottom center;
    opacity: 0.6;
    z-index: 1;
}

/* --- 3D CSS Cube Divider --- */
.geo-divider {
    position: absolute;
    z-index: 15;
}

.cube {
    width: 60px;
    height: 60px;
    position: relative;
    transform-style: preserve-3d;
    animation: cubeRotate 20s linear infinite;
}

@keyframes cubeRotate {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

.cube-face {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 1px solid #00E5FF;
    background: rgba(0, 229, 255, 0.05);
}

.cube-front  { transform: translateZ(30px); }
.cube-back   { transform: translateZ(-30px) rotateY(180deg); }
.cube-left   { transform: translateX(-30px) rotateY(-90deg); }
.cube-right  { transform: translateX(30px) rotateY(90deg); }
.cube-top    { transform: translateY(-30px) rotateX(90deg); }
.cube-bottom { transform: translateY(30px) rotateX(-90deg); }

/* --- Terminal Outro --- */
.section-terminal {
    position: relative;
    height: 100vh;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.terminal-container {
    max-width: 700px;
    padding: 0 20px;
}

.terminal-line {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.8rem, 1.2vw, 1rem);
    color: #B0BEC5;
    margin-bottom: 6px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.terminal-line.visible {
    opacity: 1;
    transform: translateY(0);
}

.terminal-final {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #00E5FF;
    text-shadow: 0 0 30px rgba(0, 229, 255, 0.4);
    margin: 24px 0 8px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.terminal-final.visible {
    opacity: 1;
    transform: translateY(0);
}

.terminal-sub {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: clamp(1rem, 2vw, 1.4rem);
    letter-spacing: 0.06em;
    color: #B0BEC5;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.terminal-sub.visible {
    opacity: 1;
    transform: translateY(0);
}

.terminal-cursor {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.terminal-cursor.visible {
    opacity: 1;
}

.green-text {
    color: #39FF14;
    text-shadow: 0 0 6px rgba(57, 255, 20, 0.4);
}

.amber-text {
    color: #FFD600;
    text-shadow: 0 0 6px rgba(255, 214, 0, 0.4);
}

/* --- Data corruption text effect --- */
.corrupted-char {
    display: inline-block;
    animation: charCorrupt 100ms steps(1) forwards;
}

@keyframes charCorrupt {
    0% { opacity: 1; }
    50% { content: attr(data-glitch); color: #FF006E; }
    100% { opacity: 1; }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .trace { animation: none; }
    .connector { animation: none; }
    .icosahedron { animation: none; }
    .cube { animation: none; }
    .stream-fast,
    .stream-medium,
    .stream-slow { animation: none; }
    #hex-node { animation: none; }
    .glitch-active { animation: none; }
    #particle-canvas { display: none; }
    #glitch-slice { display: none; }
    #scanlines { display: none; }

    .concept-module,
    .deep-module {
        opacity: 1;
        transform: none;
    }

    .terminal-line,
    .terminal-final,
    .terminal-sub,
    .terminal-cursor {
        opacity: 1;
        transform: none;
    }

    .main-title.hidden,
    .subtitle.hidden,
    .icosahedron.hidden {
        opacity: 1;
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .concept-module,
    .deep-module {
        position: relative;
        width: 90%;
        margin: 30px auto;
        left: auto !important;
        top: auto !important;
    }

    .section-concepts,
    .section-deepdive {
        height: auto;
        min-height: 100vh;
        padding: 10vh 0;
    }

    .connector-svg {
        display: none;
    }

    .icosahedron {
        display: none;
    }

    .tron-grid {
        display: none;
    }

    .geo-divider {
        display: none;
    }

    .deep-title.break-free {
        transform: none;
    }
}
