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

:root {
    --color-bg: #0f172a;
    --color-bg-alt: #1e293b;
    --color-text: #e2e8f0;
    --color-text-muted: #94a3b8;
    --color-primary: #38bdf8;
    --color-primary-hover: #7dd3fc;
    --color-accent: #818cf8;
    --color-border: #334155;
    --color-card: #1e293b;
    --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', monospace;
    --max-width: 1100px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    font-size: 16px;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-primary-hover);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 16px 0;
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s, padding 0.3s;
}

.navbar.scrolled {
    padding: 10px 0;
    border-bottom-color: var(--color-border);
}

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

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -1px;
}

.nav-logo:hover {
    color: var(--color-primary-hover);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

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

.nav-github {
    display: flex;
    align-items: center;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 20%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 10%;
    right: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

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

.hero-greeting {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--color-primary);
    margin-bottom: 16px;
}

.hero-name {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 8px;
    color: #f8fafc;
}

.hero-title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--color-text-muted);
    margin-bottom: 24px;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    max-width: 540px;
    margin-bottom: 40px;
    line-height: 1.8;
}

.hero-cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

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

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

.btn-outline {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: transparent;
}

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

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

.section-alt {
    background-color: var(--color-bg-alt);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 48px;
    color: #f8fafc;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 2px;
}

.section-subtitle {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    max-width: 600px;
    margin-bottom: 40px;
    line-height: 1.7;
}

/* About */
.about-text p {
    color: var(--color-text-muted);
    margin-bottom: 16px;
    max-width: 640px;
}

.about-hook {
    font-size: 1.25rem;
    color: #f1f5f9 !important;
    line-height: 1.6;
    margin-bottom: 24px !important;
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.skill-category {
    --skill-color: var(--color-primary);
    --skill-rgb: 56, 189, 248;
    background: linear-gradient(145deg, var(--color-card) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 36px 32px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.skill-category:nth-child(2) {
    --skill-color: var(--color-accent);
    --skill-rgb: 129, 140, 248;
}

.skill-category:nth-child(3) {
    --skill-color: #2dd4bf;
    --skill-rgb: 45, 212, 191;
}

.skill-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--skill-color);
    opacity: 0;
    transition: opacity 0.3s;
}

.skill-category:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--skill-rgb), 0.3);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25), 0 0 20px rgba(var(--skill-rgb), 0.08);
}

.skill-category:hover::before {
    opacity: 1;
}

.skill-icon-wrap {
    width: 48px;
    height: 48px;
    background: rgba(var(--skill-rgb), 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--skill-color);
    transition: background 0.3s;
}

.skill-category:hover .skill-icon-wrap {
    background: rgba(var(--skill-rgb), 0.18);
}

.skill-category h3 {
    font-size: 0.85rem;
    color: #f1f5f9;
    margin-bottom: 24px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

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

.skill-list li {
    color: var(--color-text-muted);
    padding: 10px 0;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
    transition: color 0.2s, padding-left 0.2s;
}

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

.skill-list li:hover {
    color: var(--skill-color);
    padding-left: 4px;
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

.project-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 0;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr;
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    opacity: 0;
    transition: opacity 0.3s;
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: var(--color-primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(56, 189, 248, 0.1);
}

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

/* Featured project (first card) */
.project-card.featured {
    grid-template-columns: 1fr;
    border-color: rgba(56, 189, 248, 0.2);
    background: linear-gradient(135deg, var(--color-card) 0%, rgba(56, 189, 248, 0.03) 100%);
}

.project-card.featured::before {
    opacity: 1;
}

.project-card.featured .project-highlight {
    overflow: hidden;
    border-bottom: 1px solid var(--color-border);
    max-height: 300px;
}

.project-highlight-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top left;
}

.project-highlight-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-primary);
    background: rgba(56, 189, 248, 0.1);
    padding: 4px 14px;
    border-radius: 20px;
}

.project-highlight-icon {
    font-size: 3rem;
    line-height: 1;
}

.project-highlight-stat {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.project-highlight-stat strong {
    color: var(--color-primary);
    font-size: 1.4rem;
    display: block;
    margin-bottom: 2px;
}

.project-info {
    padding: 36px;
}

.project-card:not(.featured) .project-info {
    padding: 32px 36px;
}

.project-subtitle {
    font-size: 0.85rem;
    color: var(--color-primary);
    margin-bottom: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.project-info h3 {
    font-size: 1.3rem;
    color: #f8fafc;
    margin-bottom: 14px;
    line-height: 1.3;
}

.project-card.featured .project-info h3 {
    font-size: 1.5rem;
}

.project-info p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.8;
}

.project-story {
    margin-bottom: 12px;
}

.project-story:last-of-type {
    margin-bottom: 24px;
}

.project-story strong {
    color: var(--color-primary);
    font-weight: 600;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.project-tags span {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--color-primary);
    background: rgba(56, 189, 248, 0.08);
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid rgba(56, 189, 248, 0.15);
    transition: background 0.2s, border-color 0.2s;
}

.project-card:hover .project-tags span {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.25);
}

