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

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-color: #ffffff;
    --bg-light: #f9fafb;
    --border-color: #e5e7eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

h1, h2, h3, .logo {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

section[id] {
    scroll-margin-top: 5rem;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
    border-bottom: 1px solid rgba(37, 99, 235, 0.12);
    overflow: hidden;
    z-index: 1000;
    padding: 1rem 0;
}

nav::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(59, 130, 246, 0.02));
    pointer-events: none;
}

nav .container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav .logo {
    position: relative;
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

nav .logo:hover {
    opacity: 0.95;
    transform: translateX(1px);
}

nav .logo::before {
    content: '';
    position: absolute;
    left: calc(100% + 16px);
    top: 50%;
    width: calc(var(--logo-bar-offset, 0px) + 24px);
    height: 4px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.65), rgba(37, 99, 235, 0.12));
    opacity: 0.95;
    pointer-events: none;
    transition: width 0.2s ease;
    will-change: width;
}

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

nav ul a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.25s ease, transform 0.25s ease;
    position: relative;
    padding-bottom: 0.35rem;
}

nav ul a:hover {
    transform: translateY(-1px);
}

nav ul a::after {
    content: '';
    position: absolute;
    bottom: -0.1rem;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

nav ul a:hover,
nav ul a.active {
    color: var(--primary-color);
}

nav ul a:hover::after,
nav ul a.active::after {
    width: 100%;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 2rem 2rem;
    position: relative;
    overflow: hidden;
}

.hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

.hero-blob-1 {
    width: 400px;
    height: 400px;
    background: #93c5fd;
    top: 10%;
    left: -5%;
    animation: blobDrift 12s ease-in-out infinite;
}

.hero-blob-2 {
    width: 350px;
    height: 350px;
    background: #c4b5fd;
    bottom: 15%;
    right: -5%;
    animation: blobDrift 14s ease-in-out infinite reverse;
}

.hero-blob-3 {
    width: 280px;
    height: 280px;
    background: #bfdbfe;
    top: 50%;
    left: 50%;
    animation: blobDriftCenter 10s ease-in-out infinite 2s;
}

@keyframes blobDrift {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -20px); }
}

@keyframes blobDriftCenter {
    0%, 100% { transform: translate(-50%, -50%); }
    50% { transform: translate(calc(-50% + 20px), calc(-50% - 25px)); }
}

.hero-content {
    position: relative;
    z-index: 1;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    min-height: 1.2em;
}

.hero-typewriter-text {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.typewriter-cursor {
    display: inline-block;
    color: var(--primary-color);
    -webkit-text-fill-color: var(--primary-color);
    font-weight: 300;
    margin-left: 2px;
    animation: cursorBlink 0.75s step-end infinite;
}

@keyframes cursorBlink {
    50% { opacity: 0; }
}

.hero-content p,
.hero-content .hero-actions {
    opacity: 0;
}

.hero-content.hero-ready p {
    animation: fadeUp 0.8s ease-out both;
}

.hero-content.hero-ready .hero-actions {
    animation: fadeUp 0.8s ease-out 0.15s both;
}

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    margin-left: 1rem;
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Section */
section {
    padding: 5rem 0;
}

section:nth-child(even) {
    background-color: var(--bg-light);
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-color);
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

/* About Section */
.about-layout {
    display: flex;
    align-items: center;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
}

.about-photo {
    flex-shrink: 0;
}

.about-carousel {
    position: relative;
    width: 280px;
}

.carousel-viewport {
    width: 280px;
    aspect-ratio: 1 / 1;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.15);
    border: 3px solid white;
    outline: 1px solid var(--border-color);
    background: var(--bg-light);
    transition: box-shadow 0.4s ease;
}

.about-carousel:hover .carousel-viewport {
    box-shadow: 0 24px 48px rgba(37, 99, 235, 0.2);
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    opacity: 1;
    transition: opacity 0.35s ease;
}

