/* ==========================================================================
   Kali Hub — design system
   --------------------------------------------------------------------------
   One stylesheet, every page. Two type roles carry the whole identity:
   Geist for human copy, Geist Mono for anything the machine produced
   (loadstrings, hashes, HWIDs, versions, counters, section labels).
   Palette is the original one — near-black, gold, emerald — rebuilt as a
   real token scale instead of scattered rgba() literals.
   ========================================================================== */

/* ---------------------------------------------------------------- tokens */
:root {
    --void: #050505;
    --ink: #08080a;
    --surface: #0d0d10;
    --surface-2: #131317;
    --surface-3: #1a1a20;

    --line: rgba(255, 255, 255, .07);
    --line-strong: rgba(255, 255, 255, .13);

    --gold: #fbbf24;
    --gold-deep: #f59e0b;
    --gold-pale: #fde68a;
    --gold-dim: rgba(251, 191, 36, .14);
    --gold-line: rgba(251, 191, 36, .32);

    --live: #34d399;
    --live-dim: rgba(52, 211, 153, .12);
    --warn: #fbbf24;
    --down: #f87171;
    --discord: #5865f2;

    --text: #f4f4f5;
    --muted: #9a9aa4;
    --faint: #61616b;
    --ghost: #4c4c56;

    --sans: 'Geist', 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'Geist Mono', ui-monospace, SFMono-Regular, 'JetBrains Mono', Menlo, monospace;

    /* Vertical rhythm. One scale, used everywhere, so sections never fight. */
    --gap: clamp(3.25rem, 7vw, 5.5rem);
    --pad: clamp(1.15rem, 4vw, 2rem);
    --shell: 1180px;
    --nav-h: 60px;

    --r-sm: 10px;
    --r-md: 16px;
    --r-lg: 22px;
    --r-xl: 30px;

    --ease: cubic-bezier(.22, 1, .36, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* ------------------------------------------------------------------ base */
*,
*::before,
*::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100svh;
    background: var(--void);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.6;
    letter-spacing: -.011em;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

::selection {
    background: var(--gold);
    color: #000;
}

img { max-width: 100%; }

a { color: inherit; }

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

/* Scrollbar — thin, gold thumb, matches the rest of the chrome. */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(251, 191, 36, .28) transparent;
}

*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }

*::-webkit-scrollbar-thumb {
    background: rgba(251, 191, 36, .22);
    border: 3px solid transparent;
    background-clip: content-box;
    border-radius: 99px;
}

*::-webkit-scrollbar-thumb:hover { background: rgba(251, 191, 36, .45); background-clip: content-box; }

/* ------------------------------------------------------------ atmosphere
   Two drifting gold masses, a faint engineering grid, and film grain.
   All CSS: no canvas, no rAF loop, nothing to schedule on a mid-range phone. */
.k-atmos {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    contain: strict;
}

.k-atmos::before,
.k-atmos::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    will-change: transform;
}

.k-atmos::before {
    width: min(78vw, 900px);
    aspect-ratio: 1;
    top: -32vh;
    left: 50%;
    background: radial-gradient(circle, rgba(251, 191, 36, .13) 0%, rgba(245, 158, 11, .05) 45%, transparent 70%);
    animation: k-drift-a 26s ease-in-out infinite;
}

.k-atmos::after {
    width: min(60vw, 680px);
    aspect-ratio: 1;
    top: 42vh;
    left: 8%;
    background: radial-gradient(circle, rgba(251, 191, 36, .07) 0%, transparent 68%);
    animation: k-drift-b 34s ease-in-out infinite;
}

/* Grid + grain sit above the glow but below every pixel of content. */
.k-atmos > i {
    position: absolute;
    inset: 0;
    display: block;
}

.k-atmos > i:first-child {
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, .028) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, .028) 1px, transparent 1px);
    background-size: 76px 76px;
    mask-image: radial-gradient(ellipse 100% 62% at 50% 0%, #000 8%, transparent 72%);
    -webkit-mask-image: radial-gradient(ellipse 100% 62% at 50% 0%, #000 8%, transparent 72%);
}

.k-atmos > i:last-child {
    opacity: .3;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
}

@keyframes k-drift-a {
    0%, 100% { transform: translate(-50%, 0) scale(1); }
    50% { transform: translate(-42%, 5vh) scale(1.12); }
}

@keyframes k-drift-b {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(14vw, -7vh) scale(.88); }
}

