@font-face {
    font-family: "Lapis Grotesk";
    font-weight: 400;
    font-display: swap;
    src: url("/assets/fonts/schibsted-grotesk-latin-400-normal-fcf003d6.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212;
}

@font-face {
    font-family: "Lapis Grotesk";
    font-weight: 400;
    font-display: swap;
    src: url("/assets/fonts/schibsted-grotesk-latin-ext-400-normal-c724cdb8.woff2") format("woff2");
    unicode-range: U+0100-02AF, U+1E00-1EFF, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Lapis Grotesk";
    font-weight: 500;
    font-display: swap;
    src: url("/assets/fonts/schibsted-grotesk-latin-500-normal-629789fa.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212;
}

@font-face {
    font-family: "Lapis Grotesk";
    font-weight: 500;
    font-display: swap;
    src: url("/assets/fonts/schibsted-grotesk-latin-ext-500-normal-7991fdd1.woff2") format("woff2");
    unicode-range: U+0100-02AF, U+1E00-1EFF, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Lapis Grotesk";
    font-weight: 700;
    font-display: swap;
    src: url("/assets/fonts/schibsted-grotesk-latin-700-normal-40fd462b.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212;
}

@font-face {
    font-family: "Lapis Grotesk";
    font-weight: 700;
    font-display: swap;
    src: url("/assets/fonts/schibsted-grotesk-latin-ext-700-normal-87e6ca17.woff2") format("woff2");
    unicode-range: U+0100-02AF, U+1E00-1EFF, U+20A0-20C0, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* the stone (the same in both themes) */
    --lp-lapis: #23398c;
    --lp-lapis-hi: #2d47a8;
    --lp-lapis-deep: #172660;
    --lp-on-lapis: #eef1fc;
    --lp-on-lapis-dim: #aab5e2;
    --lp-calcite: #dfe6ff;
    --lp-stone-light: #5d79dc;
    --lp-stone-dark: #1b2c74;
    --lp-focus: #3651c2;
    --lp-draft: #9fb0f3;
    /* the sheets */
    --lp-sheet: #f7f8fc;
    --lp-sheet-2: #eef0f8;
    --lp-field: #ffffff;
    --lp-ink: #151b36;
    --lp-muted: #5a6284;
    --lp-line: #dcdfec;
    --lp-field-line: #878fb1;
    --lp-ok: #2f7d5b;
    --lp-danger: #b3261e;
    /* docs: links and code */
    --link: #23398c;
    --code-bg: #eef0f8;
    --code-keyword: #23398c;
    --code-type: #2d47a8;
    --code-string: #276b4d;
    --code-comment: #5a6284;
    --code-addition: #2a7152; /* lp-ok is 4.4:1 on code-bg */
    /* lp-on-lapis-dim is 4.0:1 on the bar's lit top (lp-lapis-hi): too faint for text this size */
    --on-bar-dim: #c3cbef;
    /* the current page and the chosen search result: a filled step, no stripe or ring */
    --selected: #dfe3f3;
    /* the edge a code block fades to while it scrolls sideways */
    --code-fade: rgb(23 38 96 / .16);
    /* the same, on the dark terminal of the home page (both themes) */
    --terminal-fade: rgb(0 0 0 / .45);
    --font-sans: "Lapis Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --radius-sm: 8px;
    --radius-md: 9px;
    --radius-lg: 14px;
    --radius-pill: 99px;
    --bar: 56px;
    --gutter: max(16px, env(safe-area-inset-left, 0px));
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --lp-focus: #8ea2f5;
        --lp-sheet: #161a2c;
        --lp-sheet-2: #1c2136;
        --lp-field: #11152a;
        --lp-ink: #e7eaf7;
        --lp-muted: #99a1c4;
        --lp-line: #2a3050;
        --lp-field-line: #626b9a;
        --lp-ok: #6cc59a;
        --lp-danger: #f08078;
        --link: #9fb0f3;
        --selected: #262c47;
        --code-fade: rgb(0 0 0 / .45);
        --code-bg: #1c2136;
        --code-keyword: #9fb0f3;
        --code-type: #aab5e2;
        --code-string: #6cc59a;
        --code-comment: #99a1c4;
        --code-addition: #6cc59a;
        color-scheme: dark;
    }

    .search-panel {
        background: var(--lp-sheet-2);
    }
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--bar) + 16px);
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--lp-sheet);
    color: var(--lp-ink);
    font: 400 16.5px/1.65 var(--font-sans);
}

