/* 
   ARTILINGO_CORE_ENGINE_V2.4_MOBILE_FIRST
   PHILOSOPHY: MOBILE_PRIORITY // NATIVE_PERFORMANCE // VISUAL_CLARITY
*/

:root {
    /* --- Core Palette --- */
    --c-green: #009f68;
    --c-green-glow: rgba(0, 159, 104, 0.3);
    --c-orange: #ff6b35;
    --c-blue: #0b7ac4;
    --c-bg: #080808;
    --c-surface: #121212;
    --c-border: rgba(255, 255, 255, 0.05);
    --c-text-main: #ffffff;
    --c-text-ghost: rgba(255, 255, 255, 0.4);
    
    /* --- Layout & Motion --- */
    --f-mono: 'JetBrains Mono', monospace;
    --f-main: 'Space Grotesk', sans-serif;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-tactical: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    --blur-std: 10px;
}

/* --- BASE OPTIMIZATIONS --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    background-color: var(--c-bg);
}

body {
    font-family: var(--f-main);
    color: var(--c-text-main);
    line-height: 1.6;
    background: var(--c-bg);
    overflow-x: hidden;
    overflow-wrap: anywhere;
}

/* --- LAYERED ATMOSPHERE --- */
.power-grid, .scanline, .noise, .vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    will-change: transform, opacity;
}

.power-grid {
    background-image: 
        linear-gradient(var(--c-green-glow) 0.5px, transparent 0.5px),
        linear-gradient(90deg, var(--c-green-glow) 0.5px, transparent 0.5px);
    background-size: 60px 60px;
    z-index: -2;
    mask-image: radial-gradient(circle at center, black 40%, transparent 95%);
    opacity: 0.08;
}

.vignette {
    background: radial-gradient(circle at center, transparent 60%, rgba(0,0,0,0.4) 100%);
    z-index: -1;
}

.noise {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3%3Cfilter id='n'%3%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.015;
    z-index: 10;
}

.scanline {
    height: 100px;
    background: linear-gradient(to bottom, transparent, rgba(0, 159, 104, 0.01), transparent);
    z-index: 11;
    animation: scan 20s linear infinite;
}

@keyframes scan {
    from { transform: translateY(-100vh); }
    to { transform: translateY(100vh); }
}

/* --- SYSTEM LOADER --- */
.system-loader {
    position: fixed;
    inset: 0;
    background: var(--c-bg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out;
}

.loader-content { width: 280px; }
.loader-line {
    height: 1px;
    background: var(--c-green);
    width: 0;
    box-shadow: 0 0 10px var(--c-green);
    margin-bottom: 15px;
}

.loader-text, .loader-progress { font-family: var(--f-mono); letter-spacing: 1px; }
.loader-text { font-size: 0.65rem; color: var(--c-green); text-transform: uppercase; }
.loader-progress { font-size: 1.5rem; font-weight: 700; margin-top: 5px; }

/* --- HUD NAVIGATION (MOBILE DEFAULT) --- */
.hud-nav {
    position: fixed;
    top: 0; width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    background: rgba(8, 8, 8, 0.98);
    backdrop-filter: blur(var(--blur-std));
    border-bottom: 1px solid var(--c-border);
    z-index: 1000;
}

.brand-core img { height: 16px; filter: brightness(1.2); }
.core-version { font-family: var(--f-mono); font-size: 0.55rem; opacity: 0.3; }

.status-indicator {
    font-family: var(--f-mono);
    font-size: 0.6rem;
    padding: 6px 12px;
    border: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pulse-dot {
    width: 5px; height: 5px;
    background: var(--c-green);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--c-green);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Hide desktop nav elements by default */
.nav-metrics, .module-switcher, .nav-cta-priority {
    display: none;
}

.nav-right {
    display: flex;
    align-items: center;
}

.menu-trigger {
    cursor: pointer;
    z-index: 1100;
}

.menu-trigger .line {
    width: 22px; height: 1.5px;
    background: white;
    margin: 5px 0;
    transition: var(--transition-fast);
}

.menu-trigger.active .line:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.menu-trigger.active .line:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

/* --- MOBILE BOTTOM DOCK --- */
.mobile-dock {
    display: flex;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #111;
    border: 1px solid var(--c-border);
    border-radius: 40px;
    padding: 10px 25px;
    gap: 15px;
    z-index: 1600;
    box-shadow: 0 8px 32px rgba(0,0,0,0.8);
}

.mobile-dock .switch-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-text-ghost);
    text-decoration: none;
    font-size: 0.8rem;
    transition: var(--transition-fast);
    background: rgba(255,255,255,0.02);
}

