/* Two weights and no more: every heavier or lighter weight asked for below lands on the nearer of them. */
@font-face {
    font-family: "Atkinson Hyperlegible";
    font-weight: 400;
    font-display: swap;
    src: url(fonts/atkinson-hyperlegible-400.woff2) format("woff2");
}

@font-face {
    font-family: "Atkinson Hyperlegible";
    font-weight: 700;
    font-display: swap;
    src: url(fonts/atkinson-hyperlegible-700.woff2) format("woff2");
}

:root {
    --night: #141a38;
    --sky: #293875;
    --horizon: #faa366;
    --ground: #1e2232;
    --ember: #e65214;
    --flame: #ff9632;
    --paper: #fff4e2;
    --quiet: rgba(255, 244, 226, 0.78);
    --gutter: clamp(1rem, 6vw, 5rem);
    font-family: "Atkinson Hyperlegible", ui-rounded, "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--ground);
    color: var(--paper);
    line-height: 1.5;
    overflow-x: hidden;
}

.stage {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    /* The canvas paints the same dusk over this: what a visitor with scripts off sees. */
    background: linear-gradient(
        var(--night) 0%,
        var(--sky) 38%,
        #b96a58 60%,
        var(--horizon) 68%,
        #38543f 68%,
        #3a2c2a 76%,
        var(--ground) 100%
    );
}

.stage canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.words {
    position: relative;
    max-width: 30rem;
    padding: clamp(2rem, 12vh, 7rem) var(--gutter) 0;
    text-shadow: 0 1px 18px rgba(20, 26, 56, 0.9);
}

h1 {
    margin: 0;
    font-size: clamp(3.2rem, 11vw, 6.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--paper);
}

.line {
    margin: 0.6rem 0 0;
    font-size: clamp(1.3rem, 3.6vw, 2rem);
    font-weight: 700;
    color: var(--flame);
}

.what {
    margin: 0.9rem 0 0;
    max-width: 24rem;
    font-size: 1.05rem;
    color: var(--quiet);
}

.private {
    margin: 0.7rem 0 0;
    max-width: 24rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--paper);
}

h2 {
    margin: 0;
    font-size: clamp(2.2rem, 7vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--paper);
}

.count {
    position: absolute;
    inset: 0;
    margin: 0;
    pointer-events: none;
}

.hits {
    position: absolute;
    transform: translate(-50%, -100%);
    font-size: clamp(1.4rem, 4vw, 2.4rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--paper);
    text-shadow: 0 0 14px var(--ember);
}

.lower {
    padding: clamp(3.5rem, 12vh, 7rem) var(--gutter);
    background: var(--ground);
}

.lower:nth-of-type(even) {
    background: #191d2e;
}

.lower p {
    margin: 0.9rem 0 0;
    color: var(--quiet);
}

.copy {
    max-width: 36rem;
}

.copy p {
    font-size: 1.1rem;
}

h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--paper);
}

.stills {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    gap: 1.25rem;
    max-width: 80rem;
    margin-top: 2.5rem;
}

.stills figure {
    margin: 0;
}

/* The ratio is said here too: WebKit drops the width and height of a picture that failed, and shows its words. */
.stills img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 1rem;
    background: var(--night);
}

.stills figcaption {
    margin-top: 0.6rem;
    font-size: 0.95rem;
    color: var(--quiet);
}

#points {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    gap: 2rem var(--gutter);
    align-items: center;
}

.skeleton {
    width: 100%;
    aspect-ratio: 4 / 5;
    max-height: min(34rem, 80svh);
}

.sieve {
    display: block;
    width: 100%;
    max-width: 60rem;
    aspect-ratio: 5 / 2;
    margin-top: 2rem;
}

.scale {
    max-width: 60rem;
    margin: 2rem 0 0;
}

.scale div + div {
    margin-top: 1.1rem;
}

.scale dt {
    font-weight: 800;
    color: var(--paper);
}

.scale dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
    color: var(--quiet);
}

.scale dd::after {
    content: "";
    display: block;
    height: 0.9rem;
    margin-top: 0.4rem;
    border-radius: 0.2rem;
    background: linear-gradient(90deg, var(--sky), #b96a58);
}

/* 580 of 921,600 bytes (picture.js owns both): under a pixel on any screen, so one is drawn and the copy says so. */
.scale .pose dd::after {
    width: max(1px, 0.063%);
    border-radius: 0;
    background: var(--flame);
}

.lower .note {
    max-width: 40rem;
    font-size: 0.95rem;
}

.lower .caveat {
    max-width: 40rem;
    margin-top: 2rem;
    padding-left: 1rem;
    border-left: 2px solid var(--ember);
}

@media (max-width: 40rem) {
    .sieve {
        aspect-ratio: 3 / 2;
    }
}

#try {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    gap: 2rem var(--gutter);
    align-items: center;
}

