/* hejhej.dev: the shared look (~/src/claude-notes/web-ui.md, after the artifacts page and
   gitview): tokens with a dark override, mono figures, hairline rules, no cards or shadows.
   Reading text is larger than the apps' 13px: it's prose. */
:root {
  --bg: #fbfbfa; --fg: #1a1a19; --muted: #6b6b66; --faint: #b4b4ae; --soft: #4a4a46;
  --rule: #ececea; --rule2: #d9d9d4; --hover: #f3f3f1; --focus: #3d6fd6; --link: #2f5fc0;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413; --fg: #e8e8e3; --muted: #9a9a93; --faint: #5c5c57; --soft: #b9b9b2;
    --rule: #262624; --rule2: #34342f; --hover: #1c1c1a; --focus: #7aa2f7; --link: #7aa2f7;
  }
}

* { box-sizing: border-box; }
html { color-scheme: light dark; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 13px/1.45 var(--sans); -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: var(--faint); }
a:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.k { color: var(--muted); }
.r { text-align: right; }

/* ---- the page: one column; its side padding is outside the rules ------------ */
.page { max-width: 1240px; margin: 0 auto; padding: 0 28px; }

/* ---- the bar: breadcrumb left, feed right, a --fg hairline under it -------- */
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: baseline; gap: 6px 18px;
  padding: 18px 0 12px;
  background: var(--bg); border-bottom: 1px solid var(--fg);
  font: 12px var(--mono);
}
.crumbs { display: flex; align-items: baseline; min-width: 0; overflow: hidden; }
.crumbs > a, .crumbs > span { font: 600 14px var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs > span:last-child { font-weight: 400; color: var(--soft); }
.crumbs .sep { color: var(--faint); font-weight: 400; margin: 0 8px; flex: none; }
.push { margin-left: auto; color: var(--muted); }

.wrap { padding-bottom: 48px; }

/* ---- figures: key/value numbers under the bar ------------------------------ */
.figures {
  display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 12px 0;
  font: 12px var(--mono); font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--rule2);
}
.figures b { font-weight: 600; }
.tagline { margin-left: auto; color: var(--muted); }

/* ---- the post list: ruled rows ---------------------------------------------- */
.row {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) 48px; column-gap: 18px;
  align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--rule);
}
a.row:hover { background: var(--hover); text-decoration: none; }
.row.head {
  padding: 12px 0 6px; border-bottom-color: var(--rule2);
  font: 11px var(--mono); color: var(--muted);
}
.when, .min { font: 12px var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); }
.what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.title { font: 600 15px var(--sans); }
.desc { color: var(--muted); }
.empty { color: var(--muted); margin: 18px 0; }

/* ---- a post: title, figures, then a readable column ------------------------ */
article { max-width: 680px; }
article h1 { margin: 26px 0 0; font: 600 22px/1.25 var(--sans); }
article .figures { border-bottom: 0; padding-bottom: 6px; }
.prose { font-size: 16px; line-height: 1.65; }
.prose h2 { margin: 1.8em 0 0.4em; font: 600 17px var(--sans); padding-bottom: 6px; border-bottom: 1px solid var(--rule2); }
.prose h3 { margin: 1.5em 0 0.3em; font: 600 15px var(--sans); }
.prose a { color: var(--link); }
.prose a:hover { text-decoration-color: currentColor; }
.prose code { font: 0.86em var(--mono); background: var(--hover); padding: 1px 4px; }
.prose pre { overflow-x: auto; padding: 12px 14px; background: var(--hover); border-left: 2px solid var(--rule2); font: 13px/1.5 var(--mono); }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose blockquote { margin: 1em 0; padding: 0 0 0 14px; border-left: 2px solid var(--rule2); color: var(--soft); }
.prose hr { border: 0; border-top: 1px solid var(--rule2); margin: 2em 0; }
.prose img { max-width: 100%; height: auto; display: block; }
figure { margin: 1.4em 0; }
figure img { width: 100%; height: auto; display: block; }
figcaption { margin-top: 6px; font: 12px var(--mono); color: var(--muted); }

/* ---- a game in the page: a screenshot that becomes the game on click -------- */
.game-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.game-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.game-play {
  position: absolute; inset: 0; width: 100%; padding: 0; border: 0; cursor: pointer;
  background: #000; display: flex; align-items: center; justify-content: center;
}
.game-play img { width: 100%; height: 100%; object-fit: contain; }
.game-label {
  position: absolute; padding: 8px 14px; border: 1px solid #f0c46a;
  background: rgba(18, 13, 9, .85); color: #f0c46a; font: 13px var(--mono);
}
.game-label .k { color: #b8a888; }
.game-play:hover .game-label, .game-play:focus-visible .game-label { background: rgba(18, 13, 9, .95); }
.game-play:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

.pager {
  display: flex; justify-content: space-between; gap: 18px; max-width: 680px;
  margin-top: 36px; padding-top: 12px; border-top: 1px solid var(--rule2); font: 12px var(--mono);
}

/* ---- phones ------------------------------------------------------------------ */
@media (max-width: 760px) {
  .page { padding: 0 16px; }
  .bar { padding: calc(env(safe-area-inset-top) + 12px) 0 10px; }
  .wrap { padding-bottom: calc(env(safe-area-inset-bottom) + 32px); }
  .tagline { margin-left: 0; flex-basis: 100%; }
  .row.head { display: none; }
  .row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "a c" "b b"; row-gap: 3px; padding: 11px 0; }
  .row .what { grid-area: a; }
  .row .min { grid-area: c; }
  .row .when { grid-area: b; font-size: 11px; }
  .title { font-size: 16px; }
  article h1 { font-size: 21px; margin-top: 20px; }
  .prose { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
