@font-face {
    font-family: "Jost";
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url("fonts/jost-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: "Jost";
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url("fonts/jost-cyrillic.woff2") format("woff2");
    unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/jetbrains-mono-latin-400.woff2") format("woff2");
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/jetbrains-mono-cyrillic-400.woff2") format("woff2");
    unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("fonts/jetbrains-mono-latin-500.woff2") format("woff2");
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: "JetBrains Mono";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("fonts/jetbrains-mono-cyrillic-500.woff2") format("woff2");
    unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

:root {
    --night: #181818;
    --night-2: #202020;
    --cream: #f5eddc;
    --rust: #b2653b;
    --oxblood: #802520;
    --oxblood-lit: #b4493f;
    --ochre: #ba8530;
    --sage: #5c7f71;
    --sand: #cdb68a;
    --cream-dim: rgb(245 237 220 / 0.72);
    --cream-faint: rgb(245 237 220 / 0.14);
    --cream-hair: rgb(245 237 220 / 0.08);
    --font-display: "Jost", "Futura", sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, monospace;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --gutter: clamp(16px, 4vw, 56px);
    color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--night);
    color: var(--cream);
    font-family: var(--font-display);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
::selection { background: var(--rust); color: var(--cream); }
a { color: inherit; text-underline-offset: 0.25em; }
:focus-visible { outline: 2px solid var(--ochre); outline-offset: 3px; }
h1, h2, p, dl, dd { margin: 0; }
.mono { font-family: var(--font-mono); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.tristripe { display: grid; grid-template-columns: repeat(3, 1fr); height: 6px; width: 100%; }
.tristripe::before, .tristripe::after, .tristripe i { content: ""; display: block; }
.tristripe::before { background: var(--oxblood); }
.tristripe i { background: var(--ochre); }
.tristripe::after { background: var(--sage); }

.orbits {
    position: fixed; inset: 0 0 auto auto; width: min(1100px, 120vw); aspect-ratio: 1;
    transform: translate(45%, -45%); pointer-events: none; z-index: 0;
    -webkit-mask: radial-gradient(circle, #000 35%, transparent 70%);
    mask: radial-gradient(circle, #000 35%, transparent 70%);
}
.orbits circle { fill: none; stroke: var(--cream); stroke-width: 1; opacity: 0.12; }

.page {
    position: relative; z-index: 1;
    width: 100%; margin: 0 auto;
    padding: 40px var(--gutter) 32px;
    display: grid; gap: 36px;
}

.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 32px; }
.mark { display: inline-flex; flex-direction: column; gap: 10px; width: max-content; text-decoration: none; }
.word { font-family: var(--font-display); font-weight: 700; font-size: 46px; line-height: 0.9; letter-spacing: 0.02em; }
.title { display: grid; gap: 10px; }
h1 { font-weight: 700; font-size: clamp(38px, 5vw, 64px); line-height: 1; letter-spacing: -0.025em; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 12.5px; color: var(--cream-dim); }
.facts b { font-weight: 500; color: var(--cream); }

.status { display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--cream-dim); }
.light { flex: none; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--cream-dim); }
[data-state="live"] .light { background: var(--sage); border-color: var(--sage); }
[data-state="stale"] .light { background: var(--ochre); border-color: var(--ochre); }
[data-state="error"] .light { background: var(--oxblood-lit); border-color: var(--oxblood-lit); }
[data-state="demo"] .light { border-color: var(--sand); }
.age { white-space: pre; }

.panel {
    position: relative;
    border: 1px solid var(--cream-faint);
    background: linear-gradient(var(--night-2), var(--night));
    padding: 22px 26px 26px;
}
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; margin-bottom: 20px; }
.panel h2 { font-weight: 600; font-size: 20px; letter-spacing: -0.005em; }
.panel-sub { font-size: 12.5px; color: var(--cream-dim); }
.counters { display: grid; grid-template-columns: minmax(0, 1fr); }
.secondary-readings {
    display: grid; grid-template-columns: minmax(0, 1fr); align-items: center;
    gap: 20px; margin-top: 28px;
}

.odo {
    --h: 1em;
    --r: calc(var(--h) * 1.5388);
    display: inline-flex; align-items: stretch; gap: 0.08em;
    justify-self: start;
    max-width: 100%;
    padding: 0.14em 0.16em;
    background: #0e0e0e;
    border: 1px solid var(--cream-faint);
    box-shadow: inset 0 0 0 1px #000, inset 0 0.12em 0.3em rgb(0 0 0 / 0.8);

    font-family: var(--font-display); font-weight: 500;
    line-height: 1;
}
.odo .sep {
    display: grid; place-items: center;
    width: 0.32em; color: var(--cream-dim); font-size: 0.6em;
}
.wheel {
    position: relative;
    width: 0.74em; height: 1.42em;
    overflow: hidden;
    perspective: 2.8em;
    background: #111;
    border-left: 1px solid #000; border-right: 1px solid #000;
    box-shadow: inset 2px 0 4px rgb(0 0 0 / 0.85), inset -2px 0 4px rgb(0 0 0 / 0.85);
}

.drum {
    position: absolute; inset: 0;
    transform-style: preserve-3d;
    transform: translateZ(calc(var(--r) * -1)) rotateX(0deg);
    transition: transform 650ms var(--ease-out);
}
.face {
    position: absolute; left: 0; right: 0; top: 50%;
    height: var(--h); margin-top: calc(var(--h) / -2);
    display: grid; place-items: center;
    color: var(--cream);
    background: linear-gradient(180deg, #292721 0%, #191815 18%, #111 50%, #191815 82%, #292721 100%);
    text-shadow: 0 1px 1px rgb(255 255 255 / 0.12), 0 2px 8px rgb(245 237 220 / 0.12);
    backface-visibility: hidden;
}

.wheel::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        linear-gradient(90deg, rgb(0 0 0 / 0.36), transparent 24%, transparent 76%, rgb(0 0 0 / 0.36)),
        linear-gradient(
        rgb(0 0 0 / 0.92) 0%, rgb(0 0 0 / 0.35) 24%,
        rgb(245 237 220 / 0.05) 46%, rgb(245 237 220 / 0.05) 54%,
        rgb(0 0 0 / 0.35) 76%, rgb(0 0 0 / 0.92) 100%);
}

.wheel::before {
    content: ""; position: absolute; left: 0; right: 0; top: 50%; height: var(--h);
    margin-top: calc(var(--h) / -2); z-index: 1; pointer-events: none;
    border-top: 1px solid rgb(0 0 0 / 0.8); border-bottom: 1px solid rgb(245 237 220 / 0.12);
    box-shadow: 0 1px 4px rgb(0 0 0 / 0.8);
}

.counter { display: grid; gap: 12px; align-content: start; }
.counter-label { font-size: 14px; font-weight: 500; color: var(--cream-dim); }
.counter-note { font-size: 12.5px; color: var(--cream-dim); }
.clock-display {
    display: flex; align-items: center; justify-content: center; gap: 0.08em;
    width: 100%; min-width: 0; padding: 10px 14px;
    background: #0b0b0b; border: 1px solid var(--cream-faint);
    box-shadow: inset 0 0 0 1px #000, inset 0 0.12em 0.3em rgb(0 0 0 / 0.8);
}
.counter.time .odo {
    width: max-content; max-width: 100%; justify-self: center; justify-content: center;
    padding: 0; border: 0; background: transparent; box-shadow: none;
    font-size: clamp(58px, 10vw, 150px);
}
.clock-ms {
    flex: none; width: max-content; max-width: none; padding: 0;
    border: 0; background: transparent; box-shadow: none;
    color: var(--cream-dim); font-size: clamp(20px, 3.2vw, 44px);
    line-height: 1; letter-spacing: 0;
}
.clock-ms .sep { width: 0.22em; font-size: 0.72em; }
.clock-ms .drum { transition-duration: 45ms; }
.counter.reqs .odo { width: max-content; max-width: none; font-size: clamp(34px, 5vw, 72px); }

.gauges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; min-width: 0; width: 100%; max-width: 580px; justify-self: end; }
.gauge { min-width: 0; padding: 12px 12px 14px; }
.gauge h2 { font-size: 16px; }
.gauge .panel-head {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px;
    align-items: start; justify-items: center; margin-bottom: 6px; text-align: center;
}
.gauge svg { display: block; width: 100%; max-width: 190px; margin: 0 auto; overflow: visible; }
.gauge .arc { fill: none; stroke: var(--cream-faint); stroke-width: 1.5; }
.gauge .band { fill: none; stroke-width: 6; }
.gauge .tick { stroke: var(--cream-dim); stroke-width: 1; }
.gauge .tick.major { stroke: var(--cream); stroke-width: 1.6; }
.gauge .tick-label { fill: var(--cream-dim); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.02em; }
.gauge .needle {
    transform-origin: 120px 120px;
    transform: rotate(-120deg);
    transition: transform 900ms var(--ease-out);
}
.gauge .needle line { stroke: var(--rust); stroke-width: 2.4; stroke-linecap: square; }
.gauge .needle .tail { stroke: var(--cream-dim); stroke-width: 2.4; }
.gauge .hub { fill: var(--night); stroke: var(--cream); stroke-width: 1.6; }
.gauge .hub-dot { fill: var(--rust); }
.readout { display: grid; justify-items: center; gap: 2px; margin-top: -6px; text-align: center; }
.readout .value { font-size: clamp(18px, 1.6vw, 24px); font-weight: 500; }
.readout .unit { font-size: 0.5em; color: var(--cream-dim); margin-left: 0.3em; }