a {
    color: var(--link);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

:focus-visible {
    outline: 2px solid var(--lp-focus);
    outline-offset: 2px;
    border-radius: 4px;
}

h1,
h2,
h3 {
    line-height: 1.15;
    text-wrap: balance;
}

p,
li {
    text-wrap: pretty;
}

/* Skip link: the first stop for the keyboard, shown only when focused */
.skip {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 50;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    background: var(--lp-field);
    color: var(--link);
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-200%);

    &:focus {
        transform: none;
    }
}

#content:focus {
    outline: none;
}

/* The bar: the editor's toolbar turned into the site's header */
.bar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(180deg, var(--lp-lapis-hi), var(--lp-lapis) 55%);
    color: var(--lp-on-lapis);
    box-shadow: 0 10px 34px -22px rgb(23 38 96 / .55), inset 0 -1px 0 rgb(255 255 255 / .08);

    :focus-visible {
        outline-color: var(--lp-calcite);
    }
}

.bar-inner {
    max-width: 1320px;
    margin: 0 auto;
    height: var(--bar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-inline: var(--gutter);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
    white-space: nowrap;
    color: inherit;
    text-decoration: none;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.brand-sub {
    font-weight: 400;
    color: var(--on-bar-dim);
}

.stone {
    width: 20px;
    height: 18px;
    flex: none;
    border-radius: 52% 48% 44% 56% / 58% 50% 50% 42%;
    background:
        radial-gradient(circle at 30% 34%, var(--lp-calcite) 0 .9px, transparent 1.3px),
        radial-gradient(circle at 66% 58%, var(--lp-calcite) 0 .8px, transparent 1.2px),
        radial-gradient(circle at 48% 76%, var(--lp-calcite) 0 .7px, transparent 1.1px),
        radial-gradient(circle at 36% 26%, var(--lp-stone-light), var(--lp-stone-dark) 70%);
    box-shadow: 0 0 0 1.5px rgb(255 255 255 / .55);
}

.bar-nav {
    display: flex;
    gap: 4px;

    a {
        color: var(--lp-on-lapis);
        text-decoration: none;
        font-size: 14.5px;
        padding: 7px 11px;
        border-radius: var(--radius-md);

        &:hover {
            background: rgb(255 255 255 / .09);
        }

        &[aria-current] {
            background: rgb(255 255 255 / .16);
        }
    }
}

/* Buttons */
.button {
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding: 0 20px;
    border-radius: var(--radius-md);
    background: var(--lp-lapis);
    color: var(--lp-on-lapis);
    font-weight: 700;
    text-decoration: none;

    &:hover {
        background: var(--lp-lapis-hi);
    }
}

.quiet-link {
    font-weight: 500;
    text-decoration: none;

    &:hover {
        text-decoration: underline;
    }
}

/* Home */
.home {
    max-width: 1180px;
    margin: 0 auto;
    padding: 48px var(--gutter) 96px;
    display: grid;
    gap: 56px;

    &.narrow {
        max-width: 760px;
        gap: 24px;
    }
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
}

.hero h1,
.home.narrow h1 {
    margin: 0;
    font-size: clamp(36px, 5.2vw, 60px);
    line-height: 1.02;
    font-weight: 700;
    letter-spacing: -.04em;
}

.lead {
    margin: 20px 0 0;
    max-width: 34em;
    font-size: 18.5px;
    line-height: 1.6;
    color: var(--lp-muted);
}

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

.terminal {
    margin: 0;
    min-width: 0;
    background: var(--lp-lapis-deep);
    color: var(--lp-on-lapis);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 80px -30px rgb(10 16 46 / .6);

    pre {
        margin: 0;
        padding: 26px 28px;
        overflow-x: auto;
        border-radius: inherit;
        font: 400 14.5px/1.85 var(--font-mono);
        /* the same scrolling shades as the docs' code blocks, on the terminal's own color */
        background:
            linear-gradient(to right, var(--lp-lapis-deep) 40%, transparent) left / 32px 100% no-repeat local,
            linear-gradient(to left, var(--lp-lapis-deep) 40%, transparent) right / 32px 100% no-repeat local,
            linear-gradient(to right, var(--terminal-fade), transparent) left / 14px 100% no-repeat scroll,
            linear-gradient(to left, var(--terminal-fade), transparent) right / 14px 100% no-repeat scroll;
    }

    .prompt {
        color: var(--lp-on-lapis-dim);
        user-select: none;
    }

    .muted {
        color: var(--lp-draft);
    }
}

.facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid var(--lp-line);
    border-bottom: 1px solid var(--lp-line);

    div {
        display: grid;
        gap: 6px;
        padding: 24px 24px 24px 0;

        & + div {
            padding-left: 24px;
            border-left: 1px solid var(--lp-line);
        }
    }

    strong {
        font-size: 16px;
    }

    span {
        font-size: 14.5px;
        line-height: 1.55;
        color: var(--lp-muted);
    }
}

/* Balanced columns: a short group (Extending) goes under another instead of leaving a column nearly empty */
.topics {
    columns: 4 200px;
    column-gap: 40px;
}

.topic {
    break-inside: avoid;
    padding-bottom: 32px;

    h2 {
        margin: 0 0 10px;
        font-size: 14px;
        font-weight: 700;
        color: var(--lp-muted);
    }

    ul {
        list-style: none;
        margin: 0;
        padding: 0;
        display: grid;
        gap: 4px;
    }

    a {
        text-decoration: none;
        font-weight: 500;

        &:hover {
            text-decoration: underline;
        }
    }
}

/* Docs page: contents | text | on this page */
.docs {
    max-width: 1320px;
    margin: 0 auto;
    padding: 40px var(--gutter) 96px;
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr) 200px;
    gap: 48px;
    align-items: start;
}

