/* The dashboard's look: the Abyss's colours restated, not imported, so that
   nothing in an app's stylesheet can break this page. Dark throughout, as the
   apps are: the light comes from the violet behind everything, the cards
   float on it, and what is under way glows. */
:root {
    --bg: #05070d;
    --panel: rgba(16, 21, 38, 0.72);
    --panel-solid: #0d1220;
    --raised: rgba(255, 255, 255, 0.04);
    --text: #eef1f8;
    --muted: #a9b1c6;
    --faint: #6b7390;
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.16);
    --accent: #7c5cff;
    --accent-soft: rgba(124, 92, 255, 0.16);
    --accent-2: #22d3ee;
    --done: #7fcb9b;
    --warn: #e5b45c;
    --bad: #f07171;
    /* The lab's logo is set in Century Gothic; where it is not installed, the
       nearest geometric sans there is. Nothing is fetched for it. */
    --gothic: "Century Gothic", CenturyGothic, AppleGothic, "URW Gothic", "URW Gothic L", Futura, "Trebuchet MS", sans-serif;
    --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --ease: cubic-bezier(0.22, 0.85, 0.3, 1);
    --radius: 18px;
    color-scheme: dark;
    scrollbar-color: rgba(238, 241, 248, 0.22) transparent;
}

* {
    box-sizing: border-box;
}

/* Hidden means hidden, whatever display a class gives it. */
[hidden] {
    display: none !important;
}

html {
    overflow-x: hidden;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* The light behind the page: two slow glows, violet and a little cyan, and a
   grain of stars, all fixed so the cards scroll over them. */
.sky {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(60vmax 50vmax at 15% -10%, rgba(124, 92, 255, 0.22), transparent 60%),
        radial-gradient(50vmax 40vmax at 100% 10%, rgba(34, 211, 238, 0.09), transparent 60%),
        radial-gradient(70vmax 50vmax at 50% 120%, rgba(124, 92, 255, 0.1), transparent 60%);
    animation: drift 24s ease-in-out infinite alternate;
}

.sky::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 12% 22%, rgba(255, 255, 255, 0.5), transparent 60%),
        radial-gradient(1px 1px at 72% 14%, rgba(255, 255, 255, 0.35), transparent 60%),
        radial-gradient(1px 1px at 38% 68%, rgba(255, 255, 255, 0.3), transparent 60%),
        radial-gradient(1px 1px at 86% 58%, rgba(255, 255, 255, 0.4), transparent 60%),
        radial-gradient(1px 1px at 56% 36%, rgba(255, 255, 255, 0.25), transparent 60%),
        radial-gradient(1px 1px at 22% 86%, rgba(255, 255, 255, 0.3), transparent 60%);
    opacity: 0.7;
}

@keyframes drift {
    to {
        transform: translate3d(-2%, 2%, 0) scale(1.05);
    }
}

main {
    flex: 1;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 8px 24px 64px;
}

h1,
h2,
h3 {
    margin: 0;
    font-weight: 600;
}

.icon {
    width: 1.1em;
    height: 1.1em;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* -------------------------------- the bar -------------------------------- */

.bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1120px;
    width: 100%;
    margin: 0 auto;
    padding: 16px 24px;
}

/* The bar frosts once there is something under it. */
.bar::before {
    content: "";
    position: absolute;
    inset: 0 -100vw;
    z-index: -1;
    background: linear-gradient(to bottom, rgba(5, 7, 13, 0.85), rgba(5, 7, 13, 0.55));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

/* The lab's wordmark, the one the apps carry: white, so it sits on the dark as it is. */
.bar__start {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand {
    display: flex;
    align-items: center;
    flex: none;
}

.brand img {
    display: block;
    width: 34px;
    height: 34px;
}

/* What the page is, in the logo's own letters. */
.bar__title {
    font-family: var(--gothic);
    font-weight: 400;
    font-size: 1.3rem;
    line-height: 1.2;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.me {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 60vw;
    padding: 4px 14px 4px 4px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--raised);
    color: var(--text);
    font: inherit;
    font-size: 0.92rem;
    cursor: pointer;
    transition:
        border-color 0.2s,
        background 0.2s;
}

.me:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.me--unkept::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 26px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--warn);
    box-shadow: 0 0 0 2px var(--bg);
}

.me__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.avatar {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-weight: 700;
}

