/* ==========================================
   FONTS
   ========================================== */
@font-face {
    font-family: 'InterVariable';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/assets/fonts/Inter-4.1/web/InterVariable.woff2') format('woff2');
}

@font-face {
    font-family: 'InterVariable';
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url('/assets/fonts/Inter-4.1/web/InterVariable-Italic.woff2') format('woff2');
}

/* ==========================================
   CSS VARIABLES
   ========================================== */
:root {
    /* Colors */
    --primary-50: #f5f9fc;
    /* Lightest */
    --primary-100: #e8f1f7;
    --primary-200: #d1e3ef;
    --primary-300: #b9d5e7;
    --primary-400: #a2c7df;
    --primary-500: #1f4f71;
    /* Base color - kept for text/accents */
    --primary-600: #1a4260;
    --primary-700: #163c56;
    --primary-800: #12354d;
    --background: #f7f7f9;
    --surface: rgba(255, 255, 255, 0.85);
    --white: #fff;
    --border-subtle: #f3f4f6;
    --on-surface: #111;
    --text-light: #666;
    --success-light: rgba(34, 197, 94, 0.1);
    --success: #059669;
    --success-border: rgba(34, 197, 94, 0.2);

    /* Skill Badge Colors */
    --skill-ai-bg: #e0f2fe;
    --skill-ai-text: #0369a1;
    --skill-ai-border: #bae6fd;
    --skill-ai-bg-hover: #bae6fd;
    --skill-ai-text-hover: #0284c7;
    --skill-ai-shadow-hover: rgba(2, 132, 199, 0.1);

    --skill-theory-bg: #f5f3ff;
    --skill-theory-text: #6d28d9;
    --skill-theory-border: #ddd6fe;
    --skill-theory-bg-hover: #ede9fe;
    --skill-theory-text-hover: #5b21b6;
    --skill-theory-shadow-hover: rgba(91, 33, 182, 0.1);

    --skill-hardware-bg: #eaf5e6;
    --skill-hardware-text: #45663b;
    --skill-hardware-border: #c9d9b3;
    --skill-hardware-bg-hover: #d9f0ce;
    --skill-hardware-shadow-hover: rgba(69, 102, 59, 0.1);

    --skill-ops-bg: #e6f5ea;
    --skill-ops-text: #3b6645;
    --skill-ops-border: #b3d9c1;
    --skill-ops-bg-hover: #d1f0d9;
    --skill-ops-shadow-hover: rgba(59, 102, 69, 0.1);

    --skill-programming-bg: #e6f5ee;
    --skill-programming-text: #3b6652;
    --skill-programming-border: #b3d9c8;
    --skill-programming-bg-hover: #d1f0dd;
    --skill-programming-shadow-hover: rgba(59, 102, 82, 0.1);

    --skill-framework-bg: #e6f5f2;
    --skill-framework-text: #3b665c;
    --skill-framework-border: #b3d9d0;
    --skill-framework-bg-hover: #d1f0e9;
    --skill-framework-shadow-hover: rgba(59, 102, 92, 0.1);

    --skill-database-bg: #e6f2f5;
    --skill-database-text: #3b5a66;
    --skill-database-border: #b3d1d9;
    --skill-database-bg-hover: #d1e9f0;
    --skill-database-shadow-hover: rgba(59, 90, 102, 0.1);

    --skill-platform-bg: #e6eff5;
    --skill-platform-text: #3b4e66;
    --skill-platform-border: #b3c7d9;
    --skill-platform-bg-hover: #d1e2f0;
    --skill-platform-shadow-hover: rgba(59, 78, 102, 0.1);

    --skill-lang-bg: #f6f8ff;
    --skill-lang-text: #5a67d8;
    --skill-lang-border: #d6dfff;
    --skill-lang-bg-hover: #edf2ff;
    --skill-lang-text-hover: #4c5ac7;
    --skill-lang-shadow-hover: rgba(90, 103, 216, 0.1);
    --skill-lang-dot-bg: #d6dfff;
    --skill-lang-dot-border: #c4ceff;
    --skill-lang-dot-filled-bg: #5a67d8;
    --skill-lang-dot-filled-border: #4c5ac7;
    --skill-lang-dot-filled-shadow: rgba(90, 103, 216, 0.3);

    /* Layout */
    --max-width: 1200px;
    --border-radius-sm: 8px;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-badge: 1.6rem;
    --card-shadow: 0 4px 24px rgba(31, 79, 113, 0.10), 0 2px 8px rgba(0, 0, 0, 0.06);

    /* Badge styling variables */
    --badge-font-size: var(--text-sm);
    --badge-font-weight: var(--font-weight-normal);
    --badge-line-height: var(--line-height-normal);
    --badge-padding: var(--spacing-xs) var(--spacing-sm);
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-3xl: 5rem;
    --container-padding: 1.2rem;
    --photo-size: 280px;
    --photo-size-mobile: 180px;
    --photo-aspect-ratio: 0.618;
    --section-padding: var(--spacing-3xl) 0;
    --section-padding-mobile: var(--spacing-xl) 0;
    --card-padding: 1.75rem;
    --card-padding-mobile: var(--spacing-md);
    --card-min-width: 400px;
    --navbar-height: 80px;
    --navbar-height-mobile: 100px;
    --gradient-overlay-height: 100px;

    /* Typography */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-title: var(--font-weight-semibold);
    --text-body: 1.0rem;
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 2rem;
    --text-3xl: 2.5rem;
    --line-height-tight: 1.3;
    --line-height-normal: 1.6;
    --line-height-loose: 1.7;

    /* Layout dimensions */
    --viewport-full: 100vh;
    --viewport-large: 70vh;
    --viewport-medium: 60vh;

    /* Animation */
    --transition: 0.35s cubic-bezier(.4, 0, .2, 1);
}

