* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(1200px 700px at 76% -12%, color-mix(in srgb, var(--rl-signal) 7%, transparent), transparent 62%),
        radial-gradient(900px 500px at -10% 30%, rgba(20, 50, 42, 0.35), transparent 62%),
        #040504;
    color: var(--rl-bone);
    font-family: var(--rl-font);
    font-size: 16px;
    line-height: 1.6;
    letter-spacing: var(--rl-tracking);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    /* A tiled image, not a repeating gradient: Firefox re-rasterizes a 3px
       gradient over the whole viewport on every scroll frame, while a tile is
       uploaded once as a texture. Measured: 33 ms per frame down to 17 ms. */
    background: url("assets/brand/scanlines.png") 0 0 / 64px 48px;
    opacity: 0.21;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 49;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 40%, transparent 55%, rgba(0, 0, 0, 0.42) 100%);
}

a {
    color: var(--rl-signal-soft);
    text-decoration: none;
}

a:hover {
    color: var(--rl-signal-hot);
}

img {
    max-width: 100%;
}

code {
    color: var(--rl-paper);
    background: var(--rl-raised);
    border: 1px solid var(--rl-line);
    padding: 1px 4px;
    font-family: var(--rl-font-mono);
    font-size: 0.95em;
}

button {
    font: inherit;
}

.wrap {
    width: min(1240px, calc(100% - 48px));
    margin: 0 auto;
}

.topbar {
    position: relative;
    z-index: 60;
    border-bottom: 1px solid var(--rl-line);
    background: color-mix(in srgb, var(--rl-void) 96%, transparent);
}

.topbar-inner {
    height: 58px;
    display: flex;
    align-items: center;
    gap: 26px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--rl-cream);
    font-family: var(--rl-font-display);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.brand svg {
    width: 24px;
    height: 24px;
    fill: var(--rl-signal);
    shape-rendering: crispEdges;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: auto;
}

.topnav a {
    color: var(--rl-ash);
    font-family: var(--rl-font-display);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.topnav a:hover {
    color: var(--rl-signal-hot);
}

.top-version {
    padding: 4px 7px;
    border: 1px solid var(--rl-line-hot);
    color: var(--rl-signal-soft);
    font-family: var(--rl-font-mono);
    font-size: 9px;
    letter-spacing: 0.05em;
}

.hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--rl-line);
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--rl-signal) 3%, transparent), transparent 36%),
        repeating-linear-gradient(90deg, transparent 0 78px, rgba(212, 180, 150, 0.025) 78px 79px);
}

.hero::before {
    content: "";
    position: absolute;
    right: -60px;
    bottom: -16px;
    width: min(760px, 70vw);
    height: 300px;
    background: url("assets/brand/skyline.svg") right bottom / contain no-repeat;
    opacity: 0.38;
    pointer-events: none;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #040504 4%, rgba(4, 5, 4, 0.84) 42%, rgba(4, 5, 4, 0.18) 78%, transparent);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(320px, 0.94fr);
    gap: 56px;
    align-items: center;
    padding: 78px 0 84px;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--rl-signal-soft);
    font-family: var(--rl-font-display);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.eyebrow::before {
    content: "";
    width: 22px;
    height: 1px;
    background: var(--rl-signal);
    box-shadow: 0 0 8px color-mix(in srgb, var(--rl-signal) 50%, transparent);
}

.hero h1 {
    margin: 18px 0 6px;
    color: var(--rl-cream);
    font-family: var(--rl-font-display);
    font-size: clamp(64px, 11vw, 148px);
    font-weight: 700;
    line-height: 0.82;
    letter-spacing: -0.035em;
    text-transform: uppercase;
    text-shadow:
        3px 0 0 color-mix(in srgb, var(--rl-signal) 14%, transparent),
        -3px 0 0 rgba(20, 50, 42, 0.5),
        0 0 60px color-mix(in srgb, var(--rl-signal) 8%, transparent);
}

.hero h1 span {
    color: var(--rl-signal);
}

