:root {
    --primary-color: #00ff88;
    --secondary-color: #00ccff;
    --bg-dark: #0f0f0f;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #b0b0b0;
    --terminal-bg: #0c0c0c;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 50% 50%, #1a1a1a 0%, #000000 100%);
    color: var(--text-main);
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Navigation --- */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: all 0.3s ease;
    background: transparent;
}

#navbar.scrolled {
    background: rgba(15, 15, 15, 0.9);
    backdrop-filter: blur(10px);
    padding: 1rem 3rem;
    border-bottom: 1px solid var(--glass-border);
}

.nav-logo {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a:hover::after {
    width: 100%;
}

/* --- Background --- */
#background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.binary-digit {
    position: absolute;
    color: rgba(0, 255, 136, 0.15);
    font-family: 'JetBrains Mono', monospace;
    font-weight: bold;
    user-select: none;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.3);
    animation: float 15s infinite linear;
    z-index: -1;
}

@keyframes float {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.4; }
    90% { opacity: 0.4; }
    100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

/* Hero Section */
#hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    position: relative;
}

.hero-card {
    padding: 3rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
    text-align: center;
    max-width: 90%;
}

.glitch-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 5rem;
    font-weight: 800;
    margin: 0;
    position: relative;
    color: var(--text-main);
    letter-spacing: 4px;
}

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

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

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

@keyframes glitch-anim {
    0% { clip: rect(30px, 9999px, 10px, 0); }
    5% { clip: rect(80px, 9999px, 90px, 0); }
    10% { clip: rect(10px, 9999px, 40px, 0); }
    100% { clip: rect(50px, 9999px, 60px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(10px, 9999px, 80px, 0); }
    5% { clip: rect(90px, 9999px, 10px, 0); }
    10% { clip: rect(50px, 9999px, 20px, 0); }
    100% { clip: rect(20px, 9999px, 70px, 0); }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-top: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.scroll-indicator {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    gap: 5px;
}

.scroll-indicator span {
    width: 10px;
    height: 10px;
    border-bottom: 2px solid white;
    border-right: 2px solid white;
    transform: rotate(45deg);
    animation: scroll-arrow 2s infinite;
}

.scroll-indicator span:nth-child(2) { animation-delay: -0.2s; }
.scroll-indicator span:nth-child(3) { animation-delay: -0.4s; }

@keyframes scroll-arrow {
    0% { opacity: 0; transform: rotate(45deg) translate(-20px, -20px); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: rotate(45deg) translate(20px, 20px); }
}

/* --- Terminal Section --- */
#terminal-section {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

.terminal-window {
    width: 100%;
    max-width: 1200px;
    height: 80vh;
    background: rgba(12, 12, 12, 0.95);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Fullscreen Mode */
.terminal-window.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
    z-index: 9999;
    border: none;
}

.terminal-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.window-controls {
    display: flex;
    gap: 8px;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
}

.control.red { background: #ff5f56; }
.control.yellow { background: #ffbd2e; }
.control.green {
    background: #27c93f;
    transition: transform 0.2s;
}
.control.green:hover { transform: scale(1.2); }

.terminal-title {
    flex-grow: 1;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: #888;
}

.mobile-keyboard-hint {
    display: none;
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-left: 10px;
}

#terminal-container {
    flex-grow: 1;
    padding: 10px;
    /* Ensure touch scrolling works on mobile if needed, though xterm handles it */
}

/* Footer & Socials */
.footer {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-quote {
    font-size: 1.1rem;
    color: #ddd;
    margin-bottom: 2rem;
    font-style: italic;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.social-btn {
    text-decoration: none;
    color: var(--bg-dark);
    background: var(--primary-color);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 255, 136, 0.4);
}

.copyright {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .glitch-text { font-size: 3rem; }
    .hero-card { padding: 2rem; width: 90%; }
    .hero-card { transform: none !important; }

    #terminal-section { padding: 0.5rem; } /* Reduce padding to maximize space */
    .terminal-window {
        height: 85vh; /* Taller on mobile */
        border-radius: 8px;
    }

    #navbar { padding: 1rem; }
    .nav-links { display: none; }

    .social-links { gap: 1rem; }
    .social-btn { padding: 0.6rem 1rem; font-size: 0.9rem; }

    /* Mobile specific terminal tweaks */
    .terminal-title { font-size: 0.75rem; }
    .mobile-keyboard-hint { display: block; } /* Show hint on mobile */
}