:root {
    color-scheme: light;
    --ink: #0b1220;
    --ink-soft: #334155;
    --muted: #64748b;
    --line: #dbe3ee;
    --surface: #ffffff;
    --surface-soft: #f4f7fb;
    --dark-panel: #0b1220;
    --header-bg: rgba(255, 255, 255, .94);
    --featured-bg: #edf3fa;
    --catalog-bg: #dfe8f2;
    --soft-fill: #f8fafc;
    --soft-hover: #f1f5f9;
    --divider-soft: #e8edf4;
    --focus-fill: #dbeafe;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --programming: #2563eb;
    --web-ui: #14b8a6;
    --data-config: #7c3aed;
    --systems-hardware: #ea580c;
    --visual-learning: #db2777;
    --esoteric: #ca8a04;
    --protocols: #0891b2;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .05);
    --shadow-md: 0 18px 50px rgba(15, 23, 42, .12);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --ink: #f8fafc;
    --ink-soft: #cbd5e1;
    --muted: #94a3b8;
    --line: #334155;
    --surface: #111827;
    --surface-soft: #07101f;
    --dark-panel: #020617;
    --header-bg: rgba(7, 16, 31, .94);
    --featured-bg: #111c2d;
    --catalog-bg: #0b1626;
    --soft-fill: #182235;
    --soft-hover: #1e293b;
    --divider-soft: #263247;
    --focus-fill: rgba(59, 130, 246, .24);
    --blue: #60a5fa;
    --blue-dark: #93c5fd;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .2), 0 10px 28px rgba(0, 0, 0, .16);
    --shadow-md: 0 18px 50px rgba(0, 0, 0, .32);
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--surface-soft);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
}

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

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

.category-programming { --category-color: var(--programming); }
.category-web-ui { --category-color: var(--web-ui); }
.category-data-config { --category-color: var(--data-config); }
.category-systems-hardware { --category-color: var(--systems-hardware); }
.category-visual-learning { --category-color: var(--visual-learning); }
.category-esoteric { --category-color: var(--esoteric); }
.category-protocols { --category-color: var(--protocols); }

/* Header */
.site-header {
    position: relative;
    z-index: 20;
    background: var(--header-bg);
    border-bottom: 1px solid rgba(219, 227, 238, .9);
    backdrop-filter: blur(16px);
}

.site-nav {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -.035em;
    text-decoration: none;
}

.brand > span:last-child > span,
.footer-brand > span:last-child {
    color: var(--blue);
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: #fff;
    background: var(--ink);
    font: 800 .85rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: -.08em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.theme-toggle {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    gap: 8px;
    padding: 4px 5px 4px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink-soft);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    color: var(--ink);
    border-color: #94a3b8;
}

.theme-toggle:focus-visible {
    outline: 3px solid var(--focus-fill);
    outline-offset: 2px;
}

.theme-toggle-label {
    font-size: .76rem;
    font-weight: 800;
}

.theme-toggle-track {
    position: relative;
    display: grid;
    width: 48px;
    height: 28px;
    grid-template-columns: 1fr 1fr;
    place-items: center;
    border-radius: 999px;
    color: #64748b;
    background: var(--soft-hover);
    font-size: .68rem;
    line-height: 1;
}

.theme-sun,
.theme-moon {
    position: relative;
    z-index: 1;
    transition: opacity .2s ease;
}

.theme-moon {
    opacity: .45;
}

.theme-toggle-thumb {
    position: absolute;
    z-index: 0;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(148, 163, 184, .3);
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 2px 7px rgba(15, 23, 42, .2);
    transition: transform .22s ease;
}

:root[data-theme="dark"] .theme-toggle-track {
    color: #bfdbfe;
    background: #1e3a5f;
}

:root[data-theme="dark"] .theme-sun {
    opacity: .45;
}

:root[data-theme="dark"] .theme-moon {
    opacity: 1;
}

:root[data-theme="dark"] .theme-toggle-thumb {
    transform: translateX(20px);
}

:root[data-theme="dark"] .site-header .brand-mark {
    background: var(--blue);
}

.nav-links a {
    padding: 9px 13px;
    border-radius: 9px;
    color: var(--ink-soft);
    font-size: .92rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--blue-dark);
    background: var(--soft-hover);
}

