@font-face {
  font-family: "Switzer";
  src: url("fonts/Switzer-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
/* The ten digits of Nunito Medium, the typeface the clock's firmware draws its time in. */
@font-face {
  font-family: "Nunito Digits";
  src: url("fonts/NunitoDigits-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0030-0039;
}

/* PALETTE. Every colour on the page is named once, here. The scheme blocks below only point the
   working tokens at these. qa/contrast.mjs reads this block. */
:root {
  --day-bg: #f7f6f2;
  --day-t1: #16150f;
  --day-t2: #4f4c44;
  --day-t3: #6c6960;
  --day-accent: #d9480f;
  --day-accent-ink: #ad3b0c;
  --night-bg: #0b0b0c;
  --night-t1: #ecebe7;
  --night-t2: #adaca6;
  --night-t3: #8b8a84;
  --night-accent: #ff5b1f;
  --night-accent-ink: #ff6a33;
  --on-accent: #0b0b0c;
  /* The clock's own colours, from its dashboard definition. They do not change with the theme. */
  --face-bg: #151b18;
  --face-hi: #eef4ed;
  --face-lo: #a7b6ac;
  --face-mint: #a4dbc0;
}

:root {
  color-scheme: light;
  --bg: var(--day-bg);
  --t1: var(--day-t1);
  --t2: var(--day-t2);
  --t3: var(--day-t3);
  --accent: var(--day-accent);
  --accent-ink: var(--day-accent-ink);
  --line: color-mix(in srgb, var(--day-t1) 12%, transparent);
  --line-2: color-mix(in srgb, var(--day-t1) 32%, transparent);
  --chip: color-mix(in srgb, var(--day-t1) 7%, transparent);
  --ring: color-mix(in srgb, var(--day-t1) 14%, transparent);
  --edge: color-mix(in srgb, var(--day-t1) 50%, transparent);

  --sans: "Switzer", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: 176px;
  --gap: 24px;
  --pad: 32px;
  --dock: 0px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: var(--night-bg);
    --t1: var(--night-t1);
    --t2: var(--night-t2);
    --t3: var(--night-t3);
    --accent: var(--night-accent);
    --accent-ink: var(--night-accent-ink);
    --line: color-mix(in srgb, var(--night-t1) 13%, transparent);
    --line-2: color-mix(in srgb, var(--night-t1) 36%, transparent);
    --chip: color-mix(in srgb, var(--night-t1) 10%, transparent);
    --ring: color-mix(in srgb, var(--night-t1) 16%, transparent);
    --edge: color-mix(in srgb, var(--night-t1) 50%, transparent);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--night-bg);
  --t1: var(--night-t1);
  --t2: var(--night-t2);
  --t3: var(--night-t3);
  --accent: var(--night-accent);
  --accent-ink: var(--night-accent-ink);
  --line: color-mix(in srgb, var(--night-t1) 13%, transparent);
  --line-2: color-mix(in srgb, var(--night-t1) 36%, transparent);
  --chip: color-mix(in srgb, var(--night-t1) 10%, transparent);
  --ring: color-mix(in srgb, var(--night-t1) 16%, transparent);
  --edge: color-mix(in srgb, var(--night-t1) 50%, transparent);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 24px;
  scroll-padding-bottom: var(--dock); /* nothing scrolls to rest under the inspector's dock */
  background: var(--bg);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
/* The page stays put behind the certificate. --bar is the scrollbar's width, so nothing shifts when it goes. */
html:has(dialog[open]) { overflow: hidden; padding-right: var(--bar, 0px); }
body {
  margin: 0;
  padding-bottom: var(--dock);
  background: var(--bg);
  color: var(--t1);
  font: 400 16px/1.625 var(--sans);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, picture { display: block; }
img { max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 26%, transparent); }

.sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
.sprite { position: absolute; }
.skip {
  position: absolute; left: 16px; top: -64px; z-index: 60; padding: 8px 14px; border-radius: 6px;
  background: var(--t1); color: var(--bg); text-decoration: none;
}
.skip:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; border-radius: 3px; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--line-2);
  transition: text-decoration-color 0.15s;
}
a:hover { text-decoration-color: var(--accent); }

.wrap {
  width: 100%;
  max-width: calc(var(--gutter) + var(--gap) + 640px + var(--pad) * 2);
  margin-inline: auto;
  padding-inline: max(var(--pad), env(safe-area-inset-left)) max(var(--pad), env(safe-area-inset-right));
}

/* ---------- Header ---------- */

.top { display: flex; align-items: center; justify-content: space-between; min-height: 88px; }
.specs {
  display: inline-flex; align-items: center; height: 44px; margin: 0 -8px; padding: 0 8px;
  border: 0; border-radius: 8px; background: none; color: var(--t1); cursor: pointer;
}
.specs:disabled { cursor: default; }
.mark { display: block; overflow: visible; }
.eye-wink { transition: x 0.18s ease, y 0.18s ease, width 0.18s ease, height 0.18s ease; }
.specs:not(:disabled):hover .eye-wink,
.specs[aria-pressed="true"] .eye-wink { x: 80px; y: -26px; width: 30px; height: 48px; rx: 4px; }
@keyframes blink { 0%, 97%, 100% { transform: scaleY(1); } 98.5% { transform: scaleY(0.1); } }
.eye-open { transform-box: fill-box; transform-origin: center; animation: blink 13s 4s infinite; }

.top-nav { display: flex; gap: 22px; font-size: 15px; }
.top-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--t2); text-decoration-color: transparent; }
.top-nav a:hover { color: var(--t1); text-decoration-color: var(--accent); }