/* ----------------------------------------------------------------- shell */
.k-page {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100svh;
}

.k-shell {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: var(--pad);
}

.k-shell--tight { max-width: 860px; }
.k-shell--prose { max-width: 760px; }

main.k-main {
    flex: 1 0 auto;
    padding-top: calc(var(--nav-h) + 12px);
    padding-bottom: var(--gap);
}

section { position: relative; }

/* Sections only ever pad their top, so two of them stacked never add up to a
   double gap; main.k-main closes the last one. */
.k-section { padding-top: var(--gap); }
.k-section--tight { padding-top: clamp(2rem, 4.5vw, 3rem); }

/* -------------------------------------------------------------- typography */
.k-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .55em;
    margin: 0 0 1.15rem;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--gold);
}

.k-eyebrow--muted { color: var(--faint); }

.k-eyebrow::before {
    content: '';
    width: 18px;
    height: 1px;
    background: currentColor;
    opacity: .55;
}

.k-eyebrow--bare::before { display: none; }

/* The signature type treatment: one headline, two weights. The light half is
   the category, the heavy half is the thing itself. Used on every page. */
.k-display {
    margin: 0;
    font-weight: 250;
    font-size: clamp(2.5rem, 7.2vw, 5.25rem);
    line-height: .93;
    letter-spacing: -.045em;
    color: var(--text);
    text-wrap: balance;
}

.k-display b,
.k-display strong {
    font-weight: 800;
    letter-spacing: -.05em;
}

.k-display em {
    font-style: normal;
    font-weight: 800;
    background: linear-gradient(96deg, var(--gold-pale) 0%, var(--gold) 42%, var(--gold-deep) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.k-display--sm { font-size: clamp(1.85rem, 4.4vw, 3rem); line-height: .98; }
.k-display--xs { font-size: clamp(1.45rem, 3vw, 2.05rem); line-height: 1.05; letter-spacing: -.038em; }

.k-lede {
    margin: 1.35rem 0 0;
    max-width: 54ch;
    color: var(--muted);
    font-size: clamp(.95rem, 1.5vw, 1.075rem);
    line-height: 1.62;
    text-wrap: pretty;
}

.k-lede--center { margin-inline: auto; }

.k-mono {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}

.k-dim { color: var(--muted); }
.k-faint { color: var(--faint); }
.k-gold { color: var(--gold); }
.k-live { color: var(--live); }
.k-center { text-align: center; }

/* Labelled hairline. The label is a real waypoint, not decoration — it names
   what the next block of the page contains. */
.k-rule {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.k-rule > span {
    flex: none;
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--faint);
}

.k-rule::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--line-strong), transparent);
}

/* ------------------------------------------------------------------- nav */
.k-nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 90;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    background: rgba(5, 5, 5, 0);
    border-bottom: 1px solid transparent;
    transition: background .35s var(--ease), border-color .35s var(--ease), backdrop-filter .35s var(--ease);
}

.k-nav[data-stuck] {
    background: rgba(6, 6, 8, .72);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border-bottom-color: var(--line);
}

.k-nav__inner {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: var(--pad);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.k-brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    flex: none;
}

.k-brand img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    transition: transform .5s var(--ease);
}

.k-brand:hover img { transform: rotate(-8deg) scale(1.08); }

.k-brand span {
    font-size: 14.5px;
    font-weight: 650;
    letter-spacing: -.03em;
}

.k-nav__links {
    display: none;
    align-items: center;
    gap: 2px;
    margin-inline: auto;
}

.k-nav__link {
    position: relative;
    padding: 7px 11px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color .2s;
}

.k-nav__link:hover { color: var(--text); }

.k-nav__link[aria-current] { color: var(--text); }

.k-nav__link[aria-current]::after {
    content: '';
    position: absolute;
    left: 11px;
    right: 11px;
    bottom: 1px;
    height: 1.5px;
    border-radius: 2px;
    background: var(--gold);
    box-shadow: 0 0 10px rgba(251, 191, 36, .7);
}

.k-nav__end {
    flex: none;
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-left: auto;
}

.k-nav__status {
    display: none;
    align-items: center;
    gap: .45rem;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--faint);
}

.k-burger {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    gap: 5px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: rgba(255, 255, 255, .03);
    color: var(--text);
    cursor: pointer;
    padding: 0;
}

