/* ==========================================================================
   Checkora design system
   One stylesheet for every page: colours, type, layout and components.
   Page stylesheets only add what is particular to that page.
   ========================================================================== */

:root {
    color-scheme: dark;

    --ink-0: #08080a;
    --ink-1: #101014;
    --ink-2: #17171d;
    --ink-3: #20202a;
    --line: rgba(255, 240, 205, 0.1);
    --line-strong: rgba(255, 240, 205, 0.22);

    --title: #f6efdd;
    --text: #cdc6b4;
    --muted: #8d8778;

    --gold: #f2b93b;
    --gold-bright: #ffd772;
    --gold-deep: #b9811a;
    --on-gold: #17110a;
    --gold-wash: rgba(242, 185, 59, 0.12);

    --check: #ff5a4a;
    --check-wash: rgba(255, 90, 74, 0.12);
    --good: #45d19a;
    --good-wash: rgba(69, 209, 154, 0.12);
    --info: #74b4ff;

    --font-sans: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --pad: clamp(18px, 4vw, 56px);
    --nav-height: 72px;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);

    /* Names the older page stylesheets still read. */
    --bg-primary: var(--ink-0);
    --bg-dark: var(--ink-0);
    --nav-bg: var(--ink-1);
    --card-bg: var(--ink-1);
    --card-border: var(--line);
    --card-hover: var(--ink-2);
    --text-primary: var(--text);
    --text-title: var(--title);
    --text-secondary: var(--muted);
    --accent-gold: var(--gold);
    --border-color: var(--line);
    --danger-red: var(--check);
    --input-bg: var(--ink-2);
    --input-border: var(--line-strong);
    --input-text: var(--title);
    --input-placeholder: var(--muted);
}

[data-theme='light'] {
    color-scheme: light;

    --ink-0: #f5f0e4;
    --ink-1: #fffdf7;
    --ink-2: #f1ebdc;
    --ink-3: #e8e0cc;
    --line: rgba(40, 30, 10, 0.12);
    --line-strong: rgba(40, 30, 10, 0.26);

    --title: #17140f;
    --text: #3d382d;
    --muted: #736c5c;

    --gold: #a56a00;
    --gold-bright: #c98a10;
    --gold-deep: #7d5000;
    --on-gold: #fffaf0;
    --gold-wash: rgba(165, 106, 0, 0.1);

    --check: #c8281a;
    --check-wash: rgba(200, 40, 26, 0.08);
    --good: #11774f;
    --good-wash: rgba(17, 119, 79, 0.09);
    --info: #1f62b8;
    --shadow: 0 24px 50px -28px rgba(60, 45, 10, 0.35);
}

/* ---------- base ---------- */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 16px);
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--ink-0);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* A warm light from above, the same on every page. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(70% 55% at 50% -10%, var(--gold-wash), transparent 70%),
        radial-gradient(40% 40% at 100% 100%, rgba(242, 185, 59, 0.05), transparent 70%);
}

img,
svg,
canvas,
video {
    display: block;
    max-width: 100%;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    color: var(--title);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

h1 {
    font-size: clamp(34px, 5vw, 60px);
}
h2 {
    font-size: clamp(26px, 3.4vw, 42px);
}
h3 {
    font-size: clamp(19px, 1.8vw, 24px);
    letter-spacing: -0.015em;
}
h4 {
    font-size: 16px;
    letter-spacing: 0;
}

p {
    margin: 0;
    text-wrap: pretty;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

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

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

/* The hidden attribute wins over any component's display value. */
[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: fixed;
    left: 12px;
    top: -80px;
    z-index: 200;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--gold);
    color: var(--on-gold);
    font-weight: 600;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 12px;
}

/* ---------- type helpers ---------- */

.display {
    font-size: clamp(44px, 7.4vw, 108px);
    font-weight: 700;
    line-height: 0.94;
    letter-spacing: -0.045em;
}
.serif {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--gold);
}
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
}
.eyebrow::before {
    content: '';
    width: 22px;
    height: 1px;
    background: currentColor;
}
.lede {
    max-width: 58ch;
    font-size: clamp(17px, 1.5vw, 20px);
    line-height: 1.55;
    color: var(--text);
}
.mono {
    font-family: var(--font-mono);
    font-size: 0.86em;
    letter-spacing: 0.01em;
}
.muted {
    color: var(--muted);
}
.gold {
    color: var(--gold);
}
.text-link {
    color: var(--gold);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}
