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

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    background: #000;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
}

body {
    min-height: 100vh;
    background: transparent;
    position: relative;
}

/* The actual falling code */
#matrix-bg {
    position: fixed;
    top: 0; 
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2; /* Pushed further back */
    background: #000;
    pointer-events: none;
}

/* The "Portal" Mask */
#vignette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; /* Sits between the rain and the content */
    /* This creates the oval viewport. Adjust the 25% and 80% to widen/tighten the 'hole' */
    background: radial-gradient(ellipse at center, transparent 25%, rgba(0,0,0,0.95) 80%);
    pointer-events: none; /* Allows you to still click buttons beneath it */
}
#vignette-overlay::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    /* Subtle horizontal lines */
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 2;
}

/* --- HEADER & TYPOGRAPHY --- */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    text-align: center;
    background: rgba(0, 0, 30, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid #00ffff;
    box-shadow: 0 4px 20px rgba(0, 255, 255, 0.2);
}

h1, h2, h3 { 
    font-family: 'Orbitron', sans-serif; 
    text-align: center; 
}

h1 {
    font-size: clamp(2.8rem, 9vw, 5rem);
    background: linear-gradient(135deg, #00ffff, #ff00ff, #00ff00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(0, 255, 255, 0.6);
    padding: 1.5rem 0;
}

h2 {
    font-size: 1.9rem;
    color: #00ffff;
    text-shadow: 0 0 20px #00ffff;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.5rem;
    color: #ff00ff;
    text-shadow: 0 0 15px #ff00ff;
    margin: 1.8rem 0 1rem;
}

.sub-brand {
    text-align: center; 
    color: #00ff9d; 
    font-family: 'Courier New', monospace; 
    letter-spacing: 4px; 
    margin-top: -10px; 
    padding-bottom: 10px;
}

/* --- LAYOUT & SECTIONS --- */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: grid;
    gap: 2.5rem;
}

section {
    background: rgba(10, 0, 40, 0.65);
    border: 2px solid #00ffff;
    border-radius: 1.8rem;
    padding: 2.5rem;
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.3);
    backdrop-filter: blur(14px);
    position: relative;
    overflow: hidden;
}

/* Scanning Line Effect */
section::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 255, 255, 0.03) 2px, rgba(0, 255, 255, 0.03) 4px);
    animation: scan 20s linear infinite;
    pointer-events: none;
}

@keyframes scan { 
    0% { transform: translateY(-100%); } 
    100% { transform: translateY(100%); } 
}

.lore p { 
    margin: 1.2rem 0; 
    line-height: 1.9; 
    font-size: 1.1rem; 
}

.binary { 
    color: #00ff9d; 
    font-family: 'Courier New', monospace; 
    letter-spacing: 2px; 
}

/* --- PROJECT ARTIFACTS (SHARDS) --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.shard {
    padding: 1.5rem;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 1rem;
    background: rgba(0, 255, 255, 0.05);
    transition: 0.3s;
}

.shard:hover {
    border-color: #ff00ff;
    background: rgba(255, 0, 255, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.2);
}

/* --- SYSTEM HEARTBEAT TERMINAL --- */
#terminal {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #00ff9d;
    border-radius: 0.5rem;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #00ff9d;
    height: 220px;
    overflow-y: auto;
    margin: 1rem 0;
    box-shadow: inset 0 0 15px rgba(0, 255, 157, 0.2);
    scrollbar-width: none; /* Hide scrollbar for Firefox */
}

#terminal::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari */
}

/* --- BUTTONS & CONTROLS --- */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    justify-content: center;
    margin: 2rem 0;
}

button {
    padding: 1.1rem 2.2rem;
    border: none;
    border-radius: 1rem;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    background: linear-gradient(135deg, #00ffff, #ff00ff);
    color: #000;
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.8);
    transition: all 0.3s;
    font-family: 'Orbitron', sans-serif;
}

button:hover {
    transform: translateY(-6px);
    box-shadow: 0 0 60px rgba(0, 255, 255, 1);
}

.ca-box {
    background: rgba(0, 255, 255, 0.1);
    padding: 1.4rem;
    border-radius: 1rem;
    border: 2px dashed #00ffff;
    font-family: 'Courier New', monospace;
    text-align: center;
    cursor: pointer;
    word-break: break-all;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.ca-box:hover {
    background: rgba(0, 255, 255, 0.2);
}

/* --- ARCHITECT UPLINK (CHATBOT) --- */
#chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    background: rgba(0, 10, 20, 0.95);
    border: 2px solid #00ffff;
    border-radius: 1rem;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
    z-index: 1000;
    font-family: 'Courier New', monospace;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

#chat-container.minimized {
    transform: translateY(calc(100% - 40px));
}

#chat-header {
    padding: 10px 15px;
    background: #00ffff;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    border-radius: 0.8rem 0.8rem 0 0;
    display: flex;
    justify-content: space-between;
}

#chat-body {
    height: 300px;
    overflow-y: auto;
    padding: 15px;
    color: #00ff9d;
    font-size: 0.85rem;
    scrollbar-width: thin;
}

#chat-input-area {
    padding: 10px;
    border-top: 1px solid rgba(0, 255, 255, 0.3);
    display: flex;
}

#user-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: #fff;
    outline: none;
    font-family: 'Courier New', monospace;
}

.bot-msg { margin-bottom: 10px; color: #00ff9d; }
.user-msg { margin-bottom: 10px; color: #ff00ff; text-align: right; }

/* --- UTILITIES --- */
#toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #000, #00ffff);
    color: #000;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: bold;
    box-shadow: 0 0 50px #00ffff;
    opacity: 0;
    z-index: 1000;
    transition: all 0.4s;
}

#toast.show { 
    opacity: 1; 
    transform: translateX(-50%) translateY(-12px); 
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 640px) {
    main { padding: 1.5rem 1rem; }
    section { padding: 2rem 1.5rem; }
    #chat-container {
        width: 90%;
        right: 5%;
    }
}