.project-links {
    display: flex;
    gap: 20px;
    padding-top: 4px;
}

.project-link {
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s, color 0.2s;
}

.project-link:hover {
    gap: 8px;
}

/* Secondary project cards — subtle top accent */
.projects-secondary .project-card::before {
    opacity: 0.5;
}

/* Side-by-side layout for non-featured cards */
.projects-secondary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

/* Testimonials */
.testimonials-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    max-width: 700px;
    margin: 0 auto;
}

.testimonial-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 40px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
    box-shadow: 0 8px 32px rgba(56, 189, 248, 0.08);
}

.testimonial-quote-icon {
    font-size: 1.5rem;
    color: var(--color-primary);
    opacity: 0.6;
    margin-bottom: 16px;
    display: block;
}

.testimonial-text {
    font-style: italic;
    color: var(--color-text-muted);
    font-size: 1.05rem;
    line-height: 1.75;
    margin-bottom: 24px;
}

.testimonial-author {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.testimonial-name {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 1rem;
}

.testimonial-role {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Experience / Timeline */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--color-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -32px;
    top: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--color-bg-alt);
    border: 2px solid var(--color-primary);
}

.timeline-content h3 {
    font-size: 1.15rem;
    color: #f8fafc;
    margin-bottom: 4px;
}

.timeline-company {
    color: var(--color-primary);
    font-weight: 500;
    margin-bottom: 4px;
}

.timeline-date {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.timeline-content > p:last-child {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* Education */
.education {
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--color-border);
}

.education-title {
    font-size: 1.3rem;
    margin-bottom: 16px;
    color: var(--color-text);
}

.education-item h4 {
    font-size: 1.05rem;
    color: var(--color-primary);
    margin-bottom: 4px;
}

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

/* Contact */
.contact-content {
    max-width: 600px;
}

.contact-text {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    margin-bottom: 32px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 32px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
}

.form-group input,
.form-group textarea {
    padding: 12px 16px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.contact-links {
    display: flex;
    gap: 24px;
}

.contact-links a {
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.95rem;
}

.contact-links a:hover {
    color: var(--color-primary);
}

/* Project Detail Pages */
.project-detail {
    padding-top: 140px;
}

.back-link {
    display: inline-block;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 32px;
    transition: color 0.2s, gap 0.2s;
}

.back-link:hover {
    color: var(--color-primary);
}

.project-detail-header {
    margin-bottom: 40px;
}

.project-detail-header h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 8px;
    line-height: 1.2;
}

.project-detail-header .project-subtitle {
    margin-bottom: 20px;
}

.project-detail-image {
    margin-bottom: 40px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.project-detail-image img {
    width: 100%;
    display: block;
}

.project-detail-body {
    max-width: 720px;
    margin-bottom: 40px;
}

.project-detail-body h2 {
    font-size: 1.3rem;
    color: var(--color-primary);
    margin-bottom: 12px;
    margin-top: 32px;
    font-weight: 600;
}

.project-detail-body h2:first-child {
    margin-top: 0;
}

.project-detail-body p {
    color: var(--color-text-muted);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 16px;
}

.project-detail-links {
    padding-top: 8px;
}

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

.footer p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Mobile */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(12px);
        padding: 24px;
        gap: 16px;
        border-bottom: 1px solid var(--color-border);
    }

    .nav-links.active {
        display: flex;
    }

    .hero {
        min-height: auto;
        padding: 140px 0 80px;
    }

    .section {
        padding: 70px 0;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .skill-category {
        border-right: none;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-card.featured {
        grid-template-columns: 1fr;
    }


    .project-card.featured .project-highlight {
        max-height: 200px;
    }

    .projects-secondary {
        grid-template-columns: 1fr;
    }

    .project-info {
        padding: 28px 24px;
    }

    .project-card:not(.featured) .project-info {
        padding: 28px 24px;
    }

    .hero-content {
        text-align: center;
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        text-align: center;
    }

    .section-title {
        display: block;
        text-align: center;
    }

    .section-title::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .section-subtitle {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }

    .about-text p {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }

    .contact-content {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }

    .contact-form {
        text-align: left;
    }

    .contact-links {
        justify-content: center;
    }
}

/* Fade-in animation */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Focus-visible states for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-primary);
    border-radius: 4px;
}

input:focus-visible,
textarea:focus-visible {
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .fade-in {
        opacity: 1;
        transform: none;
    }
}