.avatar--ghost {
    background: var(--accent-soft);
    color: #c9bcff;
    box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.45);
}

.avatar--none {
    background: var(--raised);
    color: var(--muted);
    box-shadow: inset 0 0 0 1px var(--line-strong);
}

.avatar--big {
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
}

/* -------------------------------- the top -------------------------------- */

.closed {
    display: grid;
    place-items: center;
    min-height: 60vh;
    text-align: center;
}

.closed h2 {
    font-family: var(--serif);
    font-weight: 400;
    color: var(--muted);
}

.hello {
    padding: 28px 0 8px;
    animation: rise 0.7s var(--ease) both;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: 640px;
}

.stat {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.stat__label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 0.82rem;
}

.stat__label .icon {
    color: var(--accent-2);
}

.stat__value {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.stat__of {
    color: var(--faint);
    font-size: 1rem;
    font-weight: 500;
}

.stat--loading .stat__value {
    color: var(--faint);
}

/* -------------------------------- notice --------------------------------- */

.notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid rgba(229, 180, 92, 0.45);
    border-radius: 14px;
    background: rgba(229, 180, 92, 0.08);
    animation: rise 0.4s var(--ease) both;
}

.notice__words {
    flex: 1;
}

.notice p {
    margin: 0;
}

/* The way back offered under a notice, once something sent here from an app
   is done. */
.notice .button {
    margin-top: 12px;
}

/* The way back to the app that sent somebody here: quiet, above everything,
   the way a breadcrumb sits. */
.back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    color: var(--muted);
    font-size: 0.9rem;
    text-decoration: none;
}

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

.back .icon {
    width: 16px;
    height: 16px;
}

/* -------------------------------- shelf ---------------------------------- */

.shelf {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 48px 0 16px;
}

.shelf h2 {
    font-size: 0.85rem;
    color: var(--muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter:hover:not(:disabled) {
    color: var(--text);
    border-color: var(--line-strong);
}

.filter[aria-pressed="true"] {
    color: var(--text);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.filter:disabled {
    opacity: 0.4;
    cursor: default;
}

.filter__n {
    min-width: 1.4em;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--raised);
    font-size: 0.78rem;
    text-align: center;
}

/* --------------------------------- cards --------------------------------- */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
    gap: 20px;
}

.card {
    --mx: 50%;
    --my: 0%;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: rise 0.6s var(--ease) both;
    animation-delay: calc(var(--n, 0) * 70ms + 120ms);
    transition:
        transform 0.35s var(--ease),
        border-color 0.35s,
        box-shadow 0.35s;
}

/* A glow that follows the pointer across the card. */
.card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
    background: radial-gradient(420px circle at var(--mx) var(--my), rgba(124, 92, 255, 0.14), transparent 45%);
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(124, 92, 255, 0.45);
    box-shadow:
        0 24px 48px -24px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(124, 92, 255, 0.15);
}

.card:hover::before {
    opacity: 1;
}

/* What is under way is what somebody came back for, so it shines a little. */
.card--going {
    border-color: rgba(124, 92, 255, 0.35);
    box-shadow: 0 0 40px -18px rgba(124, 92, 255, 0.6);
}

.cover {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.art {
    position: relative;
    aspect-ratio: 1200 / 630;
    overflow: hidden;
    background: linear-gradient(135deg, #12183a, #070a14);
}

.art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.02);
    transition:
        opacity 0.6s,
        filter 0.35s,
        transform 0.8s var(--ease);
}

.art--loaded img {
    opacity: 1;
}

/* On a card the cover is cut to a band about the middle, which is where an
   app's own card keeps its name; its logos along the top go. */
.cover .art {
    aspect-ratio: 12 / 5;
}

.cover .art img {
    object-position: 50% 72%;
}

.card:hover .art img {
    transform: scale(1.07);
}

/* The foot of the cover fades into the card, so the art and the words are
   one thing. */
.cover .art::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 55%, rgba(13, 18, 32, 0.9));
}

.art--drawn {
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 30% 20%, hsl(var(--hue) 70% 55% / 0.55), transparent 55%),
        radial-gradient(circle at 80% 90%, hsl(calc(var(--hue) + 60) 70% 50% / 0.4), transparent 55%),
        #0a0e1c;
}