.docs-nav,
.toc {
    position: sticky;
    top: calc(var(--bar) + 32px);
    max-height: calc(100vh - var(--bar) - 64px);
    overflow-y: auto;
    overscroll-behavior: contain;
    font-size: 14px;
    line-height: 1.5;
}

.nav-group + .nav-group {
    margin-top: 22px;
}

.nav-title {
    margin: 0 0 6px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--lp-muted);
}

/* For contributors: apart at the end and quieter, it is not about building a site */
.nav-group {
    &.contributors {
        margin-top: 28px;
        padding-top: 20px;
        border-top: 1px solid var(--lp-line);
    }

    &.contributors a:not([aria-current]) {
        color: var(--lp-muted);
    }
}

.docs-nav ul,
.toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1px;
}

.docs-nav {
    a {
        display: block;
        padding: 5px 10px;
        border-radius: var(--radius-sm);
        color: var(--lp-ink);
        text-decoration: none;

        &:hover {
            background: var(--lp-sheet-2);
        }

        &[aria-current] {
            background: var(--selected);
            color: var(--link);
            font-weight: 700;
        }
    }
}

.toc {
    a {
        display: block;
        padding: 3px 0;
        color: var(--lp-muted);
        text-decoration: none;

        &:hover,
        &.current {
            color: var(--link);
        }

        &.current {
            font-weight: 700;
        }
    }
}

.nav-toggle {
    display: none;
}