.carousel-image.fading {
    opacity: 0;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    color: var(--text-color);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    padding-bottom: 2px;
    backdrop-filter: blur(4px);
    transition: background 0.2s, color 0.2s, transform 0.2s;
}

.carousel-arrow:hover {
    background: rgba(255, 255, 255, 0.75);
    color: var(--primary-color);
    transform: translateY(-50%) scale(1.08);
}

.carousel-prev {
    left: 8px;
}

.carousel-next {
    right: 8px;
}

.about-text {
    text-align: left;
    font-size: 1.125rem;
    color: var(--text-light);
    line-height: 1.8;
}

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

.about-technologies {
    max-width: 1000px;
    margin: 3rem auto 0;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border-color);
}

.technologies-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
    align-items: start;
}

.technologies-group {
    min-width: 0;
}

.about-bottom-row {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.about-tech-column,
.about-upto-column {
    flex: 1;
    min-width: 0;
}

.about-side-title {
    font-size: 1.35rem;
    text-align: left;
    margin-bottom: 1.25rem;
    color: var(--text-color);
}

.technologies-stack {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.technologies-group h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    margin-bottom: 1rem;
    font-weight: 700;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.technologies-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-pill {
    padding: 0.4rem 0.9rem;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    font-size: 0.875rem;
    color: var(--text-color);
    font-weight: 500;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}

.tech-pill:hover {
    background-color: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.25);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.upto-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.upto-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem 1.125rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.upto-item:hover {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.2);
}

.upto-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.upto-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

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

.upto-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.35;
    transition: color 0.2s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.upto-meta {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 0.35rem;
}

.upto-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.upto-art {
    width: 48px;
    height: 48px;
    border-radius: 0.375rem;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-light);
}

.upto-info {
    min-width: 0;
    flex: 1;
}

.upto-loading,
.upto-empty {
    font-size: 0.82rem;
    color: var(--text-light);
    font-style: italic;
}

.upto-error {
    font-size: 0.78rem;
    color: var(--text-light);
    line-height: 1.4;
}

/* Projects Section */
.projects-carousel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

.projects-viewport {
    flex: 1;
    overflow: hidden;
}

.projects-track {
    display: flex;
    gap: var(--projects-gap, 2rem);
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.projects-track .project-card {
    flex: 0 0 var(--project-card-width, 300px);
    min-width: var(--project-card-width, 300px);
}

.projects-arrow {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    color: var(--text-color);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    padding-bottom: 2px;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
    transition: background 0.2s, color 0.2s, transform 0.2s, opacity 0.2s, visibility 0.2s;
}

.projects-arrow:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    transform: scale(1.08);
}

.projects-arrow:disabled {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.project-card {
    background: white;
    border-radius: 0.75rem;
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.project-card.reveal {
    transition: opacity 0.7s ease, transform 0.7s ease, box-shadow 0.3s, border-color 0.3s;
}

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

.project-card:hover::before {
    transform: scaleX(1);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.2);
}

.project-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.project-card p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-light);
    border-radius: 1rem;
    font-size: 0.875rem;
    color: var(--text-color);
    transition: background-color 0.2s, transform 0.2s, color 0.2s;
}

.project-card:hover .tag {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.tag:hover {
    transform: scale(1.05);
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

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

    .reveal {
        opacity: 1;
        transform: none;
    }

    .hero-blob {
        animation: none;
    }
}

/* Contact Section */
.contact-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.125rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s, transform 0.2s;
}

.contact-link svg {
    width: 20px;
    height: 20px;
    fill: var(--text-color);
    transition: fill 0.2s;
}

.contact-link:hover {
    transform: scale(1.05);
}

.contact-link:hover svg {
    fill: white;
}

.contact-link.email:hover {
    background-color: #ea4335;
    color: white;
}

.contact-link.github:hover {
    background-color: #333;
    color: white;
}

.contact-link.linkedin:hover {
    background-color: #0077b5;
    color: white;
}

/* Footer */
footer {
    background-color: var(--text-color);
    color: white;
    text-align: center;
    padding: 2rem;
}

