/* ==========================================================================
   MSDL — an index of official Windows releases
   Apple-quiet surfaces and type, with the catalogue's technical detail:
   numbered rows, monospaced facts, and a live status card.
   ========================================================================== */

/* ------------------------------------------------------------- typefaces */

/* UI text stays on the system stack; the monospaced face is self-hosted. */
@font-face {
    font-family: "JetBrains Mono";
    src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
    font-weight: 100 800;
    font-style: normal;
    font-display: swap;
}

/* --------------------------------------------------------------- tokens */

:root {
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text",
        "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
        "Liberation Mono", monospace;

    --bg: #fbfbfd;
    --bg-elevated: #ffffff;
    --glass: rgba(251, 251, 253, 0.72);
    --field: rgba(255, 255, 255, 0.92);
    --track: rgba(118, 118, 128, 0.1);
    --row-hover: rgba(0, 0, 0, 0.035);
    --row-active: rgba(0, 0, 0, 0.06);

    --text: #1d1d1f;
    --text-2: #5f5f66;
    --text-3: #6e6e73;

    --hairline: rgba(0, 0, 0, 0.08);
    --hairline-strong: rgba(0, 0, 0, 0.16);

    --accent: #0066cc;
    --accent-hover: #0059b3;
    --accent-soft: rgba(0, 102, 204, 0.1);
    --accent-ring: rgba(0, 102, 204, 0.26);
    --accent-fill: #0066cc;
    --accent-fill-hover: #0059b3;
    --badge-fg: #0066cc;

    --live: #2c9a63;
    --glow: rgba(0, 113, 227, 0.09);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 18px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.05), 0 16px 40px rgba(0, 0, 0, 0.07);

    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;

    --shell: 1024px;
    --gutter: 24px;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --fast: 160ms;

    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #000000;
    --bg-elevated: #1c1c1e;
    --glass: rgba(12, 12, 14, 0.66);
    --field: rgba(255, 255, 255, 0.07);
    --track: rgba(118, 118, 128, 0.24);
    --row-hover: rgba(255, 255, 255, 0.055);
    --row-active: rgba(255, 255, 255, 0.09);

    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #98989d;

    --hairline: rgba(255, 255, 255, 0.12);
    --hairline-strong: rgba(255, 255, 255, 0.22);

    --accent: #0a84ff;
    --accent-hover: #409cff;
    --accent-soft: rgba(10, 132, 255, 0.16);
    --accent-ring: rgba(10, 132, 255, 0.35);
    --accent-fill: #0071e3;
    --accent-fill-hover: #0068d6;
    --badge-fg: #7cc0ff;

    --live: #3ddc84;
    --glow: rgba(10, 132, 255, 0.1);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.5), 0 20px 50px rgba(0, 0, 0, 0.45);

    color-scheme: dark;
}

/* ----------------------------------------------------------------- base */

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 72px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.5;
    letter-spacing: -0.005em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(1000px 520px at 50% -10%, var(--glow), transparent 68%);
}

h1,
h2,
h3,
p,
ul,
dl,
dd,
dt {
    margin: 0;
}

ul {
    padding: 0;
    list-style: none;
}

a {
    color: var(--accent);
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer;
}

::selection {
    background: var(--accent-soft);
}

/* Component display rules must not defeat the hidden attribute. */
[hidden] {
    display: none !important;
}

.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.sprite {
    display: none;
}

.shell {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

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

.skip-link {
    position: absolute;
    left: 50%;
    top: -60px;
    z-index: 100;
    transform: translateX(-50%);
    padding: 10px 18px;
    border-radius: 999px;
    background: var(--text);
    color: var(--bg);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: top var(--fast) var(--ease);
}

.skip-link:focus-visible {
    top: 12px;
}

.icon {
    width: 18px;
    height: 18px;
    flex: none;
}

:where(a, button, input, select, [tabindex]):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* Fields draw their own ring. */
.search-input:focus-visible,
.filter-input:focus-within {
    outline: none;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes shimmer {
    from {
        background-position: 100% 0;
    }

    to {
        background-position: 0 0;
    }
}

@keyframes live-pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.45;
        transform: scale(0.82);
    }
}

