@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

/* ============================================================
   DESIGN TOKENS
   ============================================================ */

:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-strong: #f4f4f5;
    --surface-muted: #fafafa;
    --text: #0a0a0a;
    --text-soft: #737373;
    --border: #e5e5e5;
    --primary: #0a0a0a;
    --primary-deep: #000000;
    --primary-soft: rgba(0, 0, 0, 0.04);
    --secondary: #ffffff;

    /* Modern UI Additions */
    --accent-gradient: linear-gradient(135deg, #111827 0%, #4b5563 100%);
    --primary-glow: 0 10px 20px -10px rgba(10, 10, 10, 0.4);
    --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px -4px rgba(0, 0, 0, 0.06);

    /* Modern Softer Radii */
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --radius-pill: 9999px;
}

/* ============================================================
   BASE
   ============================================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text);
    line-height: 1.6;
    background: var(--bg);
    font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 1), transparent 60%);
    opacity: 0.6;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(0, 0, 0, 0.18);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 1rem;
}

main {
    flex: 1;
}

.text-muted {
    color: var(--text-soft);
}

.text-lg {
    font-size: 1.05rem;
    line-height: 1.7;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   NAVIGATION
   ============================================================ */

.site-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid rgba(229, 229, 229, 0.5);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

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

.logo {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    text-decoration: none;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

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

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    font-weight: 600;
    color: var(--text-soft);
    transition: color 0.18s ease;
}

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

.nav-btn {
    padding: 0.7rem 1rem;
    border-radius: var(--radius-pill);
    background: var(--text);
    color: #fff !important;
    box-shadow: var(--shadow-md);
}

.nav-btn:hover {
    color: #fff;
}

.nav-toggle {
    display: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.95rem;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 15;
}

/* ============================================================
   LAYOUT
   ============================================================ */

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 2rem 5% 4rem;
}

.max-width-xl {
    max-width: 1180px;
}

.page-spacing {
    padding-top: 5rem;
    /* Clears sticky nav */
    padding-bottom: 4rem;
}

/* ============================================================
   HERO (Modernized & Balanced)
   ============================================================ */

.hero {
    position: relative;
    max-width: 1020px;
    padding: 4rem 0 3.5rem;
    text-align: center;
}

.hero-content {
    max-width: 820px;
    margin: 0 auto 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* The modern status badge */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-pill);
    background: var(--surface-strong);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-soft);
    text-decoration: none;
    transition: all 0.2s ease;
    animation: fadeInUp 0.5s ease-out forwards;
}

.hero-badge:hover {
    background: #e5e5e5;
    color: var(--text);
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.hero h1 {
    max-width: 24ch;
    margin: 0 auto 1.25rem;
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.04em;
    font-weight: 800;
}

.hero p {
    max-width: 540px;
    margin: 0 auto 2.5rem;
    font-size: 1.15rem;
    color: var(--text-soft);
}

/* Specific styling for the clean hero search */
.hero-search-wrapper {
    max-width: 680px;
    margin: 0 auto 0;
    padding: 0.75rem 1.5rem;
    min-height: 64px;
}

.hero-search-wrapper .search-icon {
    color: var(--primary);
}

.hero-quick-links {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    animation: fadeInUp 0.5s ease-out 0.32s forwards;
    opacity: 0;
}

.hero-quick-links .text-soft {
    color: var(--text-soft);
    font-weight: 500;
}

.hero-quick-links .tag {
    text-decoration: none;
    cursor: pointer;
}

/* ============================================================
   HERO STATS CARDS
   ============================================================ */

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    margin: 3.5rem auto 0;
    max-width: 900px;
}

.stat {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    text-align: left;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.stat-icon.bg-blue {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.stat-icon.bg-green {
    background: #f0fdf4;
    color: #15803d;
    border-color: #bbf7d0;
}

.stat-icon.bg-purple {
    background: #faf5ff;
    color: #7e22ce;
    border-color: #e9d5ff;
}

.stat-text strong {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stat-text span {
    display: block;
    color: var(--text-soft);
    font-size: 0.92rem;
    line-height: 1.4;
}

/* ============================================================
   SEARCH
   ============================================================ */

.search-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0.5rem 0.5rem 0.5rem 1.5rem;
    min-height: 60px;
    border-radius: var(--radius-pill);
    border: 2px solid var(--border);
    background: #f4f4f5;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-wrapper:focus-within {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(10, 10, 10, 0.08), var(--shadow-md);
    transform: translateY(-1px);
}

.search-icon {
    flex-shrink: 0;
    color: var(--text-soft);
}

.search-bar {
    width: 100%;
    padding: 0.5rem 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 1.05rem;
    min-width: 0;
}

.search-bar::placeholder {
    color: #a3a3a3;
}

.search-bar:focus-visible {
    outline: none;
    box-shadow: none;
}

.inline-search {
    flex: 1 1 320px;
    max-width: none;
    margin: 0;
    width: auto;
}

/* ============================================================
   PAGE HEADERS
   ============================================================ */

.page-header,
.page-intro {
    display: grid;
    gap: 0.7rem;
    margin-bottom: 1.75rem;
    max-width: 760px;
}

.page-header h2,
.page-intro h2,
.form-container h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.form-intro {
    margin-bottom: 1.25rem;
}

.form-subtext {
    color: var(--text-soft);
}

/* ============================================================
   CONTROLS BAR
   ============================================================ */

.controls-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0;
    margin-bottom: 2rem;
    border: none;
    background: transparent;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 1.25rem;
    transform: translateY(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--text-soft);
    pointer-events: none;
}

/* ============================================================
   GRID & CARDS
   ============================================================ */

.grid,
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.25rem;
}