/* ==========================================
   BASE STYLES
   ========================================== */
html {
    box-sizing: border-box;
    font-size: var(--text-body);
    background: var(--background);
    color: var(--on-surface);
    font-family: 'InterVariable', 'Roboto Slab', 'Roboto', Arial, sans-serif;
    font-weight: var(--font-weight-normal);
    scroll-behavior: smooth;
    letter-spacing: 0.01em;
}

*,
*:before,
*:after {
    box-sizing: inherit;
}

body {
    margin: 0;
    background: var(--background);
    min-height: var(--viewport-full);
    display: flex;
    flex-direction: column;
}

/* Remove default list indentation but keep space for markers */
ul {
    padding-left: 1.2em;
    margin-left: 0;
}

/* Reset padding for lists that don't need markers */
.nav-links,
.subtitle-list {
    padding-left: 0;
}

/* ==========================================
   LAYOUT COMPONENTS
   ========================================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding-inline: 1.2rem;
}

main {
    flex: 1;
}

/* ==========================================
   NAVIGATION
   ========================================== */
.navbar {
    width: 100%;
    background: var(--surface);
    box-shadow: var(--card-shadow);
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 10;
    font-weight: 500;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0;
    position: relative;
    width: 100%;
}

.nav-brand {
    position: absolute;
    left: var(--container-padding);
}

.nav-brand a {
    color: var(--on-surface);
    text-decoration: none;
}

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

.nav-links {
    list-style: none;
    display: flex;
    gap: var(--spacing-md);
    margin: 0;
    padding: 0;
    justify-content: center;
    width: 100%;
}

.nav-links a {
    color: var(--on-surface);
    text-decoration: none;
    position: relative;
    transition: color var(--transition);
    font-weight: var(--font-weight-normal);
}

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

.nav-actions {
    position: absolute;
    right: var(--container-padding);
    display: flex;
    gap: 0.8rem;
}

.nav-actions .button {
    padding: 0.4rem 0.2rem;
    font-size: var(--text-sm);
    color: var(--on-surface);
    border-color: var(--on-surface);
    animation: none;
    width: 3.0rem;
    text-align: center;
}

.nav-actions .button:hover {
    background: var(--on-surface);
    color: var(--surface);
    transform: none;
}

#print-contact-container {
    display: none;
}

/* ==========================================
   SECTIONS
   ========================================== */
.page-section {
    padding: var(--section-padding);
    min-height: var(--viewport-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    opacity: 1;
    transition: all 0.5s ease-in-out;
}

/* Add subtle gradient overlays for smooth transitions */
.page-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--gradient-overlay-height);
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.page-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--gradient-overlay-height);
    background: linear-gradient(to top,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

/* Show gradient overlays on hover */
.page-section:hover::before,
.page-section:hover::after {
    opacity: 1;
}

/* Smooth background color transitions */
#home.page-section {
    background: var(--primary-50);
    transition: background-color 0.5s ease-in-out;
}

#about.page-section {
    background: var(--primary-100);
    transition: background-color 0.5s ease-in-out;
}

#projects.page-section {
    background: var(--primary-200);
    transition: background-color 0.5s ease-in-out;
}

#research.page-section {
    background: var(--primary-300);
    transition: background-color 0.5s ease-in-out;
}

#contact.page-section {
    background: var(--primary-400);
    transition: background-color 0.5s ease-in-out;
}

/* Add subtle shadow transition on scroll */
.page-section {
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    transition: box-shadow 0.5s ease-in-out;
}

.page-section.is-visible {
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.05);
}

/* Add a subtle scale effect on hover */
.page-section .container {
    transform: scale(1);
    transition: transform 0.3s ease-in-out;
}

