:root {
    --topbar: 56px;
    --ink: #11161f;
    --panel: #161d28;
    --panel-2: #1c2532;
    --line: #303c4e;
    --line-soft: #242e3d;
    --text: #c4ccd8;
    --muted: #929eaf;
    --dim: #768397;
    --bright: #e9edf3;
    --accent: #6aa8f7;
    --accent-soft: #8bbcff;
    --pass: #78c69d;
    --sans:
        'Sometype Sans', ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono:
        'Roboto Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo,
        Consolas, 'Liberation Mono', monospace;
    --theme-color: var(--accent);
    --base-background-color: var(--ink);
    --sidebar-background: var(--panel);
    --sidebar-border-color: var(--line);
    --code-theme-background: var(--panel);
}

* {
    box-sizing: border-box;
}

html,
body {
    background: var(--ink);
    color: var(--text);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.topbar {
    align-items: center;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
    display: flex;
    height: var(--topbar);
    justify-content: space-between;
    left: 0;
    padding: 0 20px;
    position: fixed;
    right: 0;
    top: 0;
    transition: transform 300ms cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 50;
}

body.demo-active .topbar {
    transform: translateY(-100%);
}

.menu-button {
    background: transparent;
    border: 0;
    cursor: pointer;
    display: none;
    height: var(--topbar);
    left: 0;
    padding: 19px 16px;
    position: absolute;
    top: 0;
    width: var(--topbar);
}

.menu-button span {
    background: var(--bright);
    display: block;
    height: 1.5px;
    margin-bottom: 4px;
    width: 16px;
}

.menu-button span:last-child {
    margin-bottom: 0;
}

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

.brand-logo {
    border-radius: 6px;
    flex: none;
    height: 28px;
    width: 28px;
}

.brand-name {
    font-size: 15px;
    font-weight: 680;
    letter-spacing: -0.025em;
}

.topbar-right {
    align-items: center;
    display: flex;
    gap: 16px;
}

.icon-link {
    align-items: center;
    color: var(--muted);
    display: flex;
    height: 24px;
    justify-content: center;
    width: 24px;
}

.icon-link:hover {
    color: var(--bright);
}

.icon-link svg {
    fill: currentColor;
    height: 17px;
    width: 17px;
}

/* Sidebar */

.sidebar {
    background: var(--panel);
    border-right: 1px solid var(--line);
    bottom: 0;
    height: auto;
    padding: 18px 14px 36px;
    scrollbar-color: #344258 transparent;
    scrollbar-width: thin;
    top: var(--topbar);
    width: 264px;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #344258;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar .app-name {
    display: none;
}

.sidebar .search {
    border: 0 !important;
    margin: 18px 4px 16px;
    padding: 0;
}

.sidebar .search .input-wrap {
    position: relative;
}

.sidebar .search input {
    background: var(--panel-2) !important;
    border: 1px solid var(--line) !important;
    border-radius: 17px;
    color: var(--bright) !important;
    font-family: var(--sans);
    font-size: 12px !important;
    height: 34px;
    padding: 0 36px 0 14px !important;
    width: 100%;
}

.sidebar .search:has(.results-panel.show) input {
    border-radius: 17px 17px 0 0;
}

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

.search input:focus,
.search input:focus-visible {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 1px var(--accent) !important;
    outline: 0;
}

.sidebar .search .results-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 0 0 17px 17px;
    margin-top: -1px !important;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.sidebar .search .matching-post {
    border-bottom: 1px solid var(--line-soft);
}

.search .matching-post:has(a[href='#/']) {
    display: none;
}

.search .matching-post:last-child {
    border-bottom: 0;
}

.sidebar .search .matching-post a {
    display: block;
    padding: 10px 12px;
    text-decoration: none;
}

.search .matching-post a:hover {
    background: var(--panel-2);
}

.sidebar .search .matching-post h2 {
    color: var(--bright);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.3;
    margin: 0 0 2px;
}

.sidebar .search .matching-post p {
    color: var(--muted);
    display: block;
    font-size: 11px;
    line-height: 1.35;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search .matching-post p strong {
    color: var(--accent);
}

.sidebar .search .clear-button {
    align-items: center;
    height: 28px;
    justify-content: center;
    position: absolute;
    right: 3px;
    top: 3px;
    width: 28px;
}

.sidebar .search .clear-button.show {
    display: flex;
}

.sidebar .search .clear-button svg {
    transform: scale(0.55);
}

.sidebar .search .clear-button svg circle {
    fill: var(--dim);
}

.sidebar-nav {
    padding-bottom: 24px;
}

.sidebar-nav ul {
    margin: 0;
    padding: 0;
}

.sidebar-nav ul li {
    list-style: none;
    margin: 0;
}

.sidebar-nav ul li a {
    border-radius: 2px;
    color: var(--muted);
    display: block;
    font-size: 13px;
    line-height: 1.35;
    padding: 5px 8px;
    text-decoration: none;
}

.sidebar-nav ul li a:hover {
    background: var(--panel-2);
    color: var(--bright);
    text-decoration: none;
}

.sidebar-nav ul li.active > a {
    background: var(--panel-2);
    color: var(--bright);
}

.sidebar-nav li > strong,
.sidebar-nav li > p > strong {
    color: var(--muted);
    display: block;
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 600;
    padding: 18px 8px 6px;
    text-transform: uppercase;
}

.sidebar-toggle {
    display: none;
}

body.landing-page .sidebar {
    display: none;
}

/* Content */

.content {
    left: 264px;
    padding: 0;
    top: var(--topbar);
}

.markdown-section {
    color: var(--text);
    font-size: 16px;
    line-height: 1.7;
    margin: 0 auto;
    max-width: 840px;
    padding: 64px 56px 112px;
}

body.landing-page .content {
    left: 0;
}

body.landing-page .markdown-section {
    max-width: 1040px;
}

body .markdown-section h1,
body .markdown-section h2,
body .markdown-section h3,
body .markdown-section h4 {
    color: var(--bright);
    font-weight: 640;
    letter-spacing: -0.025em;
}

body .markdown-section h1 {
    font-size: clamp(2.4rem, 4.6vw, 3.5rem);
    letter-spacing: -0.045em;
    line-height: 1.04;
    margin: 0 0 20px;
}

body .markdown-section h2 {
    border-top: 1px solid var(--line);
    font-size: 1.32rem;
    letter-spacing: -0.02em;
    margin: 64px 0 18px;
    padding-top: 24px;
}

body .markdown-section h3 {
    font-size: 1rem;
    margin: 32px 0 8px;
}

.markdown-section p {
    margin: 0 0 18px;
}

.markdown-section strong {
    color: var(--bright);
    font-weight: 620;
}

.markdown-section a {
    color: var(--accent-soft);
    text-decoration-color: color-mix(
        in srgb,
        var(--accent) 45%,
        transparent
    );
    text-underline-offset: 3px;
}

.markdown-section a:hover {
    color: var(--accent-soft);
    text-decoration-color: currentColor;
}

.markdown-section ul,
.markdown-section ol {
    margin: 0 0 20px;
    padding-left: 22px;
}

.markdown-section li {
    margin: 6px 0;
}

.markdown-section hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 40px 0;
}

.markdown-section blockquote {
    border-left: 2px solid var(--accent);
    color: var(--muted);
    margin: 24px 0;
    padding: 0 0 0 18px;
}

.markdown-section .markdown-alert {
    border-left: 4px solid var(--line);
    color: #d7dee8;
    margin: 28px 0;
    padding: 8px 16px;
}

.markdown-section .markdown-alert-warning {
    border-left-color: #d29922;
}

.markdown-section .markdown-alert p {
    margin: 0 0 8px;
}

.markdown-section .markdown-alert p:last-child {
    margin-bottom: 0;
}

.markdown-section .markdown-alert-title {
    align-items: center;
    color: #d29922;
    display: flex;
    font-weight: 600;
    gap: 8px;
    line-height: 1;
}

.markdown-section .markdown-alert-title svg {
    fill: currentColor;
    height: 16px;
    width: 16px;
}

.markdown-section code {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 2px;
    color: var(--bright);
    font-family: var(--mono);
    font-size: 0.84em;
    padding: 0.12em 0.34em;
}

.markdown-section pre {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 2px;
    margin: 24px 0;
    overflow-x: auto;
    padding: 18px 20px;
}

.markdown-section pre code {
    background: transparent;
    border: 0;
    color: #cbd5e1;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.7;
    padding: 0;
}

.markdown-section pre .token.comment,
.markdown-section pre .token.prolog,
.markdown-section pre .token.doctype,
.markdown-section pre .token.cdata {
    color: var(--dim);
}

.markdown-section pre .token.punctuation {
    color: var(--muted);
}

.markdown-section pre .token.property,
.markdown-section pre .token.tag,
.markdown-section pre .token.boolean,
.markdown-section pre .token.number,
.markdown-section pre .token.constant,
.markdown-section pre .token.symbol {
    color: #e6a7ad;
}

.markdown-section pre .token.selector,
.markdown-section pre .token.attr-name,
.markdown-section pre .token.string,
.markdown-section pre .token.char,
.markdown-section pre .token.builtin,
.markdown-section pre .token.inserted {
    color: var(--pass);
}

.markdown-section pre .token.operator,
.markdown-section pre .token.entity,
.markdown-section pre .token.url,
.markdown-section pre .language-css .token.string,
.markdown-section pre .style .token.string {
    color: #d4b86f;
}

.markdown-section pre .token.atrule,
.markdown-section pre .token.attr-value,
.markdown-section pre .token.keyword {
    color: var(--accent-soft);
}

.markdown-section pre .token.function,
.markdown-section pre .token.class-name {
    color: #b7a6e8;
}

.markdown-section pre .token.regex,
.markdown-section pre .token.important,
.markdown-section pre .token.variable {
    color: #df9f72;
}

.markdown-section table {
    background: var(--panel);
    border: 1px solid var(--line);
    border-collapse: separate;
    border-radius: 2px;
    border-spacing: 0;
    display: table;
    font-size: 14px;
    margin: 24px 0;
    overflow: hidden;
    width: 100%;
}

.markdown-section th {
    background: var(--panel-2);
    border: 0;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 600;
    padding: 10px 14px;
    text-align: left;
    text-transform: uppercase;
}

.markdown-section td {
    background: var(--panel);
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    padding: 12px 14px;
    vertical-align: top;
}

.markdown-section th + th,
.markdown-section td + td {
    border-left: 1px solid var(--line);
}

.markdown-section tbody tr:last-child td {
    border-bottom: 0;
}

.markdown-section tr,
.markdown-section tr:nth-child(2n) {
    background: transparent;
    border: 0;
}

.status-ok,
.status-no {
    white-space: nowrap;
}

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

.status-no {
    color: var(--muted);
}

.status-ok::before,
.status-no::before {
    background: currentColor;
    content: '';
    display: inline-block;
    height: 14px;
    margin-right: 6px;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
    vertical-align: -2px;
    width: 14px;
}

.status-ok::before {
    background: var(--pass);
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m5 12 4 4L19 6' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.status-no::before {
    background: var(--dim);
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='m6 6 12 12M18 6 6 18' stroke='black' stroke-width='2.25' stroke-linecap='round'/%3E%3C/svg%3E");
}

.markdown-section img {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 2px;
    display: block;
    height: auto;
    margin: 26px 0;
    max-width: 100%;
}

.markdown-section .rule-preview {
    background: #f5f7fa;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: block;
    height: 302px;
    margin: 24px 0;
    width: 100%;
}

.markdown-section .rule-diff {
    margin: 24px 0;
}

.rule-diff code span {
    display: block;
    margin: 0 -16px;
    padding: 0 16px;
}

.rule-diff .diff-add {
    background: #173b2a;
    color: #a7e5bd;
}

.rule-diff .diff-remove {
    background: #48252a;
    color: #f3b5ba;
}

/* Home */

.hero {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    min-height: calc(100svh - var(--topbar));
    padding: 56px 0 64px;
}

.hero-copy {
    max-width: 760px;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: normal;
    line-height: 1.2;
    max-width: 760px;
}

.hero .lede {
    color: var(--muted);
    font-size: 1.12rem;
    line-height: 1.6;
    margin: 0 0 30px;
    max-width: 620px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.scroll-cue {
    align-items: center;
    color: var(--muted) !important;
    display: inline-flex;
    font-size: 12px;
    gap: 8px;
    margin-top: 72px;
    text-decoration: none;
}

.scroll-cue svg {
    fill: none;
    height: 16px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
    width: 16px;
}

.scroll-cue:hover {
    color: var(--bright) !important;
}

.markdown-section .button {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 9999px;
    color: var(--bright);
    display: inline-flex;
    font-size: 13px;
    font-weight: 620;
    height: 40px;
    padding: 0 17px;
    text-decoration: none;
}

.markdown-section .button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--ink);
}