.mobile-dock .switch-btn.active {
    border-color: var(--c-green);
    color: var(--c-green);
}

.product-masakac .mobile-dock .switch-btn.active[href*="masakac"] { border-color: var(--c-orange); color: var(--c-orange); }
.product-portfobase .mobile-dock .switch-btn.active[href*="portfobase"] { border-color: var(--c-blue); color: var(--c-blue); }

/* --- NAVIGATION OVERLAY --- */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: var(--c-bg);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: circle(0% at 95% 5%);
    transition: clip-path 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    pointer-events: none;
}

.nav-overlay.active { 
    clip-path: circle(150% at 95% 5%); 
    pointer-events: all;
}

.nav-overlay-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    text-align: center;
}

.overlay-link {
    font-family: var(--f-mono);
    font-size: clamp(1.5rem, 6vw, 4rem);
    font-weight: 700;
    color: white;
    text-decoration: none;
    transition: var(--transition-fast);
    opacity: 0.5;
}

.overlay-link:hover { opacity: 1; color: var(--c-green); transform: scale(1.05); }

/* --- VIEWPORT & SECTIONS --- */
.viewport {
    padding-top: 60px;
}

.core-section {
    min-height: auto;
    padding: 80px 5% 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.tech-tag {
    font-family: var(--f-mono);
    font-size: 0.65rem;
    color: var(--c-green);
    border-left: 2px solid var(--c-green);
    padding-left: 12px;
    margin-bottom: 15px;
}

.main-heading {
    font-size: clamp(2rem, 10vw, 3.5rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1.5px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.sub-heading {
    font-size: 1rem;
    font-weight: 300;
    color: var(--c-text-ghost);
    margin-bottom: 25px;
}

.accent-text { color: white; font-weight: 600; }

.terminal-intro {
    background: rgba(255,255,255,0.015);
    border: 1px solid var(--c-border);
    padding: 20px;
    max-width: 100%;
    margin: 0 auto 30px;
    text-align: left;
    font-size: 0.9rem;
}

.cli-input { font-family: var(--f-mono); color: var(--c-green); font-size: 0.8rem; }

/* --- HERO DATA SIDEBAR (MOBILE) --- */
.hero-sidebar {
    position: static;
    display: flex;
    flex-direction: row;
    margin-top: 30px;
    gap: 15px;
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
}

.data-cluster { 
    text-align: center; 
    border-bottom: 1px solid var(--c-green); 
    padding: 0 0 8px 0; 
    flex: 1; 
    min-width: 100px;
}
.cluster-label { font-family: var(--f-mono); font-size: 0.6rem; color: var(--c-text-ghost); }
.cluster-value { font-size: 1.2rem; font-weight: 700; line-height: 1; }

/* --- BUTTONS --- */
.cta-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    align-items: center;
}

.btn-glitch, .btn-outline, .btn-gateway {
    font-family: var(--f-mono);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 18px 36px;
    cursor: pointer;
    transition: var(--transition-fast);
    text-transform: uppercase;
    border: 1px solid transparent;
    width: 100%;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-glitch { background: var(--c-green); color: black; }
.btn-outline { background: transparent; border-color: var(--c-border); color: white; }
.btn-gateway { border-color: var(--c-border); color: white; text-decoration: none; gap: 12px; }

/* --- TACTICAL GRID (MOBILE) --- */
.ecosystem-section, .calc-section { padding: 60px 5%; }
.section-header { margin-bottom: 30px; }
.section-title { font-family: var(--f-mono); font-size: 1.1rem; letter-spacing: -0.5px; }

.tech-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.tech-card {
    background: var(--c-surface);
    padding: 30px 20px;
    border: 1px solid var(--c-border);
    position: relative;
    transition: var(--transition-tactical);
    will-change: transform, border-color;
    overflow-wrap: anywhere;
    min-width: 0;
}

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.card-header img { height: 20px; }
.module-status { font-family: var(--f-mono); text-align: right; }
.status-label { font-size: 0.55rem; color: var(--c-green); display: block; }
.status-id { font-size: 0.65rem; opacity: 0.3; }

.tech-card h3 { font-size: 1.4rem; margin-bottom: 12px; }
.tech-card p { font-size: 0.85rem; color: var(--c-text-ghost); margin-bottom: 20px; min-height: auto; }

.card-specs { display: flex; gap: 10px; margin-bottom: 30px; flex-wrap: wrap; }
.card-specs span {
    font-family: var(--f-mono);
    font-size: 0.55rem;
    padding: 4px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--c-border);
}

.card-link {
    font-family: var(--f-mono);
    color: var(--c-green);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 700;
}

/* --- ENGINE VISUALS (MOBILE) --- */
.engine-section { padding: 60px 5%; border-top: 1px solid var(--c-border); }
.engine-layout { display: flex; flex-direction: column; gap: 40px; }
.engine-text { width: 100%; }
.engine-visual { width: 100%; display: flex; justify-content: center; order: -1; }

.spec-list { margin-top: 30px; display: flex; flex-direction: column; gap: 12px; }
.spec-item {
    display: flex;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--c-border);
    font-family: var(--f-mono);
    font-size: 0.7rem;
}

.spec-value { color: var(--c-green); font-weight: 700; }

.code-cube {
    width: 150px; height: 150px;
    transform-style: preserve-3d;
    animation: rotate 20s linear infinite;
}

.cube-face {
    position: absolute;
    inset: 0;
    border: 1px solid var(--c-green);
    background: rgba(0, 159, 104, 0.05);
}

@keyframes rotate {
    from { transform: rotateX(0) rotateY(0); }
    to { transform: rotateX(360deg) rotateY(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.1); }
}

/* --- FOOTER (MOBILE) --- */
.tech-footer { 
    padding: 60px 5% 40px; 
    border-top: 1px solid var(--c-border); 
}

.footer-grid { 
    display: flex; 
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 40px;
}

.footer-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.footer-logos img {
    height: 22px;
    filter: brightness(1.2);
    opacity: 0.7;
    transition: var(--transition-fast);
}

.footer-logos img:hover {
    filter: brightness(1.8);
    opacity: 1;
}

.copyright {
    font-size: 0.65rem;
    opacity: 0.3;
    margin-top: 15px;
    font-family: var(--f-mono);
    text-transform: uppercase;
}

.footer-contact-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 25px;
}

