/* ==========================================================================
   Design Tokens & System Variables
   ========================================================================== */

:root,
[data-bs-theme="light"] {
    color-scheme: light;
    
    /* Backgrounds */
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-subtle: #f1f5f9;
    --bg-card-hover: #ffffff;
    
    /* Typography */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    /* Accents & Contrast */
    --accent-primary: #0d9488;
    --accent-primary-hover: #0f766e;
    --accent-text: #ffffff;
    --accent-subtle: rgba(13, 148, 136, 0.08);
    --accent-glow: rgba(13, 148, 136, 0.2);
    
    /* Borders */
    --border-subtle: #e2e8f0;
    --border-strong: #cbd5e1;
    --border-hover: rgba(13, 148, 136, 0.45);
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 14px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 16px 36px -4px rgba(15, 23, 42, 0.1), 0 8px 14px -6px rgba(15, 23, 42, 0.05);
    --shadow-glow: 0 0 24px var(--accent-glow);
    --active-card-shadow: 0 8px 24px -4px rgba(13, 148, 136, 0.2), 0 0 0 1.5px var(--accent-primary);
    
    /* Navigation & Frosted Glass */
    --nav-bg: rgba(248, 250, 252, 0.6);
    --nav-border: rgba(226, 232, 240, 0.6);
    
    /* Hero Atmosphere */
    --card-gradient-top: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    --hero-title-gradient: linear-gradient(135deg, #0d9488 0%, #0284c7 100%);
    --hero-ambient-glow: radial-gradient(circle at 85% 15%, rgba(13, 148, 136, 0.1) 0%, transparent 60%),
                         radial-gradient(circle at 10% 80%, rgba(2, 132, 199, 0.08) 0%, transparent 50%);
    
    /* Radii */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    /* Controls & Chart */
    --chart-filter: none;
    --theme-toggle-bg: rgba(241, 245, 249, 0.95);
    --theme-toggle-border: #cbd5e1;
    --theme-toggle-color: #0f172a;
}

[data-bs-theme="dark"] {
    color-scheme: dark;
    
    /* Backgrounds */
    --bg-base: #0b1118;
    --bg-surface: #111a24;
    --bg-surface-subtle: #0e1620;
    --bg-card-hover: #162332;
    
    /* Typography */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Accents & Contrast */
    --accent-primary: #2dd4bf;
    --accent-primary-hover: #5eead4;
    --accent-text: #0b1118;
    --accent-subtle: rgba(45, 212, 191, 0.12);
    --accent-glow: rgba(45, 212, 191, 0.28);
    
    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --border-hover: rgba(45, 212, 191, 0.5);
    
    /* Shadows */
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.65);
    --shadow-glow: 0 0 28px rgba(45, 212, 191, 0.22);
    --active-card-shadow: 0 8px 24px -2px rgba(0, 0, 0, 0.5), 0 0 16px var(--accent-glow), 0 0 0 1.5px var(--accent-primary);
    
    /* Navigation & Frosted Glass */
    --nav-bg: rgba(11, 17, 24, 0.6);
    --nav-border: rgba(255, 255, 255, 0.08);
    
    /* Hero Atmosphere */
    --card-gradient-top: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    --hero-title-gradient: linear-gradient(135deg, var(--accent-primary) 0%, #38bdf8 100%);
    --hero-ambient-glow: radial-gradient(circle at 85% 15%, rgba(45, 212, 191, 0.12) 0%, transparent 65%),
                         radial-gradient(circle at 10% 80%, rgba(56, 189, 248, 0.08) 0%, transparent 50%);
    
    /* Controls & Chart */
    --chart-filter: invert(0.88) hue-rotate(170deg) brightness(0.92) contrast(1.15);
    --theme-toggle-bg: rgba(22, 35, 50, 0.95);
    --theme-toggle-border: rgba(255, 255, 255, 0.14);
    --theme-toggle-color: #f1f5f9;
}

/* ==========================================================================
   Global Resets & Base Styles
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    background-color: var(--bg-base);
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'DM Sans', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Smooth theme transitions */
body.theme-transition,
body.theme-transition *,
body.theme-transition *::before,
body.theme-transition *::after {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, fill 0.3s ease, stroke 0.3s ease !important;
}

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

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-base);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Focus Visibility Accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 3px;
    box-shadow: 0 0 0 4px var(--accent-glow) !important;
}

