@font-face {
    font-family: "TopGeo Lisp Heading";
    src: url("../fonts/BebasNeue-Bold.woff") format("woff");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

.tg-lisp {
    --lisp-ink: #182746;
    --lisp-muted: #485975;
    --lisp-line: #d1dced;
    --lisp-blue: #1c4d9e;
    --lisp-navy: #172a51;
    --lisp-sky: #9cdcf2;
    --lisp-paper: #f4f7fc;
    --lisp-gutter: clamp(18px, 4.2vw, 68px);
    color: var(--lisp-ink);
    background: #fff;
    font: 400 16px/1.58 "Segoe UI", Arial, sans-serif;
    overflow-wrap: anywhere;
}

.tg-lisp *, .tg-lisp *::before, .tg-lisp *::after { box-sizing: border-box; }
.tg-lisp [hidden] { display: none !important; }
.tg-lisp :focus-visible { outline: 3px solid #1b73b8; outline-offset: 4px; }
.tg-lisp ::selection { color: #0d2350; background: #a6ddf6; }
.tg-lisp h1, .tg-lisp h2, .tg-lisp h3, .tg-lisp p, .tg-lisp figure { margin: 0; }
.tg-lisp :is(h1, h2, h3) {
    font-family: "TopGeo Lisp Heading", "Segoe UI", Arial, sans-serif;
    font-weight: 700;
    letter-spacing: -0.012em;
    word-spacing: 0.065em;
}
.tg-lisp a { color: var(--lisp-blue); text-decoration: underline; text-underline-offset: 0.19em; }
.tg-lisp code { font: 600 0.89em/1.45 Consolas, "Liberation Mono", monospace; }
.tg-lisp h2, .tg-lisp h3 { color: inherit; line-height: 1.2; }
.tg-lisp h2 { font-size: clamp(26px, 3.5vw, 40px); }
.tg-lisp h3 { font-size: clamp(20px, 2.3vw, 26px); }
.tg-lisp [id] { scroll-margin-top: 110px; }
.tg-lisp__wrap { width: min(100% - 2 * var(--lisp-gutter), 1230px); margin-inline: auto; }

.tg-lisp__nav { background: #eff4fb; }
.tg-lisp__crumbs {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 13px 0;
    color: var(--lisp-muted);
    font-size: 13px;
    list-style: none;
    gap: 5px 13px;
}
.tg-lisp__crumbs li { display: flex; align-items: baseline; gap: 13px; }
.tg-lisp__crumbs li + li::before {
    content: "";
    width: 5px;
    height: 5px;
    border-top: 1px solid currentColor;
    border-right: 1px solid currentColor;
    transform: rotate(45deg);
    flex-shrink: 0;
    align-self: center;
}
.tg-lisp__crumbs a { text-decoration: none; }
.tg-lisp__crumbs a:hover { text-decoration: underline; }

.tg-lisp__hero {
    background: var(--lisp-navy);
    color: #f6f9ff;
}
.tg-lisp__hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(24px, 5vw, 74px);
    padding-block: clamp(34px, 5vw, 68px);
}
.tg-lisp__hero-inner--single { grid-template-columns: minmax(0, 740px); }
.tg-lisp__lead h1 {
    color: #fff;
    font-size: clamp(34px, 4.5vw, 69px);
    line-height: 1.04;
    text-wrap: balance;
}
.tg-lisp--detail .tg-lisp__lead h1 { font-size: clamp(31px, 3.55vw, 54px); }
.tg-lisp__lead > p:not(.tg-lisp__file) {
    margin-top: 22px;
    color: #d8e5fc;
    font-size: clamp(16px, 1.55vw, 20px);
    max-width: 54ch;
}
.tg-lisp__primary, .tg-lisp__secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 50px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 5px;
    font-weight: 700;
    text-decoration: none !important;
}
.tg-lisp .tg-lisp__primary { background: var(--lisp-sky); color: #0e2646; }
.tg-lisp .tg-lisp__primary:hover { background: #cbf1ff; }
.tg-lisp .tg-lisp__secondary { color: #eaf4ff; border-color: #7793bf; }
.tg-lisp .tg-lisp__secondary:hover { background: #253e6b; }
.tg-lisp__hero :focus-visible { outline-color: #c6efff; }
.tg-lisp__lead > .tg-lisp__primary, .tg-lisp__actions { margin-top: 27px; }
.tg-lisp__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tg-lisp__lead .tg-lisp__file {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 17px;
    margin-top: 13px;
    font-size: 14px;
    color: #c0d4f4;
}
.tg-lisp__preview {
    background: #20272f;
    border: 1px solid #627ca6;
    border-radius: 10px;
    overflow: hidden;
}
.tg-lisp .tg-lisp__preview-link { display: block; color: #e6efff; text-decoration: none; border-radius: 10px; }
.tg-lisp__preview img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 340px;
    object-fit: contain;
}
.tg-lisp__preview figcaption {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 12px;
    padding: 10px 16px;
    background: #203966;
    color: #e6efff;
    font-size: 14px;
}
.tg-lisp__preview-link:hover figcaption { background: #2b497e; }

.tg-lisp__index { padding-block: clamp(39px, 6vw, 79px); }
.tg-lisp__section-top { display: grid; grid-template-columns: 1fr 1.26fr; align-items: end; gap: 10px 35px; margin-bottom: 25px; }
.tg-lisp__section-top p { max-width: 59ch; color: var(--lisp-muted); }
.tg-lisp__filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(215px, 28%);
    gap: 16px;
    padding: 15px 18px 17px;
    background: #eaf1fc;
    border-radius: 7px;
}
.tg-lisp__filters label { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 650; }
.tg-lisp__search-field { position: relative; }
.tg-lisp__search-field > svg { position: absolute; inset: 12px auto auto 11px; color: var(--lisp-blue); pointer-events: none; }
.tg-lisp__filters input, .tg-lisp__filters select {
    width: 100%;
    height: 45px;
    border: 1px solid #879fbe;
    border-radius: 4px;
    background: #fff;
    color: var(--lisp-ink);
    font: inherit;
    padding: 4px 9px;
}
.tg-lisp__filters input { padding-inline-start: 39px; }
.tg-lisp__filters input::placeholder { color: #52627c; opacity: 1; }
.tg-lisp .tg-lisp__count { margin: 12px 0 7px; color: var(--lisp-muted); font-size: 14px; }
.tg-lisp__table table { width: 100%; margin: 0; border-spacing: 0; border-collapse: collapse; text-align: left; }
.tg-lisp__table :is(th, td) { padding: 13px 12px; border-bottom: 1px solid var(--lisp-line); text-align: left; vertical-align: top; }
.tg-lisp__table thead { background: #f1f5fc; }
.tg-lisp__table thead th { font-size: 14px; padding-block: 8px; vertical-align: middle; }
.tg-lisp__sort-field { display: none; }
.tg-lisp__sort-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 32px;
    padding: 0 3px;
    margin-inline-start: -3px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    text-align: start;
    cursor: pointer;
}
.tg-lisp__sort-button svg { flex: none; }
.tg-lisp__sort-button:hover { color: var(--lisp-blue); background: #e1eafa; }
.tg-lisp__table th[aria-sort] .tg-lisp__sort-button { color: var(--lisp-blue); }
.tg-lisp__table th[aria-sort="ascending"] .tg-lisp__sort-down,
.tg-lisp__table th[aria-sort="descending"] .tg-lisp__sort-up { opacity: 0.24; }
.tg-lisp__sort-button:not([hidden]) + span { display: none; }
.tg-lisp__table tbody th { width: 28%; font-weight: 600; }
.tg-lisp__table tbody td:nth-child(2) { width: 42%; color: var(--lisp-muted); }
.tg-lisp__table td:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tg-lisp__table tr:hover td, .tg-lisp__table tr:hover th[scope="row"] { background: #f7faff; }
.tg-lisp__table th a { display: inline-block; padding-block: 2px; }
.tg-lisp__category {
    display: inline-block;
    color: #194273;
    background: #dbeaff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 650;
}
.tg-lisp__category[data-category="points"] { color: #16584f; background: #dbf1eb; }
.tg-lisp__category[data-category="text"] { color: #684518; background: #fae9cb; }
.tg-lisp__empty { padding: 23px 15px; background: var(--lisp-paper); }
.tg-lisp__empty button { margin-top: 8px; color: var(--lisp-blue); text-decoration: underline; padding: 7px 0; font: inherit; background: transparent; cursor: pointer; }

.tg-lisp__guides { background: #edf4fc; }
.tg-lisp__guides-inner {
    display: grid;
    grid-template-columns: 1fr 1.26fr;
    gap: 10px 35px;
    padding-block: clamp(30px, 5vw, 60px);
}
.tg-lisp__guide {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--lisp-line);
    padding: 9px 0;
    min-height: 46px;
}
.tg-lisp__guide svg { flex-shrink: 0; }

.tg-lisp__article {
    display: grid;
    grid-template-columns: minmax(175px, 1fr) minmax(0, 3fr);
    gap: clamp(25px, 5vw, 74px);
    align-items: start;
    padding-block: clamp(38px, 6vw, 76px);
}
.tg-lisp__subnav { position: sticky; top: 105px; border-top: 3px solid var(--lisp-blue); padding-top: 9px; }
.tg-lisp__subnav ul { list-style: none; margin: 0; padding: 0; }
.tg-lisp__subnav a { display: block; padding: 7px 0; }
.tg-lisp__body { max-width: 76ch; }
.tg-lisp__body section + section { margin-top: 51px; }
.tg-lisp__body h2, .tg-lisp__usage h3 { margin-bottom: 13px; }
.tg-lisp__body p + p, .tg-lisp__usage ul, .tg-lisp__usage ol { margin-top: 12px; }
.tg-lisp__usage h3 { margin-top: 27px; }
.tg-lisp__usage img { max-width: 100%; height: auto; }
.tg-lisp__steps { list-style: none; counter-reset: install; margin: 6px 0 10px; padding: 0; }
.tg-lisp__steps li { position: relative; padding: 13px 0 13px 42px; border-bottom: 1px solid var(--lisp-line); min-height: 52px; }
.tg-lisp__steps li::before {
    counter-increment: install;
    content: counter(install);
    position: absolute;
    inset: 12px auto auto 0;
    width: 29px;
    height: 29px;
    display: grid;
    place-content: center;
    background: #e3effd;
    border-radius: 4px;
    color: #184781;
    font: 650 15px/1 "Segoe UI", Arial, sans-serif;
}
.tg-lisp__help { display: flex; flex-wrap: wrap; gap: 5px 20px; font-size: 15px; }
.tg-lisp__usage .tg-lisp__modes {
    background: #f3f7fd;
    border: 1px solid var(--lisp-line);
    border-radius: 6px;
    margin: 15px 0;
}
.tg-lisp__modes > div { display: grid; grid-template-columns: minmax(0, 0.9fr) 1.4fr; gap: 4px 20px; padding: 12px 15px; }
.tg-lisp__modes > div + div { border-top: 1px solid var(--lisp-line); }
.tg-lisp__modes dt, .tg-lisp__modes dd { margin: 0; }
.tg-lisp__modes dt { color: var(--lisp-blue); }
.tg-lisp__related { padding-block: clamp(35px, 5vw, 67px); background: var(--lisp-paper); }
.tg-lisp__related-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 19px; }
.tg-lisp__related ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; gap: 14px; }
.tg-lisp__related li { display: flex; }
.tg-lisp__related li a {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 17px 16px;
    gap: 5px;
    background: #fff;
    border: 1px solid var(--lisp-line);
    border-radius: 6px;
    text-decoration: none;
}
.tg-lisp__related li a:hover { border-color: var(--lisp-blue); background: #f8fbff; }
.tg-lisp__related li code { display: block; }
.tg-lisp__related li strong { color: var(--lisp-ink); }
.tg-lisp__related li span { color: var(--lisp-muted); font-size: 14px; }
.tg-lisp__related li img { width: 100%; height: 145px; object-fit: contain; background: #20272f; border-radius: 4px; margin-bottom: 5px; }

@media (max-width: 800px) {
    .tg-lisp__hero-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr); gap: 20px; }
    .tg-lisp__table :is(th, td) { padding-inline: 8px; }
    .tg-lisp__table tbody th { width: 24%; }
}
@media (max-width: 650px) {
    body:has(.tg-lisp) #scrollToTopBtn { width: 46px; height: 46px; right: 14px; bottom: 14px; }
    .tg-lisp__hero-inner, .tg-lisp__section-top, .tg-lisp__guides-inner, .tg-lisp__article { grid-template-columns: minmax(0, 1fr); }
    .tg-lisp__lead h1 { text-wrap: initial; }
    .tg-lisp__lead > p:not(.tg-lisp__file) { margin-top: 13px; }
    .tg-lisp__lead > .tg-lisp__primary, .tg-lisp__actions { margin-top: 19px; }
    .tg-lisp__filters { grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); padding-inline: 11px; gap: 9px; }
    .tg-lisp__search { grid-column: 1 / -1; }
    .tg-lisp__sort-field { display: block; }
    .tg-lisp__sort-button { display: none; }
    .tg-lisp__sort-button:not([hidden]) + span { display: inline; }
    .tg-lisp__section-top { margin-bottom: 17px; }
    .tg-lisp__table { display: grid; }
    .tg-lisp__table table, .tg-lisp__table tbody { display: block; }
    .tg-lisp__table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .tg-lisp__table tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 8px;
        padding: 11px 4px;
        border-bottom: 1px solid var(--lisp-line);
    }
    .tg-lisp__table tbody :is(th, td) { width: auto; border: 0; padding: 3px 4px; background: transparent !important; }
    .tg-lisp__table tbody :is(th, td:nth-child(2)) { grid-column: 1 / -1; width: auto; }
    .tg-lisp__table tbody td:last-child { align-self: center; text-align: right; font-size: 13px; }
    .tg-lisp__subnav { position: static; }
    .tg-lisp__subnav ul { display: flex; gap: 0 18px; flex-wrap: wrap; }
    .tg-lisp__related ul { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .tg-lisp__filters { grid-template-columns: 1fr; }
    .tg-lisp__modes > div { grid-template-columns: 1fr; }
}