/* ---------- The page grid: a margin for names and labels, a column for the text ---------- */

.row {
  display: grid;
  grid-template-columns: var(--gutter) minmax(0, 1fr);
  column-gap: var(--gap);
  padding-block: 44px;
  scroll-margin-top: 0;
}
.row > h2 {
  align-self: start; justify-self: start;
  font-size: 16px; font-weight: 400; line-height: 26px; color: var(--t3);
}

.hero { padding-block: 56px 56px; }
.who { padding-top: 12px; }
.who h1 { width: fit-content; font-size: 16px; font-weight: 600; line-height: 26px; letter-spacing: -0.005em; }
.handle { display: grid; margin-top: 2px; font: 400 12.5px/22px var(--mono); color: var(--t3); }
.statement {
  font-size: 30px; font-weight: 500; line-height: 38px; letter-spacing: -0.021em;
  text-wrap: balance;
}
.statement > span { display: block; }
.wide { display: none; }
.statement a { text-decoration-thickness: 1.5px; text-underline-offset: 0.16em; }
.statement a:focus-visible { outline-offset: 1px; }
.at { color: var(--accent); }
/* 404.html: the column, with the margin left empty, and one link under the statement. */
.lost { grid-column: 2; }
.more { margin-top: 20px; color: var(--t2); }

/* ---------- Items: a name and a date, then what it was ---------- */