.hero h2 {
    margin: 20px 0 0;
    max-width: 640px;
    color: var(--rl-paper);
    font-family: var(--rl-font-display);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.hero p {
    max-width: 570px;
    margin: 16px 0 0;
    color: var(--rl-smoke);
    font-size: 16px;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.btn {
    height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    justify-content: center;
    padding: 0 18px;
    border: 1px solid var(--rl-signal);
    background: var(--rl-signal);
    color: var(--rl-void);
    font-family: var(--rl-font-display);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    cursor: pointer;
    transition:
        background-color 100ms var(--rl-ease),
        border-color 100ms var(--rl-ease),
        color 100ms var(--rl-ease);
}

.btn:hover {
    background: var(--rl-signal-hot);
    border-color: var(--rl-signal-hot);
    color: var(--rl-void);
}

.btn--ghost {
    background: transparent;
    border-color: var(--rl-line-hot);
    color: var(--rl-bone);
}

.btn--ghost:hover {
    background: color-mix(in srgb, var(--rl-signal) 8%, transparent);
    border-color: var(--rl-signal);
    color: var(--rl-cream);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 26px;
    color: var(--rl-faint);
    font-family: var(--rl-font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
}

.hero-meta span::before {
    content: "//";
    margin-right: 6px;
    color: var(--rl-signal-dim);
}

.raw-line {
    display: flex;
    align-items: stretch;
    max-width: 650px;
    margin-top: 24px;
    border: 1px solid var(--rl-line);
    background: var(--rl-void);
}

.raw-line code {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    overflow: hidden;
    color: var(--rl-paper);
    background: transparent;
    border: 0;
    font-family: var(--rl-font-mono);
    font-size: 11px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.raw-line button {
    flex: 0 0 auto;
    padding: 0 13px;
    border: 0;
    border-left: 1px solid var(--rl-line);
    background: var(--rl-raised);
    color: var(--rl-signal-soft);
    font-family: var(--rl-font-display);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    cursor: pointer;
}

.raw-line button:hover {
    background: var(--rl-signal);
    color: var(--rl-void);
}

.terminal-card {
    position: relative;
    border: 1px solid var(--rl-line-hot);
    background: rgba(8, 9, 7, 0.9);
    box-shadow:
        0 0 0 1px #020302,
        0 24px 70px rgba(0, 0, 0, 0.6),
        0 0 50px color-mix(in srgb, var(--rl-signal) 5%, transparent);
}

.terminal-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        url("assets/brand/corner-tl.svg") left top / 12px 12px no-repeat,
        url("assets/brand/corner-tr.svg") right top / 12px 12px no-repeat,
        url("assets/brand/corner-bl.svg") left bottom / 12px 12px no-repeat,
        url("assets/brand/corner-br.svg") right bottom / 12px 12px no-repeat;
    opacity: 0.6;
}

.terminal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 11px;
    border-bottom: 1px solid var(--rl-line);
    color: var(--rl-ash);
    font-family: var(--rl-font-display);
    font-size: 8px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.terminal-bar span:last-child {
    color: var(--rl-green);
}

.terminal-body {
    padding: 16px;
    color: var(--rl-smoke);
    font-family: var(--rl-font-mono);
    font-size: 11px;
    line-height: 1.8;
}

.terminal-body b {
    color: var(--rl-signal-soft);
    font-weight: 400;
}

.terminal-body .p {
    color: var(--rl-signal);
}

.terminal-body .ok {
    color: var(--rl-green);
}

.terminal-body .dim {
    color: var(--rl-faint);
}

.terminal-sep {
    height: 1px;
    margin: 12px 0;
    background: linear-gradient(90deg, var(--rl-line), transparent);
}

.terminal-swatch {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    margin-top: 13px;
}

.terminal-swatch i {
    height: 24px;
    display: block;
    border: 1px solid rgba(212, 180, 150, 0.12);
}

.ticker {
    position: relative;
    z-index: 2;
    overflow: hidden;
    border-bottom: 1px solid var(--rl-signal-deep);
    background: var(--rl-signal);
    color: var(--rl-void);
    white-space: nowrap;
}

.ticker-inner {
    display: flex;
    gap: 26px;
    width: max-content;
    padding: 7px 0;
    font-family: var(--rl-font-display);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.ticker-inner span::before {
    content: "++";
    margin-right: 26px;
    opacity: 0.55;
}

.main {
    position: relative;
    z-index: 2;
}

.section {
    padding: 78px 0;
    border-bottom: 1px solid var(--rl-line);
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.section-label {
    color: var(--rl-signal-soft);
    font-family: var(--rl-font-display);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.section-label b {
    color: var(--rl-ash);
    font-weight: 400;
}

.section h2 {
    margin: 8px 0 0;
    color: var(--rl-cream);
    font-family: var(--rl-font-display);
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.01em;
    text-transform: uppercase;
}

.section-note {
    max-width: 370px;
    color: var(--rl-smoke);
    font-size: 14px;
    line-height: 1.55;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.swatch {
    border: 1px solid var(--rl-line);
    background: var(--rl-void);
}

.swatch-color {
    height: 112px;
    border-bottom: 1px solid var(--rl-line);
}

.swatch-meta {
    padding: 9px 10px 10px;
}

.swatch-name {
    display: block;
    color: var(--rl-bone);
    font-family: var(--rl-font-display);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.swatch-hex {
    display: block;
    margin-top: 3px;
    color: var(--rl-ash);
    font-family: var(--rl-font-mono);
    font-size: 10px;
}

.swatch-source {
    display: block;
    margin-top: 7px;
    color: var(--rl-faint);
    font-family: var(--rl-font-mono);
    font-size: 8px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 34px;
}

.feature {
    min-height: 170px;
    padding: 18px;
    border: 1px solid var(--rl-line);
    background: linear-gradient(180deg, color-mix(in srgb, var(--rl-signal) 3%, transparent), transparent 70%), var(--rl-ink);
}

.feature-num {
    color: var(--rl-signal-dim);
    font-family: var(--rl-font-mono);
    font-size: 10px;
}

.feature h3 {
    margin: 26px 0 8px;
    color: var(--rl-cream);
    font-family: var(--rl-font-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.feature p {
    margin: 0;
    color: var(--rl-smoke);
    font-size: 13px;
    line-height: 1.55;
}

.feature-source {
    margin-top: 10px !important;
    font-family: var(--rl-font-mono);
    font-size: 10px !important;
    letter-spacing: 0.06em;
}

.feature-source a {
    color: var(--rl-signal);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.install {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr);
    gap: 44px;
    align-items: start;
}

.code-card {
    border: 1px solid var(--rl-line-hot);
    background: var(--rl-void);
}

.code-card-head {
    display: flex;
    justify-content: space-between;
    padding: 8px 11px;
    border-bottom: 1px solid var(--rl-line);
    color: var(--rl-ash);
    font-family: var(--rl-font-display);
    font-size: 8px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.code-card-head span:last-child {
    color: var(--rl-green);
}

.code-card pre {
    margin: 0;
    padding: 15px;
    overflow: auto;
    color: var(--rl-bone);
    font-family: var(--rl-font-mono);
    font-size: 12px;
    line-height: 1.7;
}

.code-card .c {
    color: var(--rl-faint);
}

.code-card .a {
    color: var(--rl-signal-soft);
}

.code-card .g {
    color: var(--rl-green);
}

.note {
    margin-top: 14px;
    padding: 11px 13px;
    border: 1px solid var(--rl-line);
    border-left: 2px solid var(--rl-signal-dim);
    background: color-mix(in srgb, var(--rl-signal) 3.5%, transparent);
    color: var(--rl-smoke);
    font-size: 12px;
    line-height: 1.55;
}

.note b {
    color: var(--rl-signal-soft);
    font-weight: 400;
}

.tree {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 34px;
    align-items: start;
    margin-top: 30px;
}

.tree pre {
    margin: 0;
    padding: 17px;
    border: 1px solid var(--rl-line);
    background: var(--rl-void);
    color: var(--rl-smoke);
    font-family: var(--rl-font-mono);
    font-size: 11px;
    line-height: 1.65;
    overflow: auto;
}

.tree pre b {
    color: var(--rl-signal-soft);
    font-weight: 400;
}

.tree p {
    margin: 0 0 14px;
    color: var(--rl-smoke);
    font-size: 14px;
    line-height: 1.6;
}

.tree p b {
    color: var(--rl-bone);
    font-weight: 400;
}

.link-list {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--rl-line);
}

.link-list a {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--rl-line);
    color: var(--rl-bone);
    font-family: var(--rl-font-mono);
    font-size: 11px;
}

.link-list a:hover {
    color: var(--rl-signal-hot);
}

.link-list span {
    color: var(--rl-faint);
}

.footer {
    position: relative;
    z-index: 2;
    padding: 42px 0 50px;
}

.footer-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--rl-cream);
    font-family: var(--rl-font-display);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.11em;
}

.footer-brand svg {
    width: 20px;
    height: 20px;
    fill: var(--rl-signal);
}

.footer p {
    max-width: 650px;
    margin: 8px 0 0;
    color: var(--rl-faint);
    font-size: 11px;
    line-height: 1.6;
}

.footer-meta {
    text-align: right;
    color: var(--rl-faint);
    font-family: var(--rl-font-mono);
    font-size: 9px;
    line-height: 1.8;
}

.copied {
    color: var(--rl-void) !important;
    background: var(--rl-green) !important;
}

@media (max-width: 1040px) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 36px;
        padding: 60px 0 66px;
    }

    .terminal-card {
        max-width: 620px;
    }

    .palette-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .install {
        grid-template-columns: 1fr;
        gap: 28px;
    }

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

@media (max-width: 640px) {
    .wrap {
        width: min(100% - 28px, 1240px);
    }

    .topbar-inner {
        flex-wrap: wrap;
        row-gap: 8px;
    }

    .topnav {
        order: 3;
        flex: 1 0 100%;
        display: flex;
        gap: 16px;
        overflow-x: auto;
        padding-bottom: 6px;
        scrollbar-width: none;
    }

    .topnav a {
        flex: 0 0 auto;
    }

    .lang-toggle {
        margin-left: auto;
    }

    .accent-range {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .accent-toggles {
        grid-template-columns: 1fr;
    }

    .accent-actions .btn {
        flex: 1 1 100%;
        text-align: center;
    }


    .hero-inner {
        padding: 44px 0 52px;
    }

    .hero h1 {
        font-size: clamp(56px, 18vw, 92px);
    }

    .hero h2 {
        font-size: 12px;
    }

    .hero p {
        font-size: 15px;
    }

    .raw-line code {
        font-size: 9px;
    }

    .raw-line button {
        padding: 0 9px;
        font-size: 8px;
    }

    .section {
        padding: 56px 0;
    }

    .section-head {
        display: block;
    }

    .section-note {
        margin-top: 12px;
    }

    .palette-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .footer-inner {
        display: block;
    }

    .footer-meta {
        margin-top: 20px;
        text-align: left;
    }
}

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

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}

.sound-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 26px;
}

.sound-card {
    padding: 14px;
    border: 1px solid var(--rl-line);
    background: linear-gradient(180deg, color-mix(in srgb, var(--rl-signal) 3%, transparent), transparent 60%), var(--rl-ink);
}

.sound-card h3 {
    margin: 0;
    color: var(--rl-cream);
    font-family: var(--rl-font-display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sound-file {
    display: block;
    margin-top: 3px;
    color: var(--rl-ash);
    font-family: var(--rl-font-mono);
    font-size: 9px;
}

.sound-card p {
    margin: 8px 0 12px;
    color: var(--rl-smoke);
    font-size: 12px;
    line-height: 1.5;
}

.sound-card audio {
    width: 100%;
    height: 32px;
    color-scheme: dark;
    accent-color: var(--rl-signal);
}

.sound-note {
    max-width: 760px;
    margin-top: 24px;
}

@media (max-width: 900px) {
    .sound-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

.icon-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 8px;
    margin-top: 26px;
}

.icon-card {
    min-height: 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 8px;
    border: 1px solid var(--rl-line);
    background: var(--rl-ink);
}

.icon-card i {
    display: block;
    width: 34px;
    height: 34px;
    background: var(--rl-signal);
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
    image-rendering: pixelated;
}

.icon-card span {
    color: var(--rl-ash);
    font-family: var(--rl-font-mono);
    font-size: 8px;
    letter-spacing: 0.04em;
    text-align: center;
}

@media (max-width: 1000px) {
    .icon-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .icon-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 460px) {
    .icon-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.accent-card {
    margin-top: 16px;
}

.accent-body {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.accent-field {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--rl-smoke);
    font-size: 12px;
    letter-spacing: 0.12em;
}

.accent-field input {
    width: 44px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--rl-line-hot);
    background: var(--rl-void);
    cursor: pointer;
}

.accent-field code {
    color: var(--rl-signal);
}

.accent-swatches {
    display: flex;
    gap: 8px;
}

.accent-swatches button {
    width: 28px;
    height: 28px;
    border: 1px solid var(--rl-line);
    background: var(--swatch);
    cursor: pointer;
}

.accent-swatches button:hover,
.accent-swatches button:focus-visible {
    outline: 1px solid var(--rl-cream);
    outline-offset: 2px;
}

.accent-help {
    margin: 0;
    color: var(--rl-ash);
    font-size: 12px;
}

.accent-range {
    display: grid;
    grid-template-columns: 96px 1fr;
    align-items: center;
    gap: 12px;
    color: var(--rl-smoke);
    font-size: 12px;
    letter-spacing: 0.12em;
}

.accent-range input {
    accent-color: var(--rl-signal);
}

.accent-toggles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    color: var(--rl-bone);
    font-size: 12px;
    letter-spacing: 0.08em;
}

.accent-toggles input {
    accent-color: var(--rl-signal);
}

.accent-output {
    margin: 0;
    padding: 12px;
    border: 1px solid var(--rl-line);
    background: var(--rl-void);
    color: var(--rl-signal-soft);
    font-family: var(--rl-font-mono);
    font-size: 12px;
    user-select: all;
}

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

.accent-range select,
.accent-range input[type="url"],
.accent-range input[type="file"] {
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid var(--rl-line);
    background: var(--rl-void);
    color: var(--rl-bone);
    font: inherit;
    letter-spacing: 0.04em;
}

.accent-output {
    max-height: 220px;
    overflow: auto;
}

.lang-toggle {
    padding: 4px 10px;
    border: 1px solid var(--rl-line-hot);
    background: transparent;
    color: var(--rl-signal);
    font: inherit;
    font-size: 11px;
    letter-spacing: 0.12em;
    cursor: pointer;
}

.lang-toggle:hover,
.lang-toggle:focus-visible {
    background: var(--rl-signal);
    color: var(--rl-void);
}

/* keep every column inside the viewport: grid and flex children may shrink */

html,
body {
    max-width: 100%;
    overflow-x: clip;
}

.hero-inner > *,
.install > *,
.tree > *,
.feature-grid > *,
.palette-grid > *,
.accent-body > *,
.accent-range > *,
.section-head > * {
    min-width: 0;
}

.code-card,
.terminal-card,
.raw-line {
    max-width: 100%;
    min-width: 0;
}

.code-card pre,
.tree pre,
.accent-output {
    max-width: 100%;
    overflow-x: auto;
}

.raw-line code {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.accent-range input,
.accent-range select {
    width: 100%;
}

img {
    max-width: 100%;
    height: auto;
}

.accent-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--rl-bone);
    font-size: 12px;
    letter-spacing: 0.08em;
}

.accent-check input {
    accent-color: var(--rl-signal);
}

.accent-range input[type="color"] {
    width: 44px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--rl-line-hot);
    background: var(--rl-void);
    cursor: pointer;
}

.demo-frame {
    border: 1px solid var(--rl-line-hot);
    background: var(--rl-void);
}

.demo-frame iframe {
    display: block;
    width: 100%;
    height: min(900px, 90vh);
    border: 0;
}

.demo-link {
    margin: 16px 0 0;
}

/* releases, read from the GitHub API */
.release-list {
    display: grid;
    gap: 14px;
}

.release-card {
    border: 1px solid var(--rl-line);
    background: var(--rl-panel);
    padding: 18px;
    position: relative;
}

.release-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.release-title {
    color: var(--rl-cream);
    font-family: var(--rl-font-display);
    font-size: 18px;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.release-title:hover {
    color: var(--rl-signal-hot);
    text-decoration: underline;
    text-decoration-color: var(--rl-signal);
}

.release-badge {
    border: 1px solid var(--rl-signal);
    background: var(--rl-signal);
    color: var(--rl-void);
    font-family: var(--rl-font-mono);
    font-size: 9px;
    letter-spacing: 0.08em;
    padding: 2px 6px;
}

.release-badge--pre {
    background: transparent;
    color: var(--rl-amber);
    border-color: var(--rl-amber);
}

.release-meta {
    color: var(--rl-ash);
    font-family: var(--rl-font-mono);
    font-size: 10px;
    letter-spacing: 0.04em;
    margin: 8px 0 12px;
    text-transform: uppercase;
}

.release-assets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.release-asset {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 132px;
    padding: 8px 10px;
    border: 1px solid var(--rl-line);
    background: var(--rl-raised);
    color: var(--rl-bone);
    font-family: var(--rl-font-mono);
    font-size: 11px;
    text-decoration: none;
}

.release-asset:hover {
    border-color: var(--rl-signal);
    color: var(--rl-cream);
    background: var(--rl-high);
}

.release-asset small {
    color: var(--rl-faint);
    font-size: 9px;
}

/* ------------------------------------------------------------------ */
/* Download and latest release                                        */
/* ------------------------------------------------------------------ */

.hero-release {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px 14px;
    margin-top: 18px;
    color: var(--rl-faint);
    font-family: var(--rl-font-mono);
    font-size: 10px;
    letter-spacing: 0.04em;
}

.hero-release > a {
    color: var(--rl-paper);
}

.hero-release > a:hover {
    color: var(--rl-signal-hot);
}

.release-pill {
    padding: 4px 7px;
    border: 1px solid var(--rl-line-hot);
    color: var(--rl-signal-soft);
    background: color-mix(in srgb, var(--rl-signal) 5%, transparent);
}

.download-panel {
    border: 1px solid var(--rl-line-hot);
    background:
        linear-gradient(120deg, color-mix(in srgb, var(--rl-signal) 7%, transparent), transparent 38%),
        var(--rl-void);
    box-shadow:
        0 0 0 1px #020302,
        0 26px 80px rgba(0, 0, 0, 0.48);
}

.download-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 28px;
    align-items: center;
    padding: 28px;
    border-bottom: 1px solid var(--rl-line);
}

.download-kicker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--rl-ash);
    font-family: var(--rl-font-mono);
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.download-kicker span:first-child {
    color: var(--rl-signal-soft);
}

.download-main h3 {
    margin: 16px 0 5px;
    color: var(--rl-cream);
    font-family: var(--rl-font-display);
    font-size: clamp(28px, 4vw, 46px);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.01em;
    text-transform: uppercase;
}

.download-lede {
    max-width: 600px;
    margin: 0;
    color: var(--rl-smoke);
    font-size: 15px;
    line-height: 1.6;
}

.download-note {
    max-width: 620px;
    margin: 13px 0 0;
    color: var(--rl-faint);
    font-size: 11px;
    line-height: 1.5;
}

.download-glyph {
    width: 112px;
    height: 112px;
    display: grid;
    place-items: center;
    border: 1px solid var(--rl-line-hot);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--rl-signal) 16%, transparent), transparent 60%),
        var(--rl-panel);
    color: var(--rl-signal);
    box-shadow: inset 0 0 36px color-mix(in srgb, var(--rl-signal) 8%, transparent);
}