.doc {
    min-width: 0;
    max-width: 46rem;
}

.doc-section {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--lp-muted);
}

.doc h1 {
    margin: 0 0 28px;
    font-size: clamp(34px, 4vw, 48px);
    line-height: 1.04;
    font-weight: 700;
    letter-spacing: -.035em;
}

/* Prose from Markdown */
.prose {
    & > :first-child {
        margin-top: 0;
    }

    h2 {
        margin: 2.4em 0 .6em;
        font-size: 26px;
        font-weight: 700;
        letter-spacing: -.02em;
    }

    h3 {
        margin: 1.9em 0 .5em;
        font-size: 18px;
        font-weight: 700;
        letter-spacing: -.01em;
    }

    h2,
    h3 {
        position: relative;
    }

    .anchor {
        position: absolute;
        left: -1.1em;
        padding-right: .3em;
        color: var(--lp-field-line);
        text-decoration: none;
        opacity: 0;
    }

    h2:hover .anchor,
    h3:hover .anchor,
    .anchor:focus {
        opacity: 1;
    }

    p,
    ul,
    ol {
        margin: 0 0 1.05em;
    }

    ul,
    ol {
        padding-left: 1.25em;
    }

    li {
        & + li {
            margin-top: .3em;
        }

        & > ul,
        & > ol {
            margin: .35em 0 0;
        }
    }

    strong {
        font-weight: 700;
    }

    blockquote {
        margin: 1.4em 0;
        padding: 12px 16px;
        border-radius: var(--radius-md);
        background: var(--lp-sheet-2);
        color: var(--lp-ink);

        p:last-child {
            margin-bottom: 0;
        }
    }

    /* Callouts: a tinted box with the same thin border all round (no stripe on one side of a rounded box); the title carries the color */
    .callout {
        margin: 1.4em 0;
        padding: 12px 16px;
        border: 1px solid color-mix(in srgb, var(--link) 22%, transparent);
        border-radius: var(--radius-md);
        background: color-mix(in srgb, var(--link) 6%, var(--lp-sheet));
        color: var(--lp-ink);
    }

    .callout-warning {
        border-color: color-mix(in srgb, var(--lp-danger) 30%, transparent);
        background: color-mix(in srgb, var(--lp-danger) 6%, var(--lp-sheet));
    }

    .callout-tip {
        border-color: color-mix(in srgb, var(--lp-ok) 30%, transparent);
        background: color-mix(in srgb, var(--lp-ok) 6%, var(--lp-sheet));
    }

    .callout-title {
        margin: 0 0 4px;
        font-weight: 700;
        font-size: .92em;
        color: var(--link);
    }

    .callout-warning .callout-title {
        color: var(--lp-danger);
    }

    .callout-tip .callout-title {
        color: var(--lp-ok);
    }

    .callout p:last-child {
        margin-bottom: 0;
    }

    code {
        font: 400 .86em/1.5 var(--font-mono);
        padding: .12em .36em;
        border-radius: 5px;
        background: var(--code-bg);
        white-space: nowrap;
    }

    /* Long inline spans (over 30 characters, marked by App\Docs) wrap, without affecting <pre><code> */
    :not(pre) > code.long {
        white-space: normal;
        overflow-wrap: break-word;
    }

    /* Wider than the column: a shade at the edge that has more code. The covers move with the text, the shades stay put (scrolling shadows) */
    pre {
        position: relative;
        margin: 1.3em 0 1.5em;
        padding: 18px 20px;
        overflow-x: auto;
        border-radius: var(--radius-md);
        font: 400 14px/1.6 var(--font-mono);
        background:
            linear-gradient(to right, var(--code-bg) 40%, transparent) left / 32px 100% no-repeat local,
            linear-gradient(to left, var(--code-bg) 40%, transparent) right / 32px 100% no-repeat local,
            linear-gradient(to right, var(--code-fade), transparent) left / 14px 100% no-repeat scroll,
            linear-gradient(to left, var(--code-fade), transparent) right / 14px 100% no-repeat scroll,
            var(--code-bg);

        code {
            padding: 0;
            background: none;
            font: inherit;
            white-space: inherit;
            overflow-wrap: normal;
        }
    }
}

