:root {
    --bg-color: #f8f8f8;
    --text-color: #121212;
    --accent-color: #7928ca;
    --secondary-color: #ff0080;
    --tertiary-color: #0070f3;
    --grid-color: rgba(0, 0, 0, 0.03);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* RGB helpers for semi-transparent backgrounds */
    --bg-color-rgb: 248, 248, 248;
    --accent-color-rgb: 121, 40, 202;
    --secondary-color-rgb: 255, 0, 128;
    --tertiary-color-rgb: 0, 112, 243;
}

/* Dark mode variables */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212;
        --text-color: #f8f8f8;
        --grid-color: rgba(255, 255, 255, 0.03);
        --bg-color-rgb: 18, 18, 18;
    }
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Jetbrains Mono', monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: none; /* Hide default cursor for custom cursor */
}

/* Background grid for retro feel */
.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 2rem 2rem;
    z-index: -1;
}

/* Custom cursor */
.cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--accent-color);
    transform: translate(-50%, -50%);
    pointer-events: none;
    mix-blend-mode: difference;
    z-index: 9999;
    transition: transform 0.2s cubic-bezier(0.075, 0.82, 0.165, 1), 
                width 0.3s ease, 
                height 0.3s ease,
                background-color 0.3s ease;
}

.cursor-follower {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 1px solid var(--accent-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.5s cubic-bezier(0.075, 0.82, 0.165, 1), 
                width 0.3s ease, 
                height 0.3s ease,
                opacity 0.3s ease;
    opacity: 0.5;
}

/* Disable custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
    body { cursor: auto; }
    .cursor, .cursor-follower { display: none; }
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background-color: rgba(var(--bg-color-rgb), 0.8);
    backdrop-filter: blur(5px);
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.logo-text {
    background: linear-gradient(
        90deg,
        var(--accent-color),
        var(--secondary-color),
        var(--tertiary-color),
        var(--accent-color)
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientMove 8s linear infinite;
}

.logo .colored-letter {
    color: var(--accent-color);
    animation: pulsate 2s infinite alternate;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes pulsate {
    0% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--accent-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.nav-links a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Hero section */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 10%;
    position: relative;
}

.hero-content {
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.subtitle {
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s forwards 0.3s, subtitlePulse 3s ease-in-out infinite 1s;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: linear-gradient(
        90deg,
        var(--accent-color),
        var(--secondary-color),
        var(--accent-color)
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.title {
    font-size: clamp(3rem, 8vw, 5rem);
    line-height: 1.1;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s forwards 0.5s;
}

.gradient-text {
    background: linear-gradient(
        90deg,
        var(--accent-color),
        var(--secondary-color),
        var(--tertiary-color),
        var(--accent-color)
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientMove 8s linear infinite;
    position: relative;
    display: inline-block;
}

.highlight {
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 8px;
    background-color: var(--secondary-color);
    z-index: -1;
    opacity: 0.3;
}

.gradient-text.highlight::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 8px;
    background-color: var(--secondary-color);
    z-index: -1;
    opacity: 0.3;
}

.description {
    font-size: 1.2rem;
    max-width: 600px;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s forwards 0.7s;
    text-align: center;
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 3rem;
    opacity: 0;
    animation: fadeUp 0.8s forwards 1.1s;
    position: absolute;
    bottom: 50px;
    left: 45%;
    transform: translateX(-50%);
}

.scroll-text {
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.scroll-arrow {
    position: relative;
    width: 20px;
    height: 40px;
    border: 2px solid var(--accent-color);
    border-radius: 20px;
}

.scroll-arrow::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 6px;
    height: 6px;
    background-color: var(--accent-color);
    border-radius: 50%;
    transform: translateX(-50%);
    animation: scrollAnim 2s infinite;
}

@keyframes scrollAnim {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateX(-50%) translateY(15px);
    }
    60% {
        opacity: 0;
        transform: translateX(-50%) translateY(15px);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(0);
    }
}

/* Standard section styling */
.section {
    padding: 8rem 10% 4rem;
    min-height: auto; /* Changed from 100vh */
}

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

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

/* About section - updated to remove image */
.about-content {
    display: block;
    max-width: 800px;
    margin: 0 auto;
}

.about-text p {
    margin-bottom: 1.5rem;
}

/* Certifications section */
.certifications-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.certification-card {
    background-color: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.certification-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(
        180deg,
        var(--accent-color),
        var(--secondary-color)
    );
}

.certification-card:hover {
    transform: translateX(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.certification-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--text-color);
}

.certification-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color);
    opacity: 0.8;
}

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

