:root {
    --bg-color: #050505;
    --text-primary: #e0e0e0;
    --text-secondary: #888;
    --accent-color: #00ff41; /* classic terminal green */
    --accent-glow: rgba(0, 255, 65, 0.4);
    --secondary-color: #ff003c; /* Cyberpunk red */
    --glass-bg: rgba(10, 15, 10, 0.6);
    --glass-border: rgba(0, 255, 65, 0.2);
    
    --font-main: 'Fira Code', monospace;
    --font-heading: 'Orbitron', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

::selection {
    background-color: var(--accent-color);
    color: var(--bg-color);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: #222;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Background Canvas */
#matrix-canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    opacity: 0.15;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    letter-spacing: 2px;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--accent-glow);
}

/* Navigation */
.glass-nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
}

.logo {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    position: relative;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
    align-items: center;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 10px 24px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    border: 1px solid var(--accent-color);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.btn-primary {
    background: transparent;
    color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2) inset, 0 0 10px rgba(0, 255, 65, 0.2);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-secondary {
    border-color: #444;
    color: #ccc;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: #fff;
    color: #fff;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    padding: 120px 50px 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.sys-msg {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.glitch {
    font-size: 5rem;
    font-weight: 900;
    text-transform: uppercase;
    position: relative;
    color: #fff;
    margin-bottom: 10px;
    line-height: 1;
}

.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--secondary-color);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--accent-color);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(21px, 9999px, 83px, 0); }
    5% { clip: rect(32px, 9999px, 4px, 0); }
    10% { clip: rect(72px, 9999px, 34px, 0); }
    15% { clip: rect(100px, 9999px, 12px, 0); }
    20% { clip: rect(54px, 9999px, 88px, 0); }
    25% { clip: rect(15px, 9999px, 76px, 0); }
    30% { clip: rect(81px, 9999px, 43px, 0); }
    35% { clip: rect(93px, 9999px, 11px, 0); }
    40% { clip: rect(39px, 9999px, 62px, 0); }
    45% { clip: rect(55px, 9999px, 90px, 0); }
    50% { clip: rect(11px, 9999px, 2px, 0); }
    55% { clip: rect(89px, 9999px, 31px, 0); }
    60% { clip: rect(41px, 9999px, 55px, 0); }
    65% { clip: rect(63px, 9999px, 78px, 0); }
    70% { clip: rect(22px, 9999px, 99px, 0); }
    75% { clip: rect(76px, 9999px, 18px, 0); }
    80% { clip: rect(34px, 9999px, 67px, 0); }
    85% { clip: rect(98px, 9999px, 8px, 0); }
    90% { clip: rect(12px, 9999px, 45px, 0); }
    95% { clip: rect(58px, 9999px, 21px, 0); }
    100% { clip: rect(88px, 9999px, 94px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(12px, 9999px, 89px, 0); }
    5% { clip: rect(84px, 9999px, 21px, 0); }
    10% { clip: rect(45px, 9999px, 76px, 0); }
    15% { clip: rect(2px, 9999px, 34px, 0); }
    20% { clip: rect(66px, 9999px, 11px, 0); }
    25% { clip: rect(98px, 9999px, 55px, 0); }
    30% { clip: rect(31px, 9999px, 82px, 0); }
    35% { clip: rect(54px, 9999px, 4px, 0); }
    40% { clip: rect(77px, 9999px, 93px, 0); }
    45% { clip: rect(18px, 9999px, 44px, 0); }
    50% { clip: rect(89px, 9999px, 62px, 0); }
    55% { clip: rect(22px, 9999px, 90px, 0); }
    60% { clip: rect(49px, 9999px, 15px, 0); }
    65% { clip: rect(11px, 9999px, 72px, 0); }
    70% { clip: rect(83px, 9999px, 39px, 0); }
    75% { clip: rect(35px, 9999px, 98px, 0); }
    80% { clip: rect(61px, 9999px, 5px, 0); }
    85% { clip: rect(94px, 9999px, 41px, 0); }
    90% { clip: rect(7px, 9999px, 68px, 0); }
    95% { clip: rect(52px, 9999px, 86px, 0); }
    100% { clip: rect(28px, 9999px, 19px, 0); }
}