.download-glyph svg {
    width: 54px;
    height: 54px;
    fill: currentColor;
    shape-rendering: crispEdges;
}

.os-download-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}

.os-download {
    min-width: 0;
    padding: 19px;
    border-right: 1px solid var(--rl-line);
    background: color-mix(in srgb, var(--rl-panel) 38%, transparent);
}

.os-download:last-child {
    border-right: 0;
}

.os-download.is-detected {
    background: color-mix(in srgb, var(--rl-signal) 5%, var(--rl-void));
    box-shadow: inset 0 2px 0 var(--rl-signal);
}

.os-download-head {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--rl-cream);
    font-family: var(--rl-font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.os-download-head span:last-child {
    margin-left: auto;
    padding: 2px 5px;
    border: 1px solid var(--rl-line);
    color: var(--rl-faint);
    font-family: var(--rl-font-mono);
    font-size: 8px;
    font-weight: 400;
    letter-spacing: 0.06em;
}

.os-download.is-detected .os-download-head span:last-child {
    border-color: var(--rl-line-hot);
    color: var(--rl-signal-soft);
}

.os-download p {
    min-height: 38px;
    margin: 10px 0 13px;
    color: var(--rl-smoke);
    font-size: 12px;
    line-height: 1.5;
}

.os-download code {
    padding: 1px 3px;
    font-size: 0.9em;
}

.asset-links {
    display: grid;
    gap: 7px;
}

.asset-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid var(--rl-line);
    color: var(--rl-bone);
    font-family: var(--rl-font-mono);
    font-size: 10px;
    letter-spacing: 0.04em;
}