@media (min-width: 1250px) {
    .secondary-readings { grid-template-columns: minmax(max-content, 1fr) minmax(0, 580px); }
}

@media (max-width: 900px) {
    .word { font-size: 32px; }
}

.foot {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px;
    padding-top: 16px; border-top: 1px solid var(--cream-hair);
    font-size: 14px; color: var(--cream-dim);
}
.foot a { display: inline-flex; align-items: center; min-height: 44px; text-decoration-color: var(--rust); text-decoration-thickness: 2px; }
.foot a:hover { color: var(--cream); }

@media (min-width: 901px) and (max-height: 900px) {
    .page {
        min-height: 100vh; grid-template-rows: auto minmax(0, 1fr) auto;
        padding-top: 18px; padding-bottom: 14px; gap: 14px;
    }
    .head { gap: 12px 24px; }
    .title { gap: 7px; }
    h1 { font-size: clamp(34px, 4vw, 52px); }
    .panel { padding: 14px 20px 16px; }
    .panel-head { margin-bottom: 12px; }
    .counter { gap: 8px; }
    .counter.time .odo { font-size: clamp(50px, 7.8vh, 88px); }
    .clock-display { padding: 6px 10px; }
    .clock-ms { font-size: clamp(16px, 2.6vw, 32px); }
    .secondary-readings {
        grid-template-columns: minmax(max-content, 1fr) minmax(0, min(44vw, 480px));
        gap: 12px; margin-top: 14px;
    }
    .counter.reqs .odo { font-size: clamp(30px, 4.5vw, 60px); }
    .gauges { max-width: min(44vw, 480px); gap: 10px; }
    .gauge { padding: 8px; }
    .gauge svg { max-width: 145px; }
    .gauge .readout .value { font-size: clamp(16px, 2vh, 22px); }
    .foot { padding-top: 10px; }
    .foot a { min-height: 36px; }
}

