:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-cyan: #38bdf8;
    --accent-pink: #e879f9;
    --font-heading: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: all 0.3s ease;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-heading);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Grid Effect */
.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image:
        linear-gradient(rgba(56, 189, 248, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    pointer-events: none;
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
}

.logo {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -1px;
}

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

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

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

/* General Layout */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 5%;
}

section {
    padding: 80px 0;
    opacity: 0;
    /* JS Animation trigger */
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Typography Helpers */
h1,
h2,
h3 {
    line-height: 1.2;
}

a.highlight {
    color: var(--accent-cyan);
    text-decoration: none;
    font-weight: 600;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hero Section */
/* Hero Section */
#intro {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 60px;
    position: relative;
    overflow: hidden;
    /* Spice up: Dark gradient + Tech feel */
    background: radial-gradient(circle at center, rgba(56, 189, 248, 0.1) 0%, rgba(15, 23, 42, 0) 70%);
}

#intro::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.8)),
        repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(56, 189, 248, 0.03) 1px, rgba(56, 189, 248, 0.03) 2px);
    z-index: -1;
    pointer-events: none;
}

/* Subtle glow behind text */
#intro::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, transparent 70%);
    filter: blur(60px);
    z-index: -1;
    animation: pulseGlow 8s infinite alternate;
}

@keyframes pulseGlow {
    0% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(0.8);
    }

    100% {
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.hero-content {
    max-width: 800px;
}

.greeting {
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

h1.glitch {
    font-size: 4.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    position: relative;
    color: var(--text-primary);
}

.role {
    font-size: 2rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.bio {
    max-width: 600px;
    margin: 0 auto 2.5rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn.primary {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

.btn.primary:hover {
    background: rgba(56, 189, 248, 0.2);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.btn.secondary {
    background: var(--text-primary);
    color: var(--bg-dark);
}

/* About Section */
#about .card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.card.glass {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.card-content h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.quote {
    font-style: italic;
    color: var(--accent-pink);
    border-left: 3px solid var(--accent-pink);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

.card-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    filter: grayscale(20%);
    transition: var(--transition);
}

.card-image img:hover {
    filter: grayscale(0%);
    transform: scale(1.02);
}

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

article.card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
}

article.card:hover {
    transform: translateY(-5px);
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

.image-wrapper {
    width: 100%;
    height: 350px;
    /* Increased from 200px to uncrop images */
    overflow: hidden;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /* flexible center focus */
    transition: transform 0.5s ease;
}

article.card:hover .image-wrapper img {
    transform: scale(1.05);
    /* reduced scale to keep content visible */
}

article.card .content {
    padding: 1.5rem;
}

.date {
    display: block;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

article h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

article p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Contact Form */
.form-container.glass {
    max-width: 600px;
    margin: 0 auto;
    padding: 2.5rem;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

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

.input-group label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

input,
textarea {
    width: 100%;
    padding: 0.8rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-heading);
    transition: var(--transition);
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.contact-info {
    margin-top: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.dim {
    opacity: 0.5;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    h1.glitch {
        font-size: 3rem;
    }

    #about .card {
        grid-template-columns: 1fr;
    }

    .card-image {
        order: -1;
    }

    .nav-links {
        display: none;
        /* Keep it simple for now, can add hamburger later if asked */
    }
}

/* Timeline Styles */
#experience {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.timeline-container {
    position: relative;
    padding: 2rem 0;
}

/* Vertical Line */
.timeline-container::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent, var(--accent-cyan), var(--accent-pink), transparent);
    transform: translateX(-50%);
}

.timeline-item {
    display: flex;
    justify-content: center;
    padding-bottom: 3rem;
    position: relative;
}

.timeline-content {
    width: 45%;
    padding: 2rem;
    border-radius: 12px;
    position: relative;
    border: 1px solid rgba(56, 189, 248, 0.1);
    transition: var(--transition);
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.3);
}

/* Dots */
.timeline-dot {
    position: absolute;
    left: 50%;
    top: 2rem;
    width: 16px;
    height: 16px;
    background: var(--bg-dark);
    border: 2px solid var(--accent-cyan);
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 10px var(--accent-cyan);
    z-index: 2;
}

/* Alternating Layout */
.timeline-item:nth-child(odd) {
    justify-content: flex-start;
}

.timeline-item:nth-child(even) {
    justify-content: flex-end;
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-right: auto;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: auto;
}

/* Badges */
.tech-badge-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.tech-badge {
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-cyan);
    border-radius: 20px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    font-family: var(--font-mono);
}

/* Mobile Responsive Timeline */
@media (max-width: 768px) {
    .timeline-container::before {
        left: 20px;
    }

    .timeline-item {
        justify-content: flex-start;
        padding-left: 50px;
    }

    .timeline-item:nth-child(even),
    .timeline-item:nth-child(odd) {
        justify-content: flex-start;
    }

    .timeline-content {
        width: 100%;
    }

    .timeline-dot {
        left: 20px;
    }
}