.table-wrap {
    margin: 1.3em 0 1.6em;
    overflow-x: auto;
}

.prose {
    table {
        border-collapse: collapse;
        font-size: 15px;
    }

    th,
    td {
        text-align: left;
        vertical-align: top;
        padding: 9px 18px 9px 0;
        border-bottom: 1px solid var(--lp-line);
    }

    th {
        font-size: 13.5px;
        color: var(--lp-muted);
        font-weight: 700;
    }
}

.code-block {
    position: relative;
    margin: 1.3em 0 1.5em;
}

.prose .code-block pre {
    margin: 0;
}

.copy {
    position: absolute;
    top: 8px;
    right: 8px;
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--lp-line);
    border-radius: var(--radius-sm);
    background: var(--lp-sheet);
    color: var(--lp-muted);
    font: 500 12.5px var(--font-sans);
    cursor: pointer;
    opacity: 0;
    transition: opacity .12s;

    &:hover {
        color: var(--lp-ink);
        background: var(--lp-field);
    }
}

/* Hidden until the block is pointed at or the button focused: a faded label would be too faint to read */
.code-block:hover .copy,
.code-block:focus-within .copy,
.copy:focus-visible {
    opacity: 1;
}

/* Touch screens: always shown, so it gets a strip of its own above the code instead of covering the first line */
@media (hover: none) {
    .copy {
        opacity: 1;
    }

    .prose pre {
        padding-top: 46px;
    }
}

/* tempest/highlight */
.hl-keyword,
.hl-tag {
    color: var(--code-keyword);
    font-weight: 500;
}

.hl-type,
.hl-property,
.hl-attribute,
.hl-function,
.hl-generic {
    color: var(--code-type);
}

.hl-value,
.hl-string,
.hl-literal,
.hl-number {
    color: var(--code-string);
}

.hl-comment,
.hl-blur {
    color: var(--code-comment);
    font-style: italic;
}

.hl-variable {
    color: var(--lp-ink);
}

.hl-addition {
    color: var(--code-addition);
}

.hl-deletion {
    color: var(--lp-danger);
}

.pager {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid var(--lp-line);

    a {
        display: grid;
        gap: 2px;
        padding: 14px 16px;
        border-radius: var(--radius-md);
        background: var(--lp-sheet-2);
        text-decoration: none;
        font-weight: 700;

        &:hover {
            background: var(--lp-line);
        }
    }

    small {
        font-size: 12.5px;
        font-weight: 500;
        color: var(--lp-muted);
    }

    .next {
        grid-column: 2;
        text-align: right;
    }
}

.foot {
    margin-top: auto;
    border-top: 1px solid var(--lp-line);
}

.foot-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 28px var(--gutter) 40px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px 24px;
    color: var(--lp-muted);
    font-size: 14px;
}

.foot-links {
    display: flex;
    gap: 18px;
    flex-shrink: 0;
}

