/* ==========================================
   CSS Reset & Base Styles
   ========================================== */

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

/* ==========================================
   Color System - Bold Purple/Magenta/Cyan
   ========================================== */

:root {
    /* Light Mode Colors - Sharp & Cool */
    --color-background: #fafafa;
    --color-surface: #ffffff;
    --color-text-primary: #0f0f0f;
    --color-text-secondary: #525252;

    /* Dominant Colors - Deep Blue/Teal/Electric */
    --color-primary: #0ea5e9;      /* Electric Blue */
    --color-secondary: #0891b2;    /* Deep Cyan */
    --color-accent: #06b6d4;       /* Bright Cyan */

    --color-border: #e5e5e5;
    --color-hover: #f5f5f5;
    --color-nav-bg: rgba(250, 250, 250, 0.9);

    /* Gradient Mesh Colors - Cool Spectrum */
    --gradient-1: #0ea5e9;         /* Electric Blue */
    --gradient-2: #0891b2;         /* Deep Cyan */
    --gradient-3: #14b8a6;         /* Teal */
    --gradient-4: #06b6d4;         /* Bright Cyan */

    /* Typography - Space Grotesk + Instrument Sans */
    --font-heading: 'Space Grotesk', -apple-system, sans-serif;
    --font-body: 'Instrument Sans', -apple-system, sans-serif;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
    --spacing-xxl: 8rem;

    /* Layout */
    --max-width: 1200px;
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-color: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Dark Mode - System Preference */
@media (prefers-color-scheme: dark) {
    :root {
        --color-background: #0a0a0a;
        --color-surface: #151515;
        --color-text-primary: #fafafa;
        --color-text-secondary: #a3a3a3;

        --color-primary: #22d3ee;      /* Bright Cyan */
        --color-secondary: #06b6d4;    /* Electric Cyan */
        --color-accent: #0ea5e9;       /* Electric Blue */

        --color-border: #262626;
        --color-hover: #1f1f1f;
        --color-nav-bg: rgba(10, 10, 10, 0.9);

        --gradient-1: #0ea5e9;         /* Electric Blue */
        --gradient-2: #0891b2;         /* Deep Cyan */
        --gradient-3: #14b8a6;         /* Teal */
        --gradient-4: #22d3ee;         /* Bright Cyan */
    }
}

/* Manual Dark Mode Override */
[data-theme="dark"] {
    --color-background: #0a0a0a;
    --color-surface: #151515;
    --color-text-primary: #fafafa;
    --color-text-secondary: #a3a3a3;

    --color-primary: #22d3ee;
    --color-secondary: #06b6d4;
    --color-accent: #0ea5e9;

    --color-border: #262626;
    --color-hover: #1f1f1f;
    --color-nav-bg: rgba(10, 10, 10, 0.9);

    --gradient-1: #0ea5e9;
    --gradient-2: #0891b2;
    --gradient-3: #14b8a6;
    --gradient-4: #22d3ee;
}

/* Manual Light Mode Override */
[data-theme="light"] {
    --color-background: #fafafa;
    --color-surface: #ffffff;
    --color-text-primary: #0f0f0f;
    --color-text-secondary: #525252;

    --color-primary: #0ea5e9;
    --color-secondary: #0891b2;
    --color-accent: #06b6d4;

    --color-border: #e5e5e5;
    --color-hover: #f5f5f5;
    --color-nav-bg: rgba(250, 250, 250, 0.9);

    --gradient-1: #0ea5e9;
    --gradient-2: #0891b2;
    --gradient-3: #14b8a6;
    --gradient-4: #06b6d4;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-text-primary);
    background-color: var(--color-background);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: var(--transition-color);
}

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

/* ==========================================
   Navigation
   ========================================== */

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: var(--color-nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--spacing-md);
    transition: var(--transition-color);
}

.logo {
    font-size: 1.125rem;
    font-weight: var(--font-weight-bold);
    font-family: var(--font-heading);
    color: var(--color-text-primary);
    text-decoration: none;
    transition: var(--transition);
}

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

.nav-links {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.nav-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    transition: var(--transition);
    font-size: 0.9375rem;
}

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

