/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Variables for Theme - Sonora Enhanced Color Scheme */
:root {
    /* Sonora Light Theme - Enhanced for legibility */
    --primary-color: #E85D00;           /* Stronger Orange for better contrast */
    --primary-hover: #CC5200;          /* Deeper Orange */
    --accent-color: #FF8C00;           /* Dark Orange */
    --secondary-color: #2196F3;        /* Stronger Blue */
    --highlight-color: #F39C12;        /* Warm highlight */
    --text-primary: #1A1A1A;           /* Darker for better readability */
    --text-secondary: #424242;         /* Stronger secondary text */
    --text-muted: #616161;             /* Less muted for accessibility */
    --bg-primary: #FAFAFA;             /* Subtle off-white */
    --bg-secondary: #F5F5F5;           /* Light gray */
    --bg-tertiary: #EEEEEE;            /* Card backgrounds */
    --border-color: #E0E0E0;           /* Subtle borders */
    --shadow-color: rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(224, 224, 224, 0.6);

    /* Improved gradients for better legibility */
    --gradient-primary: linear-gradient(135deg, #E85D00 0%, #FF8C00 100%);
    --gradient-bg: linear-gradient(135deg, #E85D00 0%, #FF8C00 50%, #FFA500 100%);
    --gradient-hero: linear-gradient(135deg, #F5F5F5 0%, #FAFAFA 100%);
    --gradient-card: linear-gradient(135deg, rgba(232, 93, 0, 0.03) 0%, rgba(255, 140, 0, 0.03) 100%);
    --gradient-text: linear-gradient(135deg, #E85D00 0%, #FF8C00 100%);

    /* Modern shadows */
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-large: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --glow-effect: 0 0 0 3px rgba(232, 93, 0, 0.1);

    /* Smooth transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* Typography Scale */
    --font-size-xs: 0.75rem;       /* 12px */
    --font-size-sm: 0.875rem;      /* 14px */
    --font-size-base: 1rem;        /* 16px */
    --font-size-lg: 1.125rem;      /* 18px */
    --font-size-xl: 1.25rem;       /* 20px */
    --font-size-2xl: 1.5rem;       /* 24px */
    --font-size-3xl: 1.875rem;     /* 30px */
    --font-size-4xl: 2.25rem;      /* 36px */
    --font-size-5xl: 3rem;         /* 48px */
    --font-size-6xl: 3.75rem;      /* 60px */

    /* Font Weights */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 2;
}

/* Enhanced Dark Mode Variables - Sonora Style */
[data-theme="dark"] {
    --primary-color: #FF7043;
    --primary-hover: #FF5722;
    --accent-color: #FF8C00;
    --secondary-color: #42A5F5;
    --text-primary: #FFFFFF;
    --text-secondary: #E0E0E0;
    --text-muted: #BDBDBD;
    --bg-primary: #121212;
    --bg-secondary: #1E1E1E;
    --bg-tertiary: #2A2A2A;
    --border-color: #333333;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(30, 30, 30, 0.8);
    --glass-border: rgba(51, 51, 51, 0.6);

    /* Dark gradients */
    --gradient-primary: linear-gradient(135deg, #FF7043 0%, #FF8C00 100%);
    --gradient-bg: linear-gradient(135deg, #FF7043 0%, #FF8C00 50%, #FFA500 100%);
    --gradient-hero: linear-gradient(135deg, #1E1E1E 0%, #121212 100%);
    --gradient-card: linear-gradient(135deg, rgba(255, 112, 67, 0.05) 0%, rgba(255, 140, 0, 0.05) 100%);
    --gradient-text: linear-gradient(135deg, #FF7043 0%, #FF8C00 100%);

    /* Dark shadows */
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-large: 0 10px 15px rgba(0, 0, 0, 0.4), 0 4px 6px rgba(0, 0, 0, 0.3);
    --glow-effect: 0 0 0 3px rgba(255, 112, 67, 0.2);
}

/* Enhanced Base Typography with Depth */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', 'Helvetica Neue', Arial, sans-serif;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: var(--transition);
    letter-spacing: -0.01em;
    position: relative;
    overflow-x: hidden;
}

/* Floating background elements for depth */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 25% 25%, rgba(0, 102, 204, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 75% 75%, rgba(232, 93, 0, 0.03) 0%, transparent 50%);
    animation: float-bg 20s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}

[data-theme="dark"] body::before {
    background: radial-gradient(circle at 25% 25%, rgba(79, 195, 247, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 75% 75%, rgba(255, 112, 67, 0.05) 0%, transparent 50%);
}

@keyframes float-bg {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(1deg); }
    66% { transform: translate(-20px, 20px) rotate(-1deg); }
}

/* Layered depth for sections */
.section {
    position: relative;
    z-index: 1;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(0, 102, 204, 0.01) 50%, transparent 100%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.section:hover::before {
    opacity: 1;
}

/* Typography Scale */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--text-primary);
    margin-bottom: 0.5em;
    letter-spacing: -0.025em;
}

h1 {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-extrabold);
}

h2 {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
}

h3 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
}

h4 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
}

h5 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
}

h6 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
}