/* --------------------------------------------------------------- header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--glass);
    border-bottom: 1px solid var(--hairline);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 52px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    width: 17px;
    height: 17px;
    color: var(--accent);
}

.brand-word {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}

.nav-link:hover {
    color: var(--text);
    background: var(--row-hover);
}

.nav-link .icon {
    width: 15px;
    height: 15px;
}

.theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-2);
    transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}

.theme-toggle:hover {
    color: var(--text);
    background: var(--row-hover);
}

.theme-icon-dark,
:root[data-theme="dark"] .theme-icon-light {
    display: none;
}

:root[data-theme="dark"] .theme-icon-dark {
    display: block;
}

/* ----------------------------------------------------------------- hero */

.hero {
    padding-top: clamp(48px, 7vw, 88px);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    align-items: center;
    gap: clamp(32px, 5vw, 64px);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--accent);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.eyebrow-index {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 20px;
    padding-inline: 6px;
    border: 1px solid var(--accent-soft);
    border-radius: 6px;
    background: var(--accent-soft);
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0;
}

.hero-title {
    margin-bottom: 20px;
    font-size: clamp(2.45rem, 5.4vw, 3.9rem);
    font-weight: 600;
    line-height: 1.04;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.hero-dim {
    display: block;
    color: var(--text-2);
}

.lede {
    max-width: 46ch;
    color: var(--text-2);
    font-size: clamp(1rem, 1.35vw, 1.125rem);
    line-height: 1.55;
    text-wrap: pretty;
}

/* ------------------------------------------------------------- manifest */

.manifest {
    padding: 18px 20px 0;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
    animation: rise 0.6s var(--ease) both;
}

.manifest-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 14px;
}

.pulse {
    width: 7px;
    height: 7px;
    flex: none;
    border-radius: 50%;
    background: var(--live);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 18%, transparent);
    animation: live-pulse 2.8s var(--ease) infinite;
}

.pulse.is-stale {
    background: #d97706;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.18);
    animation: none;
}

.manifest-title {
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.04em;
    color: var(--text-2);
}

.manifest-id {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-3);
}

.manifest-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--hairline);
    border-left: 1px solid var(--hairline);
}

.manifest-cell {
    padding: 12px 14px;
    border-right: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
}

.manifest-cell dt {
    margin-bottom: 4px;
    color: var(--text-3);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.manifest-cell dd {
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
    white-space: nowrap;
}

.manifest-cell dd[title] {
    cursor: help;
}

.manifest-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0 14px;
    color: var(--text-3);
    font-size: 11px;
}

.manifest-source {
    letter-spacing: 0.01em;
}

/* --------------------------------------------------------------- search */

.search {
    position: relative;
    max-width: 620px;
    margin: 36px auto 0;
}

.search-input {
    width: 100%;
    height: 54px;
    padding: 0 52px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    background: var(--field);
    color: var(--text);
    font: inherit;
    font-size: 16px;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease),
        background-color var(--fast) var(--ease);
    -webkit-appearance: none;
    appearance: none;
}

.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

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

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-ring);
}

.search-icon {
    position: absolute;
    left: 19px;
    top: 50%;
    width: 17px;
    height: 17px;
    transform: translateY(-50%);
    color: var(--text-3);
    pointer-events: none;
}

.search-hint {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    transition: opacity var(--fast) var(--ease);
}

.search-input:focus~.search-hint,
.search-input:not(:placeholder-shown)~.search-hint {
    opacity: 0;
}

.search-clear {
    position: absolute;
    right: 11px;
    top: 50%;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 999px;
    background: var(--track);
    color: var(--text-2);
    transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.search-clear:hover {
    color: var(--text);
    background: var(--hairline);
}

.search-clear[hidden] {
    display: none;
}

.search-clear .icon {
    width: 14px;
    height: 14px;
}

/* -------------------------------------------------------------- filters */

.filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 22px;
}

.filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 8px 15px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--text-2);
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease),
        border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.filter:hover {
    color: var(--text);
    background: var(--row-hover);
}

.filter[aria-pressed="true"] {
    border-color: var(--hairline);
    background: var(--bg-elevated);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.filter-count {
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--track);
    color: var(--text-3);
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}

.filter[aria-pressed="true"] .filter-count {
    background: var(--accent-soft);
    color: var(--badge-fg);
}

/* ------------------------------------------------------------ shortcuts */

.shortcuts {
    margin-top: 18px;
    color: var(--text-3);
    font-size: 11.5px;
    text-align: center;
}

