@font-face {
  font-family: 'Departure Mono';
  src: url('../fonts/DepartureMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* colors */
:root {
  --bg: #0b0c0e;
  --text: #d9dbe0;
  --dim: #6c7079;
  --mid: #a3a8b3;
  --line: #22252b;
  --blue: #4f7dff;
  --blue-soft: #8fb0ff;
  --hot: #d6ecff;
  --glow: rgba(90, 160, 255, .75);
  --mono: 'Departure Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  color-scheme: dark;
}
/* flashbang only */
:root.light {
  --bg: #f3f4f6;
  --text: #15171c;
  --dim: #6b7080;
  --mid: #454a57;
  --line: #d8dbe2;
  --blue: #2f5bff;
  --blue-soft: #1d3fd0;
  --hot: #0a1a5c;
  --glow: rgba(47, 91, 255, .35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 13px/1.65 var(--mono); }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--dim); text-underline-offset: 3px; }
a:hover { color: var(--blue-soft); text-decoration-color: var(--blue); }
:focus-visible { outline: 1px solid var(--blue); outline-offset: 2px; }
::selection { background: var(--blue); color: var(--bg); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dim { color: var(--dim); }

.page {
  min-height: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px clamp(16px, 3.5vw, 40px) 16px;
  display: flex;
  flex-direction: column;
}

.top, .bottom { display: flex; justify-content: space-between; gap: 16px; color: var(--dim); font-size: 11px; }
/* left · clock · right, clock stays dead center */
.top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; }
.top .left { display: flex; align-items: baseline; gap: 10px; }
.top .right { justify-self: end; display: flex; gap: 16px; }
#clock { font-variant-numeric: tabular-nums; }
.flash { background: none; border: 0; padding: 0; font: inherit; color: var(--dim); cursor: pointer; }
.flash::before { content: '['; } .flash::after { content: ']'; }
.flash:hover { color: var(--blue-soft); }
.bottom { margin-top: auto; padding-top: clamp(28px, 6vh, 56px);
  /* the middle floats between the bars */ flex-wrap: wrap; gap: 4px 16px; align-items: baseline; }

/* last.fm */
.np { position: relative; display: inline-flex; }
.np[hidden] { display: none; }
.np-btn { background: none; border: 0; padding: 0 2px; font: inherit; color: var(--dim); cursor: pointer; }
.np-btn:hover, .np.open .np-btn { color: var(--blue-soft); }
.np-eq { display: none; color: var(--blue); letter-spacing: 2px; }
.np.live .np-note { display: none; }
.np.live .np-eq { display: inline; }
.np-pop {
  display: none; position: absolute; top: 100%; left: -8px; z-index: 30; margin-top: 6px;
  min-width: 22ch; max-width: min(42ch, calc(100vw - 32px)); padding: 6px 10px;
  background: var(--bg); border: 1px solid var(--line); color: var(--text); white-space: normal;
}
.np-pop::before { content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 8px; } /* hover bridge */
.np-pop > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-by { color: var(--mid); }
.np-when { color: var(--dim); }
.np.open .np-pop { display: block; }
@media (hover: hover) { .np:hover .np-pop { display: block; } }
.np-dot { display: none; width: 6px; height: 6px; margin-right: 7px; vertical-align: 1px; background: var(--blue); }
.np.live .np-dot { display: inline-block; animation: np 1.2s steps(1) infinite; }
@keyframes np { 50% { opacity: .2; } }

.name { margin: auto 0 0; padding-top: clamp(18px, 6vh, 72px); font-size: 0; line-height: 0; }
.logo { position: relative; display: block; width: 100%; max-width: 560px; margin-left: -1.5%; transform: rotate(-2deg); transition: transform .25s steps(3); }
.logo:hover { transform: rotate(1deg) scale(1.02); }
.logo img { display: block; width: 100%; height: auto; }
.logo canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.logo.decoding img { visibility: hidden; }
html.pre :is(.logo, .intro, .cols, .bottom) { visibility: hidden; }
.intro { margin: clamp(10px, 2.5vh, 26px) 0 0; max-width: 60ch; color: var(--mid); }
.intro .lead { color: var(--blue); }
.intro .lead a { color: var(--blue); text-decoration-color: color-mix(in oklab, var(--blue) 45%, transparent); }

.cols {
  margin-top: clamp(18px, 5vh, 56px);
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 32ch));
  gap: 24px clamp(20px, 3vw, 40px);
}
.cols section { min-width: 0; }
.cols h2 { margin: 0 0 8px; font: inherit; font-size: 11px; color: var(--blue); }
.cols h2::before { content: '/ '; color: var(--dim); }

.kv { margin: 0; display: grid; gap: 4px; }
.kv div { display: grid; grid-template-columns: 9ch minmax(0, 1fr); gap: 8px; align-items: baseline; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; }

.builds { margin: 0; display: grid; gap: 10px; }
.builds dt { display: flex; gap: 8px; align-items: baseline; }
.builds dd { margin: 0; color: var(--mid); }
.state { font-size: 11px; color: var(--dim); }
.state::before { content: '['; } .state::after { content: ']'; }

.copy { background: none; border: 0; padding: 0; font: inherit; font-size: 11px; color: var(--dim); cursor: pointer; }
.copy::before { content: '['; } .copy::after { content: ']'; }
.copy:hover { color: var(--blue-soft); }
.mrrp { min-width: 9ch; text-align: right; }

/* light mode is a flashbang: white, then steps back */
.bang { position: fixed; inset: 0; z-index: 100; background: #fff; pointer-events: none; animation: bang 3s steps(12) forwards; }
@keyframes bang { 0%, 20% { opacity: 1; } 100% { opacity: 0; } }

@media (max-width: 560px) {
  .cols { grid-template-columns: 1fr; }
  .top { grid-template-columns: 1fr auto; }
  .top .where { display: none; }
}
@media (pointer: coarse) {
  .copy, .flash { min-height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .logo, .logo:hover { transition: none; transform: rotate(-2deg); }
}