.foot-source {
    color: inherit;
    white-space: nowrap;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Search in the bar */
.search {
    position: relative;
    flex: 1 1 280px;
    max-width: 360px;
    margin-left: auto;
}

/* The field: a 14% white fill, no ring (fills, not outlines); the placeholder in calcite is 4.6:1 on it */
.search-input {
    width: 100%;
    height: 36px;
    padding: 0 58px 0 12px;
    border: 0;
    border-radius: var(--radius-md);
    background: rgb(255 255 255 / .14);
    color: var(--lp-on-lapis);
    font: 400 14.5px var(--font-sans);

    &::placeholder {
        color: var(--lp-calcite);
        opacity: 1;
    }

    /* transparent outline: invisible here, but forced-colors mode draws it (it drops the shadow) */
    &:focus {
        outline: 2px solid transparent;
        background: var(--lp-field);
        color: var(--lp-ink);
        box-shadow: 0 0 0 2px var(--lp-calcite);
    }

    &:focus::placeholder {
        color: var(--lp-muted);
    }

    &::-webkit-search-cancel-button {
        display: none;
    }
}

.search-key {
    position: absolute;
    right: 8px;
    top: 8px;
    height: 20px;
    min-width: 20px;
    display: grid;
    place-content: center;
    color: var(--lp-calcite);
    font: 500 12px var(--font-mono);
    white-space: nowrap;
    pointer-events: none;
}

.search-input:focus ~ .search-key {
    display: none;
}

.search-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    margin: 0;
    padding: 6px;
    list-style: none;
    max-height: min(420px, 70vh);
    max-height: min(420px, 70dvh);
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--lp-line);
    border-radius: var(--radius-lg);
    background: var(--lp-sheet);
    color: var(--lp-ink);
    box-shadow: 0 30px 80px -24px rgb(10 16 46 / .6);
}

.search-results {
    margin: 0;
    padding: 0;
    list-style: none;

    &:empty {
        display: none;
    }

    a {
        display: grid;
        gap: 1px;
        padding: 9px 12px;
        border-radius: var(--radius-sm);
        color: var(--lp-ink);
        text-decoration: none;
    }

    strong {
        font-weight: 700;
        font-size: 15px;
    }
}

.search-snippet {
    font-size: 13px;
    line-height: 1.45;
    color: var(--lp-muted);

    /* The searched words: ink and weight, no yellow marker */
    mark {
        background: none;
        color: var(--lp-ink);
        font-weight: 700;
    }
}

.search-results {
    a:hover {
        background: var(--lp-sheet-2);
    }

    [aria-selected="true"] a {
        background: var(--selected);
    }
}

.search-empty {
    margin: 0;
    padding: 10px 12px;
    color: var(--lp-muted);
    font-size: 14px;
}

/* No keyboard, no shortcut hint */
@media (hover: none) {
    .search-key {
        display: none;
    }

    .search-input {
        padding-right: 12px;
    }
}

/* Plugins directory */
.plugins-page {
    gap: 36px;
}

.plugins-head {
    h1 {
        margin: 0;
        font-size: clamp(34px, 4.8vw, 52px);
        line-height: 1.04;
        font-weight: 700;
        letter-spacing: -.035em;
    }

    .hero-actions {
        margin-top: 24px;
    }
}

.plugins-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--lp-line);
}

.plugin-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.plugin-chip {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 13px;
    border: 1px solid var(--lp-line);
    border-radius: var(--radius-pill);
    background: var(--lp-field);
    color: var(--lp-ink);
    font: 500 13.5px/1 var(--font-sans);
    text-decoration: none;
    cursor: pointer;

    &:hover {
        background: var(--lp-sheet-2);
    }

    &[aria-pressed="true"],
    &[aria-current="true"] {
        border-color: var(--lp-lapis);
        background: var(--lp-lapis);
        color: var(--lp-on-lapis);
    }
}

.plugins-search {
    flex: 1 1 220px;
    max-width: 300px;
    margin-left: auto;
}

.plugins-filter {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--lp-field-line);
    border-radius: var(--radius-md);
    background: var(--lp-field);
    color: var(--lp-ink);
    font: 400 14.5px var(--font-sans);

    &::placeholder {
        color: var(--lp-muted);
        opacity: 1;
    }

    &:focus {
        outline: 2px solid var(--lp-focus);
        outline-offset: -1px;
    }
}

.plugins-count {
    margin: 0;
    font-size: 13.5px;
    color: var(--lp-muted);
    white-space: nowrap;
}

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

.plugin-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px 24px;
    border: 1px solid var(--lp-line);
    border-radius: var(--radius-lg);
    background: var(--lp-field);

    &[hidden] {
        display: none;
    }
}