.card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 1.35rem;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid rgba(229, 229, 229, 0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.12);
    border-color: #d4d4d8;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.card h3 {
    margin-top: 0.25rem;
    margin-bottom: 0.55rem;
    letter-spacing: -0.02em;
    font-size: 1.15rem;
    line-height: 1.3;
}

.card p {
    flex-grow: 1;
    margin-bottom: 1rem;
    color: var(--text-soft);
    font-size: 0.95rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: auto;
    padding-top: 0.25rem;
}

.card-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

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

/* ============================================================
   TAGS & BADGES
   ============================================================ */

.tags,
.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    padding: 0.28rem 0.68rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    background: #f4f4f5;
    border: none;
    color: #52525b;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

.tag:hover {
    background: #e4e4e7;
    color: #18181b;
}

.badge,
.difficulty {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.28rem 0.68rem;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.badge-easy,
.difficulty {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.badge-medium {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.badge-hard {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent-gradient);
    border: none;
    color: #fff !important;
    box-shadow: var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -10px rgba(10, 10, 10, 0.5);
    filter: brightness(1.1);
}

.btn-secondary {
    background: #f4f4f5;
    color: var(--text) !important;
    border: 2px solid var(--border);
    box-shadow: none;
}

.btn-secondary:hover {
    background: #e5e5e5;
    border-color: #d4d4d8;
}

.btn-ghost {
    background: transparent;
    color: var(--text) !important;
    border: 1px solid transparent;
    box-shadow: none;
}

.btn-ghost:hover {
    background: var(--surface-strong);
    border-color: var(--border);
}

.btn-search {
    padding: 0.65rem 1.5rem;
    height: 100%;
}

.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
}

.btn-full {
    width: 100%;
}

/* ============================================================
   FORMS & FILTERS
   ============================================================ */

.form-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select,
.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    border: 2px solid var(--border);
    background: #f4f4f5;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.filter-control {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    padding: 1rem 3rem 1rem 1.25rem;
    border-radius: var(--radius-pill);
    border: 2px solid var(--border);
    background: #f4f4f5;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.2s ease;
    min-width: 180px;
}

.form-group textarea {
    border-radius: var(--radius-md);
    resize: vertical;
    min-height: 140px;
}

.form-group input:focus-visible,
.form-group textarea:focus-visible,
.form-group select:focus-visible,
.filter-control:focus-visible {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(10, 10, 10, 0.08);
    outline: none;
}

.form-group input.is-error,
.form-group select.is-error,
.form-group textarea.is-error {
    border-color: #ef4444;
}

.field-hint {
    display: block;
    margin-top: 0.45rem;
    color: var(--text-soft);
    font-size: 0.88rem;
}

.field-error {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: #b91c1c;
    font-weight: 500;
}

.form-message {
    min-height: 1.4rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.form-message.is-success {
    color: #166534;
}

.form-message.is-error {
    color: #b91c1c;
}

/* ============================================================
   STATUS STATES
   ============================================================ */

.status-panel {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    padding: 3rem 2rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.72);
    color: var(--text-soft);
    text-align: center;
}

.status-panel.is-error {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fef2f2;
}

.status-panel strong {
    color: var(--text);
    font-size: 1.05rem;
}

.status-panel.is-error strong {
    color: #991b1b;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.9);
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.5rem 5%;
}

.footer-brand {
    font-weight: 700;
    letter-spacing: -0.03em;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    list-style: none;
}

.footer-links a {
    color: var(--text-soft);
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
}

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