.k-burger i {
    display: block;
    width: 15px;
    height: 1.5px;
    background: currentColor;
    border-radius: 2px;
    transition: transform .3s var(--ease), opacity .2s;
}

.k-burger[aria-expanded="true"] i:first-child { transform: translateY(3.25px) rotate(45deg); }
.k-burger[aria-expanded="true"] i:last-child { transform: translateY(-3.25px) rotate(-45deg); }

@media (min-width: 1000px) {
    .k-nav__links { display: flex; }
    .k-nav__status { display: flex; }
    .k-burger { display: none; }
}

/* Scroll progress — a gold hairline under the bar. CSS scroll timeline, so it
   costs nothing on the main thread; browsers without it just never show it. */
.k-nav__progress {
    position: absolute;
    left: 0;
    bottom: -1px;
    height: 1.5px;
    width: 100%;
    transform-origin: 0 50%;
    transform: scaleX(0);
    background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-pale));
}

@supports (animation-timeline: scroll()) {
    .k-nav__progress {
        animation: k-progress linear;
        animation-timeline: scroll(root block);
    }
}

@keyframes k-progress {
    to { transform: scaleX(1); }
}

/* Mobile sheet */
.k-sheet {
    position: fixed;
    inset: var(--nav-h) 0 auto;
    z-index: 89;
    padding: .75rem var(--pad) 1.15rem;
    background: rgba(7, 7, 9, .96);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 2px;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .26s var(--ease), transform .26s var(--ease), visibility .26s;
}

.k-sheet[data-open] {
    transform: none;
    opacity: 1;
    visibility: visible;
}

.k-sheet a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 12px;
    min-height: 46px;
    border-radius: 11px;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
}

.k-sheet a:active { background: rgba(255, 255, 255, .05); }

.k-sheet a[aria-current] {
    color: var(--text);
    background: rgba(251, 191, 36, .07);
    box-shadow: inset 2px 0 0 var(--gold);
}

.k-sheet a::after {
    content: '\2192';
    font-family: var(--mono);
    color: var(--ghost);
}

@media (min-width: 1000px) {
    .k-sheet { display: none; }
}

/* --------------------------------------------------------------- surfaces */
.k-panel {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .028) 0%, rgba(255, 255, 255, 0) 42%),
        var(--surface);
    overflow: hidden;
    isolation: isolate;
}

.k-panel--pad { padding: clamp(1.25rem, 3vw, 2rem); }
.k-panel--flat { background: var(--surface); }

/* Specular sheen tracking the pointer. The position comes from CSS variables
   set on pointermove, so the paint stays on the compositor. */
.k-spot::before {
    content: '';
    position: absolute;
    inset: -1px;
    z-index: -1;
    border-radius: inherit;
    opacity: 0;
    transition: opacity .35s var(--ease);
    background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 0%), rgba(251, 191, 36, .13), transparent 62%);
}

.k-spot::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    padding: 1px;
    opacity: 0;
    transition: opacity .35s var(--ease);
    background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 0%), rgba(251, 191, 36, .55), transparent 60%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

@media (hover: hover) {
    .k-spot:hover::before,
    .k-spot:hover::after { opacity: 1; }
}

/* Lift on hover — one rule, every card, so motion reads as a single system. */
.k-lift {
    transition: transform .45s var(--ease), border-color .35s, box-shadow .45s var(--ease);
}

@media (hover: hover) {
    .k-lift:hover {
        transform: translateY(-4px);
        border-color: var(--gold-line);
        box-shadow: 0 22px 50px -22px rgba(0, 0, 0, .85), 0 0 0 1px rgba(251, 191, 36, .07);
    }
}

.k-tile {
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, .022);
    padding: clamp(1.05rem, 2.4vw, 1.4rem);
}

/* --------------------------------------------------------------- buttons */
.k-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55em;
    min-height: 46px;
    padding: 0 1.35rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: -.005em;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    touch-action: manipulation;
    overflow: hidden;
    transition: transform .3s var(--ease), background .25s, border-color .25s, box-shadow .3s;
}

.k-btn:hover {
    background: rgba(255, 255, 255, .075);
    border-color: var(--gold-line);
}

.k-btn:active { transform: scale(.975); }

.k-btn[disabled],
.k-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
}