/* Live scan */

.scroll-demo {
    display: grid;
    grid-template-columns: 1fr;
    margin-left: calc(50% - 50vw);
    position: relative;
    width: 100vw;
}

.scroll-demo-sticky {
    align-self: start;
    background: #0d121b;
    border-bottom: 1px solid var(--line);
    border-top: 1px solid var(--line);
    grid-area: 1 / 1;
    height: 100svh;
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 60;
}

.demo-progress {
    background: var(--line-soft);
    bottom: 0;
    height: 2px;
    left: 0;
    overflow: hidden;
    position: absolute;
    right: 0;
    z-index: 2;
}

.demo-progress span {
    background: var(--accent);
    display: block;
    height: 100%;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 500ms cubic-bezier(0.77, 0, 0.175, 1);
    width: 100%;
}

.demo-browser {
    background: #080b13;
    height: 100%;
    min-width: 0;
    overflow: hidden;
}

.demo-browser iframe {
    border: 0;
    display: block;
    height: 100%;
    width: 100%;
}

.demo-intro {
    align-items: flex-end;
    backdrop-filter: blur(4px) saturate(0.72);
    background: rgb(8 11 19 / 48%);
    display: flex;
    inset: 0;
    padding: clamp(32px, 7vw, 112px);
    position: absolute;
    transition:
        opacity 300ms cubic-bezier(0.23, 1, 0.32, 1),
        visibility 300ms;
    z-index: 1;
}