.shortcuts .key {
    margin-right: 2px;
}

.shortcut-sep {
    margin-inline: 6px;
    opacity: 0.6;
}

.key {
    display: inline-grid;
    place-items: center;
    min-width: 19px;
    height: 19px;
    padding-inline: 5px;
    border: 1px solid var(--hairline);
    border-radius: 5px;
    background: var(--bg-elevated);
    color: var(--text-2);
    font-family: var(--font-mono);
    font-size: 10.5px;
    line-height: 1;
}

/* -------------------------------------------------------------- catalog */

.catalog {
    padding-top: clamp(28px, 4vw, 44px);
}

.catalog-meta {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 14px;
    padding: 0 4px 18px;
}

.catalog-meta .catalog-updated::before {
    content: "·";
    margin-right: 14px;
    color: var(--text-3);
}

.result-count {
    color: var(--text-2);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.catalog-updated {
    color: var(--text-3);
    font-family: var(--font-mono);
    font-size: 11.5px;
    white-space: nowrap;
}

/* ---------------------------------------------------------------- picker */

.picker-main {
    max-width: 640px;
    margin: 0 auto;
}

.picker-label {
    display: block;
    margin-bottom: 9px;
    color: var(--text-3);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
}

.select-wrap {
    position: relative;
}

.select {
    width: 100%;
    height: 56px;
    padding: 0 48px 0 20px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    background: var(--field);
    color: var(--text);
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.select:hover {
    border-color: var(--hairline-strong);
}

.select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-ring);
}

.select-chevron {
    position: absolute;
    right: 20px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    color: var(--text-3);
    pointer-events: none;
}

.quick-picks {
    margin-top: 28px;
    text-align: center;
}

.quick-pick-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.quick-pick {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}

.quick-pick span {
    color: var(--text-3);
    font-family: var(--font-mono);
    font-size: 11px;
}

.quick-pick:hover {
    border-color: var(--hairline-strong);
    background: var(--row-hover);
}

/* ------------------------------------------------------------- skeleton */

.skeleton {
    background: linear-gradient(90deg, var(--track) 25%, var(--row-hover) 37%, var(--track) 63%);
    background-size: 400% 100%;
    border-radius: 8px;
    animation: shimmer 1.5s ease infinite;
}

.skeleton-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px 20px;
    border-top: 1px solid var(--hairline);
}

.skeleton-row:first-child {
    border-top: 0;
}

.skeleton-line {
    height: 12px;
}

.skeleton-line.medium {
    width: 58%;
}

.skeleton-line.short {
    width: 32%;
}

/* ---------------------------------------------------------------- empty */

.empty {
    padding: 64px 24px;
    border: 1px dashed var(--hairline-strong);
    border-radius: var(--radius-lg);
    text-align: center;
}

.empty-title {
    margin-bottom: 6px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.empty-note {
    max-width: 46ch;
    margin: 0 auto 20px;
    color: var(--text-2);
    font-size: 14px;
}

/* --------------------------------------------------------------- detail */

.detail {
    max-width: 820px;
    margin-inline: auto;
    padding-top: clamp(28px, 4vw, 48px);
}

.detail-wrap {
    animation: rise 0.45s var(--ease) both;
}

.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 6px 12px 6px 9px;
    margin-left: -9px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--accent);
    font-size: 13.5px;
    font-weight: 500;
    transition: background-color var(--fast) var(--ease), opacity var(--fast) var(--ease);
}

.detail-back:hover {
    background: var(--accent-soft);
}

.detail-back .icon {
    width: 15px;
    height: 15px;
}

.detail-head {
    margin: 14px 0 26px;
}

.detail-kicker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--text-3);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: lowercase;
}

.detail-kicker .sep {
    opacity: 0.5;
}

.detail-title {
    margin-bottom: 24px;
    font-size: clamp(2rem, 4.6vw, 3rem);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.032em;
    text-wrap: balance;
}

.detail-title:focus {
    outline: none;
}

.facts-bar {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    overflow: hidden;
}

.fact-cell {
    padding: 12px 16px;
    border-left: 1px solid var(--hairline);
}

.fact-cell:first-child {
    border-left: 0;
}