.items { display: grid; gap: 26px; }
.item-h { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
h3 { font-size: 16px; font-weight: 500; line-height: 26px; letter-spacing: -0.005em; }
.when { flex: none; font: 400 12.5px/26px var(--mono); color: var(--t3); white-space: nowrap; }
.state { color: var(--t2); }
.sub { color: var(--t2); text-wrap: pretty; }
.note { margin-top: 10px; color: var(--t2); text-wrap: pretty; }

/* A link out: its arrow never leaves the last word. A long name may wrap; the arrow stays with its end. */
.out, .nb { white-space: nowrap; }
.wraps { white-space: normal; }
.ext { display: inline-block; width: 10px; height: 10px; margin-left: 5px; color: var(--t3); transition: color 0.15s, transform 0.15s; }
a:hover .ext { color: var(--accent-ink); transform: translate(1px, -1px); }
.when a { color: var(--t2); text-decoration-color: transparent; }
.when a:hover { color: var(--t1); text-decoration-color: var(--accent); }

.facts { display: grid; gap: 8px; margin-top: 16px; }
.facts > div { display: grid; grid-template-columns: 104px minmax(0, 1fr); column-gap: 16px; }
.facts dt { font: 400 12.5px/26px var(--mono); color: var(--t3); }
.facts dd { color: var(--t2); text-wrap: pretty; }
figcaption a, .sub a, .statement a { white-space: nowrap; }
.links { margin-top: 16px; }
.links .sep { margin-inline: 8px; color: var(--t3); }
.copy-fallback { margin-top: 12px; font-family: var(--mono, ui-monospace, monospace); font-size: 14px; color: var(--t1); user-select: all; overflow-wrap: anywhere; }
/* Smaller results: one line each on a wide screen. */
.lines { gap: 4px; }

/* ---------- Capture the flag ---------- */

.feature { margin-bottom: 30px; }
.photo { margin-top: 22px; }
.photo img { width: 100%; border-radius: 6px; background: var(--chip); }
figcaption { margin-top: 10px; font-size: 14px; line-height: 22px; color: var(--t3); text-wrap: pretty; }

/* ---------- The clock: both faces, laid out from dashboard/desk-clock.json ----------
   Every position is the firmware's percentage frame. Sizes are in container units, so a face is the
   same drawing at 240px and at 132px. */

.faces { display: grid; grid-template-columns: repeat(2, minmax(0, 240px)) minmax(0, 1fr); gap: 16px; margin-top: 20px; }
html:not(.clock-ready) .faces { display: none; } /* shown by app.js once the time is set */
.faces figcaption { grid-column: 1 / -1; margin-top: -2px; }
.face {
  position: relative; aspect-ratio: 1; overflow: hidden; container-type: inline-size;
  border-radius: 7px; background: var(--face-bg); color: var(--face-hi);
  box-shadow: 0 0 0 1px var(--ring);
  font-family: var(--sans); font-weight: 500; line-height: 1; white-space: nowrap; letter-spacing: 0;
  user-select: none;
}
.face > * { position: absolute; display: flex; align-items: center; }
.f-date { left: 5%; top: 5%; height: 7%; font-size: 5.8cqw; color: var(--face-lo); }
.f-time {
  left: 3%; top: 14%; width: 94%; height: 42%; justify-content: center;
  font: 500 31.667cqw/1 "Nunito Digits", var(--sans); font-variant-numeric: tabular-nums;
}
.f-time b { width: 0.605em; font-weight: 500; text-align: center; }
/* Two round dots: the firmware draws its colon rather than using the font's. */
.f-time i { position: relative; width: 0.24em; height: 0.329em; margin-top: 0.03em; }
.f-time i::before, .f-time i::after {
  content: ""; position: absolute; left: 50%; width: 0.086em; height: 0.086em; margin-left: -0.043em;
  border-radius: 50%; background: currentColor;
}
.f-time i::before { top: 0; }
.f-time i::after { bottom: 0; }
.f-temp { left: 5%; top: 57%; height: 18%; font-size: 14.4cqw; font-weight: 400; letter-spacing: -0.02em; }
.f-temp i { position: relative; top: -0.07em; font-style: normal; letter-spacing: 0.05em; }
.f-range { left: 38%; top: 60%; height: 9%; font-size: 5.8cqw; color: var(--face-lo); }
.f-rule { left: 7.5%; top: 76.4%; width: 85%; height: 0.42cqw; min-height: 1px; border-radius: 1px; background: color-mix(in srgb, var(--face-lo) 34%, transparent); }
.f-rain { left: 5%; top: 82%; height: 9%; font-size: 5.8cqw; color: var(--face-mint); }

.f-head { left: 5%; top: 4%; height: 6%; font-size: 4.6cqw; letter-spacing: 0.04em; color: var(--face-lo); }
.f-small { right: 4%; top: 4%; height: 6%; font-size: 4.8cqw; font-variant-numeric: tabular-nums; color: var(--face-lo); }
.f-art { left: 25.4%; top: 16.7%; width: 49.2%; height: 49.2%; overflow: hidden; border-radius: 2cqw; background: color-mix(in srgb, var(--face-lo) 16%, transparent); }
.f-art img { width: 100%; height: 100%; object-fit: cover; }
/* The cover is a link to the track. Nothing marks it; it lies over the artwork, outside the face,
   because the face is described as one picture. */
.face-slot { position: relative; }
.f-play { position: absolute; left: 25.4%; top: 16.7%; width: 49.2%; height: 49.2%; border-radius: 5px; }
.f-play:focus-visible { outline-color: var(--face-hi); outline-offset: 3px; }
.f-title { left: 6.7%; top: 70%; height: 8%; font-size: 6cqw; }
.f-artist { left: 6.7%; top: 81%; height: 6%; font-size: 4.8cqw; font-weight: 400; color: var(--face-lo); }
.f-bar { left: 4.6%; top: 91%; width: 90.8%; height: 2.2%; border-radius: 99px; background: color-mix(in srgb, var(--face-lo) 22%, transparent); }
.f-bar i { width: 38%; height: 100%; border-radius: inherit; background: var(--face-mint); }
/* ---------- The logger: its three parts, a short label and a line each ---------- */

.parts { gap: 6px; }

/* ---------- Contact ---------- */

.close { padding-bottom: 0; }
.close-grid { display: grid; grid-template-columns: minmax(0, 1fr) 200px; column-gap: 32px; align-items: end; border-bottom: 1px solid var(--line); }
.close-text { padding-bottom: 36px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px;
  border: 0; border-radius: 8px; background: none; box-shadow: inset 0 0 0 1px var(--edge);
  color: var(--t1); font-size: 15px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.btn[hidden] { display: none; }
.btn:hover { background: var(--chip); }
.btn-primary { background: var(--t1); box-shadow: none; color: var(--bg); }
.btn-primary:hover { background: var(--t1); opacity: 0.86; }
.plain-mail { margin-top: 14px; font: 400 14px/26px var(--mono); color: var(--t2); }
.em::before { content: attr(data-u) "\40" attr(data-d) "\2e" attr(data-t); }

.elsewhere { margin-top: 28px; border-top: 1px solid var(--line); }
.elsewhere a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 9px 0;
  border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 500;
}
.elsewhere li:last-child a { border-bottom: 0; }
.elsewhere .h { display: inline-flex; align-items: baseline; gap: 6px; font: 400 12.5px/26px var(--mono); color: var(--t3); transition: color 0.15s; }
.elsewhere a:hover .h { color: var(--t1); }
.elsewhere .ext { margin-left: 0; }
.portrait img { width: 200px; height: auto; }

/* ---------- The certificate, shown in the page ---------- */

.cert {
  width: min(960px, calc(100vw - 24px), calc((100dvh - 96px) * 1600 / 1131 + 20px));
  max-width: none; max-height: none; padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--t1);
  box-shadow: 0 24px 80px rgb(0 0 0 / 0.4);
}
.cert[open] { animation: xray-in 0.15s ease-out both; }
.cert::backdrop { background: rgb(0 0 0 / 0.64); }
.cert-in { display: grid; gap: 10px; justify-items: end; padding: 10px; }
.cert-pic { width: 100%; aspect-ratio: 1600 / 1131; border-radius: 4px; overflow: hidden; background: var(--chip); }
.cert-pic img { width: 100%; height: 100%; }