.asset-link:hover {
    border-color: var(--rl-signal);
    color: var(--rl-cream);
    background: color-mix(in srgb, var(--rl-signal) 5%, transparent);
}

.asset-link small {
    color: var(--rl-faint);
    font-size: 9px;
}

.asset-link.is-missing {
    color: var(--rl-ash);
    border-style: dashed;
}

.install-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 18px;
}

.install-steps article {
    padding: 16px;
    border: 1px solid var(--rl-line);
    background: var(--rl-ink);
}

.install-steps b {
    display: block;
    margin-bottom: 7px;
    color: var(--rl-signal-soft);
    font-family: var(--rl-font-display);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.install-steps p {
    margin: 0;
    color: var(--rl-smoke);
    font-size: 12px;
    line-height: 1.55;
}

.install-steps strong {
    color: var(--rl-cream);
    font-weight: 400;
}

/* ------------------------------------------------------------------ */
/* Theme preview: the 78 px window Appearance draws                    */
/* ------------------------------------------------------------------ */

.theme-preview-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    gap: 22px;
    align-items: start;
}

.theme-stage-card {
    overflow: hidden;
    border: 1px solid var(--rl-line-hot);
    background: var(--rl-void);
    box-shadow:
        0 0 0 1px #020302,
        0 22px 70px rgba(0, 0, 0, 0.6);
}