/* The id outranks the classes below, so what is hidden stays hidden whatever its display. */
#try [hidden] {
    display: none;
}

.ring {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 80svh;
    border-radius: 0.6rem;
}

.controls button {
    padding: 0.7rem 1.3rem;
    border: 0;
    border-radius: 2rem;
    background: var(--flame);
    color: var(--night);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.controls button:focus-visible {
    outline: 3px solid var(--paper);
    outline-offset: 3px;
}

.lower .said {
    min-height: 1.5em;
    color: var(--paper);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: 1.25rem;
    margin: 2.5rem 0 0;
    padding: 0;
    list-style: none;
}

.card {
    padding: 1.5rem;
    border: 1px solid rgba(255, 244, 226, 0.14);
    border-radius: 1rem;
    background: rgba(255, 244, 226, 0.04);
}

.lower .card p {
    margin-top: 0.5rem;
    font-size: 0.98rem;
}

.card svg {
    display: block;
    width: 3.5rem;
    height: 3.5rem;
    margin-bottom: 1rem;
    fill: none;
    stroke: var(--flame);
    stroke-width: 3;
    stroke-linecap: round;
}

.card svg .spark {
    fill: var(--flame);
    stroke: none;
}

.card svg text {
    fill: var(--paper);
    stroke: none;
    font-size: 11px;
    font-weight: 800;
    text-anchor: middle;
}

.card svg .floor,
.card svg .track {
    stroke: rgba(255, 244, 226, 0.25);
}

.lower .status {
    margin-top: 1rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--flame);
}

.lower .status.soon {
    color: var(--quiet);
}

/* The Wi-Fi goes, bar by bar, and the ember below keeps its beat. */
.offline .wave {
    animation: fade 6s ease-in-out infinite;
}

.offline .mid {
    animation-delay: 0.5s;
}

.offline .near {
    animation-delay: 1s;
}

.offline .spark,
.earned .spark {
    transform-box: fill-box;
    transform-origin: center;
    animation: beat 1.2s ease-in-out infinite;
}

/* A scale that is not there: its outline never quite arrives. */
.unweighed .ghost {
    stroke: rgba(255, 244, 226, 0.5);
    stroke-dasharray: 3 7;
    animation: ghost 5s ease-in-out infinite;
}

.gentler .spark {
    animation: bounce 1.6s ease-in-out infinite;
}

.gentler .easy {
    --rise: -10px;
}

.gentler .deep {
    --rise: -26px;
}

.earned .grown {
    stroke-dasharray: 100;
    transform-box: fill-box;
    transform-origin: center;
    transform: rotate(-90deg);
    animation: grow 5s ease-out infinite;
}

@keyframes fade {
    0%,
    20% {
        opacity: 1;
    }
    45%,
    80% {
        opacity: 0.12;
    }
    100% {
        opacity: 1;
    }
}

@keyframes beat {
    50% {
        transform: scale(1.35);
    }
}

@keyframes ghost {
    0%,
    100% {
        opacity: 0.1;
    }
    50% {
        opacity: 0.45;
    }
}

@keyframes bounce {
    50% {
        transform: translateY(var(--rise));
    }
}

@keyframes grow {
    from {
        stroke-dashoffset: 100;
    }
    70%,
    to {
        stroke-dashoffset: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .card svg * {
        animation: none;
    }

    .earned .grown {
        stroke-dashoffset: 25;
    }
}

.needs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.needs span {
    padding: 0.15rem 0.6rem;
    border-radius: 1rem;
    background: rgba(255, 150, 50, 0.14);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--flame);
}

.purse {
    margin-top: 2.5rem;
    max-width: 36rem;
}

.lower .tally {
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--paper);
}

.tally .gold {
    color: var(--flame);
}

.pipeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
    gap: 1.25rem;
    margin: 2.5rem 0 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.pipeline li {
    padding-top: 1rem;
    border-top: 2px solid var(--ember);
    counter-increment: step;
}

.pipeline h3::before {
    content: counter(step) ". ";
    color: var(--flame);
}

.pipeline .wide {
    grid-column: 1 / -1;
}

.wide p {
    max-width: 40rem;
}

.bytes {
    display: block;
    width: 100%;
    max-width: 40rem;
    aspect-ratio: 29 / 20;
    margin-top: 1.25rem;
}

.hard {
    margin-top: 3.5rem;
    font-size: 1.5rem;
}

footer {
    padding: 3rem var(--gutter) 1.5rem;
    font-size: 0.9rem;
    color: var(--quiet);
    background: var(--night);
}

footer p {
    margin: 0;
}

.imprint {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 2.5rem var(--gutter);
    max-width: 60rem;
}

.imprint section > * + * {
    margin-top: 0.4rem;
}

.role {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--flame);
}

.mark {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--paper);
    letter-spacing: -0.01em;
}

.legal {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 244, 226, 0.16);
    font-size: 0.8rem;
}