.typing-text {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 20px;
    height: 30px;
}

.cursor {
    animation: blink 1s infinite;
}

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

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 500px;
}

.cta-group {
    display: flex;
    gap: 20px;
}

/* 3D Cube Animation */
.hero-graphic {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.cube-container {
    width: 200px;
    height: 200px;
    position: relative;
    transform-style: preserve-3d;
    animation: rotate 15s infinite linear;
}

.cube {
    width: 100%;
    height: 100%;
    position: absolute;
    transform-style: preserve-3d;
}

.face {
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(0, 255, 65, 0.05);
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.2) inset;
    display: flex;
    align-items: center;
    justify-content: center;
}

.face::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 65, 0.1) 2px,
        rgba(0, 255, 65, 0.1) 4px
    );
}

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

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

/* Services */
.services {
    padding: 100px 50px;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2rem;
    color: #fff;
    display: inline-block;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 40px 30px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color));
    transition: left 0.5s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 255, 65, 0.5);
}

.glass-card:hover::before {
    left: 100%;
}

.icon-container {
    color: var(--accent-color);
    font-size: 1.2rem;
    margin-bottom: 20px;
    font-weight: bold;
}

.glass-card h3 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

/* Terminal Section */
.terminal-section {
    padding: 50px;
    max-width: 1000px;
    margin: 0 auto 100px;
}

.terminal-window {
    background: #111;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 0 1px #333;
}

.terminal-header {
    background: #222;
    padding: 10px;
    display: flex;
    align-items: center;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.terminal-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.close { background: #ff5f56; }
.minimize { background: #ffbd2e; }
.maximize { background: #27c93f; }

.terminal-title {
    flex: 1;
    text-align: center;
    color: #888;
    font-size: 12px;
    margin-right: 44px; /* balance the buttons */
}

.terminal-body {
    padding: 20px;
    height: 300px;
    overflow-y: auto;
    font-family: var(--font-main);
    font-size: 14px;
}

.output {
    margin-bottom: 8px;
    color: #ccc;
}

.output.error { color: var(--secondary-color); }
.output.success { color: var(--accent-color); }

.input-line {
    display: flex;
    align-items: center;
}

.prompt {
    color: var(--accent-color);
    margin-right: 10px;
}

#terminal-input {
    background: transparent;
    border: none;
    color: #fff;
    font-family: var(--font-main);
    font-size: 14px;
    flex: 1;
    outline: none;
}

/* Footer */
footer {
    padding: 50px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
    padding: 40px;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 20px;
}

.copyright {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #555;
}

/* Responsive */
@media (max-width: 900px) {
    .glass-nav {
        padding: 15px 20px;
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding: 120px 20px 50px;
    }

    .glitch {
        font-size: 3rem;
    }

    .typing-text {
        font-size: 1.1rem;
        height: auto;
        min-height: 30px;
    }

    .subtitle {
        margin: 0 auto 30px;
        font-size: 0.95rem;
        padding: 0 10px;
    }
    
    .cta-group {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin-bottom: 50px;
        gap: 15px;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        max-width: 250px;
    }
    
    .nav-links {
        display: none; /* simple mobile nav */
    }

    .cube-container {
        width: 120px;
        height: 120px;
        margin: 0 auto;
    }

    .face {
        width: 120px;
        height: 120px;
    }

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

    .services {
        padding: 50px 20px;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .terminal-section {
        padding: 20px;
        margin-bottom: 50px;
    }

    .terminal-title {
        margin-right: 0;
    }

    footer {
        padding: 20px;
    }

    .footer-content {
        padding: 20px;
    }

    .footer-logo {
        font-size: 1.5rem;
    }
}

/* Gallery Page */
.gallery-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 50px;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}
.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    height: 300px;
    border: 1px solid var(--glass-border);
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.gallery-item:hover img {
    transform: scale(1.1);
}
.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: var(--accent-color);
    font-family: var(--font-main);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
.gallery-item:hover .gallery-overlay {
    transform: translateY(0);
}

@media (max-width: 900px) {
    .gallery-page {
        padding: 0 20px;
    }
}