.fact-cell dt {
    margin-bottom: 5px;
    color: var(--text-3);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.fact-cell dd {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 22px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- panel */

.panel {
    padding: clamp(20px, 3vw, 28px);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.panel-title {
    margin-bottom: 6px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.panel-note {
    max-width: 62ch;
    color: var(--text-2);
    font-size: 14px;
    line-height: 1.55;
}

.panel-head .group-count {
    flex: none;
    padding-top: 4px;
    white-space: nowrap;
}

.panel-tools {
    margin-bottom: 14px;
}

.filter-input {
    display: flex;
    align-items: center;
    gap: 9px;
    max-width: 300px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--hairline-strong);
    border-radius: var(--radius-sm);
    background: var(--field);
    transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

.filter-input .icon {
    width: 15px;
    height: 15px;
    color: var(--text-3);
}

.filter-input input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: none;
    color: var(--text);
    outline: none;
    font: inherit;
    font-size: 13.5px;
}

.filter-input input::placeholder {
    color: var(--text-3);
}

.panel-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

/* ------------------------------------------------------------ languages */

.langs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
    gap: 8px;
}

.lang {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text-2);
    font-size: 13.5px;
    text-align: left;
    transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease),
        color var(--fast) var(--ease);
}

.lang:hover {
    border-color: var(--hairline-strong);
    background: var(--row-hover);
    color: var(--text);
}

.lang:focus-visible {
    border-color: var(--accent);
}

.lang .icon {
    width: 14px;
    height: 14px;
    opacity: 0;
    transform: translateX(-3px);
    transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
}

.lang:hover .icon,
.lang:focus-visible .icon {
    opacity: 1;
    transform: none;
}

.lang-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------------------------------------------------------------- links */

.links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.links li {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.link-row {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 12px 16px;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    text-decoration: none;
    transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}

.link-row:hover {
    border-color: var(--hairline-strong);
    background: var(--row-hover);
}

.link-row .icon {
    color: var(--text-3);
}

.link-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 12.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ----------------------------------------------------------------- copy */

.copy {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--hairline);
    border-radius: 7px;
    background: var(--bg-elevated);
    color: var(--text-3);
    transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease),
        background-color var(--fast) var(--ease);
}

.copy:hover {
    color: var(--text);
    border-color: var(--hairline-strong);
}

.copy.is-copied {
    color: var(--live);
    border-color: color-mix(in srgb, var(--live) 40%, transparent);
}

.copy .icon {
    width: 14px;
    height: 14px;
}

.links .copy {
    align-self: center;
    width: 44px;
    height: 44px;
    border-color: transparent;
    border-radius: var(--radius-sm);
    background: var(--field);
}

.links .copy:hover {
    border-color: var(--hairline-strong);
    background: var(--bg-elevated);
}

.fact-cell .copy {
    border-color: transparent;
    background: transparent;
}

.fact-cell .copy:hover {
    border-color: var(--hairline);
    background: var(--row-hover);
}

.links .copy .icon {
    width: 16px;
    height: 16px;
}

/* ----------------------------------------------------------------- note */

.note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--hairline);
    color: var(--text-2);
    font-size: 12.5px;
    line-height: 1.5;
}

.note .icon {
    width: 15px;
    height: 15px;
    margin-top: 1px;
    color: var(--text-3);
}

/* ---------------------------------------------------------------- alert */

.alert {
    display: flex;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex: none;
    color: var(--accent);
}

.alert-title {
    margin-bottom: 4px;
    font-size: 15px;
    font-weight: 600;
}

.alert-body {
    color: var(--text-2);
    font-size: 14px;
    line-height: 1.5;
}

.alert-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

/* -------------------------------------------------------------- buttons */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: var(--accent-fill);
    color: #fff;
    font-size: 14.5px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--fast) var(--ease), transform var(--fast) var(--ease),
        opacity var(--fast) var(--ease);
}

.button:hover {
    background: var(--accent-fill-hover);
}

.button:active {
    transform: scale(0.985);
}

.button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.button-secondary {
    background: var(--track);
    color: var(--text);
}

.button-secondary:hover {
    background: var(--hairline);
}

.button .icon {
    width: 16px;
    height: 16px;
}

/* --------------------------------------------------------------- footer */

.site-footer {
    margin-top: clamp(64px, 9vw, 110px);
    padding-block: 26px 48px;
    border-top: 1px solid var(--hairline);
}

.footer-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-2);
}

