/* status.confetti.to, in confetti's own identity (wetoast web/: the palette "Sheet and biro", the
   face Onest, the mark with its piece as the dot of the last i). Colours, sizes, spacing and radii
   are confetti's tokens (public/styles/tokens.css and the kit's scale); nothing is invented here.
   The piece is the page's one signal: blue while all is well, pulsing while busy, ink when full,
   an empty outline while videos are paused or confetti can't be reached. */

@font-face { font-family: "Onest"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/fonts/onest-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/fonts/onest-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; }

:root {
  color-scheme: light;
  --bg: #ffffff; --surface: #f4f4f4; --ink: #111111; --muted: #6b6b6b; --accent: #1a4be0;
  --line: rgb(17 17 17 / .12); --line-strong: rgb(17 17 17 / .24);
  --hero-bg: #111111; --hero-ink: #ffffff; --hero-muted: #9a9a9a;
  --font: "Onest", system-ui, sans-serif;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 20px;
  --gut: 20px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --idot-y: 0.87em;
}
/* Dark: confetti's inverse tokens. The wait card turns over with the page, so it stays the one
   card that stands out: white on the dark ground, as it is ink on the white one. ?theme=light or
   ?theme=dark (scripts/status.js) pins one for a look. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111111; --surface: #1e1e1e; --ink: #ffffff; --muted: #9a9a9a;
    --line: rgb(255 255 255 / .14); --line-strong: rgb(255 255 255 / .28);
    --hero-bg: #ffffff; --hero-ink: #111111; --hero-muted: #6b6b6b;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111111; --surface: #1e1e1e; --ink: #ffffff; --muted: #9a9a9a;
  --line: rgb(255 255 255 / .14); --line-strong: rgb(255 255 255 / .28);
  --hero-bg: #ffffff; --hero-ink: #111111; --hero-muted: #6b6b6b;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}
p, h1, h2 { margin: 0; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-sm); }
::selection { background: var(--accent); color: #ffffff; }

.page {
  display: grid; grid-template-rows: auto 1fr auto; min-height: 100svh;
  width: 100%; max-width: calc(720px + 2 * var(--gut)); margin: 0 auto; padding: 0 var(--gut);
}
@media (min-width: 640px) { :root { --gut: 32px; } }

/* ---------------------------------------------------------------- the bar: the mark, "Status", the languages */
.bar { display: flex; align-items: center; gap: var(--s-3); height: 72px; }
.bar__mark { display: inline-flex; align-items: center; min-height: 44px; }
.wm { font-weight: 600; font-size: 22px; letter-spacing: -0.035em; line-height: 1; white-space: nowrap; }
.wm__i { position: relative; display: inline-block; }
/* the piece: a small tilted square clear of the stem, exactly as on confetti.to */
.wm__i::after {
  content: ""; position: absolute; left: 40%; bottom: var(--idot-y); width: 0.19em; height: 0.19em;
  border-radius: 0.05em; background: var(--accent); transform: translateX(-50%) rotate(18deg);
}
.bar__tag { padding-left: var(--s-3); border-left: 1px solid var(--line-strong); font-weight: 500; font-size: 15px; line-height: 20px; color: var(--muted); }
.langs { display: flex; margin-left: auto; }
.langs a {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px;
  font-weight: 500; font-size: 13px; letter-spacing: 0.04em; color: var(--muted);
  transition: color var(--dur, 180ms) var(--ease);
}
.langs a:hover { color: var(--ink); }
.langs a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }

main { padding: clamp(40px, 9vw, 96px) 0 0; }

/* ---------------------------------------------------------------- now: the piece and the one sentence */
.now__piece {
  display: block; width: 22px; height: 22px; margin: 0 0 var(--s-6) 3px; border-radius: 5px;
  background: transparent; box-shadow: inset 0 0 0 2px var(--line-strong); transform: rotate(18deg);
  transition: background .4s var(--ease), box-shadow .4s var(--ease);
}
.now[data-state="quiet"] .now__piece,
.now[data-state="busy"] .now__piece { background: var(--accent); box-shadow: none; }
.now[data-state="full"] .now__piece { background: var(--ink); box-shadow: none; }
.now[data-state="paused"] .now__piece,
.now[data-state="down"] .now__piece { background: transparent; box-shadow: inset 0 0 0 2px var(--muted); }