body .markdown-section .demo-intro h2 {
    border: 0;
    font-size: clamp(3.25rem, 6.5vw, 6.5rem);
    font-weight: 700;
    letter-spacing: -0.055em;
    line-height: 0.9;
    margin: 0;
    padding: 0;
}

.scroll-demo:not([data-step='-1']) .demo-intro {
    opacity: 0;
    visibility: hidden;
}

.demo-stages {
    grid-area: 1 / 1;
    pointer-events: none;
    position: relative;
    width: 100%;
}

.demo-stages::after {
    content: '';
    display: block;
    height: 55svh;
}

.demo-stage {
    min-height: 100px;
    position: relative;
}

.demo-stage:first-child {
    min-height: 58svh;
}

.demo-stage-marker {
    height: 1px;
    left: 0;
    position: absolute;
    top: 50%;
    width: 1px;
}

.demo-stage:first-child .demo-stage-marker {
    top: 100%;
}

.demo-stage:nth-child(2) .demo-stage-marker {
    top: 25%;
}

.scan-example {
    margin: 48px 0 0;
}

.scan-example strong {
    color: var(--bright);
    font-size: 14px;
}

.scan-example p {
    color: var(--muted);
    font-size: 13px;
    margin: 4px 0 0;
}

.scan-example + pre {
    margin-top: 14px;
    padding: 12px 14px;
}