.footer-copy {
    width: 100%;
    margin-top: 0.25rem;
    color: var(--text-soft);
    font-size: 0.85rem;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

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

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hero .hero-badge {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

.hero h1 {
    animation: fadeInUp 0.5s ease-out 0.08s forwards;
    opacity: 0;
}

.hero p {
    animation: fadeInUp 0.5s ease-out 0.16s forwards;
    opacity: 0;
}

.hero .search-wrapper {
    animation: fadeInUp 0.5s ease-out 0.24s forwards;
    opacity: 0;
}

.hero-stats {
    animation: fadeInUp 0.5s ease-out 0.4s forwards;
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .hero .hero-badge,
    .hero h1,
    .hero p,
    .hero .search-wrapper,
    .hero-quick-links,
    .hero-stats,
    .spinner {
        animation: none;
        opacity: 1;
    }
}

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

@media (max-width: 960px) {
    .hero-stats {
        grid-template-columns: 1fr;
    }

    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
        justify-content: flex-start;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .select-wrapper,
    .filter-control {
        width: 100%;
    }
}

/* Compact/tablet adjustments to reduce visual bloat */
@media (max-width: 1024px) {
    .container {
        padding: 1.5rem 4%;
    }

    .page-spacing {
        padding-top: 4rem;
        padding-bottom: 2.5rem;
    }

    .hero {
        padding: 2.5rem 0 1.75rem;
    }

    .search-wrapper {
        max-width: 520px;
        padding-left: 1rem;
        padding-right: 0.75rem;
        min-height: 52px;
    }

    .grid, .projects-grid {
        gap: 1rem;
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .card { padding: 1rem; }
    .card:hover { transform: none; box-shadow: var(--shadow-md); }

    .btn { padding: 0.6rem 1rem; }

    .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
}

/* Ensure small screens stay compact and legible */
@media (max-width: 520px) {
    body::before { background-size: 48px 48px; opacity: 0.35; }

    .nav-container { padding: 0.5rem 3%; }
    .nav-btn { padding: 0.5rem 0.85rem; }

    .hero h1 { font-size: 1.65rem; }

    .search-wrapper { min-height: 44px; padding-left: 0.9rem; }

    .card { padding: 0.85rem; border-radius: 10px; }
    .card p { font-size: 0.95rem; }

    .tag { font-size: 0.72rem; padding: 0.2rem 0.5rem; }
    .badge, .difficulty { font-size: 0.66rem; padding: 0.24rem 0.5rem; }

    .form-container { padding: 0.85rem; }
    .form-group input, .form-group textarea, .form-group select { padding: 0.7rem 0.9rem; }

    .custom-select-trigger { padding: 0.6rem 0.9rem; }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.2rem;
        max-width: 28ch;
    }

    .hero p {
        font-size: 1rem;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        padding: 0.8rem 0 0;
    }

    .site-nav.nav-open .nav-links,
    .nav-links.active {
        display: flex;
    }

    .nav-container {
        flex-wrap: wrap;
    }

    .hero {
        padding-top: 3rem;
    }

    .search-wrapper {
        width: 100%;
    }

    .inline-search {
        max-width: none;
        flex-basis: 100%;
    }

    .form-container {
        padding: 1.35rem;
    }

    .footer-container {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Extra small devices: improve spacing, tap targets, and stacking */
@media (max-width: 480px) {
    .nav-container {
        padding: 0.6rem 4%;
    }

    .logo {
        font-size: 1.05rem;
    }

    .hero {
        padding: 2rem 0 1.5rem;
    }

    .hero h1 {
        font-size: 1.8rem;
        max-width: 36ch;
    }

    .hero p {
        font-size: 0.98rem;
        margin-bottom: 1rem;
    }

    .search-wrapper {
        min-height: 48px;
        padding-left: 1rem;
        padding-right: 0.75rem;
    }

    .search-bar { font-size: 1rem; }

    .btn { padding: 0.6rem 1rem; font-size: 0.95rem; }
    .btn-icon { width: 40px; height: 40px; }

    .card { padding: 1rem; }

    .grid,
    .projects-grid,
    .hero-stats { grid-template-columns: 1fr; }

    .form-container { padding: 1rem; }
    .form-group input, .form-group textarea, .form-group select, .form-input {
        padding: 0.8rem 0.9rem;
        font-size: 0.98rem;
    }

    .filter-group { gap: 0.5rem; }
    .filter-control { padding: 0.8rem 2.2rem 0.8rem 1rem; min-width: unset; }

    .custom-select-trigger { padding: 0.7rem 1rem; }
    .custom-select-options { top: calc(100% + 0.35rem); }

    .controls-bar { gap: 0.6rem; }

    .skip-link { left: 0.6rem; }
}

/* ============================================================
   CUSTOM MODERN DROPDOWNS (Overrides Native Select)
   ============================================================ */

/* Hide the old static arrow we made earlier */
.select-wrapper::after {
    display: none;
}

.custom-select {
    position: relative;
    min-width: 180px;
    width: 100%;
    user-select: none;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-pill);
    border: 2px solid var(--border);
    background: #f4f4f5;
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-select-trigger:hover,
.custom-select.open .custom-select-trigger {
    background: #ffffff;
    border-color: var(--primary);
}

.custom-select.open .custom-select-trigger svg {
    transform: rotate(180deg);
    transition: transform 0.2s ease;
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
    overflow: hidden;
}

.custom-select.open .custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    padding: 0.85rem 1.25rem;
    color: var(--text-soft);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.custom-option:hover {
    background: var(--surface-strong);
    color: var(--text);
}

.custom-option.selected {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

/* Mobile placeholder fix */
@media (max-width: 768px) {
    .search-bar::placeholder {
        font-size: 0.9rem;
        letter-spacing: -0.2px;
    }
}

@media (max-width: 480px) {
    .search-bar::placeholder {
        font-size: 0.8rem;
        letter-spacing: -0.3px;
    }
}