p {
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
    color: var(--text-secondary);
    margin-bottom: 1em;
}

.text-large {
    font-size: var(--font-size-lg);
    line-height: var(--line-height-relaxed);
}

.text-small {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
}

.text-xs {
    font-size: var(--font-size-xs);
    line-height: var(--line-height-normal);
}

/* Improved Reading Experience */
.prose {
    max-width: 65ch;
    font-size: var(--font-size-lg);
    line-height: var(--line-height-loose);
}

.prose p {
    margin-bottom: 1.25em;
}

/* Link styling for better contrast, esp. in dark mode */
a {
    color: var(--primary-color);
    text-decoration-color: color-mix(in oklab, var(--primary-color) 40%, transparent);
    text-underline-offset: 3px;
}

a:hover, a:focus {
    color: var(--primary-hover);
    text-decoration-thickness: 2px;
}

a:visited {
    color: var(--primary-color);
}

/* Sonora Pages Typography - Apple's New York Serif */
.sonora-page {
    font-family: 'New York', 'Charter', 'Georgia', 'Times New Roman', serif;
}

/* Enhanced serif typography for Sonora brand */
.sonora-page h1,
.sonora-page h2,
.sonora-page h3,
.sonora-page h4,
.sonora-page h5,
.sonora-page h6 {
    font-family: 'New York', 'Charter', 'Georgia', 'Times New Roman', serif;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Account for fixed navbar on Sonora subpages */
.sonora-page .legal-container,
.sonora-page .support-container {
    margin-top: 6rem;
}

.sonora-page p {
    font-family: 'New York', 'Charter', 'Georgia', 'Times New Roman', serif;
    font-feature-settings: 'liga' 1, 'kern' 1;
}

/* Fallback for non-Apple devices */
@supports not (font-family: 'New York') {
    .sonora-page {
        font-family: 'Charter', 'Georgia', 'Times New Roman', serif;
    }
    
    .sonora-page h1,
    .sonora-page h2,
    .sonora-page h3,
    .sonora-page h4,
    .sonora-page h5,
    .sonora-page h6,
    .sonora-page p {
        font-family: 'Charter', 'Georgia', 'Times New Roman', serif;
    }
}

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

/* Enhanced Glassmorphism Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.header:hover::before {
    opacity: 1;
}

[data-theme="dark"] .header {
    background: rgba(18, 18, 18, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(25px) saturate(200%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .header.scrolled {
    background: rgba(18, 18, 18, 0.9);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Scroll Progress Bar */
.scroll-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--gradient-bg);
    width: 0%;
    transition: width 0.1s ease-out;
    z-index: 101;
}

/* Enhanced Navigation with Micro-animations */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    position: relative;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: rgba(var(--primary-color), 0.1);
    transform: translateY(-1px);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: translateX(-50%);
    border-radius: 2px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-color);
    opacity: 0;
    border-radius: 8px;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.nav-link:hover::before {
    opacity: 0.05;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 44px;
    height: 44px;
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    padding: 8px;
    transition: var(--transition);
}

.mobile-menu-toggle:hover {
    border-color: var(--primary-color);
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: var(--transition);
    transform-origin: center;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* Mobile Navigation */
.mobile-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: var(--shadow-medium);
}

.mobile-nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.mobile-nav-links {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
}

.mobile-nav-link {
    display: block;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: var(--bg-secondary);
    color: var(--primary-color);
    padding-left: 2.5rem;
}

/* Sonora pages navbar (match header styling) */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    transition: var(--transition);
}

[data-theme="dark"] .navbar {
    background: rgba(17, 24, 39, 0.95);
}

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

.nav-links-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link, .nav-logo {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
}

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

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: inline-block;
}

.logo:hover {
    transform: translateY(-2px) scale(1.05);
    text-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.logo:hover::after {
    width: 100%;
}

.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: var(--primary-color);
    border-radius: 50%;
    transition: all 0.3s ease;
    transform: translate(-50%, -50%);
    opacity: 0.1;
}

.theme-toggle:hover::before {
    width: 100%;
    height: 100%;
}

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

/* Enhanced Hero Section with Depth */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-bg);
    position: relative;
    overflow: hidden;
    perspective: 1000px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="25" cy="75" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="75" cy="25" r="1" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    animation: subtle-float 15s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    animation: gentle-drift 25s ease-in-out infinite reverse;
    z-index: 1;
}

@keyframes subtle-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.01); }
}