.page-section:hover .container {
    transform: scale(1.01);
}

/* Ensure transitions are disabled for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {

    .page-section,
    .page-section::before,
    .page-section::after,
    .page-section .container {
        transition: none;
    }

    .page-section:hover .container {
        transform: none;
    }
}

.page-section:nth-of-type(odd),
.page-section:nth-of-type(even) {
    background: none;
}

.page-section .container {
    width: 100%;
    max-width: var(--max-width);
    text-align: center;
}

.page-section h2,
.section-title {
    color: var(--primary-700);
    font-size: var(--text-3xl);
    font-weight: var(--font-weight-title);
    margin: 0 0 var(--spacing-lg) 0;
    letter-spacing: -0.5px;
    animation: fadeInUp 0.8s;
}

.section-subtitle {
    font-size: var(--text-body);
    line-height: var(--line-height-normal);
    color: var(--primary-600);
    margin: 0 auto 2rem auto;
    max-width: 700px;
    animation: fadeInUp 0.8s 0.2s both;
    text-align: center;
    font-weight: var(--font-weight-normal);
}

/* Consolidated .project-description with base styles */
.project-summary,
.project-description,
.project-tasks {
    color: var(--text-light);
    font-size: var(--text-sm);
    line-height: var(--line-height-normal);
    margin-bottom: 1.25rem;
    hyphens: auto;
    text-align: justify;
    word-break: break-word;
    overflow-wrap: break-word;
    font-weight: var(--font-weight-normal);
}

.project-summary {
    color: var(--primary-700);
}

.project-link {
    margin: 0 0 var(--spacing-sm) 0;
    position: relative;
}

.link-preview {
    display: flex;
    width: 100%;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.link-preview:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-300);
    transform: translateY(-1px);
}

.preview-image {
    width: 120px;
    height: 80px;
    background: var(--gray-100);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.preview-content {
    padding: var(--spacing-sm);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.preview-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.3;
    margin-bottom: var(--spacing-xs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.preview-description {
    font-size: var(--text-xs);
    color: var(--text-light);
    line-height: 1.4;
    margin-bottom: var(--spacing-xs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.preview-domain {
    font-size: var(--text-xs);
    color: var(--primary-600);
    font-weight: 500;
    margin-top: auto;
}

/* Special styling for section descriptions */
.section-subtitle.project-description {
    color: var(--primary-600);
    font-size: var(--text-body);
    line-height: var(--line-height-loose);
    margin: 0 auto var(--spacing-md) auto;
    max-width: 600px;
    animation: fadeInUp 0.8s 0.2s both;
    text-align: center;
}

/* Smooth scrolling offset for fixed navbar */
#home,
#about,
#research,
#projects,
#contact {
    scroll-margin-top: var(--navbar-height);
}

/* ==========================================
   LANDING SECTION
   ========================================== */
.landing-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--viewport-large);
}

.landing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.profile-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: fit-content;
}

.profile-text h1 {
    font-size: clamp(var(--text-2xl), 5vw, var(--text-3xl));
    font-weight: 600;
    margin: 0 0 var(--spacing-xs) 0;
    color: var(--primary-500);
    line-height: var(--line-height-tight);
}

.badges-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
    margin: var(--spacing-sm) 0;
    animation: fadeInUp 0.8s 0.3s both;
}

.freelancer-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(31, 79, 113, 0.1);
    color: var(--primary-500);
    padding: var(--badge-padding);
    border-radius: var(--border-radius-badge);
    font-size: var(--badge-font-size);
    font-weight: var(--badge-font-weight);
    line-height: var(--badge-line-height);
    border: 1px solid rgba(31, 79, 113, 0.2);
}

.status-badge-available {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: var(--success-light);
    color: var(--success);
    padding: var(--badge-padding);
    border-radius: var(--border-radius-badge);
    font-size: var(--badge-font-size);
    font-weight: var(--badge-font-weight);
    line-height: var(--badge-line-height);
    border: 1px solid var(--success-border);
}

.status-dot-available {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.3;
        transform: scale(1.35);
    }
}

.subtitle-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: block;
    font-weight: var(--font-weight-normal);
    font-size: var(--text-lg);
}

.subtitle-list li {
    display: block;
    margin: var(--spacing-xs) 0;
    font-weight: var(--font-weight-normal);
}

.landing-buttons {
    display: flex;
    gap: 1.2rem;
    margin-top: 1.0rem;
}

.button {
    display: inline-block;
    padding: var(--spacing-sm) 2.5rem;
    border-radius: var(--border-radius);
    border: 1.5px solid var(--primary-500);
    background: var(--surface);
    color: var(--primary-500);
    font-weight: var(--font-weight-medium);
    box-shadow: var(--card-shadow);
    text-decoration: none;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
    cursor: pointer;
    backdrop-filter: blur(2px);
    animation: fadeInUp 1.1s;
}

