/* CSS Custom Properties for Theming */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #0f1018;
    --bg-tertiary: #1a1d35;
    --text-primary: #ffffff;
    --text-secondary: #e8eaed;
    --text-muted: #b8bcc4;
    --text-subtle: #c8ccd4;
    --accent: #305CDE;
    --accent-light: #5b8ef5;
    --accent-dark: #1e3d8a;
    --accent-glow: rgba(48, 92, 222, 0.4);
    --border-subtle: rgba(48, 92, 222, 0.1);
    --border-medium: rgba(48, 92, 222, 0.15);
    --border-strong: rgba(48, 92, 222, 0.3);
    --card-bg: rgba(15, 16, 24, 0.6);
    --card-bg-hover: rgba(48, 92, 222, 0.02);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --header-bg: rgba(10, 10, 15, 0.85);
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f8f9fc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eef1f8;
    --text-primary: #1a1d35;
    --text-secondary: #2d3142;
    --text-muted: #5a6178;
    --text-subtle: #6b7280;
    --accent: #305CDE;
    --accent-light: #4a73e8;
    --accent-dark: #1e3d8a;
    --accent-glow: rgba(48, 92, 222, 0.3);
    --border-subtle: rgba(48, 92, 222, 0.08);
    --border-medium: rgba(48, 92, 222, 0.12);
    --border-strong: rgba(48, 92, 222, 0.25);
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-bg-hover: rgba(48, 92, 222, 0.05);
    --shadow-color: rgba(48, 92, 222, 0.1);
    --header-bg: rgba(248, 249, 252, 0.9);
}