.footer-contact-info a {
    color: white;
    text-decoration: none;
    font-family: var(--f-mono);
    font-size: 1.2rem;
    font-weight: 700;
    transition: var(--transition-fast);
}

.footer-contact-info a:hover {
    color: var(--c-green);
}

.footer-contact .contact-trigger {
    display: inline-block;
    padding: 15px 35px;
    border: 1px solid white;
    color: white;
    text-decoration: none;
    font-family: var(--f-mono);
    font-size: 0.8rem;
    font-weight: 700;
    transition: var(--transition-fast);
}

.footer-contact .contact-trigger:hover {
    background: white;
    color: black;
}

/* --- CONTACT OVERLAY --- */
.contact-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 8, 0.95);
    backdrop-filter: blur(20px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.contact-overlay.active { display: flex; }

.contact-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    width: 100%;
    max-width: 600px;
    padding: 40px 20px;
    position: relative;
}

.form-grid { display: flex; flex-direction: column; gap: 20px; }
.input-field { display: flex; flex-direction: column; gap: 10px; }

.input-field input, .input-field select, .input-field textarea {
    background: #1a1a1a;
    border: 1px solid var(--c-border);
    padding: 15px;
    color: white;
    font-family: var(--f-main);
    outline: none;
}

.input-field select option {
    background: #1a1a1a;
    color: white;
}