/* Dark Mode Toggle */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: var(--font-weight-medium);
    border-radius: 8px;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.theme-toggle:hover {
    background: var(--color-hover);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.theme-toggle:active {
    transform: scale(0.98);
}

/* ==========================================
   Hero Section with Animated Gradient Mesh
   ========================================== */

.hero {
    margin-top: 72px;
    padding: var(--spacing-xxl) 0;
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Geometric Canvas Background */
.geometric-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none; /* Safari fix: prevent canvas from blocking content */
}


.hero-content {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    padding: 0 var(--spacing-md);
    text-align: center;
}

.hero-label {
    font-size: 0.875rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: var(--spacing-md);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 8vw, 6.5rem);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.04em;
    line-height: 0.95;
    margin-bottom: var(--spacing-lg);
}

.title-line {
    display: block;
}

.highlight {
    font-style: normal;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 50%, var(--color-accent) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    animation: gradient-shift 8s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-regular);
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    margin-top: var(--spacing-lg);
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    border-radius: 12px;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

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

.btn-secondary:hover {
    background: var(--color-hover);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* ==========================================
   About Section
   ========================================== */

.about {
    padding: var(--spacing-xxl) 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
}

.about-content {
    max-width: 1000px;
    margin: 0 auto;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.03em;
    text-align: center;
}

.section-lead {
    font-size: clamp(1.125rem, 2vw, 1.25rem);
    color: var(--color-text-secondary);
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto var(--spacing-xl);
    text-align: center;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.skill-category {
    background: var(--color-background);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    transition: var(--transition);
}

.skill-category:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.12);
}

.skill-category-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-md);
    color: var(--color-primary);
    letter-spacing: -0.01em;
}

.skill-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.skill-list li {
    color: var(--color-text-secondary);
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.skill-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: var(--font-weight-bold);
}

/* ==========================================
   Work Section
   ========================================== */

.work {
    padding: var(--spacing-xl) 0;
    min-height: 100vh;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.project-card {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--color-primary);
    box-shadow: 0 20px 40px rgba(14, 165, 233, 0.2);
}

.project-card:hover .project-image {
    opacity: 0.95;
}

.project-card-small {
    transform: scale(0.95);
}

.project-card-small:hover {
    opacity: 1;
    transform: scale(0.95) translateY(-4px);
}

.project-card-small .project-title {
    font-size: 1.25rem;
}

.project-card-small .project-description {
    font-size: 0.875rem;
}

.project-card-small .project-meta {
    font-size: 0.75rem;
}

.project-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--color-hover);
    overflow: hidden;
    transition: var(--transition);
}

.project-image img:not(.project-card-logo) {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Theme-specific image visibility */
.image-light-mode {
    display: none !important;
}

.image-dark-mode {
    display: block !important;
}

/* Light mode - show light image, hide dark image */
[data-theme="light"] .image-light-mode {
    display: block !important;
}

[data-theme="light"] .image-dark-mode {
    display: none !important;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .image-light-mode {
        display: block !important;
    }

    :root:not([data-theme="dark"]) .image-dark-mode {
        display: none !important;
    }
}

.project-image-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
}

.project-card-logo {
    width: 192px;
    height: 192px;
    object-fit: contain;
}

.project-image-technical {
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.technical-drawing {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

/* Light mode inversions for technical drawings */
[data-theme="light"] .technical-drawing {
    filter: invert(1);
}

[data-theme="light"] .project-image-technical {
    background: var(--color-surface);
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .technical-drawing {
        filter: invert(1);
    }

    :root:not([data-theme="dark"]) .project-image-technical {
        background: var(--color-surface);
    }
}

/* Dark background images - change to card color in light mode */
.project-image-dark-bg {
    background: #000000;
}

[data-theme="light"] .project-image-dark-bg {
    background: var(--color-surface);
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .project-image-dark-bg {
        background: var(--color-surface);
    }
}

.placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    color: var(--color-text-secondary);
    background: linear-gradient(135deg, var(--color-hover) 0%, var(--color-surface) 100%);
    font-size: 0.75rem;
    line-height: 1.4;
    text-align: center;
    opacity: 0.6;
    font-style: italic;
    overflow: hidden;
    position: relative;
}

.placeholder::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    opacity: 0.3;
}

.placeholder-hardware svg,
.placeholder-web svg {
    opacity: 0.4;
    transition: var(--transition);
}

.project-card:hover .placeholder-hardware svg,
.project-card:hover .placeholder-web svg {
    opacity: 0.6;
    transform: scale(1.1);
}