.k-btn--gold {
    border-color: transparent;
    background: linear-gradient(135deg, var(--gold-pale) 0%, var(--gold) 38%, var(--gold-deep) 100%);
    color: #150e00;
    font-weight: 700;
    box-shadow: 0 10px 30px -12px rgba(251, 191, 36, .65), inset 0 1px 0 rgba(255, 255, 255, .45);
}

.k-btn--gold:hover {
    border-color: transparent;
    background: linear-gradient(135deg, #fff2cc 0%, var(--gold-pale) 40%, var(--gold) 100%);
    box-shadow: 0 16px 42px -12px rgba(251, 191, 36, .8), inset 0 1px 0 rgba(255, 255, 255, .55);
}

/* A single light sweep on hover — the one gloss the system allows. */
.k-btn--gold::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%);
    transform: translateX(-120%);
}

@media (hover: hover) {
    .k-btn--gold:hover::after {
        transform: translateX(120%);
        transition: transform .75s var(--ease);
    }
}

.k-btn--green {
    border-color: transparent;
    background: linear-gradient(135deg, #86efac 0%, #34d399 38%, #10b981 100%);
    color: #032013;
    font-weight: 700;
    box-shadow: 0 10px 30px -12px rgba(52, 211, 153, .55), inset 0 1px 0 rgba(255, 255, 255, .4);
}

.k-btn--discord {
    border-color: transparent;
    background: var(--discord);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 10px 30px -14px rgba(88, 101, 242, .9);
}

.k-btn--discord:hover { background: #4854d4; border-color: transparent; }

.k-btn--quiet {
    background: transparent;
    border-color: var(--line);
    color: var(--muted);
}

.k-btn--quiet:hover { color: var(--text); }

.k-btn--lg { min-height: 52px; padding: 0 1.75rem; font-size: 14.5px; }
.k-btn--sm { min-height: 38px; padding: 0 .95rem; font-size: 12.5px; }
.k-btn--block { width: 100%; }

.k-btn--wide { padding-inline: 2rem; }

/* Magnetic: JS writes --dx/--dy from pointer proximity, CSS does the moving. */
.k-magnetic { transform: translate3d(var(--dx, 0), var(--dy, 0), 0); }
.k-magnetic:active { transform: translate3d(var(--dx, 0), var(--dy, 0), 0) scale(.975); }

/* ---------------------------------------------------------------- badges */
.k-badge {
    display: inline-flex;
    align-items: center;
    gap: .45em;
    padding: 4px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(255, 255, 255, .04);
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.k-badge--gold {
    border-color: var(--gold-line);
    background: var(--gold-dim);
    color: var(--gold);
}

.k-badge--live {
    border-color: rgba(52, 211, 153, .3);
    background: var(--live-dim);
    color: var(--live);
}

.k-badge--down {
    border-color: rgba(248, 113, 113, .3);
    background: rgba(248, 113, 113, .1);
    color: var(--down);
}

/* Pulsing status dot. */
.k-dot {
    position: relative;
    width: 7px;
    height: 7px;
    flex: none;
    border-radius: 50%;
    background: var(--live);
}

.k-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: inherit;
    animation: k-ping 2s cubic-bezier(0, 0, .2, 1) infinite;
}

.k-dot--gold { background: var(--gold); }
.k-dot--down { background: var(--down); }

@keyframes k-ping {
    75%, 100% { transform: scale(2.6); opacity: 0; }
}

/* --------------------------------------------------------------- console
   The signature element. A loadstring is the product's actual front door, so
   the page opens with the real thing rather than a button that hides it. */
.k-console {
    position: relative;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    background: linear-gradient(180deg, #0f0f13 0%, #0a0a0c 100%);
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .05);
    overflow: hidden;
}

.k-console__bar {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .022);
}

.k-console__dots {
    display: flex;
    gap: 5px;
    flex: none;
}

.k-console__dots i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .13);
}

.k-console__dots i:first-child { background: rgba(251, 191, 36, .5); }