/* Global Link Reset - eliminates default browser & Bootstrap underlines */
a,
a:hover,
a:focus,
a:active,
a:visited {
    text-decoration: none;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
    color: var(--accent-primary-hover);
    text-decoration: none;
}

/* ==========================================================================
   Navigation Bar (.site-nav)
   ========================================================================== */

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px max(24px, calc((100vw - 1140px) / 2));
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: var(--shadow-sm);
    transition: transform 0.36s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease, border-color 0.3s ease;
}

@media (max-width: 768px) {
    .site-nav.is-hidden {
        transform: translateY(calc(-100% - 10px));
    }
}

.site-nav:focus-within {
    transform: translateY(0);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.brand-mark span {
    color: var(--accent-primary);
    transition: color 0.3s ease;
}

.brand-mark:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.nav-links {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-left: auto;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-family: 'DM Sans', 'Noto Sans TC', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links a:hover {
    color: var(--accent-primary);
    background: var(--accent-subtle);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.github-icon {
    width: 1.1em;
    height: 1.1em;
    display: inline-block;
    vertical-align: -0.15em;
    fill: currentColor;
}

/* Theme Toggle Button */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: 14px !important;
    padding: 0;
    border-radius: var(--radius-md) !important;
    background: var(--theme-toggle-bg) !important;
    border: 1px solid var(--theme-toggle-border) !important;
    color: var(--theme-toggle-color) !important;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.theme-toggle:hover {
    background: var(--bg-surface) !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 16px var(--accent-glow);
    transform: translateY(-2px) scale(1.05);
}

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

.theme-toggle i,
.theme-toggle .material-symbols-rounded {
    font-size: 1.25rem;
    color: var(--theme-toggle-color);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.25s ease;
}

.theme-toggle:hover i,
.theme-toggle:hover .material-symbols-rounded {
    color: var(--accent-primary);
    transform: rotate(20deg);
}

.theme-toggle .bi-sun-fill,
.theme-icon-light {
    color: #f59e0b !important;
}

[data-bs-theme="dark"] .theme-toggle .bi-sun-fill,
[data-bs-theme="dark"] .theme-icon-light {
    color: #fde047 !important;
}

.theme-icon-dark {
    color: #38bdf8 !important;
}

/* ==========================================================================
   Hero Section (#home)
   ========================================================================== */

.hero-section {
    position: relative;
    padding: 130px 0 80px;
    background-color: var(--bg-base);
    background-image: var(--hero-ambient-glow);
    border-bottom: 1px solid var(--border-subtle);
    overflow: hidden;
}

.hero-grid {
    position: relative;
    z-index: 2;
}

.hero-copy {
    max-width: 820px;
    margin-bottom: 48px;
}

.eyebrow {
    color: var(--accent-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-title {
    margin: 0 0 18px;
    color: var(--text-primary);
    font-family: 'DM Sans', 'Noto Sans TC', sans-serif;
    font-size: clamp(2.8rem, 6.5vw, 5.2rem);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -0.04em;
}

.hero-title em {
    color: var(--accent-primary);
    font-style: normal;
    background: var(--hero-title-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-section .lead {
    max-width: 600px;
    margin: 0 0 32px;
    color: var(--text-secondary);
    font-size: 1.15rem;
    line-height: 1.7;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0 0 36px;
}

.stat-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    min-width: 140px;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.stat-box:hover {
    transform: translateY(-3px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.stat-box .stat-icon {
    font-size: 1.85rem;
    color: var(--accent-primary);
    opacity: 0.85;
    transition: transform 0.25s ease, opacity 0.25s ease;
    flex-shrink: 0;
}

.stat-box:hover .stat-icon {
    transform: scale(1.12);
    opacity: 1;
}

.stat-box-info {
    display: flex;
    flex-direction: column;
}

.stat-box strong {
    color: var(--text-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.1;
}

.stat-box span {
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 4px;
}

/* Hero Actions Buttons */
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'DM Sans', 'Noto Sans TC', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    color: var(--accent-text);
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
    border-color: var(--accent-primary-hover);
    color: var(--accent-text);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-outline-secondary {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
}

.btn-outline-secondary:hover {
    background: var(--bg-surface-subtle);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Hero Contribution Card (Open Source Activity in Hero) */
.hero-contribution {
    width: 100%;
}

.contribution-card {
    padding: 30px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.contribution-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-gradient-top);
}

.contribution-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.contribution-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 22px;
}

.contribution-heading {
    margin: 0;
    color: var(--text-primary);
    font-family: 'DM Sans', 'Noto Sans TC', sans-serif;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.contribution-github-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.contribution-github-link:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: var(--accent-subtle);
    transform: translateY(-1px);
}

.contribution-graph-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.contribution-graph {
    display: block;
    width: 100%;
    min-width: 680px;
    height: auto;
    filter: var(--chart-filter);
    border-radius: 4px;
    transition: filter 0.3s ease;
}

/* ==========================================================================
   Capabilities Section (Focus Category Filters)
   ========================================================================== */

.capabilities-section {
    padding: 80px 0;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border-subtle);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 36px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-heading h2 {
    margin: 8px 0 0;
    color: var(--text-primary);
    font-family: 'DM Sans', 'Noto Sans TC', sans-serif;
    font-size: clamp(1.8rem, 3.8vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.section-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 500;
}

.capabilities-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.category-filter {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    min-height: 220px;
    padding: 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    color: inherit;
    cursor: pointer;
    position: relative;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.category-filter:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.category-filter.is-active {
    background: var(--bg-surface);
    border-color: var(--accent-primary);
    box-shadow: var(--active-card-shadow);
}

.capability-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
}

.capability-number {
    display: inline-block;
    color: var(--accent-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.capability-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
    font-size: 1.05rem;
    transition: all 0.25s ease;
}

.capability-icon .material-symbols-rounded {
    font-size: 1.25rem;
}

.category-filter:hover .capability-icon,
.category-filter.is-active .capability-icon {
    background: var(--accent-subtle);
    border-color: var(--border-hover);
    color: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-glow);
    transform: scale(1.05);
}

.capability-title {
    display: block;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-family: 'DM Sans', 'Noto Sans TC', sans-serif;
    font-size: 1.12rem;
    font-weight: 700;
}

.capability-desc {
    display: block;
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.55;
    margin: 0 0 16px;
    flex-grow: 1;
}

.capability-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    width: 100%;
}

.cap-tag {
    display: inline-block;
    padding: 3px 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.category-filter:hover .cap-tag,
.category-filter.is-active .cap-tag {
    border-color: var(--border-hover);
    color: var(--accent-primary);
    background: var(--accent-subtle);
}

/* ==========================================================================
   Featured Section (#featured)
   ========================================================================== */

.featured-section {
    padding: 96px 0;
    background: var(--bg-surface-subtle);
    border-bottom: 1px solid var(--border-subtle);
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.featured-card {
    display: flex;
    flex-direction: column;
    min-height: 260px;
    padding: 28px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.featured-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg);
}

.project-label {
    display: inline-block;
    align-self: flex-start;
    padding: 4px 10px;
    background: var(--accent-subtle);
    border-radius: var(--radius-full);
    color: var(--accent-primary);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.featured-card h3 {
    margin: 18px 0 10px;
    color: var(--text-primary);
    font-family: 'DM Sans', 'Noto Sans TC', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    word-break: break-word;
}

.featured-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.65;
}

.featured-card a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 24px;
    color: var(--accent-primary);
    font-family: 'DM Sans', 'Noto Sans TC', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.featured-card a i {
    transition: transform 0.2s ease;
}

.featured-card a:hover {
    color: var(--accent-primary-hover);
    transform: translateX(2px);
}

.featured-card a:hover i {
    transform: translate(2px, -2px);
}

/* ==========================================================================
   Projects Section (#projects)
   ========================================================================== */

#projects {
    padding: 96px 0 120px !important;
    background: var(--bg-base) !important;
}

.section-count {
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Search & Filter Tools */
.project-tools {
    display: flex;
    gap: 12px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.project-search-wrapper,
.language-filter-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.project-search-wrapper {
    flex: 1;
    min-width: 240px;
}

.project-search-icon,
.language-filter-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    font-size: 1.25rem;
    transition: color 0.2s ease;
    z-index: 1;
}

.project-search-wrapper input {
    width: 100%;
    padding-left: 44px !important;
}

.project-search-wrapper:focus-within .project-search-icon {
    color: var(--accent-primary);
}

.language-filter-wrapper select {
    width: 195px;
    padding-left: 42px !important;
}

.language-filter-wrapper:focus-within .language-filter-icon {
    color: var(--accent-primary);
}

.project-tools input,
.project-tools select {
    min-height: 46px;
    padding: 10px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'DM Sans', 'Noto Sans TC', sans-serif;
    font-size: 0.92rem;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-tools input::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

.project-tools input:focus,
.project-tools select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-glow);
    outline: none;
}

.clear-filters {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 46px;
    padding: 10px 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: 'DM Sans', 'Noto Sans TC', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-filters:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: var(--accent-subtle);
}

/* Project Repository Cards */
.repo-card {
    height: 100%;
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-sm) !important;
    position: relative;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s ease, box-shadow 0.25s ease !important;
}

.repo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-gradient-top);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.repo-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover) !important;
    box-shadow: var(--shadow-lg) !important;
}

.repo-card:hover::before {
    opacity: 1;
}

.repo-card .card-body {
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.repo-card .card-title {
    margin-bottom: 12px;
    font-family: 'DM Sans', 'Noto Sans TC', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
}

.repo-card .card-title a {
    color: var(--text-primary);
    text-decoration: none;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    overflow: hidden;
    word-break: break-all;
    transition: color 0.2s ease;
}

.repo-card .card-title a:hover {
    color: var(--accent-primary);
}

.repo-card .card-text {
    margin-bottom: 20px;
    color: var(--text-secondary) !important;
    font-size: 0.9rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    min-height: 45px;
}

.project-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    gap: 12px;
}

.language-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
}

.language-swift { background-color: #FA7343; }
.language-python { background-color: #3776AB; }
.language-javascript { background-color: #F7DF1E; }
.language-typescript { background-color: #3178C6; }
.language-html { background-color: #E34F26; }
.language-css { background-color: #1572B6; }
.language-default { background-color: #64748b; }

.repo-card .btn-outline-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
    background: transparent;
    text-decoration: none;
    transition: all 0.2s ease;
}

.repo-card .btn-outline-primary:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--accent-text);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.projects-status {
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
}

.projects-status.is-error {
    color: #f87171 !important;
}

.show-more-projects {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 24px auto 0;
    padding: 12px 28px;
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'DM Sans', 'Noto Sans TC', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.show-more-projects:hover {
    background: var(--bg-surface-subtle);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.projects-toggle-icon {
    font-size: 1.25em;
    width: 1.1em;
    height: 1.1em;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.25s ease;
}

.show-more-projects[aria-expanded="true"] .projects-toggle-icon {
    transform: rotate(180deg);
}

/* ==========================================================================
   Footer (.site-footer)
   ========================================================================== */

.site-footer {
    padding: 40px 0;
    background: var(--bg-surface-subtle);
    border-top: 1px solid var(--border-subtle);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-copy {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-repo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    transition: all 0.2s ease;
}

.footer-repo-btn .github-icon {
    width: 1.15rem;
    height: 1.15rem;
    vertical-align: middle;
}

.footer-repo-btn:hover {
    color: var(--accent-primary);
    border-color: var(--border-hover);
    background: var(--accent-subtle);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 992px) {
    .capabilities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .site-nav {
        padding: 8px 16px;
    }
    
    .nav-links {
        display: none !important;
    }
    
    .theme-toggle {
        width: 38px;
        height: 38px;
        margin-left: 0 !important;
    }
    
    .hero-section {
        padding: 100px 0 60px;
    }
    
    .hero-title {
        font-size: clamp(2.4rem, 10vw, 3.6rem);
    }
    
    .hero-stats {
        gap: 10px;
    }
    
    .stat-box {
        flex: 1;
        min-width: 100px;
        padding: 10px 12px;
        gap: 8px;
    }
    
    .stat-box .stat-icon {
        font-size: 1.4rem;
    }
    
    .stat-box strong {
        font-size: 1.4rem;
    }
    
    .contribution-card {
        padding: 20px;
    }
    
    .capabilities-grid {
        grid-template-columns: 1fr;
    }
    
    .category-filter {
        min-height: auto;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .project-tools {
        flex-direction: column;
    }
    
    .project-tools select {
        width: 100%;
    }
}

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