.project-content {
    padding: var(--spacing-md);
}

.project-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.project-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.02em;
    flex: 1;
}

.project-badge {
    font-size: 0.75rem;
    font-weight: var(--font-weight-semibold);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    background: var(--color-hover);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-badge-live {
    background: rgba(14, 165, 233, 0.1);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.project-badge-active {
    background: rgba(14, 165, 233, 0.1);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.project-description {
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-sm);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.project-meta {
    font-size: 0.8125rem;
    color: var(--color-primary);
    font-weight: var(--font-weight-medium);
}

/* ==========================================
   Contact Section
   ========================================== */

.contact {
    padding: var(--spacing-xxl) 0;
    background: var(--color-surface);
    text-align: center;
    border-top: 1px solid var(--color-border);
}

.availability-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid var(--color-primary);
    border-radius: 24px;
    color: var(--color-primary);
    font-size: 0.875rem;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-md);
}

.availability-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.contact-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.03em;
}

.contact-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto var(--spacing-xl);
    line-height: 1.7;
}

.contact-links {
    display: flex;
    flex-direction: row;
    gap: var(--spacing-lg);
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-primary);
    text-decoration: none;
    font-size: 1.125rem;
    font-weight: var(--font-weight-medium);
    transition: var(--transition);
    position: relative;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-background);
}

.contact-link svg {
    transition: var(--transition);
}

.contact-link:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

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

/* ==========================================
   Footer
   ========================================== */

.footer {
    padding: var(--spacing-lg) 0;
    text-align: center;
    border-top: 1px solid var(--color-border);
}

.footer-logo {
    width: 48px;
    height: 48px;
    margin-bottom: var(--spacing-sm);
    transition: var(--transition);
    color: var(--color-text-primary);
}

/* Logo animation elements - initial state (off-screen) */
.footer-logo .logo-circle {
    -webkit-transform: translateX(-120px);
    transform: translateX(-120px);
    opacity: 0;
}

.footer-logo .logo-square {
    -webkit-transform: translateX(120px);
    transform: translateX(120px);
    opacity: 0;
}

/* Animated state - slide in and fade in */
.footer-logo.animated .logo-circle {
    -webkit-animation: slideInFromLeft 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation: slideInFromLeft 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.footer-logo.animated .logo-square {
    -webkit-animation: slideInFromRight 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation: slideInFromRight 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    -webkit-animation-delay: 0.1s;
    animation-delay: 0.1s; /* Slight stagger for visual interest */
}

/* Keyframe: Circle slides in from left */
@-webkit-keyframes slideInFromLeft {
    0% {
        -webkit-transform: translateX(-120px);
        transform: translateX(-120px);
        opacity: 0;
    }
    100% {
        -webkit-transform: translateX(0);
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromLeft {
    0% {
        -webkit-transform: translateX(-120px);
        transform: translateX(-120px);
        opacity: 0;
    }
    100% {
        -webkit-transform: translateX(0);
        transform: translateX(0);
        opacity: 1;
    }
}

/* Keyframe: D-shape slides in from right */
@-webkit-keyframes slideInFromRight {
    0% {
        -webkit-transform: translateX(120px);
        transform: translateX(120px);
        opacity: 0;
    }
    100% {
        -webkit-transform: translateX(0);
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    0% {
        -webkit-transform: translateX(120px);
        transform: translateX(120px);
        opacity: 0;
    }
    100% {
        -webkit-transform: translateX(0);
        transform: translateX(0);
        opacity: 1;
    }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .footer-logo .logo-circle,
    .footer-logo .logo-square {
        -webkit-transform: translateX(0) !important;
        transform: translateX(0) !important;
        opacity: 1 !important;
        -webkit-animation: none !important;
        animation: none !important;
    }
}

/* Light mode: invert the entire dark mode output */
[data-theme="light"] .footer-logo {
    -webkit-filter: invert(1);
    filter: invert(1);
}

/* System preference light mode (when no manual theme set) */
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .footer-logo {
        -webkit-filter: invert(1);
        filter: invert(1);
    }
}

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

/* ==========================================
   Project Detail Pages
   ========================================== */

.project-detail {
    margin-top: 72px;
    padding: var(--spacing-xl) 0;
}

.project-header {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md);
    max-width: 900px;
    margin: 0 auto;
}

.project-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--spacing-lg);
    display: block;
}

