:root {
    --primary-color: #5aff5a;
    --secondary-color: #9aff9a;
    --bg-color: #000;
    --nav-bg: rgba(0, 20, 0, 0.85);
    --glow-color: rgba(0, 255, 0, 0.3);
    --text-color: #e0e0e0;
    --card-bg: rgba(0, 30, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    background: var(--bg-color);
    font-family: "Consolas", "Courier New", monospace;
    color: var(--text-color);
    overflow-x: hidden;
}

.cover-video {
    right: 0;
    top: 0;
    position: fixed;
    inset: 0;
    width: 100%;
    height: -webkit-fill-available;
    object-fit: cover;
    object-position: top left;
    pointer-events: none;
    filter: brightness(0.4) contrast(1.05) saturate(0.3);
    opacity: 0.7;
    mix-blend-mode: luminosity;
    will-change: transform, opacity;
    z-index: 2;
}


/* Terminal Animation Styles */
canvas {
    display: block;
    width: 100vw;
    height: 100vh;
    background: var(--bg-color);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
}

.center {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    z-index: 4;
    width: 90vw;
    max-width: 800px;
}

.welcome {
    font-weight: 500;
    font-size: 4.2vw;
    color: #5aff5a;
    text-shadow:
        0 0 6px rgba(0, 255, 0, 0.25),
        0 0 20px rgba(0, 255, 0, 0.15);
    letter-spacing: 0.04em;
    opacity: 0;
    transform: scale(0.96);
    animation:
        fadeInScale 3s ease forwards,
        slowGlow 6s ease-in-out infinite,
        floatY 5s ease-in-out infinite;
    font-family: "Consolas", "Courier New", monospace;
    display: inline;
    z-index: 10;
}

@keyframes floatY {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-18px) scale(1.03);
    }
}

.cursor {
    display: inline-block;
    width: 0.4em;
    height: 1em;
    background: #3cff3c;
    margin-left: 0.2em;
    vertical-align: bottom;
    opacity: 0.6;
    animation: blink 1.4s steps(1) infinite;
    box-shadow: 0 0 4px #3cff3c;
} 

@keyframes blink {
    0%, 49% {
        opacity: 0.6;
    }
    50%, 100% {
        opacity: 0;
    }
}

.sub {
    font-size: clamp(0.8rem, 3vw, 1.3rem);
    color: var(--secondary-color);
    opacity: 0;
    margin-top: 0.8rem;
    text-shadow: 0 0 4px rgba(0, 255, 0, 0.15);
    animation: fadeIn 4s ease forwards;
    animation-delay: 1.5s;
    font-family: "Consolas", "Courier New", monospace;
}

@keyframes fadeInScale {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    to {
        opacity: 0.6;
    }
}

@keyframes slowGlow {
    0%, 100% {
        text-shadow: 0 0 6px rgba(0, 255, 0, 0.3), 0 0 14px rgba(0, 255, 0, 0.2);
    }
    50% {
        text-shadow: 0 0 10px rgba(0, 255, 0, 0.4), 0 0 28px rgba(0, 255, 0, 0.25);
    }
}

/* Terminal border and scanlines */
.terminal-border {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    box-shadow: inset 0 0 50px rgba(0, 255, 0, 0.1);
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(0, 255, 0, 0.02) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 3;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 0 100%;
    }
}

/* Hint text */
.hint {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(154, 255, 154, 0.7);
    font-size: clamp(0.7rem, 2.5vw, 0.9rem);
    text-align: center;
    z-index: 10;
    animation: pulse 3s infinite;
    width: 90%;
    max-width: 500px;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Tooltip */
.tooltip {
    position: fixed;
    background: rgba(0, 30, 0, 0.95);
    color: var(--secondary-color);
    padding: 10px 15px;
    border-radius: 6px;
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    pointer-events: none;
    z-index: 100;
    border: 1px solid rgba(0, 255, 0, 0.3);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s;
    max-width: 200px;
    text-align: center;
}

/* Navigation Panel */
.nav-panel {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 10;
    background: var(--nav-bg);
    padding: 15px 20px;
    border-radius: 12px;
    border: 1px solid rgba(0, 255, 0, 0.3);
    box-shadow: 0 0 20px var(--glow-color);
    backdrop-filter: blur(10px);
    max-width: 90vw;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-item {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    padding: 10px 18px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
    flex: 1;
    min-width: 100px;
    max-width: 150px;
}

.nav-item:hover, .nav-item:focus {
    background: rgba(0, 255, 0, 0.2);
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    transform: translateY(-2px);
    outline: none;
}

.nav-item.active {
    background: rgba(0, 255, 0, 0.2);
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-item:hover::after, .nav-item:focus::after, .nav-item.active::after {
    transform: scaleX(1);
}

/* Mobile menu toggle */
.mobile-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--nav-bg);
    border-radius: 50%;
    border: 1px solid rgba(0, 255, 0, 0.3);
    z-index: 11;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    box-shadow: 0 0 15px var(--glow-color);
}

.mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--secondary-color);
    margin: 3px 0;
    transition: 0.3s;
}

.mobile-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 20px 100px;
    position: relative;
    z-index: 5;
}

/* Typography */
h1, h2, h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    text-shadow: 0 0 5px var(--glow-color);
}

h1 {
    font-size: 2.5rem;
    border-bottom: 1px solid rgba(0, 255, 0, 0.3);
    padding-bottom: 10px;
    margin-bottom: 30px;
}

h2 {
    font-size: 2rem;
    margin-top: 40px;
}

h3 {
    font-size: 1.5rem;
    margin-top: 30px;
    color: var(--secondary-color);
}

