﻿/* ========================================
   MALTHEN DESIGN SYSTEM - v4.0 (Atomic Cleanup)
   Strict Golden Ratio Architecture
   ======================================== */

:root {
    --phi: 1.61803398875;
    
    /* Spacing */
    --sp-1: 0.5rem;
    --sp-2: calc(var(--sp-1) * var(--phi)); 
    --sp-3: calc(var(--sp-2) * var(--phi)); 
    --sp-4: calc(var(--sp-3) * var(--phi)); 
    --sp-5: calc(var(--sp-4) * var(--phi)); 
    --sp-6: calc(var(--sp-5) * var(--phi)); 
    
    /* Colors */
    --black: #010103;
    --white: #ffffff;
    --cyan: #00d9ff;
    --purple: #7a4dff;
    --gold: #ffcc66;
    
    /* Typography */
    --font-main: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --fs-xxl: 4.236rem;
    --fs-xl: 2.618rem;
    --fs-lg: 1.618rem;
    --fs-base: 1rem;
    --fs-sm: 0.75rem;
}

/* ---- Reset & Base ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { 
    background: var(--black) !important; 
    scroll-behavior: smooth; 
    color-scheme: dark;
}

body { 
    background: transparent !important;
    font-family: var(--font-main); 
    color: var(--white) !important;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---- Layout Components ---- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--sp-4);
}

section {
    position: relative;
    z-index: 10;
    padding: var(--sp-6) 0;
}

/* ---- Typography ---- */
h1 {
    font-size: clamp(2.5rem, 6vw, var(--fs-xxl)) !important;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: var(--sp-3);
    color: var(--white) !important;
}

h2 {
    font-size: clamp(1.8rem, 4vw, var(--fs-xl));
    font-weight: 700;
    margin-bottom: var(--sp-3);
}

.label-mono {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--cyan);
    letter-spacing: 0.35em;
    text-transform: uppercase;
    display: block;
    margin-bottom: var(--sp-2);
    opacity: 0.8;
}

/* ---- Navbar (Premium) ---- */
.nav-ethereal {
    position: fixed;
    top: var(--sp-3); left: 50%; transform: translateX(-50%);
    width: 90%; max-width: 1100px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    padding: var(--sp-2) var(--sp-4);
    display: flex; align-items: center; justify-content: space-between;
    z-index: 10000;
}

.nav-brand {
    display: flex; align-items: center; gap: var(--sp-3);
    text-decoration: none; color: var(--white);
}

.brand-symbol {
    position: relative;
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
}

.orbit-ring {
    position: absolute; inset: 0;
    border: 2px solid transparent;
    border-left-color: var(--cyan);
    border-top-color: var(--cyan);
    border-bottom-color: var(--purple);
    border-radius: 50%;
    animation: orbit-spin 15s linear infinite; /* Majestic slow rotation */
    filter: drop-shadow(0 0 8px rgba(0, 217, 255, 0.3));
}

.orbit-ring::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 2.5px;
    height: 7px;
    background: linear-gradient(to bottom, var(--cyan), var(--purple));
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}

.brand-symbol .m { font-weight: 800; font-size: 1.2rem; }
.brand-wordmark { font-weight: 800; letter-spacing: 4px; font-size: 1rem; }

@keyframes orbit-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.nav-links { display: flex; gap: var(--sp-4); }
.nav-link-minimal {
    font-family: var(--font-mono); font-size: 0.65rem;
    color: var(--white); opacity: 0.5;
    text-decoration: none; text-transform: uppercase;
    letter-spacing: 2px; transition: 0.3s;
}
.nav-link-minimal:hover { opacity: 1; color: var(--cyan); }

/* ---- Buttons ---- */
.btn-phi {
    padding: 0.9rem 1.8rem;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.75rem;
    text-decoration: none;
    transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary { background: var(--white); color: var(--black); }
.btn-primary:hover { transform: scale(1.05); box-shadow: 0 0 30px rgba(255,255,255,0.2); }
.btn-outline { border: 1px solid rgba(255,255,255,0.2); color: var(--white); }
.btn-outline:hover { border-color: var(--white); background: rgba(255,255,255,0.05); }

/* ---- Bento Grid ---- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--sp-4);
}

.card-phi {
    grid-column: span 4;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    padding: var(--sp-4);
    transition: 0.5s;
}

.card-phi:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 217, 255, 0.3);
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 217, 255, 0.1);
}

.card-phi.span-8 { grid-column: span 8; }
.card-phi.span-12 { grid-column: span 12; }
.card-phi.span-6 { grid-column: span 6; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { 
    background: rgba(255, 255, 255, 0.1); 
    border-radius: 10px; 
}
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* ---- Hero Assets ---- */
#blackholeCanvas {
    position: absolute;
    top: 10%; right: 5%;
    width: 140px; height: 140px;
    z-index: 1;
    pointer-events: none;
    opacity: 0.6;
}

