/* SPDX-FileCopyrightText: 2026 Leelsey */
/* SPDX-License-Identifier: MIT */

html { overflow-x: hidden; }

body > nav .gh { display: flex; align-items: center; }

body > nav .gh span {
    display: block;
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url(/assets/github.svg) no-repeat center / contain;
            mask: url(/assets/github.svg) no-repeat center / contain;
}

section { padding-top: 52px; }
section[id], main[id], header[id] { scroll-margin-top: 72px; }

.hero {
    padding: 68px 0 8px;
    border-bottom: 1px solid var(--line);
}

.hero img {
    display: block;
    width: 72px;
    height: 72px;
    margin-bottom: 22px;
}

.opener { position: relative; }

.opener-sticky {
    display: grid;
    place-items: center;
    padding: 0 var(--pad, 0);
}

.stage {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 260px;
    margin-bottom: 22px;
    border-radius: var(--radius);
    background: #000;
    overflow: hidden;
}

.stage-streak {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    will-change: opacity;
}

.stage-blast {
    position: absolute;
    inset: 0;
    background: #fff;
    mix-blend-mode: screen;
    opacity: 0;
    pointer-events: none;
    will-change: opacity;
}

.stage > * { grid-area: 1 / 1; }

.stage img { margin: 0; }

.js-opener .stage img { opacity: 0; }

.stage-mark {
    width: 112px;
    height: 112px;
    opacity: 0;
    will-change: opacity, transform;
}

.stage-word {
    position: relative;
    display: inline-block;
    font-family: var(--mono);
    font-size: clamp(22px, 6.2vw, 38px);
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--amber);
    opacity: 0;
    white-space: pre;
}

.stage-word-base {
    display: inline-block;
    width: 0;
    height: 0;
    vertical-align: baseline;
}

.stage-word-cursor {
    position: absolute;
    top: 0;
    left: 100%;
    transform: scaleX(.7);
    transform-origin: 0 50%;
}

.stage-word-slice {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    pointer-events: none;
}

.js-opener {
    --frame-w: min(1080px, 92vw);
    --frame-h: 64vh;
    --frame-h: 64svh;
}

.js-opener .opener {
    height: 210vh;
    margin: calc(-1 * var(--nav-h)) 0 28px;
}

.js-opener .opener-sticky {
    position: sticky;
    top: 0;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    height: 100vh;
    height: 100svh;
    background: var(--bg);
}

.js-opener .stage {
    width: calc(100vw - (100vw - var(--frame-w)) * var(--p, 0));
    height: calc(100vh - (100vh - var(--frame-h)) * var(--p, 0));
    height: calc(100svh - (100svh - var(--frame-h)) * var(--p, 0));
    margin: 0;
    border-radius: calc(var(--radius) * var(--p, 0));
    box-shadow: 0 calc(26px * var(--p, 0)) calc(56px * var(--p, 0))
                calc(-18px * var(--p, 0)) var(--shadow-far);
}

.js-opener .stage-mark {
    width: calc(230px - 118px * var(--p, 0));
    height: calc(230px - 118px * var(--p, 0));
}

.js-opener .stage-word {
    font-size: calc(clamp(30px, 8vw, 74px) - (clamp(8px, 2vw, 36px) * var(--p, 0)));
}

.js-opener body > nav,
.js-opener body > nav a,
.js-opener body > nav .brand,
.js-opener .theme {
    transition: background-color .3s ease, border-color .3s ease, color .3s ease;
}

.js-opener.on-dark body > nav {
    background: transparent;
    border-bottom-color: transparent;
}