.button.primary {
    background: var(--primary-500);
    color: var(--white);
    border: none;
    box-shadow: 0 4px 16px rgba(31, 79, 113, 0.13);
}

.button:hover,
.button:focus {
    background: var(--primary-50);
    color: var(--primary-500);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 32px rgba(31, 79, 113, 0.13), 0 4px 16px rgba(0, 0, 0, 0.09);
}

.button.primary:hover,
.button.primary:focus {
    background: var(--primary-700);
    color: var(--white);
}

/* Profile Photos - Base Styles */
.profile-photo {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    contain: layout style paint;
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    max-width: 100%;
    max-height: 100%;
}

.profile-photo-mobile {
    display: block;
    width: var(--photo-size-mobile);
    height: var(--photo-size-mobile);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    margin: 0 auto;
    background: var(--surface);
}

.profile-photo-desktop {
    display: flex;
    height: var(--photo-size);
    width: auto;
    aspect-ratio: var(--photo-aspect-ratio)/1;
    flex: 0 0 auto;
    margin: 0;
    overflow: hidden;
    border-radius: var(--border-radius);
    contain: layout style paint;
}

.profile-photo-desktop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
}

/* ==========================================
   CONTACT SECTION
   ========================================== */
.contact-grid {
    max-width: 800px;
    margin: var(--spacing-xl) auto 0;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Center the last card when it's alone in its row */
.contact-grid .contact-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    max-width: 50%;
    width: 100%;
}

.contact-card {
    padding: var(--spacing-lg);
    text-align: center;
    align-items: center;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.contact-title {
    color: var(--primary-500);
    font-size: var(--text-xl);
    margin: 0 0 var(--spacing-sm) 0;
    font-weight: var(--font-weight-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    width: 100%;
}

.contact-icon {
    color: var(--primary-500);
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-info p {
    margin: 0;
    color: var(--text-light);
    font-size: var(--text-sm);
    opacity: 0.8;
    font-weight: var(--font-weight-normal);
}

.contact-link {
    color: var(--primary-500);
    text-decoration: none;
    font-weight: var(--font-weight-normal);
    font-size: var(--text-lg);
    transition: color var(--transition);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--primary-500);
    background: transparent;
    display: inline-block;
}

.contact-link:hover {
    color: var(--white);
    background: var(--primary-500);
    text-decoration: none;
}

.contact-text {
    color: var(--on-surface);
    font-weight: var(--font-weight-normal);
    font-size: var(--text-body);
    line-height: var(--line-height-normal);
}

/* ==========================================
   PROJECTS SECTION
   ========================================== */
.projects {
    padding: var(--spacing-3xl) var(--spacing-lg);
    position: relative;
    z-index: 1;
}

.projects-grid,
.contact-grid {
    display: grid;
    gap: var(--spacing-lg);
}

.projects-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    grid-template-columns: repeat(auto-fit, minmax(var(--card-min-width), 1fr));
}

.project-card,
.contact-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid var(--border-subtle);
    will-change: transform;
    contain: layout style paint;
    display: flex;
    flex-direction: column;
}

.project-card:hover,
.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.project-card {
    padding: var(--card-padding);
    position: relative;
    overflow: visible;
    height: 100%;
}


.project-role {
    color: var(--primary-500);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: var(--font-weight-title);
    line-height: 1.3;
}

.project-meta {
    margin-bottom: 0.5rem;
    text-align: center;
}

.project-meta .client-name {
    font-size: var(--text-lg);
    font-style: italic;
    color: var(--text-light);
    display: inline;
}

.project-meta-row {
    text-align: center;
    margin-bottom: 0.2rem;
}

.project-meta-row:last-child {
    margin-bottom: 0;
}

.project-meta-row span {
    display: inline;
}

.project-meta .meta-sep {
    opacity: 0.7;
    font-style: italic;
    color: var(--text-light);
}

.project-meta .location {
    font-size: var(--text-lg);
    font-style: italic;
    color: var(--text-light);
    display: inline;
}