[data-theme="light"] .hero {
    background: linear-gradient(165deg, #f8f9fc 0%, #eef1f8 50%, #e4e8f4 100%);
}

[data-theme="light"] .section.light {
    background: linear-gradient(180deg, #f8f9fc 0%, #ffffff 100%);
}

[data-theme="light"] .section.dark {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fc 100%);
}

[data-theme="light"] footer {
    background: #f8f9fc;
}

[data-theme="light"] .hero-content h1 {
    background: linear-gradient(135deg, #1a1d35 0%, #305CDE 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] #cockpit-canvas {
    opacity: 0.3;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background: var(--bg-primary);
    color: var(--text-secondary);
    line-height: 1.7;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Navigation */
header {
    background: var(--header-bg);
    backdrop-filter: blur(20px) saturate(180%);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 4px 30px var(--shadow-color);
    transition: background 0.3s ease;
}

.nav {
    max-width: 1280px;
    margin: auto;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: var(--text-primary);
    font-weight: 700;
    text-decoration: none;
    font-size: 1.4rem;
    letter-spacing: -0.8px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo:hover::after {
    width: 100%;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-medium);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover {
    background: rgba(48, 92, 222, 0.1);
    border-color: var(--accent);
    transform: rotate(20deg);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.nav-links a::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a:hover::before {
    width: 100%;
}

#cockpit-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.7;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    padding-top: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(165deg, #0a0a0f 0%, #0f1423 50%, #1a1d35 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(48, 92, 222, 0.15) 0%, transparent 60%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1) translate(0, 0);
        opacity: 0.15;
    }

    50% {
        transform: scale(1.1) translate(5%, 5%);
        opacity: 0.08;
    }
}

.hero-content {
    max-width: 980px;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

.hero-tag {
    font-size: 0.85rem;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
    font-weight: 600;
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: rgba(48, 92, 222, 0.1);
    border: 1px solid rgba(48, 92, 222, 0.3);
    border-radius: 50px;
    backdrop-filter: blur(10px);
}

.hero-content h1 {
    font-size: 4.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -2px;
    background: linear-gradient(135deg, #ffffff 0%, #b8c5e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: -0.5px;
    min-height: 1.5em;
    /* Prevent layout shift */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.1em;
}

.typing-cursor {
    display: inline-block;
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.hero-content h2:after {
    display: none;
}

.hero-content p {
    font-size: 1.15rem;
    max-width: 800px;
    line-height: 1.9;
    margin: 2rem auto;
    color: var(--text-muted);
    font-weight: 400;
}

/* CTA Button */
.hero-cta {
    margin: 2.5rem 0;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border: none;
    border-radius: 50px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(48, 92, 222, 0.4);
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(48, 92, 222, 0.5);
}

.cta-button:hover::before {
    left: 100%;
}

.hero-links {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.hero-links a {
    color: var(--accent);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.75rem 1.5rem;
    background: rgba(48, 92, 222, 0.08);
    border: 1px solid rgba(48, 92, 222, 0.2);
    border-radius: 50px;
    backdrop-filter: blur(10px);
}

.hero-links a:hover {
    color: var(--text-primary);
    background: rgba(48, 92, 222, 0.2);
    border-color: rgba(48, 92, 222, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(48, 92, 222, 0.2);
}

.hero-links span {
    color: rgba(255, 255, 255, 0.2);
}

/* Sections */
.section {
    padding: 8rem 2rem;
    position: relative;
    transition: background 0.3s ease;
}

.section.light {
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.section.dark {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.container {
    max-width: 1200px;
    margin: auto;
}

h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.2;
}

h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), transparent);
    margin-top: 1.5rem;
    border-radius: 2px;
}

.section-intro {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    line-height: 1.8;
    font-weight: 400;
}

/* About Section */
.about-content p {
    color: var(--text-subtle);
    font-size: 1.1rem;
    line-height: 1.9;
    margin-bottom: 1.8rem;
}

.about-content p em {
    color: var(--accent);
    font-style: normal;
    font-weight: 600;
}

.skills-section {
    margin-top: 4rem;
}

.skills-section h3 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    margin-top: 4rem;
    font-weight: 700;
    letter-spacing: -0.8px;
}

.skills {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

/* Skill Category with Enhanced Animations */
.skill-category {
    background: linear-gradient(145deg, rgba(48, 92, 222, 0.03), var(--card-bg));
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid var(--border-medium);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.skill-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Subtle glow effect on hover */
.skill-category::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(48, 92, 222, 0.08), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

@keyframes gradient-shift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.skill-category:hover::before {
    transform: scaleX(1);
}

.skill-category:hover::after {
    opacity: 1;
}

.skill-category:hover {
    transform: translateY(-8px);
    border-color: var(--border-strong);
    box-shadow: 0 20px 60px rgba(48, 92, 222, 0.15);
}

.skill-category h3 {
    color: var(--accent);
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.skill-category h3::before {
    content: '';
    width: 5px;
    height: 32px;
    background: linear-gradient(180deg, var(--accent), var(--accent-dark));
    border-radius: 3px;
    box-shadow: 0 0 20px var(--accent-glow);
    transition: box-shadow 0.3s ease;
}

.skill-category:hover h3::before {
    box-shadow: 0 0 30px var(--accent-glow), 0 0 60px rgba(48, 92, 222, 0.2);
}

.skill-category h4 {
    color: var(--accent);
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.skill-category h4::before {
    content: '';
    width: 5px;
    height: 32px;
    background: linear-gradient(180deg, var(--accent), var(--accent-dark));
    border-radius: 3px;
    box-shadow: 0 0 20px var(--accent-glow);
}

.skill-category ul {
    list-style: none;
    color: var(--text-subtle);
    position: relative;
    z-index: 1;
}

.skill-category li {
    padding: 0.8rem 0;
    font-size: 1rem;
    line-height: 1.7;
    display: flex;
    align-items: flex-start;
    transition: all 0.3s ease;
}

.skill-category li:hover {
    color: var(--text-primary);
    transform: translateX(5px);
}

.skill-category li::before {
    content: "→";
    color: var(--accent);
    margin-right: 1rem;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.skill-category li:hover::before {
    transform: translateX(3px);
}

/* Services/Expertise */
.cards {
    display: grid;
    gap: 2.5rem;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    margin-top: 3rem;
}

.card {
    background: linear-gradient(145deg, var(--card-bg), var(--card-bg-hover));
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid var(--border-medium);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(48, 92, 222, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--border-strong);
    box-shadow: 0 20px 60px rgba(48, 92, 222, 0.2);
}

.card:hover::before {
    transform: scaleX(1);
}

.card:hover::after {
    opacity: 1;
}

.card i {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
    display: block;
    filter: drop-shadow(0 0 15px rgba(48, 92, 222, 0.3));
}

.card h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.card p {
    color: var(--text-muted);
    line-height: 1.8;
    font-size: 1rem;
}

/* Portfolio */
.projects {
    display: grid;
    gap: 2.5rem;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    margin-top: 3rem;
}

.project {
    background: linear-gradient(145deg, var(--card-bg), var(--card-bg-hover));
    border: 1px solid var(--border-medium);
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.project::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(48, 92, 222, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.project:hover::before {
    opacity: 1;
}

.project:hover {
    border-color: var(--border-strong);
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(48, 92, 222, 0.15);
}

/* Project Image Container */
.project-image {
    width: 100%;
    min-height: 150px;
    max-height: 220px;
    background: linear-gradient(135deg, rgba(48, 92, 222, 0.1), rgba(48, 92, 222, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.project-image::before {
    content: '\f03e';
    font-family: 'Font Awesome 6 Free';
    font-weight: 400;
    font-size: 3rem;
    color: rgba(48, 92, 222, 0.3);
    position: absolute;
}

.project-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: transform 0.4s ease;
    position: relative;
    z-index: 1;
}

.project-image img[src=""] {
    display: none;
}

.project:hover .project-image img {
    transform: scale(1.05);
}

.project-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* For projects without image container (like "And many more...") */
.project:not(:has(.project-image)) {
    padding: 2.5rem;
}

.project h4 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 1.4rem;
    font-weight: 700;
}

.project p {
    color: var(--text-subtle);
    line-height: 1.8;
    font-size: 1rem;
    flex: 1;
}

/* Project Footer: Role + Link stacked and centered */
.project-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1rem;
}

/* Project Role/Position - Discreet styling */
.project small {
    font-size: 0.85rem;
    font-weight: 400;
    font-style: italic;
    color: var(--text-muted);
    letter-spacing: 0.2px;
    line-height: 1;
    display: flex;
    align-items: center;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    background: rgba(48, 92, 222, 0.08);
    border: 1px solid rgba(48, 92, 222, 0.2);
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: fit-content;
}

.project-link:hover {
    color: var(--text-primary);
    background: rgba(48, 92, 222, 0.15);
    border-color: var(--accent);
    transform: translateX(5px);
}

.project-link i {
    font-size: 0.85rem;
}

.portfolio-note {
    margin-top: 3rem;
    font-size: 1rem;
    color: var(--text-subtle);
    text-align: center;
    font-style: italic;
}

.github-link {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}

.github-link a {
    color: var(--text-muted);
    font-size: 1.8rem;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.github-link a:hover {
    color: var(--accent);
    opacity: 1;
    transform: translateY(-2px);
}

/* Contact */
.contact-info {
    max-width: 700px;
    margin: 3rem auto;
    text-align: center;
    padding: 3rem;
    background: linear-gradient(145deg, rgba(48, 92, 222, 0.05), var(--card-bg));
    border-radius: 20px;
    border: 1px solid var(--border-medium);
}

.contact-info p {
    font-size: 1.15rem;
    color: var(--text-subtle);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.contact-info strong {
    color: var(--accent);
    font-weight: 600;
}

.contact-info a {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.contact-info a:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem;
    background: var(--bg-primary);
    color: var(--text-subtle);
    font-size: 0.95rem;
    border-top: 1px solid var(--border-subtle);
    transition: background 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .nav {
        padding: 1rem 1.5rem;
    }

    .hamburger {
        display: flex;
        order: 2;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg-primary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -10px 0 30px var(--shadow-color);
        z-index: 999;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        font-size: 1.2rem;
    }

    .theme-toggle {
        order: 1;
        margin-left: auto;
        margin-right: 1rem;
    }

    .hero-content h1 {
        font-size: 2.8rem;
    }

    .hero-content h2 {
        font-size: 1.3rem;
    }

    h2 {
        font-size: 2.2rem;
    }

    .section {
        padding: 5rem 1.5rem;
    }

    .skills {
        grid-template-columns: 1fr;
    }

    .cards,
    .projects {
        grid-template-columns: 1fr;
    }

    .cta-button {
        padding: 0.9rem 2rem;
        font-size: 1rem;
    }

    .project-image {
        height: 150px;
    }
}