@media (max-width: 640px) {
    .page { padding-top: 24px; gap: 28px; }
    .panel { padding: 18px 14px 20px; }
    .odo { gap: 0.06em; padding: 0.12em; }
    .clock-display { gap: 0.04em; padding: 8px 6px; }
    .counter.time .odo { font-size: clamp(28px, 9vw, 64px); }
    .clock-ms { font-size: clamp(12px, 3.4vw, 20px); }
    .secondary-readings { grid-template-columns: minmax(0, 1fr) minmax(84px, 32vw); gap: 8px; align-items: center; }
    .counter.reqs { min-width: 0; }
    .counter.reqs .odo { max-width: 100%; font-size: clamp(15px, 5.8vw, 25px); }
    .gauges { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; max-width: none; justify-self: stretch; }
    .gauge { padding: 4px 1px; border: 0; background: transparent; }
    .gauge .panel-head { display: block; margin: 0; text-align: center; }
    .gauge h2 { font-size: clamp(7px, 1.8vw, 9px); line-height: 1.1; letter-spacing: -0.03em; white-space: nowrap; }
    .gauge .tick-label { display: none; }
    .gauge svg { max-width: 72px; }
    .gauge .readout { margin-top: -5px; gap: 0; transform: translateY(-5px); }
    .gauge .readout .value { font-size: clamp(8px, 2.5vw, 10px); white-space: nowrap; }
    .gauge .readout .unit { margin-left: 0.15em; }
}
@media (prefers-reduced-motion: reduce) {
    .drum, .gauge .needle { transition: none; }
}