.k-console__title {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: var(--faint);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.k-console__body {
    display: flex;
    align-items: stretch;
    gap: 0;
    flex-wrap: wrap;
}

.k-console__code {
    flex: 1 1 260px;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 1rem 1.1rem;
    font-family: var(--mono);
    font-size: clamp(11.5px, 2.4vw, 13.5px);
    line-height: 1.55;
    color: #d8d8de;
    overflow-x: auto;
}

.k-console__code > span:first-child {
    flex: none;
    color: var(--gold);
    user-select: none;
}

.k-console__code code {
    font: inherit;
    white-space: pre;
}

.k-console__code .t-fn { color: var(--gold-pale); }
.k-console__code .t-str { color: #7ee2b8; }
.k-console__code .t-pun { color: #6d6d78; }

.k-console__copy {
    flex: none;
    margin: 10px 10px 10px 0;
    min-height: 44px;
}

@media (max-width: 559px) {
    .k-console__copy { margin: 0 10px 10px; width: calc(100% - 20px); }
}

/* Caret that idles at the end of the command. */
.k-caret {
    display: inline-block;
    width: 7px;
    height: 1.05em;
    vertical-align: -.16em;
    background: var(--gold);
    animation: k-blink 1.15s steps(2, start) infinite;
}

@keyframes k-blink {
    to { opacity: 0; }
}

/* ----------------------------------------------------------------- stats */
.k-stat {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: clamp(1.1rem, 2.6vw, 1.5rem);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: rgba(255, 255, 255, .02);
}

.k-stat__value {
    font-family: var(--mono);
    font-size: clamp(1.6rem, 4.2vw, 2.35rem);
    font-weight: 500;
    letter-spacing: -.045em;
    line-height: 1;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.k-stat__label {
    font-size: 13px;
    font-weight: 550;
    color: var(--text);
}

.k-stat__note {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ghost);
}

/* ----------------------------------------------------------------- grids */
.k-grid {
    display: grid;
    gap: clamp(.75rem, 1.6vw, 1rem);
}

.k-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.k-grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.k-grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 152px), 1fr)); }
.k-grid--cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 232px), 1fr)); }

/* ------------------------------------------------------------ game cards */
.k-game {
    position: relative;
    display: block;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
    overflow: hidden;
    text-decoration: none;
    isolation: isolate;
}

.k-game__shell {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #0b0b0e;
    overflow: hidden;
}

/* Shimmer while Roblox has not answered yet; removed the moment it loads. */
.k-game__shell::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 34%, rgba(255, 255, 255, .05) 50%, transparent 66%);
    transform: translateX(-100%);
    animation: k-shimmer 1.6s ease-in-out infinite;
}

@keyframes k-shimmer {
    100% { transform: translateX(100%); }
}

.k-game__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.01);
    transition: opacity .45s var(--ease), transform .6s var(--ease);
}

.k-game.is-ready .k-game__shell::after { display: none; }
.k-game.is-ready .k-game__img { opacity: 1; }

@media (hover: hover) {
    .k-game:hover .k-game__img { transform: scale(1.06); }
}

.k-game__img.is-fallback {
    object-fit: contain;
    padding: 2rem;
    opacity: .28;
}

.k-game.is-ready .k-game__img.is-fallback { opacity: .28; }

.k-game__meta {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .7rem .85rem;
    border-top: 1px solid var(--line);
}

.k-game__name {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 550;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.k-game__state {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--live);
}

/* ----------------------------------------------------------------- forms */
.k-field {
    position: relative;
    display: flex;
    align-items: center;
}

.k-field > i.fas,
.k-field > i.fa-solid {
    position: absolute;
    left: 14px;
    color: var(--ghost);
    font-size: 13px;
    pointer-events: none;
}

.k-input {
    width: 100%;
    min-height: 48px;
    padding: 12px 15px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: rgba(0, 0, 0, .45);
    color: var(--text);
    font-family: var(--mono);
    font-size: 14px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.k-field > i + .k-input { padding-left: 38px; }

.k-input::placeholder { color: var(--ghost); }

.k-input:focus {
    outline: none;
    border-color: var(--gold-line);
    background: rgba(0, 0, 0, .6);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, .1);
}

/* ------------------------------------------------------------------ list */
.k-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: .7rem;
}

.k-list li {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    font-size: 14px;
    color: var(--muted);
}

.k-list li > i {
    flex: none;
    margin-top: .28em;
    font-size: 11px;
    color: var(--gold);
}

.k-list li b { color: var(--text); font-weight: 600; }

/* --------------------------------------------------------------- reveals
   One observer, one class. Stagger comes from --i so markup stays clean. */
.k-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition:
        opacity .8s var(--ease-out) calc(var(--i, 0) * 65ms),
        transform .8s var(--ease-out) calc(var(--i, 0) * 65ms);
    will-change: opacity, transform;
}