#bh-trigger {
    position: absolute;
    z-index: 100;
    cursor: pointer;
}

#starfield {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
}

.classified-asset {
    position: absolute;
    top: 50%; left: 50%;
    width: 800px;
    z-index: 0;
    opacity: 0.05;
    pointer-events: none;
    mix-blend-mode: screen;
    filter: sepia(1) hue-rotate(180deg) brightness(1.2);
    transform: translate(-50%, -50%) rotate(-15deg);
}

#contact { position: relative; overflow: hidden; }

.hud-line {
    position: fixed;
    height: 1px;
    background: linear-gradient(90deg, var(--cyan), transparent);
    z-index: 99;
    pointer-events: none;
    opacity: 0;
    transform-origin: left center;
    transition: opacity 0.5s;
}

.hud-terminal {
    position: fixed;
    z-index: 100;
    pointer-events: none;
    transition: opacity 0.5s;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: var(--sp-2) var(--sp-3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 0.6rem;
    white-space: nowrap;
}

.hud-terminal .telemetry {
    display: block;
    font-size: 0.5rem;
    opacity: 0.5;
    margin-top: 4px;
}

#hero { position: relative; }

.classified-asset img { width: 100%; height: auto; }
.asset-label { display: none; }

/* ---- Background Effects ---- */
.nebula-layer {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.1;
}

.nebula-layer.orion { background: radial-gradient(circle at 85% 15%, rgba(0, 217, 255, 0.08), transparent 60%); }
.nebula-layer.eagle { background: radial-gradient(circle at 15% 85%, rgba(122, 77, 255, 0.08), transparent 60%); }
.nebula-layer.lagoon { background: radial-gradient(circle at 50% 50%, rgba(255, 204, 102, 0.05), transparent 70%); }

/* ---- Terminal ---- */
.terminal-minimal {
    position: fixed;
    bottom: var(--sp-4);
    right: var(--sp-4);
    width: 320px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    z-index: 10001;
    font-family: var(--font-mono);
    overflow: hidden;
    transition: 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.terminal-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.status-dot {
    width: 6px; height: 6px;
    background: #00ff00;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff00;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

.terminal-title {
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
}

.terminal-body {
    height: 140px;
    padding: 12px;
    font-size: 0.65rem;
    overflow-y: auto;
    color: rgba(255, 255, 255, 0.7);
    scroll-behavior: smooth;
}

.terminal-body::-webkit-scrollbar { width: 2px; }

.terminal-input-wrapper {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
}

.prompt { color: var(--cyan); font-weight: bold; }

#terminal-input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    width: 100%;
    font-family: var(--font-mono);
    font-size: 0.65rem;
}

.terminal-minimal:focus-within {
    border-color: var(--cyan);
    width: 380px;
}

.line { margin-bottom: 4px; line-height: 1.4; }
.line.cmd { color: var(--cyan); }
.line.res { color: var(--white); opacity: 0.9; }

/* ---- Responsive ---- */
@media (max-width: 991px) {
    .card-phi { grid-column: span 12 !important; }
    h1 { font-size: 2.5rem !important; }
    .nav-ethereal { width: 95%; }
}

/* MATRIX MODE */
.matrix-mode {
    filter: brightness(0.8) sepia(1) hue-rotate(80deg) saturate(3);
    background-color: #000 !important;
}
.matrix-mode * {
    text-shadow: 0 0 5px #00ff00;
}
.matrix-mode .terminal-window {
    border-color: #00ff00 !important;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5) !important;
}

/* ---- MALTHEN PREMIUM UI ADDITIONS ---- */
.nav-link-minimal {
    text-decoration: none;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 3px;
    opacity: 0.4;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 0.5rem 1rem;
}
.nav-link-minimal:hover { opacity: 1; transform: translateY(-2px); color: var(--cyan); }
.nav-link-minimal::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1px;
    background: var(--cyan);
    transition: all 0.3s;
    transform: translateX(-50%);
}
.nav-link-minimal:hover::after { width: 30%; }

.btn-scanline {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: btn_scan 3s infinite;
}
@keyframes btn_scan {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}