/* ---------- Footer ---------- */

.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 20px 28px; }
.foot-note { display: flex; flex-wrap: wrap; gap: 0 20px; font: 400 12.5px/22px var(--mono); color: var(--t3); }
html:not(.theme-ready) .theme { display: none; } /* shown by app.js once the radios work */
.theme { display: inline-flex; gap: 2px; margin: 0 -10px 0 0; padding: 0; border: 0; font-size: 14px; }
.theme label { position: relative; display: inline-flex; cursor: pointer; }
.theme input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.theme span { display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: 6px; color: var(--t3); transition: background-color 0.15s, color 0.15s; }
.theme label:hover span { color: var(--t1); }
.theme input:checked + span { background: var(--chip); color: var(--t1); }
.theme input:focus-visible + span { outline: 2px solid var(--accent-ink); outline-offset: 2px; }

/* ---------- Inspect mode: boxes and labels read from the live page ---------- */

.xray { position: fixed; inset: 0; z-index: 50; pointer-events: none; overflow: hidden; contain: strict; }
.xray[hidden] { display: none; }
.xray > i {
  position: absolute; left: 0; top: 0; display: block; border: 1px solid var(--accent); border-radius: 3px;
  font-style: normal; animation: xray-in 0.2s ease-out both;
}
.xray > i b[hidden] { display: none; }
.xray > i b {
  position: absolute; left: 0; top: 0; height: 17px; padding: 0 5px; border-radius: 3px;
  background: var(--accent); color: var(--on-accent);
  font: 500 10.5px/17px var(--mono); white-space: nowrap;
}
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51;
  display: flex; align-items: center; justify-content: space-between; gap: 8px 20px;
  padding: 10px max(var(--pad), env(safe-area-inset-left), calc((100% - 840px) / 2)) calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--accent); background: var(--bg); color: var(--t2);
  font: 400 11.5px/19px var(--mono); animation: xray-in 0.2s ease-out both;
}
.dock[hidden] { display: none; }
.dock-lines { display: grid; gap: 1px 24px; grid-template-columns: repeat(2, minmax(0, max-content)); min-width: 0; }
.dock li { min-width: 0; }
.dock em { font-style: normal; color: var(--t1); }
.dock u { display: inline-block; width: 9px; height: 9px; margin: 0 5px 0 0; border-radius: 2px; box-shadow: 0 0 0 1px var(--ring); vertical-align: -1px; }
.dock-close {
  position: relative; flex: none; height: 30px; padding: 0 12px; border: 0; border-radius: 7px;
  background: none; box-shadow: inset 0 0 0 1px var(--edge); color: var(--t1);
  font: 500 13px/1 var(--sans); cursor: pointer; transition: background-color 0.15s;
}
.dock-close::before { content: ""; position: absolute; inset: -7px -6px; } /* a 44px target */
.dock-close:hover { background: var(--chip); }
@keyframes xray-in { from { opacity: 0; } }

