:root {
  --bg: #000;
  --fg: #ededed;
  --mute: #8a8a8a;
  --line: #fff;
  --soft: rgba(255,255,255,.18);
  --hover: rgba(255,255,255,.06);
}
:root[data-theme="light"] {
  --bg: #fff;
  --fg: #111;
  --mute: #707070;
  --line: #000;
  --soft: rgba(0,0,0,.18);
  --hover: rgba(0,0,0,.05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 14px/1.7 "JetBrains Mono", ui-monospace, Menlo, monospace;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--fg); color: var(--bg); }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--mute); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--fg); }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.mute { color: var(--mute); }
.small { font-size: 12px; }
hr { border: 0; border-top: 1px solid var(--soft); margin: 32px 0; }

.page { max-width: 720px; margin: 0 auto; padding: 72px 16px 48px; }

/* header */
.head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 28px; }
.head h1 { margin: 0; font-size: 26px; font-weight: 500; letter-spacing: -.01em; }
.theme { color: var(--mute); }
.theme:hover { color: var(--fg); }

/* tabs */
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); margin-bottom: 36px; }
.tabs a { text-decoration: none; text-align: center; padding: 10px 6px; border-left: 1px solid var(--line); }
.tabs a:first-child { border-left: 0; }
.tabs a:hover { background: var(--hover); }
.tabs a[aria-selected="true"] { background: var(--fg); color: var(--bg); }

/* panels */
.panel p { margin: 0 0 16px; }
.panel h2 { font-size: 14px; font-weight: 500; margin: 40px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--soft); }
.panel > h2:first-child { margin-top: 0; }

.rows { display: grid; grid-template-columns: 140px 1fr; margin: 20px 0 0; border-top: 1px solid var(--soft); }
.rows dt, .rows dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--soft); }
.rows dt { color: var(--mute); padding-right: 12px; }
@media (max-width: 520px) {
  .rows { grid-template-columns: 1fr; }
  .rows dt { border-bottom: 0; padding-bottom: 0; }
}

/* github repo card */
.repo { display: block; text-decoration: none; border: 1px solid var(--line); padding: 16px; }
.repo:hover { background: var(--hover); }
.repo__top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.repo__top b { font-weight: 500; }
.repo__desc { color: var(--mute); margin: 8px 0 12px !important; }
.repo__stats { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; }
.repo__stats b { font-weight: 500; }
.repo__files { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--soft); columns: 3; column-gap: 16px; font-size: 12px; color: var(--mute); }
.repo__files:empty { display: none; }
.repo__files li { break-inside: avoid; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 520px) { .repo__files { columns: 2; } }

/* board renders */
.renders { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.renders figure { margin: 0; }
.renders a { display: block; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--soft); background: #000; }
.renders a:hover { border-color: var(--line); }
.renders img { width: 100%; height: 100%; object-fit: cover; }
.renders figcaption { font-size: 12px; color: var(--mute); padding: 4px 0 8px; }
@media (max-width: 520px) { .renders { grid-template-columns: repeat(2, 1fr); } }

/* embedded frames */
.frame { border: 1px solid var(--line); margin: 16px 0 8px; }
.frame__bar { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--mute); }
.frame__bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frame__bar a { color: var(--fg); text-decoration: none; flex: none; }
.frame iframe { display: block; width: 100%; height: 480px; border: 0; background: #111; }
.frame--game iframe { height: auto; aspect-ratio: 485 / 402; }

/* scratch stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); margin: 24px 0 8px; }
.stats div { padding: 12px 14px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.stats div:nth-child(3n+1) { border-left: 0; }
.stats div:nth-child(-n+3) { border-top: 0; }
.stats b { display: block; font-size: 22px; font-weight: 500; }
.stats span { color: var(--mute); font-size: 12px; }

.list { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: 13px; }
.list th { text-align: left; font-weight: 400; color: var(--mute); padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); }
.list td { padding: 7px 8px 7px 0; border-bottom: 1px solid var(--soft); }
.list th:nth-child(n+2), .list td:nth-child(n+2) { text-align: right; font-variant-numeric: tabular-nums; }
.list td:last-child { width: 1%; white-space: nowrap; }
.list tbody tr { cursor: pointer; }
.list tbody tr:hover { background: var(--hover); }
.list tr.is-playing td:first-child::before { content: "▶ "; }
.list .play { color: var(--mute); }
.list tr:hover .play, .list tr.is-playing .play { color: var(--fg); }
@media (max-width: 520px) { .list th:nth-child(3), .list td:nth-child(3) { display: none; } }

/* misc */
.portrait { width: 200px; height: auto; margin: 24px 0 0; border: 1px solid var(--soft); }

/* poem: lines are hexameter / indented pentameter; scansion marks sit above each syllable */
.poem { margin: 12px 0 0; }
.poem figcaption { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; margin-bottom: 12px; }
.poem__toggle { margin-left: auto; color: var(--mute); font-size: 12px; }
.poem__toggle:hover { color: var(--fg); }
.verse { margin: 0; overflow-x: auto; font-size: min(14px, 2.75vw); }
.v { display: block; position: relative; white-space: nowrap; }
.v.pen { padding-left: 2ch; }
.gap { display: block; height: .9em; }
.ln { position: absolute; right: 0; color: var(--mute); font-size: 12px; }
.sy { position: relative; }
.el { color: var(--mute); }
.is-scanned .v { line-height: 2.7; }
.is-scanned .sy::before { content: attr(data-m); position: absolute; left: 0; right: 0; top: -1.15em; text-align: center; font-size: 12px; color: var(--fg); opacity: .6; line-height: 1; }
.is-scanned .ft + .ft { box-shadow: inset 1px 0 var(--soft); padding-left: 3px; margin-left: 2px; }
.is-scanned .el { text-decoration: underline dotted; text-underline-offset: 3px; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 4px 0; }
.plain li::before { content: "– "; color: var(--mute); }
.photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.photos a { aspect-ratio: 1; overflow: hidden; border: 1px solid var(--soft); }
.photos img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }
@media (max-width: 520px) { .photos { grid-template-columns: repeat(2, 1fr); } }

.foot { margin-top: 56px; }
.foot p { margin: 0 0 6px; }