.art__letter {
    font-family: var(--serif);
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 6px 30px rgba(0, 0, 0, 0.5);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: rgba(5, 7, 13, 0.7);
    border: 1px solid var(--line-strong);
    color: var(--muted);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.pill::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.cover .pill {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
}

.pill--going {
    color: #c9bcff;
    border-color: rgba(124, 92, 255, 0.55);
}

.pill--going::before {
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(124, 92, 255, 0.7);
    animation: beat 2s infinite;
}

.pill--done {
    color: var(--done);
    border-color: rgba(127, 203, 155, 0.5);
}

.pill--new {
    color: var(--accent-2);
    border-color: rgba(34, 211, 238, 0.4);
}

@keyframes beat {
    70% {
        box-shadow: 0 0 0 7px rgba(124, 92, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(124, 92, 255, 0);
    }
}

.cover__hint {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(5, 7, 13, 0.75);
    border: 1px solid var(--line-strong);
    font-size: 0.82rem;
    opacity: 0;
    transform: translateY(6px);
    transition:
        opacity 0.25s,
        transform 0.25s var(--ease);
}

.card:hover .cover__hint,
.cover:focus-visible .cover__hint {
    opacity: 1;
    transform: none;
}

/* The examples, over a dimmed cover while the pointer is on the card. Only
   where there is a pointer to hover with; on a touch screen the cover opens
   the sheet, which has them all. */
.peek {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}

.peek__track {
    display: flex;
    gap: 10px;
    height: calc(100% - 24px);
    width: max-content;
    animation: peek 45s linear infinite paused;
}

.peek__track img {
    height: 100%;
    width: auto;
    border-radius: 8px;
    border: 1px solid var(--line-strong);
    box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.8);
}

/* Half the track is one pass through the examples, and the gap after the
   last of them. */
@keyframes peek {
    to {
        transform: translateX(calc(-50% - 5px));
    }
}

@media (hover: hover) {
    .card:hover .peek {
        opacity: 1;
    }

    .card:hover .peek__track {
        animation-play-state: running;
    }

    .card:hover .cover--peek .art img {
        filter: brightness(0.3) blur(3px);
    }
}

.card__body {
    position: relative;
    z-index: 2;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 14px;
    padding: 4px 20px 20px;
}

.card__title {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.5rem;
    line-height: 1.2;
}

.card__tagline {
    margin: -8px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.card__actions {
    margin-top: auto;
    padding-top: 4px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tags li {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--raised);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.8rem;
}

/* An app of subtests: a row the whole width, the cover down its left side and
   a tile for each subtest beside it. */
.card--wide {
    grid-column: 1 / -1;
    flex-direction: row;
}

.card--wide .cover {
    flex: 0 0 clamp(240px, 30%, 340px);
    align-self: flex-start;
}

/* The cover at its own shape at the head of its column, the card's glass
   under it, rather than stretched down the row and cut to fit. */
.card--wide .cover .art {
    aspect-ratio: 1200 / 630;
}

.card--wide .cover .art img {
    object-position: 50% 50%;
}

.card--wide .cover .art::after {
    background: linear-gradient(to bottom, transparent 55%, rgba(13, 18, 32, 0.9));
}

.card--wide .card__body {
    padding: 20px 22px 22px;
}

.card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
}

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 4px;
    height: 100%;
    min-height: 64px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--raised);
    color: var(--text);
    text-decoration: none;
    animation: rise 0.5s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 35ms + 250ms);
    transition:
        transform 0.25s var(--ease),
        border-color 0.25s,
        background 0.25s;
}

.tile__name {
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.3;
}

.tile__meta {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 0.78rem;
}

/* The level's picture over its name: its results at stand-in scores, cut to
   the top, where each figure starts. */
.tiles--pictured {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.tiles--pictured .tile {
    justify-content: flex-start;
    padding: 0 0 10px;
    overflow: hidden;
}

.tiles--pictured .tile__name,
.tiles--pictured .tile__meta {
    padding: 0 12px;
}

.tile__shot {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    margin-bottom: 6px;
    overflow: hidden;
    background:
        radial-gradient(circle at 30% 25%, hsl(var(--hue) 70% 55% / 0.35), transparent 60%),
        #0a0e1c;
}

.tile__shot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 0;
    transition:
        filter 0.3s,
        opacity 0.3s,
        transform 0.5s var(--ease);
}

/* The foot of the picture fades into the tile, so the name sits under it. */
.tile__shot::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(10, 14, 28, 0.85));
}