/* --- CALCULATOR (MOBILE) --- */
.calc-container {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    padding: 25px 20px;
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.calc-inputs {
    display: flex;
    flex-direction: column;
    gap: 25px;
    width: 100%;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group label {
    font-family: var(--f-mono);
    font-size: 0.75rem;
    color: var(--c-text-ghost);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-group label span {
    color: white;
    font-weight: 700;
    font-size: 1rem;
    background: rgba(255,255,255,0.05);
    padding: 2px 8px;
    border: 1px solid var(--c-border);
}

.calc-hint {
    font-size: 0.7rem;
    opacity: 0.4;
    font-style: italic;
    line-height: 1.4;
}

.calc-results {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.result-card {
    background: rgba(255,255,255,0.02);
    padding: 20px;
    border: 1px solid var(--c-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-card h4 {
    font-family: var(--f-mono);
    font-size: 0.65rem;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-value { 
    font-size: 2rem; 
    font-weight: 800; 
    line-height: 1;
}

/* --- FLOATING CONTACT --- */
.floating-contact {
    position: fixed;
    bottom: 85px;
    right: 15px;
    width: 52px;
    height: 52px;
    background: var(--c-green);
    color: black;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1500;
    animation: pulse-ring 3s infinite;
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 var(--c-green-glow); }
    70% { box-shadow: 0 0 0 20px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

/* --- REVEAL ANIMATION --- */
.reveal-prepare {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.revealed { opacity: 1 !important; transform: translateY(0) !important; }

/* --- ENHANCEMENTS FOR LARGER SCREENS (TABLETS & LAPTOPS) --- */
@media (min-width: 769px) {
    .hud-nav { height: 70px; padding: 0 4%; background: rgba(8, 8, 8, 0.7); }
    .viewport { padding-top: 0; }
    
    .core-section { min-height: 80vh; padding: 0 5%; flex-direction: row; text-align: left; }
    .main-heading { font-size: clamp(3rem, 8vw, 6rem); letter-spacing: -3px; }
    .sub-heading { font-size: 1.4rem; }
    
    .terminal-intro { margin: 0 0 50px 0; padding: 30px; }
    .cta-group { flex-direction: row; width: auto; }
    .btn-glitch, .btn-outline, .btn-gateway { width: auto; }

    .hero-sidebar { position: absolute; right: 5%; flex-direction: column; width: auto; margin-top: 0; gap: 40px; }
    .data-cluster { text-align: right; border-bottom: none; border-right: 2px solid var(--c-green); padding: 0 20px 0 0; }
    .cluster-value { font-size: 2.2rem; }

    .tech-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
    .tech-card { padding: 40px; }
    .tech-card p { min-height: 54px; }

    .engine-layout { flex-direction: row; gap: 60px; align-items: center; }
    .engine-visual { order: 0; flex: 1; }
    .engine-text { flex: 1; }
    .code-cube { width: 200px; height: 200px; }

    .footer-grid { flex-direction: row; justify-content: space-between; text-align: left; }
    .footer-logos { justify-content: flex-start; }
    .footer-contact-info a { font-size: 1.4rem; }

    .calc-container { flex-direction: row; padding: 50px; gap: 50px; }
    .calc-inputs, .calc-results { flex: 1; }
    .result-value { font-size: 3rem; }

    .mobile-dock { display: none; }
    .floating-contact { bottom: 30px; right: 40px; width: 60px; height: 60px; font-size: 1.5rem; }
}

/* --- FULL DESKTOP ENHANCEMENTS --- */
@media (min-width: 1025px) {
    .hud-nav { height: 80px; padding: 0 5%; }
    .core-section { min-height: calc(100vh - 80px); }
    
    .nav-metrics, .module-switcher, .nav-cta-priority { display: flex; }
    
    .module-switcher { gap: 10px; margin-right: 30px; padding-right: 30px; border-right: 1px solid var(--c-border); }
    .nav-metrics { gap: 24px; font-family: var(--f-mono); font-size: 0.65rem; margin-right: 30px; }
    .m-item span { color: var(--c-green); font-weight: 700; }

    .switch-btn {
        width: 35px; height: 35px;
        display: flex; align-items: center; justify-content: center;
        border: 1px solid var(--c-border);
        color: var(--c-text-ghost);
        transition: var(--transition-fast);
        background: rgba(255,255,255,0.02);
        text-decoration: none;
    }
    .switch-btn:hover { border-color: white; color: white; background: rgba(255,255,255,0.05); }
    .switch-btn.active { border-color: var(--c-green); color: var(--c-green); }

    .nav-cta-priority {
        background: var(--c-green); color: black;
        padding: 10px 20px; font-family: var(--f-mono); font-size: 0.7rem; font-weight: 800;
        text-decoration: none; margin-right: 20px;
        box-shadow: 0 0 15px var(--c-green-glow);
    }
    
    .main-heading { font-size: clamp(3rem, 10vw, 8rem); }

    .contact-card { padding: 50px; }
    .form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 25px; }
    .full-width { grid-column: span 2; }
}

/* --- PRODUCT SPECIFIC OVERRIDES --- */
.product-masakac .nav-cta-priority, .product-masakac .btn-glitch, .product-masakac .floating-contact { background: var(--c-orange); }
.product-masakac .switch-btn.active { border-color: var(--c-orange); color: var(--c-orange); }

.product-portfobase .nav-cta-priority, .product-portfobase .btn-glitch, .product-portfobase .floating-contact { background: var(--c-blue); }
.product-portfobase .switch-btn.active { border-color: var(--c-blue); color: var(--c-blue); }

/* Range Input Customization */
input[type="range"] { -webkit-appearance: none; width: 100%; height: 4px; background: rgba(255,255,255,0.1); outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; background: var(--c-green); cursor: pointer; border-radius: 0; border: 2px solid white; }
.product-masakac input[type="range"]::-webkit-slider-thumb { background: var(--c-orange); }
.product-portfobase input[type="range"]::-webkit-slider-thumb { background: var(--c-blue); }

/* Ultra-Small Adjustments */
@media (max-width: 400px) {
    .main-heading { font-size: 2.1rem; }
    .mobile-dock { width: 95%; padding: 6px 10px; gap: 6px; }
    .mobile-dock .switch-btn { width: 40px; height: 40px; }
}