.text-link:hover {
    border-color: currentColor;
}

/* ---------- layout ---------- */

.site-main {
    flex: 1;
    padding-top: var(--nav-height);
}
.wrap {
    width: min(1180px, 100% - 2 * var(--pad));
    margin-inline: auto;
}
.wrap--narrow {
    width: min(760px, 100% - 2 * var(--pad));
}
.wrap--wide {
    width: min(1380px, 100% - 2 * var(--pad));
}
.section {
    padding-block: clamp(48px, 7vw, 96px);
}
.page {
    padding-block: clamp(28px, 5vw, 56px) clamp(56px, 8vw, 96px);
}
.stack {
    display: flex;
    flex-direction: column;
    gap: var(--gap, 16px);
}
.cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--gap, 12px);
}
.grid {
    display: grid;
    gap: var(--gap, 18px);
    grid-template-columns: repeat(auto-fit, minmax(min(var(--min, 260px), 100%), 1fr));
}
.spread {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 24px;
}

.page-head {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: clamp(24px, 4vw, 44px);
}
.page-head p {
    max-width: 60ch;
    color: var(--muted);
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--muted);
    transition: color 0.2s, gap 0.25s var(--ease-out);
}
.back-link::before {
    content: '←';
}
.back-link:hover {
    color: var(--gold);
    gap: 12px;
}
/* On a touch screen the link takes a tap a little way outside its text.
   Nothing moves: the extra area is laid over the page, not added to it. */
@media (hover: none) and (pointer: coarse) {
    .back-link {
        position: relative;
    }
    .back-link::after {
        content: '';
        position: absolute;
        inset: -10px -8px;
    }
}

/* ---------- navigation ---------- */

.site-nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    border-bottom: 1px solid transparent;
    transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}
.site-nav.is-stuck {
    background: color-mix(in srgb, var(--ink-0) 82%, transparent);
    border-color: var(--line);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
}
.site-nav__inner {
    width: min(1380px, 100% - 2 * var(--pad));
    margin-inline: auto;
    display: flex;
    align-items: center;
    gap: 24px;
}
/* The Checkora logo, unchanged: the glowing king and the Cinzel wordmark. */
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: 'Cinzel', serif;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--title);
    transition: opacity 0.3s, filter 0.3s;
}
.brand:hover {
    opacity: 0.9;
    filter: drop-shadow(0 0 10px rgba(201, 168, 76, 0.35));
}
.brand__icon {
    height: 40px;
    width: auto;
    animation: logo-glow 2.5s ease-in-out infinite alternate;
    transition: transform 0.3s;
}
.brand:hover .brand__icon {
    transform: scale(1.07);
}
.brand__name span {
    color: var(--gold);
}
@keyframes logo-glow {
    0% {
        filter: brightness(1.6) contrast(1.3) drop-shadow(0 0 4px rgba(0, 200, 255, 0.3));
    }
    100% {
        filter: brightness(1.6) contrast(1.3) drop-shadow(0 0 12px rgba(0, 200, 255, 0.8));
    }
}
.site-nav__links {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-inline: auto;
}
.site-nav__links a {
    position: relative;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 15px;
    color: var(--text);
    transition: color 0.2s, background 0.2s;
}
.site-nav__links a:hover,
.site-nav__links a[aria-current='page'] {
    color: var(--title);
    background: var(--gold-wash);
}
.site-nav__links a[aria-current='page'] {
    color: var(--gold);
}
.site-nav__tools {
    display: flex;
    align-items: center;
    gap: 10px;
}
.icon-button {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: transparent;
    color: var(--title);
    transition: border-color 0.2s, background 0.2s, transform 0.3s var(--ease-spring);
}
.icon-button:hover {
    border-color: var(--gold);
    background: var(--gold-wash);
    transform: rotate(-12deg);
}
.icon-button svg {
    width: 18px;
    height: 18px;
}
.theme-toggle .icon-sun,
[data-theme='light'] .theme-toggle .icon-moon {
    display: none;
}
[data-theme='light'] .theme-toggle .icon-sun {
    display: block;
}
.nav-menu-button {
    display: none;
}

