:root {
    --bg-dark: #0a0a0a;
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --accent-green: #00ff00;
    --accent-blue: #00ffff;
    --accent-purple: #ff00ff;
    --card-bg: rgba(25, 25, 35, 0.7);
    --border-color: rgba(100, 100, 100, 0.3);
}

html,
body {
    scroll-behavior: smooth; /* Smooth scrolling for anchor links */
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: "IBM Plex Mono", monospace;
    line-height: 1.6;
    overflow-x: hidden;
    /* Animated background */
    background-image:
        radial-gradient(
            circle at 10% 20%,
            rgba(40, 40, 60, 0.1) 0%,
            transparent 20%
        ),
        radial-gradient(
            circle at 90% 80%,
            rgba(60, 40, 80, 0.1) 0%,
            transparent 20%
        );
    animation: background-pulse 15s infinite alternate;
}

@keyframes background-pulse {
    0% {
        background-color: var(--bg-dark);
    }
    100% {
        background-color: #1a1a1a; /* Slightly lighter dark */
    }
}

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

/* Header & Navigation */
header {
    padding: 0; /* No padding initially */
    max-height: 0; /* Collapse height */
    border-bottom: 1px solid transparent; /* Transparent border initially */
    position: sticky;
    top: 0;
    background-color: transparent; /* Start with transparent background */
    z-index: 100;
    backdrop-filter: blur(0px); /* Start with no blur */
    opacity: 0; /* Hidden by default */
    pointer-events: none; /* Not interactive when hidden */
    overflow: hidden; /* Hide content during transition */
    transition: all 0.4s ease-in-out; /* Smooth transition for appearance */
}

/* Class to make header visible */
header.visible {
    padding: 15px 0; /* Apply padding when visible */
    max-height: 60px; /* Sufficient height for content + padding */
    border-bottom: 1px solid var(--border-color); /* Show border */
    background-color: rgba(10, 10, 10, 0.95); /* Show background */
    backdrop-filter: blur(5px); /* Apply blur */
    opacity: 1;
    pointer-events: auto;
}

nav {
    display: flex;
    align-items: center;
    justify-content: center; /* Center the nav links */
}

.nav-links {
    display: flex;
    gap: 35px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    position: relative;
    transition: color 0.3s;
}

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

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

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

/* Active navigation link style */
.nav-links a.active {
    color: var(--accent-green);
}

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

/* Hero Section */
.hero {
    padding: 100px 0 60px;
    text-align: center;
    position: relative;
    min-height: 80vh; /* Ensure enough height for content and scroll */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Hide overflow from particles */
    cursor: none; /* Hide default cursor within hero section */
}

.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: radial-gradient(
        circle at center,
        rgba(0, 255, 0, 0.05) 0%,
        transparent 70%
    );
    pointer-events: none;
    z-index: -1;
}

/* Hero elements animations */
.hero-element {
    opacity: 0;
    transform: translateY(20px);
    animation: fade-in-up 0.8s forwards ease-out;
    /* animation-delay will be set by JS */
}

@keyframes fade-in-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tagline {
    font-size: 1.2rem;
    color: var(--accent-green);
    margin-bottom: 10px;
    font-weight: 500;
}

.typewriter {
    /* Now h1 */
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
    color: var(--text-primary); /* Ensure color is set */
}

.typewriter::after {
    content: "|";
    position: absolute;
    right: -15px;
    animation: blink 1s infinite;
}

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

.subtitle {
    /* Now p */
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 20px; /* Adjusted margin */
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.value-prop {
    /* New element */
    font-size: 1.2rem;
    color: var(--accent-blue);
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.highlight {
    color: var(--accent-blue);
    font-weight: 500;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

.btn {
    padding: 12px 30px;
    border: 2px solid var(--accent-green);
    background: transparent;
    color: var(--accent-green);
    font-family: "IBM Plex Mono", monospace;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease; /* Smooth transition for all properties */
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-flex; /* Use flex for icon alignment */
    align-items: center;
    justify-content: center;
    gap: 8px; /* Space between text and icon */
}

.btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(0, 255, 0, 0.1);
    transition: left 0.4s;
}

.btn:hover::before {
    left: 0;
}

.btn-primary {
    background: rgba(0, 255, 0, 0.1);
}

/* Button hover effects (glow/underline) */
.btn:hover {
    box-shadow:
        0 0 15px rgba(0, 255, 0, 0.5),
        0 0 30px rgba(0, 255, 0, 0.2); /* Subtle glow */
    border-color: var(--accent-blue); /* Change border color */
    color: var(--text-primary); /* Change text color */
    transform: translateY(-3px); /* Slight lift */
}

/* Scroll Indicator */
.scroll-indicator {
    margin-top: 30px; /* Pushes it to the bottom of the flex container */
    color: var(--accent-blue);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    opacity: 0; /* Hidden by default */
    animation: fade-in-up 0.8s forwards ease-out;
    animation-delay: 1s; /* Appear after other hero elements */
}

.scroll-indicator i {
    animation: bounce 1.5s infinite;
}

@keyframes bounce {
    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Tooltip styles */
.tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s,
        visibility 0.3s;
    top: -40px; /* Position above the element */
    left: 50%;
    transform: translateX(-50%);
}

.tooltip.visible {
    opacity: 1;
    visibility: visible;
}

/* Canvas for particle background */
#hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2; /* Behind hero::before */
}

/* Cursor Trail Dot */
.cursor-trail-dot {
    position: absolute; /* Position relative to .hero */
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(0, 255, 255, 0.7); /* Cyan base */
    box-shadow:
        0 0 5px rgba(0, 255, 255, 0.8),
        0 0 10px rgba(0, 255, 255, 0.5); /* Glow */
    pointer-events: none; /* Allows clicking through the dots */
    transform: translate(-50%, -50%); /* Center the dot on the cursor */
    animation: fade-out-shrink 0.8s forwards ease-out;
    z-index: 9999; /* High z-index to be on top */
}

@keyframes fade-out-shrink {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
}

/* Sections */
section {
    padding: 100px 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 60px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent-green);
}