/* Not done yet: the picture faded and grey, a glimpse of what is to come,
   brought up as the pointer reaches it. */
.tile--todo .tile__shot img {
    filter: grayscale(0.85) brightness(0.6);
    opacity: 0.55;
}

a.tile:hover .tile__shot img {
    filter: none;
    opacity: 1;
    transform: scale(1.04);
}

/* Done: the green the levels are done in elsewhere, and the way to the results. */
.tile--done {
    border-color: rgba(127, 203, 155, 0.4);
    background: rgba(127, 203, 155, 0.07);
}

.tile--done .tile__meta {
    color: var(--done);
}

/* Where the run in progress stopped: what somebody came back for. */
.tile--next {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 28px -12px rgba(124, 92, 255, 0.8);
}

.tile--next .tile__meta {
    color: #c9bcff;
}

/* Still to do: an outline, filled in once it is done. */
.tile--todo {
    border-style: dashed;
    border-color: var(--line-strong);
    background: transparent;
}

.tile--todo .tile__name {
    color: var(--muted);
}

a.tile:hover {
    transform: translateY(-2px);
    border-color: var(--accent-2);
}

a.tile--todo:hover .tile__name {
    color: var(--text);
}

/* A level done long enough ago to take again: a small way to it in the
   tile's corner, beside (not inside) the tile, which is the way to its
   results. */
.tiles__item--again {
    position: relative;
}

.tile__again {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px 4px 7px;
    border: 1px solid rgba(127, 203, 155, 0.5);
    border-radius: 999px;
    background: rgba(5, 7, 13, 0.78);
    color: var(--done);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    backdrop-filter: blur(6px);
    animation: rise 0.5s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 35ms + 400ms);
}

.tile__again:hover {
    border-color: var(--done);
    color: var(--text);
}

.tile__again .icon {
    width: 13px;
    height: 13px;
}

/* The card that stands in for the apps to come. */
.card--soon {
    justify-content: center;
    align-items: flex-start;
    min-height: 220px;
    padding: 28px;
    border-style: dashed;
    border-color: var(--line-strong);
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.card--soon:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--line-strong);
}

.soon__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    font-weight: 600;
}

.soon__title .icon {
    color: var(--accent-2);
}

.soon__text {
    margin: 0;
    color: var(--faint);
    font-size: 0.92rem;
}

/* ------------------------------- progress -------------------------------- */

.progress {
    display: flex;
    align-items: center;
    gap: 14px;
}

.progress__words p {
    margin: 0;
}

.progress__line {
    font-weight: 600;
}

.standing--done .progress__line {
    color: var(--done);
}

.progress__when {
    color: var(--faint);
    font-size: 0.85rem;
}

.ring {
    width: 52px;
    height: 52px;
    flex: none;
    transform: rotate(-90deg);
}

.ring circle {
    fill: none;
    stroke-width: 4;
}

.ring__back {
    stroke: var(--line-strong);
}

.ring__front {
    stroke: var(--accent);
    stroke-linecap: round;
    stroke-dasharray: var(--share) 100;
    animation: fill 1.1s var(--ease) both 0.3s;
    filter: drop-shadow(0 0 4px rgba(124, 92, 255, 0.6));
}

.standing--done .ring__front {
    stroke: var(--done);
    filter: drop-shadow(0 0 4px rgba(127, 203, 155, 0.5));
}

@keyframes fill {
    from {
        stroke-dasharray: 0 100;
    }
}

.ring__text {
    fill: var(--text);
    font-size: 11px;
    font-weight: 650;
    text-anchor: middle;
    dominant-baseline: central;
    transform: rotate(90deg);
    transform-origin: 22px 22px;
}

/* The levels as one track: a segment each, filled once done, and the core
   ones taller, since a run asks them of everybody. */
.track {
    display: flex;
    gap: 3px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    align-items: flex-end;
}

.track li {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--line-strong);
    transform-origin: left;
    animation: grow 0.5s var(--ease) both;
}

.track li {
    animation-delay: calc(0.3s + var(--i, 0) * 40ms);
}

.track li.core {
    height: 9px;
}

.track li.done {
    background: linear-gradient(90deg, var(--accent), #9a83ff);
}

.standing--done .track li.done {
    background: var(--done);
}

@keyframes grow {
    from {
        transform: scaleX(0);
    }
}

.skeleton {
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--raised) 25%, rgba(255, 255, 255, 0.09) 50%, var(--raised) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.3s linear infinite;
}