.theme-stage {
    --ps: 2.65;
    position: relative;
    padding: clamp(12px, 3vw, 28px);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--p-accent) 7%, transparent), transparent 45%),
        repeating-linear-gradient(0deg, transparent 0 3px, rgba(255, 255, 255, 0.018) 3px 4px),
        var(--rl-void);
}

.theme-stage::before,
.theme-stage::after {
    content: "";
    position: absolute;
    width: 11px;
    height: 11px;
    pointer-events: none;
    border-color: color-mix(in srgb, var(--p-accent) 55%, transparent);
    border-style: solid;
}

.theme-stage::before {
    top: 10px;
    left: 10px;
    border-width: 1px 0 0 1px;
}

.theme-stage::after {
    right: 10px;
    bottom: 10px;
    border-width: 0 1px 1px 0;
}

.theme-stage .rc-preview {
    --ps: 2.65;
    max-width: 620px;
    margin: 0 auto;
}

.theme-stage-caption {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: baseline;
    padding: 11px 14px;
    border-top: 1px solid var(--rl-line);
    color: var(--rl-faint);
    font-family: var(--rl-font-mono);
    font-size: 10px;
}

.theme-stage-caption b {
    color: var(--rl-cream);
    font-family: var(--rl-font-display);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.theme-picker {
    display: grid;
    gap: 12px;
}

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

.theme-choice {
    min-width: 0;
    padding: 7px;
    border: 1px solid var(--rl-line);
    background: var(--rl-ink);
    color: var(--rl-smoke);
    text-align: left;
    cursor: pointer;
    transition: border-color 120ms var(--rl-ease), background 120ms var(--rl-ease);
}

.theme-choice:hover {
    border-color: var(--rl-line-hot);
    background: var(--rl-raised);
}

.theme-choice.is-active {
    border-color: var(--rl-signal);
    background: color-mix(in srgb, var(--rl-signal) 6%, var(--rl-ink));
}

.theme-choice .rc-preview {
    --ps: 1.15;
    margin-bottom: 7px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.theme-choice-copy {
    display: block;
    min-width: 0;
}

.theme-choice-copy b,
.theme-choice-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theme-choice-copy b {
    color: var(--rl-bone);
    font-family: var(--rl-font-display);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.theme-choice-copy small {
    margin-top: 2px;
    color: var(--rl-faint);
    font-size: 9px;
}

.theme-accent {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border: 1px solid var(--rl-line);
    color: var(--rl-ash);
    font-family: var(--rl-font-mono);
    font-size: 9px;
    letter-spacing: 0.08em;
}

.theme-accent input {
    width: 38px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--rl-line-hot);
    background: var(--rl-void);
    cursor: pointer;
}

.theme-accent code {
    margin-left: auto;
    color: var(--rl-signal-soft);
    background: transparent;
    border: 0;
    font-size: 10px;
}

.theme-picker .btn {
    width: 100%;
}

.theme-preview-note {
    margin: 12px 0 0;
    color: var(--rl-faint);
    font-size: 11px;
    line-height: 1.55;
}

/* The miniature itself. Its geometry is the one Appearance draws: a 78 px
   window with a 16 px rail, a 38 px sidebar, two messages and a composer. */
.rc-preview {
    --ps: 2;
    display: block;
    position: relative;
    width: 100%;
    height: calc(78px * var(--ps));
    overflow: hidden;
    border-radius: calc(6px * var(--ps));
    background: var(--p-chat);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--p-text) 10%, transparent);
    isolation: isolate;
}