.footer-brand .brand-word {
    font-size: 13px;
}

.footer-note {
    max-width: 54ch;
    color: var(--text-2);
    font-size: 12.5px;
    line-height: 1.55;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--hairline);
}

.footer-stamp {
    color: var(--text-3);
    font-size: 11px;
}

.footer-links {
    display: flex;
    gap: 18px;
    font-size: 12.5px;
}

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

.footer-links a:hover {
    color: var(--text);
    text-decoration: underline;
}

.noscript-banner {
    position: fixed;
    inset: auto 16px 16px;
    z-index: 90;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: var(--text);
    color: var(--bg);
    font-size: 14px;
    text-align: center;
}

/* ----------------------------------------------------------- responsive */

@media (max-width: 900px) {
    .hero-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }

    .manifest {
        max-width: 420px;
    }

    .lede {
        max-width: 58ch;
    }

    .search {
        margin-top: 32px;
    }
}

@media (max-width: 640px) {
    :root {
        --gutter: 20px;
    }

    body {
        font-size: 16px;
    }

    .header-inner {
        height: 50px;
    }

    .nav-link[href="#catalog"] {
        display: none;
    }

    .hero {
        padding-top: 40px;
    }

    .hero-title {
        font-size: clamp(2.2rem, 9vw, 2.8rem);
    }

    .search {
        margin-top: 28px;
    }

    .search-input {
        height: 50px;
        font-size: 16px;
    }

    .select {
        height: 52px;
        font-size: 15px;
    }

    .quick-picks {
        margin-top: 22px;
    }

    .manifest-cell dd {
        font-size: 12px;
    }

    .search-hint {
        display: none;
    }

    .filters {
        justify-content: flex-start;
        flex-wrap: nowrap;
        margin-inline: calc(var(--gutter) * -1);
        padding-inline: var(--gutter);
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
        mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
    }

    .filters::-webkit-scrollbar {
        display: none;
    }

    .shortcuts {
        display: none;
    }

    .row {
        grid-template-columns: 26px minmax(0, 1fr) auto;
        gap: 10px;
        padding: 13px 16px;
    }

    .facts {
        grid-column: 2 / -1;
        grid-row: 2;
        margin-top: -2px;
    }

    .go {
        grid-column: 3;
        grid-row: 1;
    }

    .flag {
        display: none;
    }

    .catalog-updated {
        display: none;
    }

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

    .fact-cell {
        border-top: 1px solid var(--hairline);
    }

    .fact-cell:nth-child(-n + 2) {
        border-top: 0;
    }

    .fact-cell:nth-child(odd) {
        border-left: 0;
    }

    .fact-cell:last-child {
        grid-column: 1 / -1;
    }

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

@media (max-width: 420px) {
    .hero-title {
        font-size: 2.05rem;
    }

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

/* ---------------------------------------------------------- chocolatey */

.hero-copy-wide {
    max-width: 780px;
}

.hero-copy-wide .lede {
    max-width: 62ch;
}

.choco {
    padding-top: 18px;
}

.choco-meta {
    margin-top: 8px;
    color: var(--text-3);
    font-size: 11px;
}

.code-block {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    background: var(--bg);
}

.code-block code {
    flex: 1;
    min-width: 0;
    color: var(--text-2);
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

.copy-lg {
    width: auto;
    min-width: 60px;
    height: 34px;
    flex: none;
    padding: 0 12px;
    font: inherit;
    font-size: 12.5px;
    font-weight: 500;
}

.copy.is-copied {
    color: var(--live);
    border-color: color-mix(in srgb, var(--live) 40%, transparent);
}

.choco-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.choco-cats {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.choco-cats::-webkit-scrollbar {
    display: none;
}

.cat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease),
        border-color var(--fast) var(--ease);
}

.cat:hover {
    color: var(--text);
    background: var(--row-hover);
}

.cat[aria-pressed="true"] {
    border-color: var(--hairline);
    background: var(--bg-elevated);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.cat[aria-pressed="true"] .filter-count {
    background: var(--accent-soft);
    color: var(--badge-fg);
}

.choco-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 8px;
}

.pkg {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 14px;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
    background: var(--bg);
    text-align: left;
    transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}

.pkg:hover {
    border-color: var(--hairline-strong);
    background: var(--row-hover);
}

.pkg[aria-pressed="true"] {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.pkg:focus-visible {
    border-color: var(--accent);
}

.pkg-check {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    flex: none;
    margin-top: 1px;
    border: 1px solid var(--hairline-strong);
    border-radius: 6px;
    color: transparent;
    transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.pkg-check svg {
    width: 12px;
    height: 12px;
}

.pkg[aria-pressed="true"] .pkg-check {
    border-color: var(--accent-fill);
    background: var(--accent-fill);
    color: #fff;
}

.pkg-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pkg-name {
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.pkg-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    color: var(--text-3);
    font-size: 11.5px;
}

.pkg-id {
    font-family: var(--font-mono);
    font-size: 11px;
}

.pkg-summary {
    display: -webkit-box;
    margin-top: 2px;
    overflow: hidden;
    color: var(--text-2);
    font-size: 12px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.command-bar {
    position: sticky;
    bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    padding: 12px 14px;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    background: var(--glass);
    box-shadow: var(--shadow-md);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
}

.command-text {
    flex: 1;
    min-width: 0;
}

.command-label {
    display: block;
    margin-bottom: 3px;
    color: var(--text-3);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

#command-output {
    display: block;
    overflow-wrap: anywhere;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 12.5px;
}

.command-actions {
    display: flex;
    gap: 8px;
}

@media (max-width: 640px) {
    .choco-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .command-bar {
        bottom: 10px;
    }

    .command-actions {
        width: 100%;
    }

    .command-actions .button {
        flex: 1;
    }
}

/* ---------------------------------------------------------- activation */

.act {
    padding-top: 18px;
}

.act-section + .act-section {
    margin-top: 34px;
}

.act-heading {
    margin-bottom: 12px;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

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

@media (max-width: 760px) {
    .act-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.act-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    color: inherit;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease),
        box-shadow var(--fast) var(--ease);
}

.act-card:hover {
    border-color: var(--hairline-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.act-shot {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-bottom: 1px solid var(--hairline);
    background: var(--track);
}

.act-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px 16px;
}

.act-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.act-blurb {
    color: var(--text-2);
    font-size: 13px;
    line-height: 1.5;
}

.act-link {
    margin-top: 8px;
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 500;
}

.hero-copy-wide a {
    color: var(--accent);
}

@media (max-width: 640px) {
    .act-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* activation ------------------------------------------------------------- */

.act-panel {
    padding: 18px 18px 16px;
}

.act-title {
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: 600;
}

.act-blurb {
    color: var(--text-2);
    font-size: 13px;
    line-height: 1.55;
}

.act-tag {
    margin-top: 10px;
    color: var(--text-3);
    font-family: var(--font-mono);
    font-size: 10.5px;
}

.act-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0 16px;
    padding-left: 18px;
    color: var(--text-2);
    font-size: 13.5px;
    line-height: 1.55;
    list-style: disc;
}

.act-list code {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text);
}

.term {
    overflow: hidden;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    background: #0d1117;
}

.term-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.term-bar span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ff5f57;
}

.term-bar span:nth-child(2) { background: #febc2e; }
.term-bar span:nth-child(3) { background: #28c840; }

.term-bar em {
    margin-left: 8px;
    color: #7d8590;
    font-family: var(--font-mono);
    font-size: 11px;
    font-style: normal;
}

.term-body {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    color: #d1d5db;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.7;
}

/* Touch devices get full-size targets. */
@media (pointer: coarse) {
    .theme-toggle {
        width: 44px;
        height: 44px;
    }

    .nav-link {
        padding-block: 12px;
    }

    .filter {
        min-height: 44px;
    }

    .detail-back {
        min-height: 44px;
    }

    .lang {
        min-height: 48px;
    }

    .copy {
        width: 40px;
        height: 40px;
    }
}

@media (hover: none) {
    .row:hover {
        background: transparent;
    }

    .row:hover .go {
        transform: none;
    }

    .lang .icon {
        opacity: 1;
        transform: none;
    }
}

/* ------------------------------------------------------- reduced motion */

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

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .pulse {
        animation: none;
    }
}

@media print {
    .site-header,
    .hero .search,
    .hero .filters,
    .hero .shortcuts,
    .site-footer {
        display: none;
    }

    body::before {
        display: none;
    }

    .row,
    .panel,
    .manifest {
        box-shadow: none;
    }
}