/* Account and appearance menus share one popover. */
.menu {
    position: relative;
}
.menu__button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px 0 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--title);
    transition: border-color 0.2s, background 0.2s;
}
.menu__button:hover,
.menu.is-open .menu__button {
    border-color: var(--gold);
    background: var(--gold-wash);
}
.menu__button svg {
    width: 14px;
    height: 14px;
    transition: transform 0.25s var(--ease-out);
}
.menu.is-open .menu__button svg {
    transform: rotate(180deg);
}
.avatar {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--gold);
    color: var(--on-gold);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.avatar--lg {
    width: 72px;
    height: 72px;
    font-size: 28px;
}
.menu__panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    padding: 8px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--ink-1);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.98);
    transform-origin: top right;
    transition: opacity 0.18s, transform 0.22s var(--ease-out), visibility 0s linear 0.22s;
}
.menu.is-open .menu__panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition-delay: 0s;
}
.menu__panel a,
.menu__panel button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 10px;
    background: none;
    font-size: 14.5px;
    text-align: left;
    color: var(--text);
    transition: background 0.15s, color 0.15s;
}
.menu__panel a:hover,
.menu__panel button:hover {
    background: var(--gold-wash);
    color: var(--title);
}
.menu__panel hr {
    margin: 6px 4px;
    border: 0;
    border-top: 1px solid var(--line);
}
.menu__panel .is-danger {
    color: var(--check);
}
.menu__panel .is-danger:hover {
    background: var(--check-wash);
    color: var(--check);
}
.menu__label {
    padding: 8px 12px 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

@media (max-width: 1040px) {
    :root {
        --nav-height: 64px;
    }
    .nav-menu-button {
        display: inline-grid;
    }
    .site-nav__links {
        position: fixed;
        inset: var(--nav-height) 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        margin: 0;
        padding: 12px var(--pad) 20px;
        background: var(--ink-0);
        border-bottom: 1px solid var(--line);
        /* On a phone held sideways the six links are taller than the
           screen, so the panel scrolls instead of losing the last one. */
        max-height: calc(100vh - var(--nav-height));
        max-height: calc(100dvh - var(--nav-height));
        overflow-y: auto;
        overscroll-behavior: contain;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.2s, transform 0.25s var(--ease-out), visibility 0s linear 0.25s;
    }
    .site-nav.is-open .site-nav__links {
        opacity: 1;
        visibility: visible;
        transform: none;
        transition-delay: 0s;
    }
    .site-nav.is-open {
        background: var(--ink-0);
    }
    .site-nav__links a {
        padding: 14px 12px;
        font-size: 17px;
        border-radius: 12px;
    }
    .site-nav__inner {
        gap: 10px;
    }
    .site-nav__tools {
        margin-left: auto;
    }
    .menu__button span.menu__name {
        display: none;
    }
    .menu__button {
        padding: 0 8px 0 6px;
    }
    .site-nav .nav-guest-signin,
    .site-nav .cursor-dropdown {
        display: none;
    }
}
@media (max-width: 480px) {
    .site-nav .brand {
        gap: 8px;
        font-size: 1.02rem;
        letter-spacing: 1px;
    }
    .site-nav .brand__icon {
        height: 32px;
    }
    .site-nav__tools {
        gap: 6px;
    }
    .site-nav__tools .button--sm {
        padding: 0 12px;
    }
}
/* At 320px the logo, the theme toggle, Register and the menu button are a
   few pixels wider than the bar, which pushed the logo against the toggle
   and the menu button toward the edge. */
@media (max-width: 359px) {
    .site-nav__inner {
        gap: 6px;
    }
    .site-nav .brand {
        gap: 6px;
        font-size: 0.94rem;
        letter-spacing: 0.5px;
    }
    .site-nav__tools .button--sm {
        padding: 0 10px;
    }
}
/* A menu opened from the navbar never runs past the bottom of the screen;
   on a short one (a phone held sideways) it scrolls. */
.site-nav .menu__panel {
    max-height: calc(100vh - var(--nav-height) - 8px);
    max-height: calc(100dvh - var(--nav-height) - 8px);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.menu__name {
    max-width: 14ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- buttons ---------- */

.button {
    --button-bg: transparent;
    --button-fg: var(--title);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 22px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--button-bg);
    color: var(--button-fg);
    font-size: 15.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    transition: transform 0.25s var(--ease-spring), border-color 0.2s, background 0.2s, box-shadow 0.3s;
}
.button:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
}
.button:active {
    transform: translateY(0) scale(0.97);
    transition-duration: 0.08s;
}
.button--primary {
    --button-bg: linear-gradient(180deg, var(--gold-bright), var(--gold));
    --button-fg: var(--on-gold);
    border-color: transparent;
    box-shadow: 0 10px 30px -12px var(--gold);
}
.button--primary:hover {
    border-color: transparent;
    box-shadow: 0 16px 36px -12px var(--gold);
}
/* A band of light crosses the gold button on hover. */
.button--primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%);
    transform: translateX(-120%);
}
.button--primary:hover::after {
    transform: translateX(120%);
    transition: transform 0.7s var(--ease-out);
}
.button--ghost {
    border-color: transparent;
}
.button--ghost:hover {
    background: var(--gold-wash);
    border-color: transparent;
}
.button--danger {
    --button-fg: var(--check);
    border-color: color-mix(in srgb, var(--check) 45%, transparent);
}
.button--danger:hover {
    background: var(--check-wash);
    border-color: var(--check);
}
.button--sm {
    min-height: 36px;
    padding: 0 14px;
    font-size: 14px;
}
/* A small button is still big enough for a finger. */
@media (hover: none) and (pointer: coarse) {
    .button--sm {
        min-height: 40px;
    }
}
.button--lg {
    min-height: 56px;
    padding: 0 30px;
    font-size: 17px;
}
.button--block {
    width: 100%;
}
.button[disabled],
.button[aria-disabled='true'] {
    opacity: 0.5;
    pointer-events: none;
}
.button svg {
    width: 18px;
    height: 18px;
    flex: none;
}

