:root {
    color-scheme: light;
    --page: #f5f7fb;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-strong: #ffffff;
    --surface-muted: #eef2f7;
    --text: #142033;
    --text-soft: #64748b;
    --border: rgba(148, 163, 184, 0.24);
    --brand: #0f766e;
    --brand-strong: #115e59;
    --brand-soft: rgba(13, 148, 136, 0.12);
    --success: #15803d;
    --warning: #b45309;
    --danger: #b91c1c;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 24px 60px rgba(15, 23, 42, 0.14);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --page: #09111f;
    --surface: rgba(15, 23, 42, 0.82);
    --surface-strong: #111c2e;
    --surface-muted: #172235;
    --text: #edf4ff;
    --text-soft: #9baac1;
    --border: rgba(148, 163, 184, 0.16);
    --brand: #2dd4bf;
    --brand-strong: #5eead4;
    --brand-soft: rgba(45, 212, 191, 0.12);
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #fb7185;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
    --shadow-hover: 0 24px 65px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--page);
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 15% 10%, rgba(45, 212, 191, 0.08), transparent 28rem),
        radial-gradient(circle at 92% 18%, rgba(59, 130, 246, 0.08), transparent 30rem),
        var(--page);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

.background-orb {
    position: fixed;
    z-index: -1;
    width: 24rem;
    height: 24rem;
    border-radius: 999px;
    filter: blur(80px);
    opacity: 0.18;
    pointer-events: none;
}

.background-orb-one {
    top: -8rem;
    left: -8rem;
    background: #14b8a6;
}

.background-orb-two {
    top: 14rem;
    right: -10rem;
    background: #3b82f6;
}

.topbar,
.page-shell,
.footer {
    width: min(1180px, calc(100% - 40px));
    margin-inline: auto;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 26px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--brand), var(--brand-strong));
    color: #fff;
    font-size: 1.15rem;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(15, 118, 110, 0.25);
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.brand small {
    color: var(--text-soft);
    font-size: 0.72rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    backdrop-filter: blur(18px);
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(13, 148, 136, 0.38);
}

.page-shell {
    padding-bottom: 56px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 30px;
    padding: clamp(34px, 6vw, 72px);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.95), rgba(15, 23, 42, 0.96)),
        var(--surface-strong);
    color: #fff;
    box-shadow: var(--shadow);
}

.eyebrow,
.section-kicker,
.project-category {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.eyebrow {
    color: rgba(255, 255, 255, 0.72);
}

.hero h1 {
    max-width: 760px;
    margin: 12px 0 14px;
    font-size: clamp(2.2rem, 5vw, 4.65rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.hero p {
    max-width: 680px;
    margin: 0;
    color: rgba(255, 255, 255, 0.74);
    font-size: clamp(1rem, 1.8vw, 1.18rem);
}

.hero-stats {
    display: grid;
    min-width: 180px;
    gap: 10px;
}

.stat-card {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    min-height: 68px;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
}

.stat-card strong {
    font-size: 1.55rem;
}

.stat-card span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.84rem;
}

.stat-online {
    justify-content: flex-start;
    align-items: center;
}

.pulse-dot,
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
}

.pulse-dot {
    color: #4ade80;
    box-shadow: 0 0 0 7px rgba(74, 222, 128, 0.12);
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 26px;
}

.search-box {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    color: var(--text-soft);
    backdrop-filter: blur(18px);
}

.search-box:focus-within {
    border-color: rgba(13, 148, 136, 0.55);
    box-shadow: 0 0 0 4px var(--brand-soft);
}

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.search-box input::placeholder {
    color: var(--text-soft);
}

.filter-buttons {
    display: flex;
    gap: 8px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    backdrop-filter: blur(18px);
}

.filter-button {
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    transition: background 180ms ease, color 180ms ease;
}

.filter-button:hover,
.filter-button.is-active {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin: 42px 0 18px;
}

.section-kicker,
.project-category {
    color: var(--brand);
}

.section-heading h2,
.getting-started h2 {
    margin: 5px 0 0;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    letter-spacing: -0.035em;
}

.results-count {
    color: var(--text-soft);
    font-size: 0.9rem;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.project-card {
    display: flex;
    min-height: 330px;
    flex-direction: column;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: rgba(13, 148, 136, 0.36);
    box-shadow: var(--shadow-hover);
}

.project-card[hidden] {
    display: none;
}

.tool-card {
    background:
        linear-gradient(145deg, var(--surface), var(--brand-soft)),
        var(--surface);
}

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

.project-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 16px;
    background: var(--surface-muted);
    font-size: 1.55rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--surface-muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.status-active {
    color: var(--success);
}

.status-beta,
.status-maintenance {
    color: var(--warning);
}

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

.project-card-body {
    flex: 1;
    padding-top: 28px;
}

.project-card h3 {
    margin: 8px 0 10px;
    font-size: 1.4rem;
    letter-spacing: -0.03em;
}

.project-card p {
    margin: 0;
    color: var(--text-soft);
}

.project-card-footer {
    padding-top: 26px;
    border-top: 1px solid var(--border);
}

.updated-at {
    max-width: 52%;
    color: var(--text-soft);
    font-size: 0.76rem;
}

.open-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 800;
    text-decoration: none;
    transition: transform 180ms ease, background 180ms ease;
}

.open-button:hover {
    transform: translateY(-1px);
    background: var(--brand-strong);
}

.empty-state,
.getting-started {
    margin-top: 20px;
    padding: 34px;
    border: 1px dashed rgba(13, 148, 136, 0.38);
    border-radius: var(--radius-lg);
    background: var(--surface);
    text-align: center;
}

.empty-state > span {
    display: block;
    font-size: 2rem;
}

.empty-state h2 {
    margin: 8px 0 4px;
}

.empty-state p,
.getting-started p {
    color: var(--text-soft);
}

.getting-started {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 24px;
    text-align: left;
}

.getting-started code,
.folder-example {
    border-radius: 10px;
    background: var(--surface-muted);
    color: var(--brand-strong);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.getting-started code {
    padding: 2px 6px;
}

.folder-example {
    padding: 14px 16px;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding-block: 24px 40px;
    border-top: 1px solid var(--border);
    color: var(--text-soft);
    font-size: 0.84rem;
}

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

    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .topbar,
    .page-shell,
    .footer {
        width: min(100% - 24px, 1180px);
    }

    .theme-toggle-text {
        display: none;
    }

    .hero {
        padding: 30px 24px;
    }

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

    .toolbar,
    .section-heading,
    .getting-started {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar {
        display: flex;
    }

    .filter-buttons {
        overflow-x: auto;
    }

    .filter-button {
        flex: 1;
        white-space: nowrap;
    }

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

    .project-card {
        min-height: 300px;
    }

    .getting-started {
        display: flex;
    }

    .folder-example {
        overflow-x: auto;
        white-space: nowrap;
    }
}

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