.js-opener.on-dark body > nav,
.js-opener.on-dark body > nav .brand { color: #f2f4f7; }
.js-opener.on-dark body > nav a { color: #c8d0dc; }
.js-opener.on-dark body > nav a:hover { color: #fff; }
.js-opener.on-dark body > nav [aria-current="page"] { color: #f2f4f7; }

.js-opener.on-dark .theme {
    background: rgba(255, 255, 255, .09);
    border-color: rgba(255, 255, 255, .2);
    color: #e7e9ee;
}
.js-opener.on-dark .theme:hover { border-color: rgba(255, 255, 255, .34); }

.scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 16px 12px;
    color: rgba(255, 255, 255, .6);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .45s ease, visibility .45s, color .2s ease;
}

.js-opener.at-top .scroll-cue {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.scroll-cue-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .2s ease, transform .2s ease;
}

.scroll-cue > svg { transition: transform .2s ease; }

.scroll-cue:hover { color: #fff; }
.scroll-cue:hover > svg { transform: translateY(-4px); }
.scroll-cue:hover .scroll-cue-label { opacity: 1; transform: translateY(-4px); }

@media (hover: none) {
    .scroll-cue > svg { transform: translateY(-4px); }
    .scroll-cue-label { opacity: 1; transform: translateY(-4px); }
}

@media (prefers-reduced-motion: reduce) {
    .stage-mark { display: none; }
    .stage-word { opacity: 1; }
}

.hero p { max-width: 62ch; }

.hero .lede { font-size: 18px; }

.mark-badge {
    display: inline-block;
    padding: 1.5px 7px;
    border-radius: 4px;
    background: var(--panel-2);
    color: var(--muted);
    border: 1px solid var(--line-2);
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    vertical-align: 2px;
}

.more { margin: 12px 0 0; }

.detail {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
}

.detail span { display: inline-block; transition: transform .15s ease; }
.detail:hover { text-decoration: underline; }
.detail:hover span { transform: translateX(3px); }

.scroll.prose table { min-width: 47rem; }

.shots { margin: 24px 0 0; }

.shots img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.shots img + img { margin-top: 14px; }

.shots figcaption {
    color: var(--muted);
    font-size: 13.5px;
    margin-top: 12px;
}

:root {
    --shot-dim:  brightness(.86) contrast(1.02);
    --shot-tone: none;
}

:root[data-theme="dark"] { --shot-tone: var(--shot-dim); }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) { --shot-tone: var(--shot-dim); }
}

.shots img { filter: var(--shot-tone); }

.swatches {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.swatches li {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--panel);
}

.swatches .chip { display: block; width: 100%; height: 62px; }
.swatches .label { padding: 10px 14px; }
.swatches b { display: block; font-size: 14px; }
.swatches code { background: none; border: 0; padding: 0; font-size: 12.5px; color: var(--muted); }
.swatches span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.marks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 14px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.marks li {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    padding: 22px 14px 16px;
    text-align: center;
}

.marks img, .marks .glyph { width: 88px; height: 88px; display: block; margin: 0 auto 14px; }

.marks .glyph {
    background: currentColor;
    -webkit-mask: url(/brand/insecurity-glyph.svg) no-repeat center / contain;
            mask: url(/brand/insecurity-glyph.svg) no-repeat center / contain;
}
.marks code { background: none; border: 0; padding: 0; font-size: 12.5px; color: var(--muted); overflow-wrap: break-word; }
.marks .role { display: block; margin-top: 5px; font-size: 12.5px; color: var(--muted); }
.marks .role code { font-size: 11.5px; }

.ladder { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 20px; margin: 22px 0 0; }
.ladder figure { margin: 0; text-align: center; }
.ladder img { display: block; image-rendering: -webkit-optimize-contrast; }
.ladder figcaption { color: var(--muted); font-size: 12px; margin-top: 8px; }

.hero .tag-chips:not(:empty) { margin: 14px 0 0; }

.host {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.ladder-list {
    list-style: none;
    counter-reset: none;
    margin: 26px 0 0;
    padding: 0;
}

.ladder-list li {
    display: flex;
    gap: 18px;
    padding: 22px 0;
    border-top: 1px solid var(--line);
}

.ladder-list li:last-child { border-bottom: 1px solid var(--line); }

.ladder-list .rank {
    flex: none;
    width: 34px;
    font-family: var(--mono);
    font-size: 20px;
    font-weight: 600;
    color: var(--line-2);
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
}

.ladder-list .body { min-width: 0; }

.ladder-list .name {
    font-size: 19px;
    margin: 0 0 4px;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 9px;
}

.ladder-list .name a { color: var(--fg); text-decoration: none; }
.ladder-list .name a:hover { color: var(--accent); text-decoration: underline; }

.ladder-list .tagline { margin: 0 0 6px; color: var(--fg-2); font-weight: 500; }
.ladder-list .surface { margin: 0 0 8px; color: var(--fg-2); }
.ladder-list .tag-chips:not(:empty) { margin: 0 0 8px; }

.ladder-list .plats {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-family: var(--mono);
}

.neighbours {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 24px 0 0;
}

.neighbours a {
    display: block;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--fg);
    text-decoration: none;
    font-weight: 600;
}

.neighbours a:hover { text-decoration: none; border-color: var(--muted); }
.neighbours a.next { text-align: right; }
.neighbours + .sub { margin-top: 16px; }

.neighbours span {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}

.center { text-align: center; padding: clamp(44px, 11vh, 86px) 0 40px; }
.center .actions { justify-content: center; margin-bottom: 0; }
.center p { margin-inline: auto; }

:root.ground {
    color-scheme: dark;

    --bg:        var(--slate);
    --panel:     color-mix(in srgb, #fff 7%, var(--slate));
    --panel-2:   color-mix(in srgb, #fff 13%, var(--slate));
    --fg:        #f2f4f7;
    --fg-2:      #cdd7e0;
    --muted:     #9fb2c1;
    --line:      rgba(255, 255, 255, .16);
    --line-2:    rgba(255, 255, 255, .3);
    --accent:    var(--amber);
    --accent-fg: var(--slate);

    --shadow-near: rgba(0, 0, 0, .2);
    --shadow-far:  rgba(0, 0, 0, .55);
}

.ground body > nav,
.ground footer { background: none; border-color: transparent; }

.ground .mark {
    width: min(clamp(112px, 22vw, 168px), 34vh);
    margin: 0 auto 28px;
}

.ground .mark > * { display: block; width: 100%; height: auto; }

.ground .ix-slip {
    transform: translate(calc(var(--dx, 0) * 1px), calc(var(--dy, 0) * 1px));
}

@keyframes ix-split {
    0%,   19% { transform: translate(calc(var(--dx) * 1px),   calc(var(--dy) * 1px)); }
    20%,  22% { transform: translate(calc(var(--dx) * 2.4px), calc(var(--dy) * 1.6px)); }
    23%,  24% { transform: translate(calc(var(--dx) * .2px),  calc(var(--dy) * 1px)); }
    25%,  61% { transform: translate(calc(var(--dx) * 1px),   calc(var(--dy) * 1px)); }
    62%,  63% { transform: translate(calc(var(--dx) * 1.8px), calc(var(--dy) * 1px)); }
    64%, 100% { transform: translate(calc(var(--dx) * 1px),   calc(var(--dy) * 1px)); }
}

@keyframes ix-slide {
    0%,   20% { transform: translate(calc(var(--dx) * 1px),   calc(var(--dy) * 1px)); }
    21%,  23% { transform: translate(calc(var(--dx) * 1.7px), calc(var(--dy) * 1px)); }
    24%,  25% { transform: translate(calc(var(--dx) * .4px),  calc(var(--dy) * 1px)); }
    26%,  80% { transform: translate(calc(var(--dx) * 1px),   calc(var(--dy) * 1px)); }
    81%,  82% { transform: translate(calc(var(--dx) * 1.4px), calc(var(--dy) * 1px)); }
    83%, 100% { transform: translate(calc(var(--dx) * 1px),   calc(var(--dy) * 1px)); }
}

@keyframes ix-strike {
    0%,   21% { opacity: 1; }
    22%,  23% { opacity: 0; }
    24%,  62% { opacity: 1; }
    63%,  64% { opacity: .35; }
    65%, 100% { opacity: 1; }
}

.ground .ix-ghost .ix-slip { animation: ix-split 6.4s infinite; }
.ground .ix-tear  .ix-slip { animation: ix-slide 6.4s infinite; }
.ground .ix-block          { animation: ix-strike 6.4s infinite; }

.ground .ix-ghost[data-row="2"] .ix-slip { animation-delay: -.45s; }
.ground .ix-ghost[data-row="3"] .ix-slip { animation-delay: -2.3s; }
.ground .ix-ghost[data-row="4"] .ix-slip { animation-delay: -3.1s; }
.ground .ix-tear[data-row="B"]  .ix-slip { animation-delay: -1.7s; }
.ground .ix-tear[data-row="C"]  .ix-slip { animation-delay: -4.2s; }

@media (prefers-reduced-motion: reduce) {
    .ground .ix-ghost .ix-slip,
    .ground .ix-tear .ix-slip,
    .ground .ix-block { animation: none; }
}