.project-meta .duration-dates {
    font-size: var(--text-sm);
    color: var(--text-light);
    opacity: 0.8;
    font-style: italic;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.project-tech {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.tech-tag {
    background: var(--border-subtle);
    color: var(--text-light);
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: var(--badge-font-weight);
}

/* ==========================================
   FOOTER
   ========================================== */
footer {
    background: var(--primary-800);
    box-shadow: var(--card-shadow);
    padding: 1.2rem 0;
    text-align: center;
    font-size: 1rem;
    font-weight: var(--font-weight-normal);
    color: var(--white);
    backdrop-filter: blur(3px);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-links {
    gap: 0.5rem;
}

footer .copyright {
    color: var(--white);
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: var(--font-weight-normal);
}

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

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

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Tablet (768px - 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(var(--card-min-width), 1fr));
    }

    .projects-grid,
    .contact-grid {
        gap: 1.5rem;
    }

    .projects {
        padding: 4rem 1.5rem;
    }

    .project-card,
    .contact-card {
        padding: 1.6rem;
    }

    .project-role {
        font-size: 1.15rem;
    }

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

    .skills-card {
        flex: none;
    }
}

/* Mobile landscape (601px - 767px) */
@media (min-width: 601px) and (max-width: 767px) {
    .about-content {
        flex-direction: column;
        gap: 2.5rem;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(var(--card-min-width), 1fr));
    }
    
    .contact-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .projects-grid,
    .contact-grid {
        gap: 1.5rem;
    }

    .landing-content {
        flex-direction: column;
        gap: 2rem;
    }

    .profile-text {
        align-items: center;
        text-align: center;
    }
}

/* Mobile (≤600px) */
@media (max-width: 600px) {
    html {
        font-size: 16px;
    }

    .container {
        padding: 0 0.7rem;
    }

    /* PhD thesis card mobile layout */
    .phd-thesis-full-width {
        display: block !important;
        grid-template-columns: none !important;
        gap: 0 !important;
        margin-bottom: var(--spacing-lg);
    }

    .phd-thesis-full-width .project-role {
        grid-column: unset !important;
        margin-bottom: var(--spacing-sm);
    }

    .phd-thesis-full-width .project-meta {
        grid-column: unset !important;
        margin-bottom: var(--spacing-md);
    }

    .phd-thesis-full-width .project-description {
        grid-column: unset !important;
        grid-row: unset !important;
        align-self: unset !important;
        margin-bottom: var(--spacing-md);
    }

    .phd-thesis-full-width .project-tech {
        grid-column: unset !important;
        margin-top: 0;
    }

    .about-content {
        flex-direction: column;
        gap: 2rem;
    }

    .skills-card {
        flex: none;
    }

    .nav-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0 1.2rem;
    }

    .nav-brand {
        display: none;
    }

    .nav-links {
        justify-content: flex-start;
        width: auto;
        gap: var(--spacing-sm);
    }

    .nav-actions {
        position: static;
    }

    .page-section {
        padding: 3rem 0;
        min-height: 50vh;
    }

    .page-section h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .page-section p {
        font-size: var(--text-body);
        padding: 0 1rem;
    }

    .projects {
        padding: 3rem 1rem;
    }

    .projects-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-card,
    .contact-card {
        padding: 1.5rem;
    }

    .project-role {
        font-size: 1.1rem;
    }

    .project-summary,
    .project-description,
    .project-tasks {
        font-size: var(--text-sm);
    }

    .contact-grid {
        margin-top: 2rem;
    }

    .landing-main {
        min-height: auto;
        padding: 4rem 0;
        margin: 0;
    }

    .landing-content {
        flex-direction: column;
        gap: 2rem;
        padding: 0 1rem;
        margin: 0;
    }

    .profile-photo-desktop {
        display: none;
    }

    .profile-photo-mobile {
        display: block;
        width: 180px;
        height: 180px;
        border-radius: 50%;
        overflow: hidden;
        box-shadow: var(--card-shadow);
        margin: 0 auto;
        background: var(--surface);
    }

    .profile-photo-mobile img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center 20%;
    }

    /* Use CSS variable instead of magic number */
    #home,
    #about,
    #projects,
    #contact {
        scroll-margin-top: var(--navbar-height-mobile);
    }

    .profile-text {
        align-items: center;
        text-align: center;
    }

    .subtitle-list {
        text-align: left;
    }

    .subtitle-list li {
        text-align: left;
    }

    .contact-grid .contact-card:last-child:nth-child(odd) {
        max-width: none;
    }
}

/* Mobile First Approach */
@media (min-width: 601px) {
    .landing-content {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: var(--spacing-lg);
        padding: 0 var(--container-padding);
    }

    .profile-text {
        align-items: flex-start;
        text-align: left;
        flex: 0 0 auto;
        width: fit-content;
        display: flex;
        flex-direction: column;
        justify-content: center;
        height: var(--photo-size);
    }

    .profile-photo-mobile {
        display: none;
    }

    .profile-photo-desktop {
        display: flex;
    }

    /* Create a wrapper for photo and text to keep them together */
    .landing-content {
        position: relative;
    }

    .landing-content::before,
    .landing-content::after {
        content: '';
        flex: 1;
        min-width: var(--spacing-lg);
    }

    .nav-container {
        padding: 0 var(--container-padding);
    }

    .nav-brand {
        position: absolute;
        left: var(--container-padding);
    }

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

    .badges-container {
        margin: auto 0;
    }
}