/* ---------- surfaces ---------- */

.panel {
    position: relative;
    padding: clamp(18px, 2.4vw, 28px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--ink-1);
}
.panel--raised {
    background: var(--ink-2);
    box-shadow: var(--shadow);
}
.panel--link {
    display: block;
    transition: translate 0.35s var(--ease-out), transform 0.5s var(--ease-out), border-color 0.25s, background 0.25s;
}
.panel--link:hover {
    translate: 0 -4px;
    border-color: color-mix(in srgb, var(--gold) 55%, transparent);
    background: var(--ink-2);
}
.panel__title {
    margin-bottom: 8px;
}

/* Cards that lean toward the pointer. app.js sets the angles. */
[data-tilt] {
    transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateZ(0);
    transform-style: preserve-3d;
    transition: transform 0.5s var(--ease-out);
    will-change: transform;
}
[data-tilt].is-tilting {
    transition-duration: 0.08s;
}
[data-tilt]::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(240px circle at var(--glare-x, 50%) var(--glare-y, 0%), rgba(255, 220, 140, 0.16), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}
[data-tilt].is-tilting::after {
    opacity: 1;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--ink-1);
}
.stat__value {
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: var(--title);
}
.stat__label {
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.5;
    color: var(--text);
    white-space: nowrap;
}
.chip--gold {
    border-color: transparent;
    background: var(--gold-wash);
    color: var(--gold);
}
.chip--good {
    border-color: transparent;
    background: var(--good-wash);
    color: var(--good);
}
.chip--check {
    border-color: transparent;
    background: var(--check-wash);
    color: var(--check);
}

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: clamp(36px, 6vw, 72px) 20px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    text-align: center;
    color: var(--muted);
}
.empty h3 {
    color: var(--title);
}