@keyframes gentle-drift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(10px, -5px) rotate(0.5deg); }
    50% { transform: translate(-5px, 10px) rotate(-0.5deg); }
    75% { transform: translate(-10px, -5px) rotate(0.3deg); }
}

.hero-content {
    text-align: center;
    color: white;
    position: relative;
    z-index: 2;
    animation: fadeInUp 1s ease-out;
}

.hero h1 {
    font-size: clamp(var(--font-size-4xl), 8vw, var(--font-size-6xl));
    font-weight: var(--font-weight-extrabold);
    line-height: var(--line-height-tight);
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero .tagline {
    font-size: clamp(var(--font-size-lg), 3vw, var(--font-size-2xl));
    font-weight: var(--font-weight-light);
    line-height: var(--line-height-snug);
    margin-bottom: 2rem;
    opacity: 0.95;
    letter-spacing: -0.01em;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    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.1), transparent);
    transition: left 0.5s ease;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.cta-button span:last-child {
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.cta-button:hover span:last-child {
    transform: translateY(3px);
    animation: bounce-arrow 0.6s ease-in-out;
}

@keyframes bounce-arrow {
    0%, 100% { transform: translateY(3px); }
    50% { transform: translateY(8px); }
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    animation: bounce 2s infinite;
}

/* Main Content */
.main {
    padding-top: 4rem;
}

.section {
    padding: 4rem 0;
    border-bottom: 1px solid var(--border-color);
    /* prevent fixed header overlap for in-page anchors */
    scroll-margin-top: 80px;
}

.section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

/* About Section */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-text {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-loose);
    color: var(--text-secondary);
    margin-bottom: 2rem;
    letter-spacing: -0.01em;
}

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

.skill-tag {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition);
}

.skill-tag:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

/* Glassmorphism Project Cards */
.project-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 102, 204, 0.1);
}

[data-theme="dark"] .project-card {
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
    border-radius: 20px;
}

.project-card::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 22px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.project-card > * {
    position: relative;
    z-index: 1;
}

.project-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 0 25px 50px rgba(0, 102, 204, 0.2);
    backdrop-filter: blur(30px) saturate(200%);
    border-color: rgba(var(--primary-color), 0.3);
}

[data-theme="dark"] .project-card:hover {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.project-card:hover::before {
    opacity: 0.05;
}

.project-card:hover::after {
    opacity: 0.3;
}

.project-card:hover .project-title {
    color: var(--primary-color);
    transform: translateX(5px);
}

.project-card:hover .project-description {
    transform: translateX(3px);
}

.project-card .project-title,
.project-card .project-description {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Floating depth effect */
.project-card:nth-child(odd) {
    transform: perspective(1000px) rotateX(2deg) rotateY(-1deg);
}

.project-card:nth-child(even) {
    transform: perspective(1000px) rotateX(-1deg) rotateY(2deg);
}

.project-card:nth-child(odd):hover {
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateY(-12px) scale(1.03);
}

.project-card:nth-child(even):hover {
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateY(-12px) scale(1.03);
}

.project-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-snug);
    margin-bottom: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.project-description {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-relaxed);
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.01em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.project-link::after {
    content: '→';
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    margin-left: 0.25rem;
}

.project-link:hover {
    color: var(--primary-hover);
    transform: translateX(5px);
}

.project-link:hover::after {
    transform: translateX(8px);
    animation: arrow-bounce 0.6s ease-in-out;
}

@keyframes arrow-bounce {
    0%, 100% { transform: translateX(8px); }
    50% { transform: translateX(12px); }
}

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

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

/* Glassmorphism Social Links */
.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 102, 204, 0.1);
}

[data-theme="dark"] .social-link {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.social-link::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 0;
}

.social-link span {
    position: relative;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-link:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 25px rgba(0, 102, 204, 0.3);
}

.social-link:hover::before {
    top: 0;
}

.social-link:hover span {
    color: white;
    transform: scale(1.1) rotate(5deg);
}

.social-link:nth-child(1):hover span {
    animation: pulse-github 0.6s ease-in-out;
}

.social-link:nth-child(2):hover span {
    animation: bounce-email 0.6s ease-in-out;
}

.social-link:nth-child(3):hover span {
    animation: shake-linkedin 0.6s ease-in-out;
}

@keyframes pulse-github {
    0%, 100% { transform: scale(1.1) rotate(5deg); }
    50% { transform: scale(1.3) rotate(5deg); }
}

@keyframes bounce-email {
    0%, 100% { transform: scale(1.1) rotate(5deg) translateY(0); }
    50% { transform: scale(1.2) rotate(5deg) translateY(-3px); }
}

@keyframes shake-linkedin {
    0%, 100% { transform: scale(1.1) rotate(5deg); }
    25% { transform: scale(1.1) rotate(-2deg); }
    75% { transform: scale(1.1) rotate(12deg); }
}

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

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

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