.plugin-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 12px;
}

.plugin-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;

    h2 {
        margin: 0;
        font-size: 19px;
        font-weight: 700;
        letter-spacing: -.015em;
    }
}

.plugin-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    background: var(--lp-sheet-2);
    color: var(--lp-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;

    &.official {
        background: var(--selected);
        color: var(--link);
    }

    &.abandoned {
        background: rgb(179 38 30 / .12);
        color: var(--lp-danger);
    }
}

.plugin-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    font: 500 12.5px var(--font-mono);
    color: var(--lp-muted);
}

.plugin-summary {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.55;
    color: var(--lp-muted);
}

.plugin-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;

    li {
        padding: 3px 9px;
        border-radius: var(--radius-sm);
        background: var(--lp-sheet-2);
        color: var(--lp-ink);
        font-size: 12.5px;
        font-weight: 500;
    }
}

.plugin-install {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 8px 8px 12px;
    border-radius: var(--radius-md);
    background: var(--code-bg);
    min-width: 0;

    code {
        overflow-x: auto;
        white-space: nowrap;
        font: 400 13.5px/1.4 var(--font-mono);
        color: var(--lp-ink);
    }
}

.plugin-copy {
    flex-shrink: 0;
    height: 30px;
    padding: 0 11px;
    border: 1px solid var(--lp-line);
    border-radius: var(--radius-sm);
    background: var(--lp-field);
    color: var(--lp-ink);
    font: 500 12.5px var(--font-sans);
    cursor: pointer;

    &:hover {
        background: var(--lp-sheet-2);
    }
}

.plugin-links {
    margin-top: auto;
    padding-top: 4px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    font-size: 14px;

    a {
        font-weight: 500;
        text-decoration: none;

        &:hover {
            text-decoration: underline;
        }
    }
}

.plugin-downloads {
    margin-left: auto;
    font-size: 13px;
    color: var(--lp-muted);
}

.plugins-empty {
    padding: 40px 24px;
    border: 1px dashed var(--lp-line);
    border-radius: var(--radius-lg);
    text-align: center;
    color: var(--lp-muted);

    &[hidden] {
        display: none;
    }

    p {
        margin: 0 0 14px;
    }
}

.plugins-reset {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 16px;
    border: 1px solid var(--lp-line);
    border-radius: var(--radius-md);
    background: var(--lp-field);
    color: var(--lp-ink);
    font: 500 14px var(--font-sans);
    text-decoration: none;
    cursor: pointer;

    &:hover {
        background: var(--lp-sheet-2);
    }
}

.lapis-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--lp-line);
}

.lapis-pagination-pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.lapis-pagination-prev,
.lapis-pagination-next,
.lapis-pagination-pages a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--lp-line);
    border-radius: var(--radius-md);
    background: var(--lp-field);
    color: var(--lp-ink);
    font: 500 14px/1 var(--font-sans);
    text-decoration: none;
}

.lapis-pagination a:hover {
    background: var(--lp-sheet-2);
}

.lapis-pagination [aria-current="page"] {
    border-color: var(--lp-lapis);
    background: var(--lp-lapis);
    color: var(--lp-on-lapis);
    font-weight: 700;
}

.lapis-pagination [aria-disabled="true"] {
    color: var(--lp-muted);
    background: var(--lp-sheet-2);
    opacity: .6;
}

.lapis-pagination-ellipsis {
    padding: 0 4px;
    color: var(--lp-muted);
}

.plugins-submit {
    padding: 28px;
    border: 1px solid var(--lp-line);
    border-radius: var(--radius-lg);
    background: var(--lp-sheet-2);

    h2 {
        margin: 0 0 8px;
        font-size: 20px;
    }

    p {
        margin: 0;
        max-width: 58ch;
        color: var(--lp-muted);
    }

    code {
        padding: 1px 5px;
        border-radius: 4px;
        background: var(--lp-field);
        color: var(--lp-ink);
        font: 400 .9em var(--font-mono);
    }
}