.progress {
    height: 8px;
    border-radius: 999px;
    background: var(--ink-3);
    overflow: hidden;
}
.progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright));
    transition: width 0.8s var(--ease-out);
}

/* ---------- forms ---------- */

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.field > label,
.field__label {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--title);
}
.input,
.field input:not([type='checkbox'], [type='radio'], [type='file'], [type='range']),
.field select,
.field textarea {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--ink-2);
    color: var(--title);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.5;
}
.input::placeholder,
.field input::placeholder,
.field textarea::placeholder {
    color: var(--muted);
}
.input:hover,
.field input:hover,
.field select:hover,
.field textarea:hover {
    border-color: color-mix(in srgb, var(--gold) 50%, var(--line-strong));
}
.input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 4px var(--gold-wash);
}
.field__hint {
    font-size: 13px;
    color: var(--muted);
}
.field__error,
.errorlist {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13.5px;
    color: var(--check);
}
.field--password {
    position: relative;
}
.field--password input {
    padding-right: 48px;
}
.field--password .field__reveal {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--muted);
}
.field--password .field__reveal:hover {
    color: var(--gold);
}
.check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14.5px;
    color: var(--text);
}
.check input {
    width: 18px;
    height: 18px;
    accent-color: var(--gold);
}
@media (hover: none) and (pointer: coarse) {
    .check {
        min-height: 40px;
    }
}

/* ---------- notices and toasts ---------- */

.notice {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--ink-2);
    font-size: 14.5px;
    color: var(--title);
}
.notice--error {
    border-color: color-mix(in srgb, var(--check) 50%, transparent);
    background: var(--check-wash);
}
.notice--success {
    border-color: color-mix(in srgb, var(--good) 50%, transparent);
    background: var(--good-wash);
}
.notice--warning {
    border-color: color-mix(in srgb, var(--gold) 50%, transparent);
    background: var(--gold-wash);
}
.messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}
.messages:empty {
    display: none;
}

#toast-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(360px, calc(100vw - 40px));
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--info);
    border-radius: 12px;
    background: var(--ink-2);
    box-shadow: var(--shadow);
    font-size: 14.5px;
    color: var(--title);
    pointer-events: auto;
    cursor: pointer;
    animation: toast-in 0.35s var(--ease-spring) both;
}
.toast-success {
    border-left-color: var(--good);
}
.toast-error {
    border-left-color: var(--check);
}
.toast-warning {
    border-left-color: var(--gold);
}
.toast.hiding {
    animation: toast-out 0.25s ease-in both;
}
@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.96);
    }
}
@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateX(24px);
    }
}

/* ---------- tables and tabs ---------- */