@keyframes shimmer {
    to {
        background-position: -200% 0;
    }
}

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

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), #9a6bff);
    color: #fff;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 6px 20px -8px rgba(124, 92, 255, 0.8);
    transition:
        transform 0.2s var(--ease),
        box-shadow 0.2s,
        filter 0.2s;
}

.button:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
    box-shadow: 0 10px 26px -8px rgba(124, 92, 255, 0.9);
}

.button:active {
    transform: translateY(0);
}

.button.quiet {
    background: var(--raised);
    color: var(--text);
    border-color: var(--line-strong);
    box-shadow: none;
    font-weight: 500;
}

.button.quiet:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.button:disabled {
    opacity: 0.6;
    cursor: progress;
}

button:focus-visible,
a:focus-visible,
.strip:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 2px;
}

/* A button that reads as a link: the forgotten password, beside the real ones. */
.linkish {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent-2);
    font: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(34, 211, 238, 0.4);
    text-underline-offset: 3px;
    cursor: pointer;
}

.linkish:hover {
    text-decoration-color: currentColor;
}

.close {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: none;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--raised);
    color: var(--muted);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.close:hover {
    color: var(--text);
    border-color: var(--line-strong);
}

/* --------------------------------- sheets -------------------------------- */

dialog.sheet {
    width: min(460px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 24px;
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    background: var(--panel-solid);
    color: var(--text);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.8);
    overflow: auto;
}

dialog.sheet[open] {
    animation: pop 0.35s var(--ease) both;
}

dialog.sheet::backdrop {
    background: rgba(3, 4, 9, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

@keyframes pop {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
}

.sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.sheet__head h2 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.5rem;
}

.who > p {
    margin: 0 0 16px;
    color: var(--muted);
}

.identity {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.identity p {
    margin: 0;
}

.identity__line {
    font-weight: 600;
}

.identity__detail {
    color: var(--muted);
    font-size: 0.9rem;
    word-break: break-all;
}

.keep {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(124, 92, 255, 0.16), rgba(34, 211, 238, 0.06));
    border: 1px solid rgba(124, 92, 255, 0.3);
}

.keep p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.keep .keep__title {
    margin-bottom: 2px;
    color: var(--text);
    font-weight: 600;
    font-size: 1rem;
}

code {
    font-size: 0.85em;
    color: var(--muted);
}

/* Signing in with an email: one form, labels over their fields. */
.sign {
    display: grid;
    gap: 14px;
    margin: 0 0 20px;
}

.sign label {
    display: grid;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--muted);
}

.sign input {
    padding: 11px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: rgba(5, 7, 13, 0.6);
    color: var(--text);
    font: inherit;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.sign input::placeholder {
    color: var(--faint);
}

.sign input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.sign .actions {
    justify-content: space-between;
}

.sign .linkish {
    font-size: 0.9rem;
}

.switch {
    margin: 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 0.92rem;
    text-align: center;
}

.error {
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(229, 180, 92, 0.1);
    color: var(--warn);
    font-size: 0.92rem;
}

/* Deleting the account: set apart at the foot of the sheet, a quiet link until
   it is asked for, then a box edged in red with what goes and what stays. */
.erase {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.erase__open {
    color: var(--faint);
    font-size: 0.88rem;
    text-decoration-color: rgba(255, 255, 255, 0.2);
}

.erase__open:hover {
    color: var(--bad);
}

.erase__panel {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(240, 113, 113, 0.4);
    border-radius: 14px;
    background: rgba(240, 113, 113, 0.06);
}

.erase__panel[hidden] {
    display: none;
}

.erase__panel p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.erase__panel .erase__title {
    color: var(--text);
    font-weight: 600;
    font-size: 1rem;
}

/* What stays, which somebody deleting an account most needs to read. */
.erase__panel .erase__kept {
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--raised);
    color: var(--text);
}

.erase__panel label {
    display: grid;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--muted);
}

.erase__panel input {
    padding: 11px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: rgba(5, 7, 13, 0.6);
    color: var(--text);
    font: inherit;
}

.erase__panel input:focus {
    outline: none;
    border-color: var(--bad);
    box-shadow: 0 0 0 4px rgba(240, 113, 113, 0.18);
}