.plugins-submit-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
    margin-top: 20px;
}

/* The contents as a drawer on phones (hidden on wide screens) */
.nav-drawer-head,
.nav-backdrop {
    display: none;
}

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

    .toc {
        display: none;
    }
}

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

    /* a smaller shadow: the wide blur showed as a hard-edged patch around the stacked terminal */
    .terminal {
        box-shadow: 0 18px 40px -22px rgb(10 16 46 / .5);
    }

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

        div {
            &:nth-child(3) {
                padding-left: 0;
                border-left: 0;
            }

            &:nth-child(n+3) {
                border-top: 1px solid var(--lp-line);
            }
        }
    }

    .docs {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
        padding-top: 20px;
    }

    .nav-toggle {
        display: inline-flex;
        justify-self: start;
        height: 44px;
        align-items: center;
        padding: 0 16px;
        border: 0;
        border-radius: var(--radius-md);
        background: var(--lp-sheet-2);
        color: var(--lp-ink);
        font: 500 14px var(--font-sans);
        cursor: pointer;

        &:hover {
            background: var(--lp-line);
        }
    }

    .docs-nav {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 30;
        width: min(320px, 86vw);
        max-height: none;
        padding: 0 16px calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
        border-right: 1px solid var(--lp-line);
        scroll-padding-top: calc(var(--bar) + 8px);
        background: var(--lp-sheet);
        box-shadow: 0 0 60px -20px rgb(10 16 46 / .6);
        transform: translateX(-105%);
        visibility: hidden;
        transition: transform .2s ease, visibility 0s .2s;

        &.open {
            transform: none;
            visibility: visible;
            transition: transform .2s ease;
        }

        a {
            padding: 11px 10px;
        }
    }

    .nav-drawer-head {
        position: sticky;
        top: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: var(--bar);
        margin-bottom: 8px;
        background: var(--lp-sheet);
        font-weight: 700;
        border-bottom: 1px solid var(--lp-line);
    }

    .nav-close {
        width: 44px;
        height: 44px;
        border: 0;
        border-radius: var(--radius-md);
        background: none;
        color: var(--lp-ink);
        font: 400 26px/1 var(--font-sans);
        cursor: pointer;

        &:hover {
            background: var(--lp-sheet-2);
        }
    }

    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 25;
        background: rgb(10 16 46 / .45);

        &[hidden] {
            display: none;
        }
    }

    body.drawer-open {
        overflow: hidden;
    }

    .search {
        flex-basis: auto;
        max-width: none;
    }

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

    .search-panel {
        position: fixed;
        top: calc(var(--bar) + 6px);
        left: var(--gutter);
        right: var(--gutter);
        max-height: min(420px, calc(100dvh - var(--bar) - 20px));
    }

    .bar-nav {
        display: none;
    }

    .prose .anchor {
        display: none;
    }

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

    .plugins-search {
        flex-basis: 100%;
        max-width: none;
        margin-left: 0;
    }
}

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

        div {
            &,
            & + div {
                padding-left: 0;
                border-left: 0;
            }

            & + div {
                border-top: 1px solid var(--lp-line);
            }
        }
    }

    .pager {
        grid-template-columns: 1fr;

        .next {
            grid-column: auto;
            text-align: left;
        }
    }

    .brand-sub {
        display: none;
    }
}

/* Windows high contrast: backgrounds are dropped, so the chosen and current items get an outline */
@media (forced-colors: active) {
    .search-results [aria-selected="true"] a,
    .docs-nav a[aria-current],
    .plugin-chip[aria-pressed="true"],
    .plugin-chip[aria-current="true"],
    .lapis-pagination [aria-current="page"] {
        outline: 2px solid Highlight;
        outline-offset: -2px;
    }

    .toc a[aria-current] {
        text-decoration: underline;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