p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    transition: color 0.3s;
}

a:hover {
    color: #fff;
    text-shadow: 0 0 5px var(--glow-color);
}

/* Cards */
.card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 0, 0.2);
    transition: transform 0.3s;
    position: relative;
    z-index: 5;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 255, 0, 0.2);
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* Blog Styles */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.blog-card {
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    z-index: 5;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 255, 0, 0.2);
}

.blog-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
}

.blog-content {
    padding: 20px;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.blog-category {
    background: rgba(0, 255, 0, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.blog-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.blog-excerpt {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 15px;
}

.read-more {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.read-more:hover {
    background: var(--primary-color);
    color: #000;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    padding: 12px;
    background: rgba(0, 30, 0, 0.5);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 5px;
    color: var(--text-color);
    font-family: "Consolas", "Courier New", monospace;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
}

.btn {
    padding: 12px 24px;
    background: rgba(0, 255, 0, 0.2);
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    color: var(--primary-color);
    font-family: "Consolas", "Courier New", monospace;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--primary-color);
    color: #000;
}

.btn-primary {
    background: var(--primary-color);
    color: #000;
}

.btn-primary:hover {
    background: #7aff7a;
}

/* Profile Section */
.profile-section {
    text-align: center;
}

.profile-img {
    width: 100%;
    max-width: 300px;
    height: 300px;
    background: rgba(0, 50, 0, 0.5);
    border-radius: 10px;
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 20px var(--glow-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.contact-info {
    background: rgba(0, 30, 0, 0.3);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 0, 0.2);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.contact-item:last-child {
    margin-bottom: 0;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.skill-category {
    background: rgba(0, 30, 0, 0.3);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 0, 0.2);
    transition: transform 0.3s;
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 255, 0, 0.2);
}

.skill-category h3 {
    margin-top: 0;
    font-size: 1.3rem;
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
    padding-bottom: 10px;
}

.skill-category ul {
    list-style-type: none;
    padding: 0;
}

.skill-category li {
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
}

.skill-category li:before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* Education Timeline */
.education-timeline {
    margin-top: 30px;
}

.education-item {
    background: rgba(0, 30, 0, 0.3);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 0, 0.2);
    margin-bottom: 20px;
}

.education-item:last-child {
    margin-bottom: 0;
}

.education-period {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

/* Leadership */
.leadership-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.leadership-item {
    background: rgba(0, 30, 0, 0.3);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 0, 0.2);
}

/* Tech Stack Tags */
.tech-stack {
    margin-top: 15px;
}

.tech-tag {
    display: inline-block;
    background: rgba(0, 255, 0, 0.2);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-right: 8px;
    margin-bottom: 8px;
    border: 1px solid rgba(0, 255, 0, 0.3);
}

/* Projects Grid */
.projects-grid h2 {
    margin-top: 50px;
    margin-bottom: 20px;
}

.projects-grid h2:first-child {
    margin-top: 0;
}

/* Social Links */
.social-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.social-link {
    display: block;
    padding: 10px;
    text-align: center;
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--primary-color);
    color: #000;
}

/* Error Messages */
.error-message {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid #ff4444;
    color: #ff4444;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

/* Login Form */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    padding: 20px;
    position: relative;
    z-index: 5;
}

.login-form {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 10px;
    border: 1px solid rgba(0, 255, 0, 0.3);
    box-shadow: 0 0 20px var(--glow-color);
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 5;
}

.login-title {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
}

/* Mobile specific styles */
@media (max-width: 974px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .nav-panel {
        flex-direction: column;
        width: 80%;
        max-width: 300px;
        bottom: -100%;
        transition: bottom 0.4s ease;
    }

    .nav-panel.active {
        bottom: 80px;
    }

    .mobile-toggle {
        display: flex;
    }

    .nav-item {
        min-width: auto;
        max-width: none;
        padding: 12px;
    }
    
    .container {
        padding: 30px 15px 100px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .welcome {
        font-size: 2.5rem;
    }
    
    .sub {
        font-size: 1rem;
    }
    
    .hint {
        bottom: 70px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .nav-panel {
        width: 90%;
        padding: 12px 15px;
        gap: 10px;
    }
    
    .container {
        padding: 20px 10px 100px;
    }
    
    .hint {
        bottom: 65px;
    }
    
    .welcome {
        font-size: 2rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .nav-item:hover {
        background: transparent;
        transform: none;
        box-shadow: none;
    }

    .nav-item:active {
        background: rgba(0, 255, 0, 0.2);
        transform: scale(0.98);
    }
    
    .card:hover, .blog-card:hover {
        transform: none;
    }
    
    .skill-category:hover {
        transform: none;
    }
}

/* Ensure content is above canvas */
.container, .nav-panel, .mobile-toggle, .login-container {
    z-index: 10;
}

/* Background for non-home pages */
body:not(.home-page) {
    background: linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.9));
}


/* ===== Enhanced mobile responsiveness additions ===== */

/* Prefer reduced motion: minimize animations on user preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Larger tappable areas, scaled typography and lighter visuals for tablets */
@media (max-width: 1024px) {
    .center {
        width: 94vw;
        max-width: 720px;
        padding: 0 12px;
    }

    .welcome {
        font-size: clamp(2.4rem, 6vw, 3.8rem);
    }

    .nav-item {
        padding: 12px 20px;
        font-size: clamp(0.95rem, 2.6vw, 1.05rem);
    }

    .scanlines {
        background-size: 100% 6px;
        opacity: 0.85;
    }
}

.text-muted {
    color: #a7a7a7bf !important;
}