.project-header h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.03em;
}

.project-header .lead {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.project-info {
    display: flex;
    gap: var(--spacing-lg);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.info-item {
    text-align: center;
}

.info-label {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--spacing-xs);
    font-weight: var(--font-weight-medium);
}

.info-value {
    font-size: 1rem;
    color: var(--color-text-primary);
    font-weight: var(--font-weight-semibold);
}

.project-body {
    max-width: 800px;
    margin: var(--spacing-xl) auto;
    padding: 0 var(--spacing-md);
}

.project-section {
    margin-bottom: var(--spacing-xl);
}

.project-section h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.02em;
}

.project-section p {
    color: var(--color-text-secondary);
    line-height: 1.8;
    font-size: 1.0625rem;
    margin-bottom: var(--spacing-md);
}

.project-section ul {
    margin-left: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.project-section li {
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: var(--spacing-xs);
}

.image-full {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--color-hover);
    border-radius: var(--border-radius);
    margin: var(--spacing-lg) 0;
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.image-full img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
}

.image-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
}

.image-grid .placeholder {
    aspect-ratio: 1;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
}

.mobile-showcase {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
    flex-wrap: wrap;
}

.phone-mockup {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 320px;
}

.phone-frame {
    position: relative;
    width: 320px;
    background: #1a1a1a;
    border-radius: 42px;
    padding: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 130px;
    height: 26px;
    background: #1a1a1a;
    border-radius: 0 0 18px 18px;
    z-index: 10;
}

.phone-screen {
    position: relative;
    width: 100%;
    aspect-ratio: 390 / 844;
    background: white;
    border-radius: 32px;
    overflow: hidden;
}

.phone-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.feature-label {
    margin-top: var(--spacing-md);
    text-align: center;
    padding: 0 var(--spacing-sm);
}

.feature-label h3 {
    font-size: 1.125rem;
    font-weight: var(--font-weight-semibold);
    margin-bottom: 0.5rem;
    color: var(--color-text-primary);
}

.feature-label p {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--color-primary);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-lg);
    transition: var(--transition);
}

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

/* ==========================================
   Responsive Design
   ========================================== */

@media (max-width: 768px) {
    .nav {
        height: 60px;
        padding: 0 var(--spacing-sm);
    }

    .hero {
        margin-top: 60px;
        padding: var(--spacing-xl) 0;
        min-height: 75vh;
    }

    .hero-title {
        line-height: 1.05;
    }

    .about {
        padding: var(--spacing-lg) 0;
    }

    .section-lead {
        margin-bottom: var(--spacing-md);
    }

    .skills-grid {
        gap: var(--spacing-md);
        margin-top: var(--spacing-md);
    }

    .skill-category {
        padding: var(--spacing-md);
    }

    .project-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .contact-links {
        gap: var(--spacing-sm);
    }

    .project-info {
        gap: var(--spacing-md);
    }

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

    .mobile-showcase {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-xl);
    }

    .phone-mockup {
        max-width: 280px;
    }

    .phone-frame {
        width: 280px;
    }

    .theme-toggle {
        font-size: 0.625rem;
        padding: 0.375rem 0.75rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================
   Accessibility
   ========================================== */

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

    .gradient-mesh {
        animation: none;
    }

    .highlight {
        animation: none;
        background-position: 0% 50%;
    }
}

/* Focus styles for keyboard navigation */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
}

/* Selection color */
::selection {
    background: var(--color-primary);
    color: white;
}

::-moz-selection {
    background: var(--color-primary);
    color: white;
}

/* ==========================================
   Image Loading States - Skeleton Shimmer
   ========================================== */

.image-loading-container {
    position: relative;
    overflow: hidden;
    background: var(--color-hover);
    display: inline-block;
    width: 100%;
}

.image-loading-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--color-hover) 0%,
        var(--color-surface) 20%,
        var(--color-hover) 40%,
        var(--color-hover) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    z-index: 1;
}

.image-loading-container img {
    display: block;
    width: 100%;
    height: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-loading-container.loaded img {
    opacity: 1;
}

.image-loading-container.loaded .image-loading-placeholder {
    display: none;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@-webkit-keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .image-loading-placeholder {
        animation: none;
        background: var(--color-hover);
    }
}