/* About */
.about-content {
    display: grid;
    gap: 50px;
    grid-template-columns: 1fr 1fr;
}

.about-text {
    flex: 1;
}

.about-text p {
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.terminal {
    flex: 1;
    background: rgba(10, 20, 30, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    background: rgba(30, 30, 40, 0.9);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.terminal-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.btn-red {
    background: #ff5f56;
}
.btn-yellow {
    background: #ffbd2e;
}
.btn-green {
    background: #27c93f;
}

.terminal-body {
    padding: 25px;
    font-family: "IBM Plex Mono", monospace;
    font-size: 1rem;
    line-height: 1.8;
}

.terminal-line {
    display: block;
    margin-bottom: 10px;
}

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

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 18px;
    background: var(--accent-blue);
    vertical-align: middle;
    margin-left: 2px;
    animation: blink 1s infinite;
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.skill-category {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    transition:
        transform 0.3s,
        box-shadow 0.3s;
    backdrop-filter: blur(10px);
}

.skill-category:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 255, 255, 0.1);
    border-color: rgba(0, 255, 255, 0.3);
}

.skill-category h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-category h3 i {
    font-size: 1.8rem;
}

.skill-list {
    list-style: none;
}

.skill-list li {
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
    display: flex;
    justify-content: space-between;
}

.skill-list li:last-child {
    border-bottom: none;
}

.skill-name {
    color: var(--text-primary);
}

.skill-level {
    color: var(--accent-green);
    font-weight: 500;
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 40px;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition:
        transform 0.3s,
        box-shadow 0.3s;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 255, 0, 0.1);
    border-color: rgba(0, 255, 0, 0.3);
}

.project-header {
    padding: 25px 25px 15px;
    border-bottom: 1px solid var(--border-color);
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--accent-purple);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.project-tag {
    background: rgba(100, 100, 255, 0.15);
    color: var(--accent-blue);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.project-body {
    padding: 25px;
    flex-grow: 1;
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.7;
}

.project-footer {
    padding: 0 25px 25px;
    display: flex;
    gap: 15px;
}

.project-link {
    color: var(--accent-green);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s;
}

.project-link:hover {
    opacity: 0.8;
}

/* Contact */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.contact-icon {
    font-size: 1.8rem;
    color: var(--accent-blue);
}

.contact-details h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: var(--accent-green);
}

.contact-details p,
.contact-details a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
}

.contact-details a:hover {
    color: var(--accent-green);
}

.contact-form .form-group {
    margin-bottom: 25px;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 14px;
    background: rgba(30, 30, 40, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: "IBM Plex Mono", monospace;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

/* Footer */
footer {
    padding: 50px 0 30px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 30px;
}

.social-link {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-blue);
    font-size: 1.3rem;
    text-decoration: none;
    transition: all 0.3s;
}

.social-link:hover {
    background: var(--accent-blue);
    color: var(--bg-dark);
    transform: translateY(-5px);
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 900px) {
    .about-content,
    .contact-container {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .typewriter {
        font-size: 2.8rem;
    }

    .subtitle {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        gap: 35px;
    }

    .hero {
        padding: 60px 0 30px; /* Adjusted padding for mobile */
        cursor: auto; /* Re-enable default cursor on mobile if desired, or keep none */
    }

    .tagline {
        font-size: 1rem;
    }

    .typewriter {
        font-size: 2.2rem;
        margin-bottom: 15px;
    }

    .subtitle {
        font-size: 1.1rem;
        margin-bottom: 15px; /* Adjusted margin for mobile */
    }

    .value-prop {
        font-size: 1rem;
        margin-bottom: 30px; /* Adjusted margin for mobile */
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px; /* Adjust gap for stacked buttons */
    }

    .btn {
        width: 80%; /* Make buttons wider on small screens */
        max-width: 300px;
    }

    .scroll-indicator {
        bottom: 15px;
    }

    section {
        padding: 70px 0;
    }
}