/* Tighter spacing between About and Projects */
#about.section { padding-bottom: 2rem; }
#projects.section { padding-top: 2rem; }

.project-card {
    background-color: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.project-image {
    width: 100%;
    height: 200px;
    background-color: #ddd;
    background-size: cover;
    background-position: center;
}

.projects-container {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* keep close, but add a little breathing room */
    padding: 0 2rem;
    align-items: center; /* center tiles horizontally */
    justify-content: flex-start; /* avoid vertical centering */
}

.project-tile {
    margin: 0 !important; /* Ensure no margin */
    padding: 0 !important; /* Ensure no padding */
}
/* removed forced full-viewport centering to fix layout stacking */

.project-content {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 2.5rem;
    max-width: 800px;
    width: 100%;
    backdrop-filter: none; /* keep content crisp */
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.project-content:hover {
    transform: scale(1.02);
    backdrop-filter: none;
}

/* Animated gradient border on hover */
.project-content::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px; /* border thickness */
    background: linear-gradient(
        120deg,
        var(--accent-color),
        var(--secondary-color),
        var(--tertiary-color),
        var(--accent-color)
    );
    background-size: 300% 300%;
    /* show only the border area */
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.25s ease, background-position 0.3s ease;
    pointer-events: none;
    z-index: 0; /* keep border layer behind content */
}

.project-content:hover::before {
    opacity: 1;
    animation: borderGradientMove 4s linear infinite;
}

@keyframes borderGradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Ensure content appears above the decorative border layer */
.project-content > * { position: relative; z-index: 1; }

.project-header {
    margin-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
}

.project-primary {
    flex: 1 1 46%;
    min-width: 260px;
}

.project-summary {
    flex: 1 1 54%;
    font-size: 0.98rem;
    line-height: 1.6;
    opacity: 0.85;
}

.project-bullets {
    margin-top: 0.75rem;
    margin-left: 1rem;
    display: grid;
    gap: 0.4rem;
}
.project-bullets li {
    list-style: none;
    position: relative;
    padding-left: 1rem;
}
.project-bullets li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
}

.project-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.project-tags {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0;
}

.project-tag {
    background: rgba(var(--accent-color-rgb), 0.1);
    color: var(--accent-color);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
}

.project-description {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    opacity: 0.8;
}

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

.project-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

/* Skills section */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
}

.skill-category {
    margin-bottom: 2rem;
    padding-left: 7px;
    padding-right: 10px;
}

.skill-category-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-left: 15px;
    padding-right: 15px;
    color: var(--accent-color);
}

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

.skill-item {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.5rem;
}

.skill-item::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
}

/* Contact section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-text {
    margin-bottom: 2rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    background-color: transparent;
    color: var(--text-color);
    font-family: 'Space Mono', monospace;
}

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

.submit-button {
    padding: 1rem 2rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Space Mono', monospace;
    margin-top: 1rem;
}

.submit-button:hover {
    background-color: var(--secondary-color);
}

/* Footer */
footer {
    padding: 4rem 10%;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

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

.social-link {
    font-size: 1.5rem;
    color: var(--text-color);
    transition: var(--transition);
}

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

.footer-text {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Animations */
@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes subtitlePulse {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Media queries for responsiveness */
@media (max-width: 768px) {
    .about-content, .contact-content {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
    }

    .section {
        padding: 6rem 5% 3rem;
    }

    .hero {
        padding: 0 5%;
    }

    /* Stack project header on small screens */
    .project-header { flex-direction: column; }
    .project-primary, .project-summary { flex: 1 1 auto; min-width: 0; }
    .project-summary { margin-top: 0.75rem; }
}

/* Project card icon styles */
.project-icon {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(121, 40, 202, 0.1), rgba(255, 0, 128, 0.1));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 2.5rem;
    color: var(--accent-color);
}

.project-icon svg {
    width: 64px;
    height: 64px;
    stroke: var(--accent-color);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.project-card:hover .project-icon {
    color: var(--secondary-color);
}

.project-card:hover .project-icon svg {
    stroke: var(--secondary-color);
}