.now__head {
  max-width: 14ch; font-weight: 400; font-size: clamp(38px, 8vw, 64px); line-height: 1.02; letter-spacing: -0.04em;
  text-wrap: balance;
}
.now__lead { max-width: 36ch; margin-top: var(--s-4); font-size: 18px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.now__lead:empty { display: none; }

/* ---------------------------------------------------------------- the numbers */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-top: var(--s-8); }
.stat {
  display: flex; flex-direction: column; gap: var(--s-1); min-height: 132px; padding: var(--s-5) var(--s-5) 22px;
  border-radius: var(--r-lg); background: var(--surface);
}
.stat__label { font-weight: 500; font-size: 13px; letter-spacing: 0.02em; color: var(--muted); }
.stat__value {
  margin-top: auto; font-size: clamp(28px, 5vw, 40px); line-height: 1.05; letter-spacing: -0.035em;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.stat__value.is-new { opacity: 0; transform: translateY(6px); transition: none; }
.stat__note { font-size: 13px; color: var(--muted); }
/* the wait is the one number most people come for: the dark card, the largest figure */
.stat--wait { grid-column: 1 / -1; min-height: 176px; background: var(--hero-bg); color: var(--hero-ink); }
.stat--wait .stat__label, .stat--wait .stat__note { color: var(--hero-muted); }
.stat--wait .stat__value { font-size: clamp(44px, 10vw, 72px); letter-spacing: -0.045em; }
/* with no wait to tell (paused, confetti out of reach, the page's own read failed) the card steps
   back to the others' ground: a dash should not be the loudest thing on the page */
.stats:is([data-state="paused"], [data-state="down"], [data-state="error"], [data-state="loading"]) .stat--wait { background: var(--surface); color: var(--ink); }
.stats:is([data-state="paused"], [data-state="down"], [data-state="error"], [data-state="loading"]) .stat--wait :is(.stat__label, .stat__note) { color: var(--muted); }
@media (min-width: 640px) {
  .stats { grid-template-columns: 1.35fr 1fr; grid-template-rows: auto auto; }
  .stat--wait { grid-column: 1; grid-row: 1 / span 2; }
}

/* ---------------------------------------------------------------- how busy: a biro line and where the piece lands on it */
.load { margin-top: var(--s-8); }
.load__title { margin-bottom: var(--s-4); font-weight: 500; font-size: 13px; letter-spacing: 0.02em; color: var(--muted); }
.meter { position: relative; height: 28px; }
.meter__line { position: absolute; inset: 13px 0 auto; height: 2px; border-radius: 1px; background: var(--ink); }
.meter__tick { position: absolute; top: 7px; width: 2px; height: 14px; border-radius: 1px; background: var(--ink); transform: translateX(-50%); }
.meter__tick--a { left: 33.333%; }
.meter__tick--b { left: 66.667%; }
.meter__piece {
  position: absolute; top: 14px; left: var(--pos, 0%); width: 16px; height: 16px; border-radius: 4px;
  background: var(--accent); box-shadow: 0 0 0 5px var(--bg); transform: translate(-50%, -50%) rotate(18deg);
  transition: left .9s var(--ease), background .4s var(--ease);
}
.load[data-state="full"] .meter__piece { background: var(--ink); }
.load[data-state="paused"] .meter__piece,
.load[data-state="down"] .meter__piece,
.load[data-state="loading"] .meter__piece { background: var(--bg); box-shadow: 0 0 0 5px var(--bg), inset 0 0 0 2px var(--muted); }
.meter__zones { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: var(--s-3); font-size: 13px; color: var(--muted); }
.meter__zones > :nth-child(2) { text-align: center; }
.meter__zones > :nth-child(3) { text-align: right; }
.meter__zones > .is-here { color: var(--ink); font-weight: 500; }

/* ---------------------------------------------------------------- the note and when it was read */
.note { margin-top: var(--s-8); padding: var(--s-5) max(0px, calc(100% - 54ch)) 0 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.6; color: var(--muted); }
.updated { display: flex; align-items: center; gap: var(--s-3); min-height: 20px; margin-top: var(--s-4); font-size: 13px; color: var(--muted); }
.updated__stroke { flex: 0 0 72px; height: 2px; overflow: hidden; border-radius: 1px; background: var(--line); }
.updated__stroke > span { display: block; width: 100%; height: 100%; background: var(--muted); transform: scaleX(0); transform-origin: left; }
.updated.is-counting .updated__stroke > span { animation: stroke 30s linear forwards; }
.updated:not(.is-counting) .updated__stroke { visibility: hidden; }

/* ---------------------------------------------------------------- the foot */
.foot { display: flex; flex-wrap: wrap; gap: 0 var(--s-5); padding: var(--s-8) 0 var(--s-6); font-size: 14px; color: var(--muted); }
.foot a { display: inline-flex; align-items: center; min-height: 44px; transition: color var(--dur, 180ms) var(--ease); }
.foot a:hover { color: var(--ink); }

.noscript { max-width: 720px; margin: 0 auto; padding: 0 var(--gut) var(--s-6); color: var(--muted); }

/* ---------------------------------------------------------------- motion: the piece lands, busy breathes */
@keyframes land {
  0% { opacity: 0; transform: translateY(-36px) rotate(-42deg); }
  70% { opacity: 1; transform: translateY(2px) rotate(22deg); }
  100% { opacity: 1; transform: translateY(0) rotate(18deg); }
}
@keyframes breathe { 0%, 100% { transform: rotate(18deg) scale(1); } 50% { transform: rotate(18deg) scale(1.14); } }
@keyframes stroke { to { transform: scaleX(1); } }
.now.is-landing .now__piece { animation: land .8s var(--ease) both; }
.now[data-state="busy"]:not(.is-landing) .now__piece { animation: breathe 2.4s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .updated__stroke { visibility: hidden; }
}