.table-wrap {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--ink-1);
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}
.data-table th,
.data-table td {
    padding: 14px 18px;
    text-align: left;
    white-space: nowrap;
}
.data-table th {
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}
.data-table tbody tr + tr td {
    border-top: 1px solid var(--line);
}
.data-table tbody tr {
    transition: background 0.15s;
}
.data-table tbody tr:hover {
    background: var(--gold-wash);
}
.data-table .is-me td {
    background: var(--gold-wash);
    color: var(--title);
}
.data-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--ink-1);
}
.tabs button,
.tabs a {
    padding: 8px 16px;
    border: 0;
    border-radius: 999px;
    background: none;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--muted);
    transition: color 0.2s, background 0.2s;
}
.tabs button:hover,
.tabs a:hover {
    color: var(--title);
}
.tabs .is-active,
.tabs .is-active:hover,
.tabs [aria-selected='true'],
.tabs [aria-selected='true']:hover,
.tabs [aria-pressed='true'],
.tabs [aria-pressed='true']:hover,
.tabs [aria-current='page'],
.tabs [aria-current='page']:hover {
    background: var(--gold);
    color: var(--on-gold);
}
@media (hover: none) and (pointer: coarse) {
    .tabs button,
    .tabs a {
        min-height: 40px;
    }
}

/* ---------- dialogs ---------- */

dialog.modal {
    width: min(640px, calc(100vw - 32px));
    max-height: min(84vh, 760px);
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background: var(--ink-1);
    color: var(--text);
    box-shadow: var(--shadow);
}
dialog.modal::backdrop {
    background: rgba(4, 4, 6, 0.72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
dialog.modal[open] {
    animation: modal-in 0.35s var(--ease-out);
}
@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.97);
    }
}
.modal__head {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    background: var(--ink-1);
}
/* A long title must wrap; it must not squeeze the close button. */
.modal__head .icon-button {
    flex: none;
}
.modal__body {
    padding: 20px 24px 28px;
}
.modal__body h3 {
    margin: 22px 0 8px;
    font-size: 17px;
}
.modal__body ul {
    margin: 8px 0 0;
    padding-left: 20px;
}
.modal__body li + li {
    margin-top: 4px;
}

/* ---------- footer ---------- */

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--ink-1) 60%, transparent);
}
.site-footer__grid {
    display: grid;
    grid-template-columns: 1.6fr repeat(3, 1fr);
    gap: 32px;
    padding-block: clamp(36px, 5vw, 64px) 28px;
}
.site-footer h4 {
    margin-bottom: 14px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}
.site-footer ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.site-footer li a,
.site-footer li button {
    display: inline-block;
    padding: 4px 0;
    border: 0;
    background: none;
    font-size: 15px;
    color: var(--text);
    transition: color 0.2s;
}
.site-footer li a:hover,
.site-footer li button:hover {
    color: var(--gold);
}
.site-footer__about p {
    max-width: 36ch;
    margin-top: 14px;
    font-size: 15px;
    color: var(--muted);
}
.site-footer__discord {
    margin-top: 18px;
}
.site-footer__base {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 24px;
    padding-block: 18px 26px;
    border-top: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--muted);
}
@media (max-width: 800px) {
    .site-footer__grid {
        grid-template-columns: 1fr 1fr;
    }
    .site-footer__about {
        grid-column: 1 / -1;
    }
}

/* ---------- motion ---------- */

/* Elements marked data-reveal rise in when they scroll into view. */
/* They move with the translate and scale properties, not transform, so a
   card can rise in and still lean toward the pointer. */
[data-reveal] {
    opacity: 0;
    translate: 0 26px;
    transition: opacity 0.7s var(--ease-out), translate 0.8s var(--ease-out), scale 0.8s var(--ease-out), transform 0.5s var(--ease-out);
    transition-delay: calc(var(--i, 0) * 70ms);
}
[data-reveal='left'] {
    translate: -32px 0;
}
[data-reveal='scale'] {
    translate: none;
    scale: 0.94;
}
[data-reveal].is-in {
    opacity: 1;
    translate: none;
    scale: none;
}
[data-reveal].is-in[data-tilt] {
    transition-delay: 0s;
}
.no-js [data-reveal] {
    opacity: 1;
    translate: none;
    scale: none;
}