/* Hero */
.hero {
    position: relative;
    overflow: hidden;
    min-height: 570px;
    color: #fff;
    background: var(--dark-panel);
}

.hero-grid {
    position: absolute;
    inset: 0 0 0 48%;
    opacity: .22;
    background-image:
        linear-gradient(rgba(148, 163, 184, .25) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, .25) 1px, transparent 1px);
    background-size: 86px 86px;
    mask-image: linear-gradient(90deg, transparent, #000 25%);
}

.hero-grid::before,
.hero-grid::after {
    position: absolute;
    color: #60a5fa;
    font: 800 8rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.hero-grid::before {
    content: "{ }";
    top: 72px;
    left: 24%;
    color: #8b5cf6;
    transform: rotate(-5deg);
}

.hero-grid::after {
    content: "</>";
    right: 7%;
    bottom: 76px;
    color: #14b8a6;
    transform: rotate(5deg);
}

.hero-color-rail {
    position: absolute;
    inset: 0 auto 0 0;
    display: grid;
    width: 8px;
    grid-template-rows: repeat(7, 1fr);
}

.hero-color-rail span {
    background: var(--category-color);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding-block: 80px 70px;
}

.eyebrow,
.section-kicker {
    margin: 0 0 14px;
    color: var(--blue);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.hero .eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #93c5fd;
}

.prompt-mark {
    color: #60a5fa;
    font: 800 .95rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: -.08em;
}

.hero h1 {
    max-width: 800px;
    margin: 0;
    font-size: clamp(3.2rem, 7vw, 6.4rem);
    line-height: .94;
    letter-spacing: -.07em;
}

.hero h1 span {
    color: #60a5fa;
}

.hero-copy {
    max-width: 660px;
    margin: 28px 0 0;
    color: #cbd5e1;
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: .94rem;
    font-weight: 800;
    text-decoration: none;
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    background: #fff;
    color: #0b1220;
}

.button-primary:hover {
    background: #dbeafe;
}

.button-quiet {
    color: #e2e8f0;
    border-color: #334155;
    background: rgba(255, 255, 255, .04);
}

.button-quiet:hover {
    border-color: #64748b;
    background: rgba(255, 255, 255, .08);
}

.button-dark {
    color: #fff;
    background: var(--dark-panel);
}

.button-dark:hover {
    background: #1e293b;
}

.hero-stats {
    display: flex;
    gap: 0;
    margin: 48px 0 0;
}

.hero-stats div {
    min-width: 130px;
    padding-right: 32px;
    margin-right: 32px;
    border-right: 1px solid #334155;
}

.hero-stats div:last-child {
    border-right: 0;
}

.hero-stats dt {
    font-size: 1.55rem;
    font-weight: 800;
}

.hero-stats dd {
    margin: 2px 0 0;
    color: #94a3b8;
    font-size: .77rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* Shared section styles */
.featured-section,
.catalog-section {
    padding-block: 76px;
    clip-path: inset(0 -100vmax);
}

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

.section-heading h2 {
    margin: 0;
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    line-height: 1.05;
    letter-spacing: -.045em;
}

.section-heading > a {
    color: var(--blue-dark);
    font-size: .9rem;
    font-weight: 800;
    text-decoration: none;
}

.section-heading > a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Featured */
.featured-section {
    padding-bottom: 38px;
    background: var(--featured-bg);
    box-shadow: 0 0 0 100vmax var(--featured-bg);
}

.starting-point {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
    gap: 42px;
    align-items: center;
    margin-bottom: 72px;
    padding: clamp(28px, 5vw, 48px);
    border: 1px solid var(--line);
    border-radius: 20px;
    background: color-mix(in srgb, var(--surface) 78%, var(--featured-bg));
    box-shadow: var(--shadow-sm);
}

.starting-point-copy h2 {
    max-width: 680px;
    margin: 0;
    font-size: clamp(2rem, 4.5vw, 3.35rem);
    line-height: 1.02;
    letter-spacing: -.055em;
}

.starting-point-copy > p:not(.section-kicker) {
    max-width: 720px;
    margin: 20px 0 0;
    color: var(--ink-soft);
    font-size: .98rem;
    line-height: 1.75;
}

.starting-point-copy > p:last-child {
    margin-top: 14px;
}

.starting-point-copy strong {
    color: var(--blue-dark);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .92em;
}

.url-pattern {
    position: relative;
    overflow: hidden;
    padding: 30px;
    border: 1px solid #263247;
    border-radius: 16px;
    color: #f8fafc;
    background: var(--dark-panel);
    box-shadow: var(--shadow-md);
}

.url-pattern::after {
    content: "{ }";
    position: absolute;
    right: -14px;
    bottom: -24px;
    color: rgba(96, 165, 250, .12);
    font: 800 6rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.url-pattern > p {
    position: relative;
    z-index: 1;
    margin: 0 0 24px;
    font: 750 clamp(1.15rem, 2.5vw, 1.65rem)/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: -.04em;
}

.url-pattern > p span {
    color: #94a3b8;
}

.url-pattern > p strong {
    color: #60a5fa;
}

.url-pattern > div {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.url-pattern a {
    padding: 10px 12px;
    border: 1px solid #263247;
    border-radius: 9px;
    color: #cbd5e1;
    background: rgba(255, 255, 255, .035);
    font: 700 .78rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
    text-decoration: none;
}

.url-pattern a:hover,
.url-pattern a:focus-visible {
    color: #fff;
    border-color: #60a5fa;
    background: rgba(96, 165, 250, .12);
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.featured-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 102px;
    overflow: hidden;
    padding: 20px 48px 20px 24px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.featured-card:hover,
.featured-card:focus-visible {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--category-color) 40%, var(--line));
    box-shadow: var(--shadow-md);
}

.card-color-bar {
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: var(--category-color);
}

.language-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 13px;
    background: var(--soft-fill);
    border: 1px solid var(--divider-soft);
}

.language-icon img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.featured-card-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.featured-card-copy strong {
    font-size: 1.06rem;
}

.featured-card-copy small {
    overflow: hidden;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-url {
    overflow: hidden;
    color: var(--blue-dark);
    font: 750 .68rem/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: -.025em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-arrow {
    color: #94a3b8;
    font-size: 1.05rem;
    transition: color .18s ease, transform .18s ease;
}

.featured-card > .card-arrow {
    position: absolute;
    top: 18px;
    right: 18px;
}

.featured-card:hover .card-arrow,
.language-card:hover .card-arrow {
    color: var(--category-color);
    transform: translate(2px, -2px);
}

/* Catalog */
.catalog-section {
    padding-top: 48px;
    background: var(--catalog-bg);
    box-shadow: 0 0 0 100vmax var(--catalog-bg);
}

.catalog-heading {
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.catalog-heading > p {
    max-width: 370px;
    margin: 0;
    color: var(--muted);
}

.discovery-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: -2px 0 26px;
}

.discovery-filters > span {
    color: var(--muted);
    font-size: .69rem;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.discovery-filters > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.discovery-filter {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink-soft);
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    font-size: .78rem;
    font-weight: 800;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.discovery-filter:hover,
.discovery-filter:focus-visible {
    transform: translateY(-1px);
    border-color: #94a3b8;
}

.discovery-filter:focus-visible {
    outline: 3px solid var(--focus-fill);
    outline-offset: 1px;
}

.discovery-filter.is-active {
    color: #fff;
    border-color: var(--dark-panel);
    background: var(--dark-panel);
}

:root[data-theme="dark"] .discovery-filter.is-active {
    border-color: var(--blue);
    background: #1e3a5f;
}

.discovery-filter small {
    min-width: 20px;
    padding: 2px 5px;
    border-radius: 999px;
    color: inherit;
    background: rgba(148, 163, 184, .18);
    font-size: .66rem;
    font-variant-numeric: tabular-nums;
}

.catalog-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 30px;
    align-items: start;
}

.category-panel {
    position: sticky;
    top: 20px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.category-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px 14px;
    border-bottom: 1px solid var(--divider-soft);
}

.category-panel-heading h3 {
    margin: 0;
    font-size: .92rem;
}

.category-panel-heading > span {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.category-legend {
    display: grid;
    padding: 8px;
}

.legend-item {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 11px;
    min-height: 48px;
    padding: 7px 9px 7px 5px;
    border: 0;
    border-radius: 9px;
    color: var(--ink-soft);
    background: transparent;
    text-align: left;
}

.legend-item:hover,
.legend-item.is-active {
    color: var(--ink);
    background: var(--soft-hover);
}

.legend-item:focus-visible {
    outline: 3px solid #bfdbfe;
    outline-offset: 1px;
}

.legend-bar {
    width: 5px;
    flex: 0 0 auto;
    border-radius: 5px;
    background: var(--category-color);
}

.legend-all {
    background: linear-gradient(
        to bottom,
        var(--programming) 0 14.28%,
        var(--web-ui) 14.28% 28.56%,
        var(--data-config) 28.56% 42.84%,
        var(--systems-hardware) 42.84% 57.12%,
        var(--visual-learning) 57.12% 71.4%,
        var(--esoteric) 71.4% 85.68%,
        var(--protocols) 85.68% 100%
    );
}

.legend-copy {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.legend-copy strong {
    overflow: hidden;
    font-size: .78rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.legend-copy small {
    color: var(--muted);
    font-size: .72rem;
    font-variant-numeric: tabular-nums;
}

.catalog-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.search-field {
    position: relative;
    display: flex;
    align-items: center;
}

.search-field input,
.sort-field select {
    min-height: 50px;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--ink);
    background: var(--surface);
    outline: 0;
    box-shadow: var(--shadow-sm);
}

.search-field input {
    width: 100%;
    padding: 0 48px 0 46px;
}

.search-field input:focus,
.sort-field select:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px var(--focus-fill);
}

.search-icon {
    position: absolute;
    left: 18px;
    z-index: 1;
    width: 15px;
    height: 15px;
    border: 2px solid #64748b;
    border-radius: 50%;
}

.search-icon::after {
    content: "";
    position: absolute;
    right: -5px;
    bottom: -3px;
    width: 6px;
    height: 2px;
    background: #64748b;
    transform: rotate(45deg);
}

.search-field kbd {
    position: absolute;
    right: 14px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 1px solid var(--line);
    border-bottom-width: 2px;
    border-radius: 6px;
    color: #64748b;
    background: var(--soft-fill);
    font: 700 .76rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.sort-field {
    display: flex;
    align-items: center;
    gap: 9px;
}

.sort-field > span {
    color: var(--muted);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sort-field select {
    min-width: 170px;
    padding: 0 38px 0 14px;
}

.catalog-results-line {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 650;
}

.clear-filters {
    padding: 4px;
    border: 0;
    color: var(--blue-dark);
    background: transparent;
    font-size: .76rem;
    font-weight: 800;
}

.clear-filters:hover {
    text-decoration: underline;
}

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

.language-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 188px;
    overflow: hidden;
    flex-direction: column;
    padding: 20px 18px 16px 24px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.language-card:hover,
.language-card:focus-visible {
    z-index: 1;
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--category-color) 42%, var(--line));
    box-shadow: var(--shadow-md);
}

.language-card:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--category-color) 30%, transparent);
    outline-offset: 2px;
}

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

.language-card-topline {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.language-card-topline strong {
    font-size: 1.08rem;
    letter-spacing: -.02em;
}

.language-description {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 12px;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.language-card-url {
    display: block;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--divider-soft);
    font-size: .7rem;
}

.language-card-meta {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 16px;
    color: var(--muted);
    font-size: .66rem;
    font-weight: 750;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.language-card-meta span:first-child {
    color: var(--category-color);
}

.catalog-empty {
    padding: 70px 20px;
    border: 1px dashed var(--line);
    border-radius: 14px;
    text-align: center;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.catalog-empty > span {
    color: #94a3b8;
    font: 800 2rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.catalog-empty h3 {
    margin: 16px 0 6px;
}

.catalog-empty p {
    margin: 0;
    color: var(--muted);
}

.catalog-empty button {
    margin-top: 18px;
    padding: 9px 13px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--blue);
    font-weight: 800;
}

/* Lesson pages */
.lesson-page {
    padding-block: 34px 80px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 700;
}

.breadcrumb a {
    color: var(--blue-dark);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.lesson-header {
    position: relative;
    overflow: hidden;
    padding: clamp(28px, 6vw, 58px);
    border-radius: 20px;
    color: #fff;
    background: var(--dark-panel);
}

.lesson-color-bar {
    position: absolute;
    inset: 0 auto 0 0;
    width: 9px;
    background: var(--category-color);
}

.category-label {
    margin: 0 0 12px;
    color: color-mix(in srgb, var(--category-color) 60%, white);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.lesson-header h1 {
    margin: 0;
    font-size: clamp(3rem, 8vw, 6.5rem);
    line-height: .95;
    letter-spacing: -.065em;
}

.lesson-description {
    max-width: 760px;
    margin: 24px 0 0;
    color: #cbd5e1;
    font-size: clamp(1rem, 2vw, 1.18rem);
    line-height: 1.65;
}

.lesson-starting-point {
    display: flex;
    max-width: 760px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 30px;
    padding: 14px 14px 14px 18px;
    border: 1px solid #334155;
    border-radius: 12px;
    background: rgba(255, 255, 255, .045);
}

.lesson-starting-point > div {
    min-width: 0;
}

.lesson-starting-point > div > span {
    display: block;
    margin-bottom: 4px;
    color: #94a3b8;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.lesson-starting-point a {
    display: block;
    overflow: hidden;
    color: #93c5fd;
    font: 750 clamp(.85rem, 2vw, 1rem)/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lesson-starting-point a:hover,
.lesson-starting-point a:focus-visible {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.lesson-starting-point button {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 13px;
    border: 1px solid #475569;
    border-radius: 9px;
    color: #e2e8f0;
    background: #1e293b;
    font-size: .76rem;
    font-weight: 800;
}

.lesson-starting-point button:hover,
.lesson-starting-point button:focus-visible,
.lesson-starting-point button.is-copied {
    color: #fff;
    border-color: #60a5fa;
    background: #1d4ed8;
}

.lesson-layout {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    margin-top: 26px;
}

.language-facts {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.language-facts div {
    padding: 18px;
    border-bottom: 1px solid var(--divider-soft);
}

.language-facts div:last-child {
    border-bottom: 0;
}

.language-facts dt {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.language-facts dd {
    margin: 0;
    color: var(--ink-soft);
    font-size: .9rem;
    line-height: 1.6;
}

.language-facts a {
    color: var(--blue-dark);
    font-weight: 700;
    text-decoration: none;
}

.language-facts a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.code-example {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #263247;
    border-radius: 14px;
    background: #151b13;
    box-shadow: var(--shadow-md);
}

.code-example-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px;
    border-bottom: 1px solid #2d3748;
    background: #111827;
}

.code-example-header .section-kicker {
    margin-bottom: 5px;
    color: color-mix(in srgb, var(--category-color) 65%, white);
}

.code-example-header h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.3rem;
    letter-spacing: -.02em;
}

.code-example-header > span {
    padding: 6px 9px;
    border: 1px solid #334155;
    border-radius: 7px;
    color: #94a3b8;
    font: 700 .7rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.code-example pre[class*="language-"],
.code-example pre {
    max-height: 560px;
    margin: 0;
    padding: 28px;
    border-radius: 0;
    background: #151b13;
    font-size: clamp(.82rem, 1.6vw, 1rem);
    line-height: 1.7;
    overflow: auto;
}

.lesson-next {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.lesson-next a {
    color: var(--blue-dark);
    font-size: .86rem;
    font-weight: 800;
    text-decoration: none;
}

.lesson-next a:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Content pages */
.content-page {
    max-width: 820px;
    padding-block: 70px 100px;
}

.content-page h1 {
    margin: 0;
    font-size: clamp(2.7rem, 7vw, 5rem);
    line-height: 1;
    letter-spacing: -.06em;
}

.content-lede {
    margin: 24px 0 52px;
    color: var(--ink-soft);
    font-size: 1.2rem;
    line-height: 1.7;
}

.content-page section {
    margin-top: 38px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.content-page h2 {
    margin: 0 0 10px;
    font-size: 1.25rem;
}

.content-page section p {
    margin: 0;
    color: var(--ink-soft);
    line-height: 1.8;
}

.content-page a {
    color: var(--blue-dark);
}

.not-found {
    min-height: 65vh;
}

.not-found .button {
    color: #fff;
}

/* Footer */
.site-footer {
    color: #cbd5e1;
    background: var(--dark-panel);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 46px;
    align-items: start;
    padding-block: 48px 32px;
}

.footer-brand {
    color: #fff;
}

.footer-brand .brand-mark {
    color: var(--ink);
    background: #fff;
}

.footer-content > div:first-child > p {
    margin: 12px 0 0;
    color: #94a3b8;
    font-size: .85rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.footer-links a {
    color: #cbd5e1;
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
}

.footer-links a:hover {
    color: #fff;
}

.copyright {
    grid-column: 1 / -1;
    margin: 0;
    padding-top: 28px;
    border-top: 1px solid #263247;
    color: #64748b;
    font-size: .74rem;
}

@media (max-width: 1040px) {
    .featured-grid,
    .language-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .catalog-layout {
        grid-template-columns: 210px minmax(0, 1fr);
        gap: 20px;
    }
}

@media (max-width: 780px) {
    .site-shell {
        width: min(100% - 28px, 1180px);
    }

    .site-nav {
        min-height: 64px;
    }

    .nav-links a:first-child {
        display: none;
    }

    .hero {
        min-height: 0;
    }

    .hero-grid {
        inset: 0 0 0 30%;
        opacity: .14;
    }

    .hero-content {
        padding-block: 66px 56px;
    }

    .hero h1 br {
        display: none;
    }

    .hero-stats div {
        min-width: 0;
        padding-right: 18px;
        margin-right: 18px;
    }

    .featured-section,
    .catalog-section {
        padding-block: 54px;
    }

    .starting-point {
        grid-template-columns: 1fr;
        gap: 28px;
        margin-bottom: 54px;
    }

    .catalog-section {
        padding-top: 28px;
    }

    .section-heading,
    .catalog-heading {
        align-items: start;
        flex-direction: column;
        gap: 12px;
    }

    .catalog-layout {
        grid-template-columns: 1fr;
    }

    .discovery-filters {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .category-panel {
        position: static;
    }

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

    .catalog-toolbar {
        grid-template-columns: 1fr;
    }

    .sort-field {
        justify-content: space-between;
    }

    .sort-field select {
        flex: 1;
    }

    .lesson-layout {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 540px) {
    .brand {
        font-size: 1.08rem;
    }

    .brand-mark {
        width: 32px;
        height: 32px;
    }

    .nav-links a {
        padding-inline: 8px;
        font-size: .82rem;
    }

    .theme-toggle {
        padding-left: 5px;
    }

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

    .hero h1 {
        font-size: clamp(2.75rem, 15vw, 4.2rem);
    }

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

    .hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-stats {
        justify-content: space-between;
    }

    .hero-stats div {
        padding-right: 12px;
        margin-right: 12px;
    }

    .hero-stats dt {
        font-size: 1.25rem;
    }

    .hero-stats dd {
        font-size: .62rem;
    }

    .featured-grid,
    .language-grid {
        grid-template-columns: 1fr;
    }

    .featured-card {
        min-height: 90px;
    }

    .starting-point {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .url-pattern {
        padding: 24px 20px;
    }

    .lesson-starting-point {
        align-items: stretch;
        flex-direction: column;
    }

    .lesson-starting-point button {
        width: 100%;
    }

    .category-legend {
        grid-template-columns: 1fr;
    }

    .language-card {
        min-height: 164px;
    }

    .lesson-page {
        padding-top: 24px;
    }

    .lesson-header {
        border-radius: 14px;
    }

    .lesson-header h1 {
        font-size: clamp(2.7rem, 18vw, 4.5rem);
    }

    .code-example-header {
        align-items: start;
        flex-direction: column;
        gap: 12px;
    }

    .code-example pre[class*="language-"],
    .code-example pre {
        padding: 20px;
    }

    .lesson-next {
        align-items: start;
        flex-direction: column;
    }

    .footer-links {
        flex-direction: column;
        gap: 12px;
    }
}

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

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
