/* --- CSS VARIABLES & RESET --- */
:root {
    --bg-dark: #050505;
    --bg-panel: #0a0a0a;
    --bg-card: #111111;

    --accent-red: #ff3333;
    --accent-purple: #bb00ff;
    --accent-glow: rgba(255, 51, 51, 0.4);

    --text-main: #e0e0e0;
    --text-muted: #888888;

    --font-head: 'Orbitron', sans-serif;
    --font-tech: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;

    --border-tech: 1px solid rgba(255, 51, 51, 0.2);
    --transition-speed: 0.3s;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    /* Sci-Fi Grid Background */
    background-image:
        linear-gradient(rgba(255, 51, 51, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 51, 51, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-red);
    border-radius: 4px;
}

/* --- TYPOGRAPHY --- */
h1,
h2,
h3,
h4 {
    font-family: var(--font-head);
    text-transform: uppercase;
    letter-spacing: 2px;
    color: white;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

/* Sci-Fi underline for headings */
h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent-red);
    margin-top: 5px;
    box-shadow: 0 0 10px var(--accent-red);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- UI COMPONENTS --- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    font-family: var(--font-tech);
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    background: transparent;
    cursor: pointer;
    transition: var(--transition-speed);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: var(--accent-red);
    z-index: -1;
    transition: var(--transition-speed);
}

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

.btn:hover::before {
    width: 100%;
}

.btn-secondary {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

.btn-secondary::before {
    background: var(--accent-purple);
}

.btn-secondary:hover {
    box-shadow: 0 0 20px rgba(187, 0, 255, 0.4);
}

/* --- NAVIGATION --- */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1rem 0;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-head);
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
    text-decoration: none;
}

.logo span {
    color: var(--accent-red);
}

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

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-family: var(--font-tech);
    font-weight: 600;
    font-size: 1.1rem;
    transition: color 0.3s;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-red);
}

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

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

.hamburger {
    display: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
}

/* --- SCROLL PROGRESS --- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--accent-red);
    width: 0%;
    z-index: 1001;
    box-shadow: 0 0 10px var(--accent-red);
}

/* --- HERO SECTION --- */
#hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding-top: 60px;
}

.hero-content {
    z-index: 2;
    opacity: 0;
    animation: fadeIn 1.5s ease forwards;
}

.glitch-text {
    font-size: 4rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-family: var(--font-tech);
    font-size: 1.5rem;
    color: var(--accent-red);
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.tagline {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

/* --- SECTIONS COMMON --- */
section {
    padding: 100px 0;
}

/* --- ABOUT --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: #ccc;
}

.about-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.stat-item h3 {
    font-size: 2.5rem;
    color: var(--accent-purple);
    margin-bottom: 0.5rem;
}

.stat-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.about-visual {
    position: relative;
    height: 300px;
    border: 1px solid var(--accent-red);
    background: linear-gradient(45deg, rgba(255, 51, 51, 0.1), transparent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.code-block {
    font-family: monospace;
    color: var(--accent-red);
    font-size: 0.9rem;
    text-align: left;
}

/* --- SKILLS --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: var(--bg-card);
    border: var(--border-tech);
    padding: 2rem;
    transition: transform 0.3s;
}

.skill-category:hover {
    transform: translateY(-5px);
    border-color: var(--accent-red);
    box-shadow: 0 0 15px rgba(255, 51, 51, 0.1);
}

.skill-category h3 {
    font-family: var(--font-tech);
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skill-tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #ddd;
    border: 1px solid transparent;
    transition: 0.3s;
}

.skill-category:hover .skill-tag {
    border-color: rgba(255, 51, 51, 0.3);
    color: white;
}

/* --- PROJECTS --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-card);
    border: var(--border-tech);
    overflow: hidden;
    position: relative;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    border-color: var(--accent-red);
    box-shadow: 0 0 20px rgba(255, 51, 51, 0.2);
    transform: translateY(-5px);
}

.project-img {
    height: 180px;
    background: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: 0.5s;
}

.project-card:hover .project-img img {
    opacity: 1;
    transform: scale(1.05);
}

.project-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-content h4 {
    font-family: var(--font-tech);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.project-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.tech-stack {
    font-size: 0.8rem;
    color: var(--accent-purple);
    margin-bottom: 1rem;
    font-weight: 600;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    text-decoration: none;
    color: white;
    font-size: 0.9rem;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
}

.project-link:hover {
    border-color: var(--accent-red);
}

/* --- EXPERIENCE & EDUCATION --- */
.timeline-block {
    background: var(--bg-card);
    border-left: 3px solid var(--accent-red);
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
}

.timeline-block::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 25px;
    width: 17px;
    height: 17px;
    background: var(--bg-dark);
    border: 2px solid var(--accent-red);
    border-radius: 50%;
}

.exp-role {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
}

.exp-org {
    color: var(--accent-red);
    font-family: var(--font-tech);
    font-size: 1.1rem;
}

.exp-date {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: block;
}

/* --- CERTIFICATIONS & ACHIEVEMENTS --- */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.cert-card {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.cert-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 51, 51, 0.1), transparent);
    z-index: -1;
    opacity: 0;
    transition: 0.3s;
}

.cert-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-red);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.cert-card:hover::before {
    opacity: 1;
}

.cert-icon {
    font-size: 3rem;
    color: var(--accent-red);
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(255, 51, 51, 0.3);
}

.cert-title {
    font-family: var(--font-tech);
    font-size: 1.2rem;
    color: white;
    margin-bottom: 0.5rem;
}

.cert-org {
    color: var(--accent-purple);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.cert-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* --- CONTACT --- */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-info-item i {
    font-size: 1.5rem;
    color: var(--accent-red);
    margin-top: 5px;
}

.contact-form {
    background: var(--bg-card);
    padding: 2rem;
    border: var(--border-tech);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid #333;
    padding: 12px;
    color: white;
    font-family: var(--font-body);
    transition: 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.2);
}

/* --- FOOTER --- */
footer {
    background: var(--bg-panel);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 2rem;
}

.social-icons {
    margin-bottom: 1rem;
}

.social-icons a {
    color: var(--text-muted);
    font-size: 1.5rem;
    margin: 0 10px;
    transition: 0.3s;
}

.social-icons a:hover {
    color: var(--accent-red);
    transform: translateY(-3px);
}

/* --- TOAST --- */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-card);
    border-left: 4px solid var(--accent-red);
    color: white;
    padding: 15px 25px;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    transform: translateY(100px);
    opacity: 0;
    transition: 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* --- BACK TO TOP BUTTON --- */
.back-to-top {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: var(--bg-card);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 1000;
    text-decoration: none;
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.2);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-5px);
}

/* --- ANIMATIONS & MEDIA QUERIES --- */
@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .nav-links {
        position: absolute;
        top: 60px;
        right: 0;
        width: 100%;
        background: var(--bg-panel);
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        transform: translateY(-150%);
        transition: 0.4s;
        border-bottom: 1px solid var(--accent-red);
    }

    .nav-links.nav-active {
        transform: translateY(0);
    }

    .hamburger {
        display: block;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .about-grid,
    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}