/* High Contrast Mode */
@media (forced-colors: active) {

    .profile-photo,
    .profile-photo-desktop {
        border: 1px solid CanvasText;
    }

    .button {
        border: 2px solid CanvasText;
    }

    .status-badge-available {
        border: 2px solid CanvasText;
    }
}

/* Print Styles */
@media print {
    @page {
        margin: 1.0cm;
        counter-increment: page;

        @top-center {
            content: "Dr. David Kaumanns - AI/ML Engineer";
            font-family: Georgia, "Times New Roman", Times, serif;
            font-size: 10pt;
            opacity: 0.8;
        }

        @bottom-left {
            content: "kaumanns.dev";
            font-family: Georgia, "Times New Roman", Times, serif;
            font-size: 10pt;
            opacity: 0.8;
        }

        @bottom-right {
            content: counter(page) " / " counter(pages);
            font-family: Georgia, "Times New Roman", Times, serif;
            font-size: 10pt;
            opacity: 0.8;
        }
    }

    @page :first {
        @top-center {
            content: none;
        }

        @bottom-left {
            content: none;
        }
    }

    /* Basic resets */
    body {
        font-family: Georgia, "Times New Roman", Times, serif;
        font-size: 12pt;
        line-height: 1.4;
        background: none !important;
        color: #000;
    }

    .page-section h2,
    .section-title {
        font-size: 18pt;
        font-family: Georgia, "Times New Roman", Times, serif;
        font-weight: bold;
        color: #000 !important;
    }

    .skills-card h4 {
        text-align: center;
    }

    .skills-card {
        border: none !important;
    }

    /* Remove shadows and unnecessary decorations. */
    *,
    *::before,
    *::after {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        box-shadow: none !important;
        text-shadow: none !important;
        background: transparent !important;
        border-color: #ddd !important;
    }

    /* Hide non-essential elements for printing */
    .navbar,
    footer,
    .landing-buttons,
    .badges-container .status-badge-available,
    .badges-container .status-badge-occupied,
    .freelancer-badge,
    #vcf-link,
    a[href="#contact"],
    a[href="#projects"],
    #about .section-title,
    #about .section-subtitle,
    #projects .section-title,
    .nav-actions,
    #contact {
        display: none !important;
    }

    #print-contact-container {
        display: flex !important;
        justify-content: space-between;
        align-items: flex-start;
        gap: 2rem;
        margin-top: 1.5rem;
        width: 100%;
    }

    #print-contact-info {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    #print-contact-qr {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    #print-contact-qr h5 {
        font-size: 10pt;
        font-weight: normal;
        margin: 0;
    }

    #print-contact-container p {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin: 0;
        font-size: 11pt;
    }

    #print-contact-container .contact-icon {
        width: 18px;
        height: 18px;
    }

    /* General link styling for print */
    a {
        text-decoration: underline;
    }

    #print-contact-container a {
        text-decoration: none !important;
    }

    /* Page layout and breaks */
    .page-section {
        page-break-before: always;
        padding: 2rem 0;
        min-height: 0;
    }

    #contact,
    #about {
        page-break-before: auto;
    }

    #about {
        padding: 0;
    }

    .landing-main {
        min-height: auto;
        page-break-before: auto;
        padding-top: 2rem;
    }

    .landing-content {
        display: flex;
        align-items: flex-start;
        gap: 2rem;
    }

    .profile-photo-mobile {
        display: none !important;
    }

    .profile-photo-desktop {
        display: flex !important;
    }

    .profile-text {
        text-align: left;
        margin-bottom: 2rem;
        height: auto;
        display: block;
    }

    .profile-text h1 {
        font-family: "Georgia", serif;
        font-size: 22pt;
        font-weight: normal;
        letter-spacing: .05em;
        text-transform: uppercase;
        margin: 0 auto .5rem;
        padding-bottom: .5rem;
        border-bottom: 1px solid #000;
        display: inline-block;
    }

    .profile-text .subtitle-list {
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .profile-text .subtitle-list li {
        font-size: 11pt;
        font-style: italic;
        line-height: 1.5;
    }


    /* Convert grids to a single-column flow, except for contacts */
    .projects-grid,
    .phd-thesis-full-width {
        display: block;
    }

    .contact-grid {
        display: grid !important;
        /* Override inline or other styles */
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 0.5rem;
    }

    .about-content {
        flex-direction: column;
        margin-top: 0;
    }

    .about-text p,
    .about-text ul,
    .about-text li {
        font-size: var(--text-sm) !important;
    }

    .about-text p {
        margin-bottom: 0.5rem;
    }

    /* Prevent elements from breaking across pages */
    .project-card,
    .contact-card,
    .skills-card,
    .profile-photo-desktop {
        page-break-inside: avoid;
        margin-bottom: 1.5rem;
    }

    .contact-card {
        padding: 0.75rem;
        margin-bottom: 0;
    }

    .contact-card .contact-title {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .contact-card .contact-info {
        gap: 0.25rem;
    }

    .contact-card .contact-link,
    .contact-card .contact-text {
        font-size: 0.9rem;
        padding: 0.25rem 0.5rem;
    }

    /* Remove borders from project cards for better space efficiency */
    .project-card {
        border: none !important;
        box-shadow: none !important;
        padding: 1rem !important;
    }

    /* Simplify project links for print */
    .project-link .link-preview .preview-image,
    .project-link .link-preview .preview-content .preview-description {
        display: none !important;
    }
    
    .project-link .link-preview {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0.2rem 0 !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    
    .project-link .link-preview .preview-content {
        padding: 0 !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    .project-link .link-preview .preview-title {
        font-size: 10pt !important;
        color: #000 !important;
        text-decoration: underline !important;
        margin: 0 0 0.25rem 0 !important;
        -webkit-line-clamp: unset !important;
        overflow: visible !important;
        text-align: center !important;
    }
    
    .project-link .link-preview::after {
        content: attr(href) !important;
        display: block !important;
        font-size: 9pt !important;
        color: #666 !important;
        font-style: italic !important;
        margin: 0 !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    .project-link .link-preview .preview-domain {
        display: none !important;
    }

    /* Restyle specific components for print */
    .button {
        border: 1px solid #000;
        text-decoration: none;
        padding: 0.5rem 1rem;
    }

    .skill-badge,
    .tech-tag {
        border: 1px solid #ccc;
        padding: 0.2rem 0.5rem;
        font-size: 10pt;
    }

    .skill-badge-language .level-dot {
        width: 10px;
        height: 10px;
        border: 1px solid #000;
        border-radius: 50%;
    }

    .skill-badge-language .level-dot.filled {
        background: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .profile-photo {
        transition: none;
    }

    .profile-photo img {
        animation: none;
    }
}

/* Focus improvements */
.nav-links a:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

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

.about-text {
    font-size: var(--text-body);
    line-height: var(--line-height-loose);
    color: var(--on-surface);
    flex: 1;
    min-width: 0;
}

.about-text p {
    margin: 0 0 2rem 0;
    text-align: justify;
    hyphens: auto;
    font-size: var(--text-body);
}

.skills-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-subtle);
    transition: all 0.3s ease;
    flex: 1;
    margin: 0;
}

.skills-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.skills-card h4 {
    color: var(--primary-500);
    font-size: 1.2rem;
    margin: 0 0 1rem 0;
    font-weight: var(--font-weight-title);
    border-bottom: 2px solid var(--primary-50);
    padding-bottom: 0.5rem;
}

.skill-section {
    margin-bottom: 1.25rem;
}

.skill-section:last-child {
    margin-bottom: 0;
}

.skill-section h5 {
    color: var(--primary-600);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.skill-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}

.skill-badge {
    background: var(--primary-50);
    color: var(--primary-600);
    padding: var(--badge-padding);
    border-radius: var(--border-radius-badge);
    font-size: var(--badge-font-size);
    font-weight: var(--badge-font-weight);
    line-height: var(--badge-line-height);
    border: 1px solid var(--primary-200);
    transition: all 0.2s ease;
    cursor: default;
}

.skill-badge:hover {
    background: var(--primary-100);
    color: var(--primary-700);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(31, 79, 113, 0.1);
}

/* PhD Thesis Card Special Styling */
.phd-thesis-card {
    background: linear-gradient(135deg, var(--white) 0%, #f8f9ff 100%);
    border: 2px solid var(--primary-300);
    box-shadow: 0 6px 30px rgba(31, 79, 113, 0.15);
    position: relative;
    overflow: hidden;
}



.phd-thesis-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 50px rgba(31, 79, 113, 0.25);
}

.phd-thesis-card .project-role {
    color: var(--primary-600);
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}

.phd-thesis-card .project-grade {
    font-size: 1rem;
    font-weight: var(--font-weight-medium);
    color: var(--primary-500);
    font-style: italic;
    margin-top: 0.25rem;
}

/* Full-width PhD thesis card styling */
.phd-thesis-full-width {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto var(--spacing-lg) auto;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-lg);
    align-items: start;
}

.phd-thesis-full-width .project-meta,
.phd-thesis-full-width .project-role {
    grid-column: 1;
}

.phd-thesis-full-width .project-description {
    grid-column: 2;
    grid-row: 1 / 3;
    margin-bottom: 0;
    align-self: center;
}

.phd-thesis-full-width .project-tech {
    grid-column: 1 / -1;
    margin-top: var(--spacing-md);
}

/* Category-specific skill badge styles */
.skill-badge-ai {
    background: var(--skill-ai-bg);
    color: var(--skill-ai-text);
    border-color: var(--skill-ai-border);
}

.skill-badge-ai:hover {
    background: var(--skill-ai-bg-hover);
    color: var(--skill-ai-text-hover);
    box-shadow: 0 2px 8px var(--skill-ai-shadow-hover);
}

.skill-badge-theory {
    background: var(--skill-theory-bg);
    color: var(--skill-theory-text);
    border-color: var(--skill-theory-border);
}

.skill-badge-theory:hover {
    background: var(--skill-theory-bg-hover);
    color: var(--skill-theory-text-hover);
    box-shadow: 0 2px 8px var(--skill-theory-shadow-hover);
}

.skill-badge-hardware {
    background: var(--skill-hardware-bg);
    color: var(--skill-hardware-text);
    border-color: var(--skill-hardware-border);
}

.skill-badge-hardware:hover {
    background: var(--skill-hardware-bg-hover);
    color: var(--skill-hardware-text);
    box-shadow: 0 2px 8px var(--skill-hardware-shadow-hover);
}

.skill-badge-ops {
    background: var(--skill-ops-bg);
    color: var(--skill-ops-text);
    border-color: var(--skill-ops-border);
}

.skill-badge-ops:hover {
    background: var(--skill-ops-bg-hover);
    color: var(--skill-ops-text);
    box-shadow: 0 2px 8px var(--skill-ops-shadow-hover);
}

.skill-badge-programming,
.skill-badge-dev {
    background: var(--skill-programming-bg);
    color: var(--skill-programming-text);
    border-color: var(--skill-programming-border);
}

.skill-badge-programming:hover,
.skill-badge-dev:hover {
    background: var(--skill-programming-bg-hover);
    color: var(--skill-programming-text);
    box-shadow: 0 2px 8px var(--skill-programming-shadow-hover);
}

.skill-badge-framework {
    background: var(--skill-framework-bg);
    color: var(--skill-framework-text);
    border-color: var(--skill-framework-border);
}

.skill-badge-framework:hover {
    background: var(--skill-framework-bg-hover);
    color: var(--skill-framework-text);
    box-shadow: 0 2px 8px var(--skill-framework-shadow-hover);
}

.skill-badge-database {
    background: var(--skill-database-bg);
    color: var(--skill-database-text);
    border-color: var(--skill-database-border);
}

.skill-badge-database:hover {
    background: var(--skill-database-bg-hover);
    color: var(--skill-database-text);
    box-shadow: 0 2px 8px var(--skill-database-shadow-hover);
}

.skill-badge-platform {
    background: var(--skill-platform-bg);
    color: var(--skill-platform-text);
    border-color: var(--skill-platform-border);
}

.skill-badge-platform:hover {
    background: var(--skill-platform-bg-hover);
    color: var(--skill-platform-text);
    box-shadow: 0 2px 8px var(--skill-platform-shadow-hover);
}

/* Language-specific skill badge styles */
.skill-badge-language {
    background: var(--skill-lang-bg);
    color: var(--skill-lang-text);
    border-color: var(--skill-lang-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: var(--badge-padding);
}

.skill-badge-language:hover {
    background: var(--skill-lang-bg-hover);
    color: var(--skill-lang-text-hover);
    box-shadow: 0 2px 8px var(--skill-lang-shadow-hover);
}

.skill-badge-language .language-name {
    font-weight: var(--font-weight-medium);
    flex-shrink: 0;
}

.skill-badge-language .level-dots {
    display: flex;
    gap: 0.2rem;
    align-items: center;
    flex-shrink: 0;
}

.skill-badge-language .level-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--skill-lang-dot-bg);
    border: 1px solid var(--skill-lang-dot-border);
    transition: all 0.2s ease;
}

.skill-badge-language .level-dot.filled {
    background: var(--skill-lang-dot-filled-bg);
    border-color: var(--skill-lang-dot-filled-border);
    box-shadow: 0 1px 2px var(--skill-lang-dot-filled-shadow);
}

.skill-badge-language .level-text {
    font-size: var(--text-xs);
    font-style: italic;
    opacity: 0.7;
    flex-shrink: 0;
}

.profile-photo:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* Status badge: occupied (yellow, not pulsating) */
.status-badge-occupied {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: #fffbe6;
    color: #bfa100;
    padding: var(--badge-padding);
    border-radius: var(--border-radius-badge);
    font-size: var(--badge-font-size);
    font-weight: var(--badge-font-weight);
    line-height: var(--badge-line-height);
    border: 1px solid #ffe066;
}

.status-dot-occupied {
    width: 8px;
    height: 8px;
    background: #ffe066;
    border-radius: 50%;
}