.commands {
    border-top: 1px solid var(--line);
    margin-top: 8px;
}

.command {
    border-bottom: 1px solid var(--line-soft);
    padding: 24px 0;
}

.command h3 {
    margin: 0 0 5px;
}

.command p {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 0;
    max-width: 620px;
}

.command pre {
    margin: 14px 0 0;
}

.command pre code {
    display: block;
    white-space: pre-wrap;
}

.categories {
    border: 1px solid var(--line);
    border-radius: 2px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 8px;
    overflow: hidden;
}

.category {
    align-items: baseline;
    border-bottom: 1px solid var(--line-soft);
    border-right: 1px solid var(--line-soft);
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding: 12px 14px;
    text-decoration: none;
}

.category:nth-child(3n) {
    border-right: 0;
}

.category:nth-last-child(-n + 3) {
    border-bottom: 0;
}

.category span {
    color: var(--bright);
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

.category small {
    color: var(--dim);
    font-family: var(--sans);
    font-size: 11px;
    white-space: nowrap;
}

.category:hover span {
    color: var(--accent);
}

.doc-footer {
    align-items: center;
    border-top: 1px solid var(--line);
    color: var(--dim);
    display: flex;
    font-family: var(--sans);
    font-size: 10px;
    justify-content: space-between;
    margin-top: 64px;
    padding-top: 20px;
    text-transform: uppercase;
}

.doc-footer a {
    color: var(--muted);
    text-decoration: none;
}

.doc-footer a:hover {
    color: var(--accent);
}

@media (min-width: 769px) {
    .sidebar-toggle {
        display: none;
    }
}

@media (max-width: 768px) {
    body.landing-page {
        height: auto;
        overflow: visible;
    }

    body.landing-page > main {
        overflow: visible;
    }

    .topbar {
        padding-left: 64px;
    }

    .menu-button {
        display: block;
    }

    body.landing-page .topbar {
        padding-left: 20px;
    }

    body.landing-page .menu-button {
        display: none;
    }

    body.close::after {
        background: rgba(10, 11, 13, 0.62);
        content: '';
        inset: var(--topbar) 0 0 264px;
        position: fixed;
        z-index: 10;
    }

    .brand-sub,
    .brand-divider {
        display: none;
    }

    .content {
        left: 0;
        padding-top: var(--topbar);
    }

    .markdown-section {
        padding: 36px 20px 72px;
    }

    body .markdown-section h1 {
        font-size: clamp(2rem, 9vw, 2.7rem);
    }

    .hero .lede {
        font-size: 1.02rem;
    }

    .hero {
        min-height: calc(100svh - var(--topbar));
        padding: 40px 0 48px;
    }

    .scroll-cue {
        margin-top: 48px;
    }

    .scroll-demo {
        margin-left: -20px;
        width: 100vw;
    }

    .scroll-demo-sticky {
        height: 100svh;
    }

    .demo-intro {
        backdrop-filter: blur(2px) saturate(0.8);
        padding: 32px 20px 48px;
    }

    body .markdown-section .demo-intro h2 {
        font-size: clamp(3.25rem, 16vw, 4.25rem);
        letter-spacing: -0.05em;
        line-height: 0.9;
    }

    .command {
        padding: 22px 0;
    }

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

    .category:nth-child(3n) {
        border-right: 1px solid var(--line-soft);
    }

    .category:nth-child(2n) {
        border-right: 0;
    }

    .category:nth-last-child(-n + 3) {
        border-bottom: 1px solid var(--line-soft);
    }

    .category:nth-last-child(-n + 2) {
        border-bottom: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .demo-intro,
    .demo-progress span {
        transition: opacity 200ms ease;
    }

    .topbar {
        transition: none;
    }
}

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

    .category,
    .category:nth-child(3n) {
        border-bottom: 1px solid var(--line-soft);
        border-right: 0;
    }

    .category:last-child {
        border-bottom: 0;
    }
}
