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

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a26;
    --text-primary: #ffffff;
    --text-secondary: #b4b4c8;
    --text-tertiary: #7a7a8c;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --accent-secondary: #8b5cf6;
    --accent-tertiary: #ec4899;
    --border: #2a2a3a;
    --shadow: rgba(0, 0, 0, 0.5);
    --gradient-1: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    --gradient-2: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav.scrolled {
    background: rgba(10, 10, 15, 0.95);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.nav-logo:hover {
    transform: scale(1.05);
}

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

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 48px;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-1);
    transition: width 0.3s ease;
}

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

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

/* Animated Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4) 0%, transparent 70%);
    top: 40%;
    right: -150px;
    animation-delay: -7s;
}

.orb-3 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.3) 0%, transparent 70%);
    bottom: -200px;
    left: 30%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(50px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-30px, 30px) scale(0.9);
    }
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 0 40px;
    position: relative;
}

.hero-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    animation: fadeInUp 1s ease-out;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.875rem;
    color: var(--accent);
    margin-bottom: 32px;
    animation: fadeIn 1s ease-out 0.2s both;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

.hero-greeting {
    display: block;
    font-size: 1.25rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 16px;
    animation: fadeIn 1s ease-out 0.2s both;
}

.hero-name {
    display: block;
    font-size: 5rem;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.03em;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
    animation: fadeInScale 1s ease-out 0.3s both;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 48px;
    animation: fadeIn 1s ease-out 0.4s both;
}

.hero-cta {
    display: flex;
    gap: 24px;
    justify-content: center;
    animation: fadeIn 1s ease-out 0.6s both;
}

.btn {
    padding: 16px 40px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

.btn-secondary:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
    max-width: 700px;
    margin: 0 auto;
    animation: fadeIn 1s ease-out 0.7s both;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}


/* Sections */
section {
    padding: 120px 0;
    position: relative;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 64px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.section-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    color: var(--accent);
}

/* About Section */
.about {
    background: var(--bg-secondary);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.about-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.about-intro {
    font-size: 1.3rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 32px;
}

.about-text p {
    margin-bottom: 24px;
}

.quote {
    font-style: italic;
    border-left: 3px solid var(--accent);
    padding-left: 20px;
    margin: 32px 0;
    color: var(--text-tertiary);
    font-size: 1.05rem;
    line-height: 1.6;
}

.code-window {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px var(--shadow);
}

.code-header {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 8px;
}

.code-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-tertiary);
}

.code-dot:nth-child(1) { background: #ff5f56; }
.code-dot:nth-child(2) { background: #ffbd2e; }
.code-dot:nth-child(3) { background: #27c93f; }

.code-content {
    padding: 32px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    line-height: 1.8;
    overflow-x: auto;
}

.code-comment { color: #6a9955; }
.code-keyword { color: #c586c0; }
.code-variable { color: #9cdcfe; }
.code-property { color: #4fc1ff; }
.code-string { color: #ce9178; }

/* Quote Section */
.quote-section {
    padding: 20px 0 40px;
    background: var(--bg-primary);
    position: relative;
}

.quote-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: 0 24px;
}

.zen-quote {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 8px;
    font-style: italic;
    transition: opacity 0.3s ease;
}

.zen-author {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    font-weight: 500;
    margin-bottom: 8px;
    transition: opacity 0.3s ease;
}

.quote-refresh-info {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    opacity: 0.6;
    margin: 0;
}

/* Projects Section */
.projects-section {
    background: var(--bg-primary);
}

.projects-grid {
    display: grid;
    gap: 40px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(30px);
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

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

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(99, 102, 241, 0.2);
}

.project-image {
    position: relative;
    height: 300px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-logo {
    max-width: 70%;
    max-height: 70%;
    object-fit: contain;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

/* Optimize image loading and prevent layout shift */
.project-image picture {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.project-card-header picture {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* Ensure images don't cause layout shift during load */
img[width][height] {
    height: auto;
}

.project-card:hover .project-logo {
    transform: scale(1.05);
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 15, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.project-link-overlay {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 16px 32px;
    border: 2px solid var(--accent);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.project-link-overlay:hover {
    background: var(--accent);
    transform: scale(1.05);
}

.project-content {
    padding: 48px;
}

.project-tags {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tag {
    padding: 6px 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--accent);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.project-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.project-details {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.project-detail-section h4 {
    font-size: 0.9rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    font-weight: 600;
}

.project-detail-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
}

.project-detail-section p:last-child {
    margin-bottom: 0;
}

/* Compact Project Cards */
.project-card.compact {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.project-card-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 48px 32px 40px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    position: relative;
    min-height: 200px;
}

.project-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.compact-logo {
    max-width: 180px;
    max-height: 140px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.project-card:hover .compact-logo {
    transform: scale(1.1);
}

.project-external {
    position: absolute;
    top: 16px;
    right: 16px;
    color: var(--text-tertiary);
    transition: all 0.2s ease;
    padding: 8px;
    border-radius: 8px;
}

.project-external:hover {
    color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    transform: translate(2px, -2px);
}

.project-card.compact .project-title {
    font-size: 1.5rem;
    margin-bottom: 16px;
    padding: 0 32px;
}

.project-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
    flex-grow: 1;
    padding: 0 32px;
}

.project-card.compact .project-tags {
    margin-top: auto;
    padding: 0 32px 32px;
}

/* Compact cards grid */
.projects-grid {
    grid-template-columns: 1fr;
}

.projects-grid .project-card.compact {
    grid-column: span 1;
}

@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tech Stack Section */
.stack-section {
    background: var(--bg-secondary);
}

.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
}

.stack-category {
    background: var(--bg-card);
    padding: 32px;
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.stack-category:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.stack-category h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    font-weight: 600;
}

.stack-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stack-list li {
    color: var(--text-secondary);
    padding-left: 20px;
    position: relative;
}

.stack-list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 1.2rem;
}

/* Contact Section */
.contact-section {
    background: var(--bg-primary);
    text-align: center;
}

.contact-content {
    max-width: 700px;
    margin: 0 auto;
}

.contact-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 48px;
    line-height: 1.8;
}

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

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.contact-btn:hover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    padding: 48px 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer p {
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.footer-subtitle {
    font-size: 0.9rem;
}

.footer-attribution {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-top: 12px;
}

.footer-attribution a {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-attribution a:hover {
    color: var(--accent);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Selection */
::selection {
    background-color: var(--accent-glow);
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-name {
        font-size: 4rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 48px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 24px;
    }

    .nav-container {
        padding: 0 24px;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: rgba(10, 10, 15, 0.98);
        backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 48px 24px;
        gap: 32px;
        transition: left 0.3s ease;
        align-items: flex-start;
    }

    .nav-menu.active {
        left: 0;
    }

    .hero {
        padding: 140px 0 30px;
    }

    .hero-name {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .hero-cta {
        flex-direction: column;
        gap: 16px;
    }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    section {
        padding: 80px 0;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 48px;
    }

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

    .project-content {
        padding: 32px 24px;
    }

    .project-title {
        font-size: 1.5rem;
    }

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

    .contact-links {
        flex-direction: column;
    }

    .quote-section {
        padding: 15px 0 30px;
    }

    .quote-container {
        padding: 0 16px;
    }

    .zen-quote {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .hero-name {
        font-size: 2.5rem;
    }

    .stat-number {
        font-size: 2.5rem;
    }

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