/* ---------- Narrow screens: the margin folds in above the column ---------- */

@media (min-width: 900px) {
  .wide { display: inline; }
  .lines li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; align-items: baseline; }
  .lines .item-h { display: contents; }
  .lines h3 { grid-area: 1 / 1; }
  .lines .sub { grid-area: 1 / 2; }
  .lines .when { grid-area: 1 / 3; }
  .close > h2 { margin-top: 7px; } /* level with the buttons beside it */
}
@media (max-width: 899px) {
  :root { --pad: 20px; }
  .top { min-height: 68px; }
  .row { grid-template-columns: minmax(0, 1fr); row-gap: 14px; padding-block: 30px; }
  .hero { padding-block: 22px 40px; row-gap: 26px; }
  .lost { grid-column: 1; }
  .who { padding-top: 0; }
  .handle { display: flex; gap: 0 14px; }
  .statement { margin-top: 0; font-size: 25px; line-height: 32px; letter-spacing: -0.018em; }
  .more { margin-top: 16px; }
  .items { gap: 22px; }
  /* A name and its date share a line when both fit. When they do not, the date takes the next line. */
  .item-h { flex-wrap: wrap; row-gap: 0; }
  .facts > div { grid-template-columns: minmax(0, 1fr); }
  .facts dt { line-height: 22px; }
  .parts > div { grid-template-columns: 56px minmax(0, 1fr); column-gap: 12px; }
  .parts dt { line-height: 26px; }
  .faces { grid-template-columns: repeat(2, minmax(0, 240px)); gap: 12px; }
  .close { padding-bottom: 0; }
  .close-grid { grid-template-columns: minmax(0, 1fr) 132px; column-gap: 16px; }
  .close-text { display: contents; }
  .actions, .copy-fallback, .plain-mail, noscript { grid-column: 1 / -1; }
  .copy-fallback { margin: -10px 0 24px; }
  .plain-mail { margin: -12px 0 22px; } /* without script: the address sits with its button */
  .actions { margin-bottom: 26px; }
  .elsewhere { grid-column: 1; align-self: end; margin-top: 0; border-top: 0; }
  .elsewhere a { padding: 10px 0; }
  .elsewhere li:first-child a { border-top: 1px solid var(--line); }
  .portrait { grid-column: 2; align-self: end; }
  .portrait img { width: 132px; }
  .btn { height: 44px; }
  .foot { padding-block: 18px 26px; }
  .lines { gap: 14px; }
  .dock { display: block; padding-top: 8px; font-size: 10.5px; line-height: 17px; }
  .dock-lines { grid-template-columns: minmax(0, 1fr); }
  .dock li:first-child { padding: 6.5px 76px 6.5px 0; } /* as tall as the Close button beside it */
  .dock-close { position: absolute; top: 8px; right: max(var(--pad), env(safe-area-inset-right)); }
}
@media (max-width: 359px) {
  .top-nav { gap: 16px; }
  .statement { font-size: 24px; line-height: 31px; }
  .close-grid { grid-template-columns: minmax(0, 1fr) 112px; column-gap: 12px; }
  .portrait img { width: 112px; }
  .elsewhere .h span { display: none; }
  .lines .item-h { display: block; } /* one long name here: every date in the list goes under its name */
  .actions .btn { flex: 1 1 100%; }
}

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

@media (forced-colors: active) {
  .face { forced-color-adjust: none; }
  .btn, .dock-close { border: 1px solid CanvasText; }
}

@media print {
  .top-nav, .specs, .theme, .xray, .dock, .skip, .actions { display: none !important; }
  .row { padding-block: 16px; break-inside: avoid; }
  a { text-decoration: none; }
}