@view-transition {
    navigation: auto;
}
::view-transition-old(root) {
    animation: page-out 0.18s ease-in both;
}
::view-transition-new(root) {
    animation: page-in 0.32s var(--ease-out) both;
}
@keyframes page-out {
    to {
        opacity: 0;
    }
}
@keyframes page-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
}

.theme-transition,
.theme-transition * {
    transition: background-color 0.3s, border-color 0.3s, color 0.3s !important;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    [data-reveal] {
        opacity: 1;
        translate: none;
        scale: none;
    }
    [data-tilt] {
        transform: none !important;
    }
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation: none;
    }
}

/* The chosen option in a menu of choices (the cursor effect list). */
.menu__panel .selected {
    color: var(--gold);
}
.menu__panel .selected::after {
    content: '✓';
    margin-left: auto;
}

/* ---------- the low performance tier ----------
   perf.js puts data-perf="low" on <html> for a machine that cannot keep up
   with the page. Nothing is taken away and nothing moves: every page, every
   control and every hover and focus state is still there. What goes is the
   costly decoration: blur behind the navbar and dialogs, wide glows, cards
   that lean, long entrances and animations that never stop. Each page
   stylesheet ends with a block like this one for its own effects. */

[data-perf='low'] {
    /* A tighter shadow costs far less to draw than a wide soft one. */
    --shadow: 0 10px 22px -12px rgba(0, 0, 0, 0.7);
    scroll-behavior: auto;
}
[data-perf='low'][data-theme='light'] {
    --shadow: 0 10px 20px -14px rgba(60, 45, 10, 0.4);
}

/* Solid colour where there was blur. */
[data-perf='low'] .site-nav {
    transition: background 0.2s, border-color 0.2s;
}
[data-perf='low'] .site-nav.is-stuck {
    background: var(--ink-0);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}
[data-perf='low'] dialog.modal::backdrop {
    background: rgba(4, 4, 6, 0.84);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

/* The logo keeps its glow but the glow no longer breathes. */
[data-perf='low'] .brand__icon {
    animation: none;
    filter: brightness(1.6) contrast(1.3) drop-shadow(0 0 6px rgba(0, 200, 255, 0.5));
}

/* The gold button: no halo under it and no band of light across it. It
   still lifts on hover like every other button. */
[data-perf='low'] .button--primary,
[data-perf='low'] .button--primary:hover {
    box-shadow: none;
}
[data-perf='low'] .button--primary::after {
    display: none;
}

/* Cards stay level (app.js stops setting the angles too). A linked card
   still rises on hover. */
[data-perf='low'] [data-tilt] {
    transform: none;
    transition: none;
    will-change: auto;
}
[data-perf='low'] [data-tilt]::after {
    display: none;
}

/* Hover still answers, but at once. A list scrolling under the pointer
   would otherwise start a colour fade on every row it passes. */
[data-perf='low'] .data-table tbody tr,
[data-perf='low'] .panel--link,
[data-perf='low'] .site-nav__links a,
[data-perf='low'] .menu__panel a,
[data-perf='low'] .menu__panel button,
[data-perf='low'] .tabs button,
[data-perf='low'] .tabs a {
    transition: none;
}

/* Things marked data-reveal fade in where they stand, with no travel and
   no stagger. */
[data-perf='low'] [data-reveal] {
    translate: none;
    scale: none;
    transition: opacity 0.2s linear;
    transition-delay: 0s;
}

[data-perf='low'] .progress > span {
    transition: none;
}

/* A page change is a plain page change, and a theme change is at once. */
[data-perf='low']::view-transition-old(root),
[data-perf='low']::view-transition-new(root) {
    animation: none;
}
[data-perf='low'].theme-transition,
[data-perf='low'].theme-transition * {
    transition: none !important;
}

/* The cursor effects are off, so their menu has nothing to choose. It is
   already hidden on phones for the same reason. */
[data-perf='low'] .site-nav .cursor-dropdown {
    display: none;
}