.rc-chat,
.rc-rail,
.rc-sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
}

.rc-chat {
    inset: 0;
    background: var(--p-chat);
    border-radius: inherit;
}

.rc-rail {
    left: 0;
    width: calc(16px * var(--ps));
    background: var(--p-rail);
}

.rc-sidebar {
    left: calc(16px * var(--ps));
    width: calc(38px * var(--ps));
    background: var(--p-sidebar);
}

.rc-server,
.rc-channel,
.rc-avatar,
.rc-name,
.rc-line {
    position: absolute;
    display: block;
}

.rc-server {
    left: calc(3px * var(--ps));
    width: calc(10px * var(--ps));
    height: calc(10px * var(--ps));
    border-radius: calc(5px * var(--ps));
    background: var(--p-raised);
}

.rc-server--active {
    top: calc(6px * var(--ps));
    border-radius: calc(3px * var(--ps));
    background: var(--p-accent);
}

.rc-server--two {
    top: calc(19px * var(--ps));
}

.rc-server--three {
    top: calc(32px * var(--ps));
}

.rc-channel {
    left: calc(22px * var(--ps));
    height: calc(4px * var(--ps));
    border-radius: calc(2px * var(--ps));
    background: var(--p-muted);
}

.rc-channel--one {
    top: calc(8px * var(--ps));
    width: calc(18px * var(--ps));
}