/* Project Modal */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    padding: 2rem;
    overflow-y: auto;
}

.project-modal.active {
    opacity: 1;
    visibility: visible;
}

.project-modal-content {
    background: white;
    border-radius: 1rem;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 3rem;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.project-modal-content-wrapper {
    position: relative;
    z-index: 1;
}

.project-modal.active .project-modal-content {
    transform: scale(1);
}

.project-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
    z-index: 10;
}

.project-modal-close:hover {
    background-color: var(--bg-light);
    color: var(--text-color);
}

.project-modal-header {
    margin-bottom: 2rem;
    padding: 2rem;
    padding-right: 3rem;
    position: relative;
    z-index: 1;
    border-radius: 0.5rem;
    margin-left: -2rem;
    margin-right: -2rem;
    margin-top: -2rem;
}

.project-modal-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 0.5rem;
    opacity: 0.2;
    z-index: 0;
    transition: opacity 0.3s;
}

.project-modal-header h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.project-modal-header p {
    position: relative;
    z-index: 2;
}

.project-modal-body {
    color: var(--text-color);
    line-height: 1.8;
    position: relative;
    z-index: 1;
}

.project-modal-body p {
    margin-bottom: 1.5rem;
    color: var(--text-light);
    font-size: 1.125rem;
}

.project-modal-details {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.project-modal-details h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.project-modal-details ul {
    list-style: none;
    padding-left: 0;
}

.project-modal-details li {
    padding: 0.5rem 0;
    color: var(--text-light);
    padding-left: 1.5rem;
    position: relative;
}

.project-modal-details li:before {
    content: "•";
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
    nav ul {
        gap: 1rem;
        font-size: 0.9rem;
    }

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

    .hero-content p {
        font-size: 1.25rem;
    }

    .btn-outline {
        margin-left: 0;
        margin-top: 1rem;
        display: block;
    }

    .section-title {
        font-size: 2rem;
    }

    .about-layout {
        flex-direction: column;
        text-align: center;
    }

    .about-text {
        text-align: center;
    }

    .about-carousel,
    .carousel-viewport {
        width: 220px;
    }

    .about-bottom-row {
        flex-direction: column;
        gap: 2.5rem;
    }

    .about-technologies {
        margin-top: 2.5rem;
        padding-top: 2rem;
    }

    .hero-blob-1,
    .hero-blob-2 {
        width: 250px;
        height: 250px;
    }

    .project-modal {
        padding: 1rem;
    }

    .project-modal-content {
        padding: 2rem 1.5rem;
        max-height: 95vh;
    }

    .project-modal-header h2 {
        font-size: 1.75rem;
    }

    .project-modal-header {
        padding: 1.5rem;
        padding-right: 2rem;
        margin-left: -1.5rem;
        margin-right: -1.5rem;
        margin-top: -1.5rem;
    }

    .project-modal-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Floating Social Button */
.floating-social {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.social-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: transform 0.3s, background-color 0.3s;
}

.social-toggle:hover {
    background-color: var(--secondary-color);
    transform: scale(1.1);
}

.social-icons {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}

.floating-social:hover .social-icons {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.social-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, background-color 0.2s;
}

.social-icon svg {
    width: 24px;
    height: 24px;
    transition: fill 0.2s;
    fill: var(--text-color);
}

.social-icon:hover {
    transform: scale(1.15);
}

.social-icon:hover svg {
    fill: white;
}

.social-icon.email:hover {
    background-color: #ea4335;
}

.social-icon.github:hover {
    background-color: #333;
}

.social-icon.linkedin:hover {
    background-color: #0077b5;
}

.social-icon.twitter:hover {
    background-color: #1da1f2;
}

/* Responsive for floating social */
@media (max-width: 768px) {
    .floating-social {
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .social-toggle {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .social-icon {
        width: 45px;
        height: 45px;
    }

    .social-icon svg {
        width: 20px;
        height: 20px;
    }

    .social-icons {
        bottom: 60px;
    }
}
