/* ============================================
   simulai.tech — Holographic Command Surface
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0B0E17;
    color: #B8C4D0;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.75rem, 1.1vw, 0.95rem);
    letter-spacing: 0.04em;
    line-height: 1.7;
    overflow-x: hidden;
}

/* --- Grid Substrate --- */
.grid-substrate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    opacity: 0.4;
    pointer-events: none;
}

/* --- Navigation Cube --- */
.nav-cube-wrapper {
    position: fixed;
    top: 36px;
    right: 36px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-direction: row-reverse;
}

.nav-cube {
    width: 24px;
    height: 24px;
    transform-style: preserve-3d;
    animation: rotateCube 20s linear infinite;
    cursor: pointer;
}

.cube-face {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 1px solid #1E2538;
    background: transparent;
}

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

@keyframes rotateCube {
    from { transform: rotateY(0deg) rotateX(0deg); }
    to   { transform: rotateY(360deg) rotateX(360deg); }
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 300ms ease, transform 300ms ease;
    pointer-events: none;
}

.nav-cube-wrapper:hover .nav-links {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.nav-cube-wrapper:hover .nav-cube {
    transform: scale(1.5);
    animation: none;
}

.nav-cube-wrapper:hover .cube-face {
    border-color: #4ECDC4;
}

.nav-links a {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #4ECDC4;
    text-decoration: none;
    white-space: nowrap;
    transition: color 300ms ease;
}

.nav-links a:hover {
    color: #00F5D4;
}

/* --- Phase Sections --- */
.phase-section {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 12vh 12vw;
    display: flex;
}

.phase-content {
    max-width: 700px;
}

.phase-content--center {
    margin: auto;
    text-align: center;
}

.phase-content--left {
    align-self: center;
    margin-right: auto;
}

.phase-content--right {
    align-self: center;
    margin-left: auto;
    text-align: right;
}

.phase-content--bottom-center {
    align-self: flex-end;
    margin: 0 auto;
    text-align: center;
}

/* --- Holographic Text --- */
.holographic-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(2.5rem, 8vw, 7rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 0.92;
    color: #E8ECF1;
    background: linear-gradient(135deg, #FF6B9D, #4ECDC4, #7B68EE, #FF6B9D);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: holoShift 60s ease infinite;
    margin-bottom: 1.5rem;
}

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

/* --- Body Text --- */
.body-text {
    color: #B8C4D0;
    max-width: 520px;
    margin-bottom: 2rem;
}

.phase-content--center .body-text,
.phase-content--bottom-center .body-text {
    margin-left: auto;
    margin-right: auto;
}

/* --- Sparklines --- */
.sparkline {
    display: inline-block;
    vertical-align: middle;
    margin-left: 6px;
}

/* --- Interstitials --- */
.phase-interstitial {
    position: relative;
    z-index: 1;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.phase-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #4ECDC4;
    opacity: 0.7;
}

.phase-interstitial--final {
    height: 50vh;
}

/* --- Data Cards --- */
.data-cards {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.phase-content--center .data-cards,
.phase-content--bottom-center .data-cards {
    justify-content: center;
}

.data-card {
    background: #141829;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(78, 205, 196, 0.3);
    border-image: linear-gradient(135deg, #FF6B9D, #4ECDC4, #9B59B6) 1;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 300ms ease, border-color 300ms ease;
}

.data-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(78, 205, 196, 0.15);
}

.card-number {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(2rem, 4vw, 4rem);
    color: #E8ECF1;
    line-height: 1;
}

.card-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #4ECDC4;
}

/* --- Wire Sphere --- */
.wire-sphere {
    width: 200px;
    height: 200px;
    position: relative;
    margin-left: auto;
    margin-top: 3rem;
    transform-style: preserve-3d;
    animation: sphereRotate 30s linear infinite;
}

@keyframes sphereRotate {
    from { transform: rotateY(0deg) rotateX(0deg); }
    to   { transform: rotateY(360deg) rotateX(360deg); }
}

.sphere-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid #1E2538;
    border-radius: 50%;
}

.sphere-ring--1 { transform: rotateY(0deg); }
.sphere-ring--2 { transform: rotateY(22.5deg); }
.sphere-ring--3 { transform: rotateY(45deg); }
.sphere-ring--4 { transform: rotateY(67.5deg); }
.sphere-ring--5 { transform: rotateY(90deg); }
.sphere-ring--6 { transform: rotateY(112.5deg); }
.sphere-ring--7 { transform: rotateY(135deg); }
.sphere-ring--8 { transform: rotateY(157.5deg); }

.sphere-ring--3,
.sphere-ring--6 {
    border-color: #4ECDC4;
    opacity: 0.4;
}

/* --- Lorenz Attractor --- */
.lorenz-attractor {
    width: 100%;
    max-width: 600px;
    height: auto;
    margin-bottom: 2rem;
}

#lorenz-path {
    stroke-dasharray: 9999;
    stroke-dashoffset: 9999;
    animation: drawPath 8s ease-out forwards;
}

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

/* --- Output Terminal --- */
.output-terminal {
    background: rgba(20, 24, 41, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid #1E2538;
    padding: 24px 28px;
    text-align: left;
    max-width: 560px;
    margin: 2rem auto 0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    font-weight: 400;
}

.terminal-line {
    padding: 4px 0;
    opacity: 0;
    animation: terminalFadeIn 0.5s ease forwards;
}

.terminal-line:nth-child(1) { animation-delay: 0.5s; }
.terminal-line:nth-child(2) { animation-delay: 1.2s; }
.terminal-line:nth-child(3) { animation-delay: 1.9s; }
.terminal-line:nth-child(4) { animation-delay: 2.6s; }
.terminal-line:nth-child(5) { animation-delay: 3.3s; }
.terminal-line:nth-child(6) { animation-delay: 4.0s; }

@keyframes terminalFadeIn {
    to { opacity: 1; }
}

.terminal-prompt {
    color: #4ECDC4;
}

.terminal-status--ok {
    color: #2ECC71;
}

.terminal-status--data {
    color: #7B68EE;
}

.terminal-line--highlight {
    color: #E8ECF1;
}

/* --- Hero Section Specifics --- */
.phase-hero {
    align-items: center;
    justify-content: center;
}

.phase-hero .phase-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Selection --- */
::selection {
    background: rgba(78, 205, 196, 0.3);
    color: #E8ECF1;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .phase-section {
        padding: 8vh 6vw;
    }

    .data-cards {
        flex-direction: column;
    }

    .phase-content--right {
        margin-left: 0;
        text-align: left;
    }

    .wire-sphere {
        margin: 2rem auto 0;
    }

    .nav-cube-wrapper {
        top: 20px;
        right: 20px;
    }
}