.rc-channel--two {
    top: calc(19px * var(--ps));
    width: calc(24px * var(--ps));
    background: var(--p-text);
}

.rc-channel--three {
    top: calc(30px * var(--ps));
    width: calc(22px * var(--ps));
}

.rc-channel--four {
    top: calc(41px * var(--ps));
    width: calc(18px * var(--ps));
}

.rc-message {
    position: absolute;
    left: calc(60px * var(--ps));
    width: calc(100% - 66px * var(--ps));
    height: calc(10px * var(--ps));
}

.rc-message--first {
    top: calc(8px * var(--ps));
}

.rc-message--second {
    top: calc(30px * var(--ps));
}

.rc-avatar {
    left: 0;
    top: 0;
    width: calc(10px * var(--ps));
    height: calc(10px * var(--ps));
    border-radius: 50%;
    background: var(--p-muted);
}

.rc-message--first .rc-avatar {
    background: var(--p-accent);
}

.rc-name {
    left: calc(14px * var(--ps));
    top: calc(1px * var(--ps));
    width: calc(22px * var(--ps));
    height: calc(4px * var(--ps));
    border-radius: calc(2px * var(--ps));
    background: var(--p-text);
}

.rc-message--second .rc-name {
    width: calc(16px * var(--ps));
}

.rc-line {
    left: calc(14px * var(--ps));
    top: calc(8px * var(--ps));
    width: calc(52px * var(--ps));
    max-width: calc(100% - 14px * var(--ps));
    height: calc(3px * var(--ps));
    border-radius: calc(1.5px * var(--ps));
    background: var(--p-muted);
}

.rc-message--second .rc-line {
    width: calc(40px * var(--ps));
}