.footer-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40%, 43% {
        transform: translateX(-50%) translateY(-15px);
    }
    70% {
        transform: translateX(-50%) translateY(-5px);
    }
    90% {
        transform: translateX(-50%) translateY(-2px);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .nav {
        padding: 0.75rem 0;
    }

    /* Hide desktop navigation, show mobile toggle */
    .nav-links {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: var(--font-size-3xl);
        margin-bottom: 2rem;
    }

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

    .social-links {
        gap: 1rem;
    }

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

    .skills {
        gap: 0.75rem;
    }

    .skill-tag {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    /* Mobile Navigation Adjustments */
    .mobile-nav-link:last-child {
        border-bottom: none;
    }
}

@media (max-width: 480px) {
    .hero .tagline {
        font-size: var(--font-size-lg);
        line-height: var(--line-height-normal);
    }

    .cta-button {
        padding: 0.875rem 1.5rem;
        font-size: var(--font-size-sm);
    }

    .about-text {
        font-size: var(--font-size-base);
        line-height: var(--line-height-relaxed);
    }

    .project-card {
        padding: 1.5rem;
    }

    .section-title {
        font-size: var(--font-size-2xl);
    }

    .project-title {
        font-size: var(--font-size-lg);
    }
}

/* Screen Reader and Accessibility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    z-index: 999999;
}

/* Enhanced Focus Management */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    scroll-margin-top: 100px; /* Account for fixed header */
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Specific Focus States */
.nav-link:focus,
.mobile-nav-link:focus {
    background: var(--bg-secondary);
    border-radius: 8px;
    outline-offset: 4px;
}

.theme-toggle:focus,
.mobile-menu-toggle:focus {
    outline-color: var(--primary-color);
    outline-width: 3px;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--primary-color);
}

.cta-button:focus {
    outline-color: white;
    outline-width: 3px;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5), 0 0 0 4px white;
}

.project-card:focus-within,
.project-card:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.social-link:focus {
    outline-color: var(--primary-color);
    outline-width: 3px;
    outline-offset: 2px;
    transform: scale(1.05);
}

/* Keyboard Navigation Improvements */
.nav-link,
.mobile-nav-link,
.cta-button,
.project-card a,
.social-link,
.theme-toggle,
.mobile-menu-toggle {
    position: relative;
}

/* Skip Link Styling */
.skip-link {
    position: absolute;
    top: -9999px;
    left: -9999px;
    z-index: 999999;
    padding: 1rem 2rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    text-decoration: none;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    font-weight: var(--font-weight-semibold);
    transition: var(--transition);
}

.skip-link:focus {
    position: fixed;
    top: 1rem;
    left: 1rem;
    box-shadow: var(--shadow-large);
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #000000;
        --text-secondary: #000000;
        --bg-primary: #FFFFFF;
        --border-color: #000000;
        --primary-color: #0000FF;
    }

    [data-theme="dark"] {
        --text-primary: #FFFFFF;
        --text-secondary: #FFFFFF;
        --bg-primary: #000000;
        --border-color: #FFFFFF;
        --primary-color: #00FFFF;
    }

    .project-card,
    .social-link,
    .theme-toggle,
    .mobile-menu-toggle {
        border: 2px solid var(--text-primary);
    }
}

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

    .fade-in {
        opacity: 1 !important;
        transform: none !important;
    }

    .scroll-indicator {
        display: none;
    }
}

/* Large Text Support */
@media (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Page Loading and Transition Effects */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-loader.fade-out {
    opacity: 0;
    transform: scale(1.1);
}

.loader-content {
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

.loader-text {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    min-height: 1.5em;
    letter-spacing: 0.05em;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Page Transition Overlay */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: scaleX(0);
    transform-origin: left;
}

.page-transition.active {
    opacity: 1;
    visibility: visible;
    transform: scaleX(1);
}

.page-transition::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Body loaded state */
body.loaded .fade-in {
    animation: slideInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced fade-in animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation delays */
.fade-in:nth-child(1) { transition-delay: 0.1s; }
.fade-in:nth-child(2) { transition-delay: 0.2s; }
.fade-in:nth-child(3) { transition-delay: 0.3s; }
.fade-in:nth-child(4) { transition-delay: 0.4s; }
.fade-in:nth-child(5) { transition-delay: 0.5s; }

/* Loading state styles */
.loading {
    pointer-events: none;
    opacity: 0.7;
    filter: blur(1px);
}

/* Skeleton loading for cards */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 0%, var(--bg-tertiary) 50%, var(--bg-secondary) 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

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

/* Success state animations */
.success-flash {
    animation: success-pulse 0.6s ease-out;
}

@keyframes success-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(0, 255, 0, 0);
        transform: scale(1.02);
    }
}