.button.danger {
    background: linear-gradient(135deg, #e05252, #f07171);
    box-shadow: 0 6px 20px -8px rgba(240, 113, 113, 0.8);
}

.button.danger:hover {
    box-shadow: 0 10px 26px -8px rgba(240, 113, 113, 0.9);
}

/* -------------------------------- preview -------------------------------- */

dialog.sheet--wide {
    width: min(860px, calc(100vw - 32px));
    padding: 0;
}

.close--float {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    background: rgba(5, 7, 13, 0.7);
    border-color: var(--line-strong);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.preview__hero {
    position: relative;
}

.preview__hero .art {
    aspect-ratio: 1200 / 630;
}

.preview__hero .art::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, var(--panel-solid));
}

.preview__heading {
    position: relative;
    margin-top: -64px;
    padding: 0 28px;
    z-index: 2;
}

.preview__heading h2 {
    margin: 10px 0 4px;
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(1.7rem, 4vw, 2.3rem);
    line-height: 1.15;
}

.preview__heading .card__tagline {
    margin: 0;
}

.preview__main {
    display: grid;
    gap: 20px;
    padding: 18px 28px 28px;
}

.preview__about {
    margin: 0;
    color: var(--muted);
    font-size: 1.02rem;
}

.preview__section {
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.preview__section > h3 {
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.levels {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.levels li {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--muted);
}

/* The core levels are the ones a run asks of everybody; the rest are optional. */
.levels li.core {
    border-color: rgba(124, 92, 255, 0.5);
}

.levels li.done {
    color: #06210f;
    background: var(--done);
    border-color: var(--done);
    font-weight: 600;
}

.note {
    margin: 10px 0 0;
    color: var(--faint);
    font-size: 0.85rem;
}

.preview__actions .button {
    padding: 11px 24px;
    font-size: 1rem;
}

/* The pictures: a strip that snaps a slide at a time, each slide most of the
   width so the next peeks in and says there is more. */
.gallery {
    position: relative;
}

.strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 82%;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    border-radius: 14px;
}

.strip::-webkit-scrollbar {
    display: none;
}

.slide {
    margin: 0;
    scroll-snap-align: start;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: #0a0e1a;
}

.slide img {
    display: block;
    width: 100%;
    height: 340px;
    object-fit: cover;
    object-position: top;
}

.slide figcaption {
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    border-top: 1px solid var(--line);
}

.nav {
    position: absolute;
    top: 170px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: rgba(5, 7, 13, 0.8);
    color: var(--text);
    cursor: pointer;
    transform: translateY(-50%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: border-color 0.2s;
}

.nav:hover {
    border-color: var(--accent);
}

.nav--prev {
    left: -12px;
}

.nav--next {
    right: -12px;
}

.dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
}

.dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--line-strong);
    cursor: pointer;
    transition:
        width 0.3s var(--ease),
        background 0.3s;
}

.dot--on {
    width: 22px;
    background: var(--accent);
}

/* --------------------------------- foot ---------------------------------- */

.foot {
    padding: 24px;
    text-align: center;
    color: var(--faint);
    font-size: 0.82rem;
}

.foot p {
    margin: 0;
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
}

/* -------------------------------- narrow --------------------------------- */

@media (max-width: 760px) {
    .card--wide {
        flex-direction: column;
    }

    .card--wide .cover {
        flex: none;
    }

    .card--wide .cover {
        align-self: stretch;
    }

    .card--wide .cover .art {
        aspect-ratio: 12 / 5;
    }

    .card--wide .cover .art img {
        object-position: 50% 72%;
    }
}

@media (max-width: 600px) {
    .tiles {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    main,
    .bar {
        padding-left: 16px;
        padding-right: 16px;
    }

    .brand img {
        width: 30px;
        height: 30px;
    }

    .bar__title {
        font-size: 1.15rem;
    }

    .hello {
        padding-top: 24px;
    }

    .stats {
        gap: 8px;
    }

    .stat {
        padding: 10px 12px;
    }

    .stat__value {
        font-size: 1.35rem;
    }

    .stat__label .icon {
        display: none;
    }

    .preview__heading,
    .preview__main {
        padding-left: 18px;
        padding-right: 18px;
    }

    .preview__heading {
        margin-top: -40px;
    }

    .strip {
        grid-auto-columns: 90%;
    }

    .slide img {
        height: 260px;
    }

    .nav {
        display: none;
    }
}

/* Somebody who has asked for less movement gets none of it. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