.k-reveal.is-in {
    opacity: 1;
    transform: none;
}

/* Page-load sequence for the hero: each line wipes up from behind a mask. */
.k-rise > * {
    display: block;
    animation: k-rise .95s var(--ease-out) both;
    animation-delay: calc(.06s + var(--i, 0) * .09s);
}

.k-rise {
    clip-path: inset(-30% -20% -10% -20%);
}

@keyframes k-rise {
    from { opacity: 0; transform: translateY(115%) rotate(1.5deg); }
    to { opacity: 1; transform: none; }
}

.k-fade {
    animation: k-fade .9s var(--ease-out) both;
    animation-delay: calc(.2s + var(--i, 0) * .09s);
}

@keyframes k-fade {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- footer */
.k-footer {
    flex: none;
    border-top: 1px solid var(--line);
    padding-block: clamp(2rem, 5vw, 3rem);
    background: linear-gradient(180deg, transparent, rgba(251, 191, 36, .022));
}

.k-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.75rem;
}

.k-footer__brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: 13px;
    font-weight: 600;
}

.k-footer__brand img { width: 22px; height: 22px; object-fit: contain; }

.k-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1.25rem;
    margin-left: auto;
}

.k-footer__links a {
    font-size: 12.5px;
    color: var(--faint);
    text-decoration: none;
    transition: color .2s;
}

.k-footer__links a:hover { color: var(--gold); }

.k-footer__fine {
    width: 100%;
    margin: 0;
    padding-top: 1.15rem;
    border-top: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1.7;
    letter-spacing: .02em;
    color: var(--ghost);
}

/* -------------------------------------------------------------- utilities */
.k-hairline {
    height: 1px;
    border: 0;
    margin: 0;
    background: linear-gradient(90deg, transparent, var(--line-strong) 18%, var(--line-strong) 82%, transparent);
}

.k-anchor { scroll-margin-top: calc(var(--nav-h) + 24px); }

.k-break { overflow-wrap: anywhere; word-break: break-word; }

.k-float { animation: k-float 6s ease-in-out infinite; }

@keyframes k-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-9px); }
}

.k-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------- prose (legal) */
.k-prose { color: var(--muted); font-size: 15px; line-height: 1.75; }

.k-prose h2 {
    margin: 0 0 .85rem;
    font-size: clamp(1.15rem, 2.4vw, 1.4rem);
    font-weight: 650;
    letter-spacing: -.028em;
    color: var(--text);
    text-wrap: balance;
}

.k-prose h3 {
    margin: 1.75rem 0 .6rem;
    font-size: 15px;
    font-weight: 650;
    color: var(--text);
}

.k-prose p { margin: 0 0 .9rem; }
.k-prose p:last-child { margin-bottom: 0; }

.k-prose ul,
.k-prose ol { margin: 0 0 .9rem; padding-left: 1.15rem; display: grid; gap: .55rem; }

.k-prose li::marker { color: var(--gold-line); }

.k-prose strong,
.k-prose b { color: var(--text); font-weight: 600; }

.k-prose a {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--gold-line);
}

.k-prose a:hover { text-decoration-color: var(--gold); }

/* Numbered legal sections: the number is set in mono in the margin, so the
   heading itself stays clean and the order stays scannable. */
.k-clause {
    display: grid;
    grid-template-columns: 1fr;
    gap: .5rem 1.5rem;
    padding-block: clamp(1.5rem, 3vw, 2rem);
    border-top: 1px solid var(--line);
}

.k-clause:first-child { border-top: 0; padding-top: 0; }

.k-clause__no {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .16em;
    color: var(--gold);
    padding-top: .3rem;
}

@media (min-width: 800px) {
    .k-clause { grid-template-columns: 68px 1fr; }
    .k-clause__no { grid-row: span 2; }
}

/* Sticky table of contents for the legal pages. */
.k-toc {
    position: sticky;
    top: calc(var(--nav-h) + 20px);
    display: grid;
    gap: 1px;
    align-content: start;
}

.k-toc a {
    display: block;
    padding: 7px 12px;
    border-left: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--faint);
    text-decoration: none;
    transition: color .2s, border-color .2s;
}

.k-toc a:hover,
.k-toc a.is-active {
    color: var(--text);
    border-left-color: var(--gold);
}

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

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }

    .k-reveal { opacity: 1; transform: none; }
    .k-magnetic { transform: none; }
}