.rc-composer {
    position: absolute;
    left: calc(60px * var(--ps));
    right: calc(6px * var(--ps));
    bottom: calc(6px * var(--ps));
    height: calc(12px * var(--ps));
    border-radius: calc(4px * var(--ps));
    background: var(--p-raised);
}

.rc-composer i {
    position: absolute;
    right: calc(4px * var(--ps));
    top: calc(3px * var(--ps));
    width: calc(6px * var(--ps));
    height: calc(6px * var(--ps));
    border-radius: 50%;
    background: var(--p-accent);
}

/* Each preview carries the same palette values Appearance uses. */
[data-theme="recore"] {
    --p-rail: #080907;
    --p-sidebar: #0e100c;
    --p-chat: #080907;
    --p-raised: #131511;
    --p-accent: #e94221;
    --p-text: #e4cdb1;
    --p-muted: #8c7b6c;
}

[data-theme="paper"] {
    --p-rail: #f3e9d7;
    --p-sidebar: #e4d6bd;
    --p-chat: #f3e9d7;
    --p-raised: #dccdb2;
    --p-accent: #e94221;
    --p-text: #2a1d14;
    --p-muted: #6b5644;
}

[data-theme="ambxst"] {
    --p-rail: #1a1111;
    --p-sidebar: #231919;
    --p-chat: #140c0c;
    --p-raised: #271d1d;
    --p-accent: #ffb3ae;
    --p-text: #fff0ef;
    --p-muted: #a08c8b;
}

[data-theme="ambxst-paper"] {
    --p-rail: #fff8f7;
    --p-sidebar: #f5dddc;
    --p-chat: #fbf2f0;
    --p-raised: #eed6d5;
    --p-accent: #904a46;
    --p-text: #2a1716;
    --p-muted: #6e5a59;
}

[data-theme="catppuccin"] {
    --p-rail: #11111b;
    --p-sidebar: #181825;
    --p-chat: #1e1e2e;
    --p-raised: #313244;
    --p-accent: #cba6f7;
    --p-text: #cdd6f4;
    --p-muted: #a6adc8;
}

[data-theme="tokyo-night"] {
    --p-rail: #15161e;
    --p-sidebar: #16161e;
    --p-chat: #1a1b26;
    --p-raised: #292e42;
    --p-accent: #7aa2f7;
    --p-text: #c0caf5;
    --p-muted: #a9b1d6;
}

[data-theme="nord"] {
    --p-rail: #292f3a;
    --p-sidebar: #3b4252;
    --p-chat: #2e3440;
    --p-raised: #434c5e;
    --p-accent: #a3be8c;
    --p-text: #eceff4;
    --p-muted: #aeb8c8;
}

[data-theme="gruvbox"] {
    --p-rail: #1d2021;
    --p-sidebar: #1d2021;
    --p-chat: #282828;
    --p-raised: #3c3836;
    --p-accent: #fe8019;
    --p-text: #fbf1c7;
    --p-muted: #bdae93;
}

[data-theme="solarized"] {
    --p-rail: #e9e2cd;
    --p-sidebar: #eee8d5;
    --p-chat: #fdf6e3;
    --p-raised: #f5efdd;
    --p-accent: #2aa198;
    --p-text: #073642;
    --p-muted: #657b83;
}

@media (max-width: 1040px) {
    .theme-preview-layout {
        grid-template-columns: 1fr;
    }

    .theme-picker {
        grid-template-columns: minmax(0, 1fr) minmax(220px, 0.65fr);
        align-items: start;
    }

    .theme-picker .theme-accent,
    .theme-picker .theme-preview-note,
    .theme-picker .btn {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .download-main {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .download-glyph {
        display: none;
    }

    .os-download-grid,
    .install-steps {
        grid-template-columns: 1fr;
    }

    .os-download {
        border-right: 0;
        border-bottom: 1px solid var(--rl-line);
    }

    .os-download:last-child {
        border-bottom: 0;
    }

    .theme-stage {
        --ps: 1.75;
    }

    .theme-stage .rc-preview {
        --ps: 1.75;
    }

    .theme-picker {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .theme-stage {
        --ps: 1.45;
    }

    .theme-stage .rc-preview {
        --ps: 1.45;
    }

    .theme-choice .rc-preview {
        --ps: 0.95;
    }
}

/* The bar above the live theme preview. */
.preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--rl-line);
    color: var(--rl-ash);
    font-family: var(--rl-font-mono);
    font-size: 9px;
    letter-spacing: 0.06em;
}

.preview-bar span:last-child {
    color: var(--rl-signal-soft);
}

@media (max-width: 900px) {
    .topbar-inner {
        height: auto;
        min-height: 58px;
        flex-wrap: wrap;
        row-gap: 8px;
        padding: 8px 0;
    }

    .topnav {
        order: 3;
        flex: 1 0 100%;
        gap: 16px;
        overflow-x: auto;
        padding-bottom: 6px;
        scrollbar-width: none;
    }
}
