:root {
  --orange: #ff6600;
  --bg: #f6f6ef;
  --panel: #ffffff;
  --soft: #ececdf;
  --text: #000000;
  --muted: #828282;
  --line: #e0e0d6;
  --mark: #ffe2b8;
  --ui: Verdana, Geneva, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --panel: #1c1c1c;
    --soft: #262626;
    --text: #e8e8e8;
    --muted: #8f8f8f;
    --line: #2e2e2e;
    --mark: #5a3410;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 var(--ui);
}
a { color: inherit; }
button { font: inherit; color: inherit; }

/* ---- header: Hacker News' orange bar ---- */
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  background: var(--orange); color: #000;
  padding: 4px 10px; min-height: 34px;
}
.logo { display: flex; align-items: center; gap: 6px; text-decoration: none; color: #000; }
.logo-box {
  display: grid; place-items: center;
  width: 20px; height: 20px; border: 1px solid #fff; color: #fff;
  font-weight: bold; font-size: 13px;
}
.bar nav { white-space: nowrap; overflow-x: auto; }
.bar nav a { text-decoration: none; }
.bar nav a.on { color: #fff; }
.search { margin-left: auto; }
.search input {
  width: 180px; padding: 3px 6px;
  border: 1px solid #c2560d; border-radius: 2px;
  background: #fff7ef; color: #000; font: 12px var(--ui);
}

main { max-width: 1280px; margin: 0 auto; padding: 18px 16px 40px; min-height: 70vh; }
footer {
  max-width: 1280px; margin: 0 auto; padding: 14px 16px 30px;
  border-top: 2px solid var(--orange);
  color: var(--muted); font-size: 11px; text-align: center;
}

/* ---- feed pages ---- */
.intro { margin-bottom: 14px; }
.intro h1 { font: 400 40px/1.1 var(--serif); margin: 4px 0 6px; }
.intro p { color: var(--muted); margin: 0; max-width: 70ch; }
.intro a { color: var(--text); }

.wotd {
  display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 16px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px; margin: 0 0 20px; max-width: 860px;
}
.wotd:empty { display: none; }
.wotd-cover { position: relative; }
.wotd-cover a { text-decoration: none; display: block; }
.wotd h2 { font: 400 34px/1 var(--serif); margin: 2px 0 6px; }
.wotd h2 a { text-decoration: none; }
.wotd p { margin: 0 0 4px; }
.wotd-label { color: var(--orange); font-weight: bold; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.wotd-def {
  font: 400 17px/1.3 var(--serif);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.wotd-cta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.btn.sponsor { background: var(--orange); color: #000; font-weight: bold; padding: 6px 14px; font-size: 12px; }
.price { display: inline-block; background: var(--soft); border-radius: 12px; padding: 2px 10px; font-size: 12px; font-weight: bold; }

.grid {
  display: grid; gap: 22px 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.card { position: relative; min-width: 0; }
.card-link { text-decoration: none; display: block; }
.card-link:hover .cover { filter: brightness(1.08); }

/* tap-to-say, over a cover's top-right corner */
.say {
  position: absolute; top: 6px; right: 6px;
  width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: rgb(0 0 0 / .5); cursor: pointer;
  display: grid; place-items: center;
}
.say::before {
  content: ""; border-style: solid; border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent #fff; margin-left: 3px;
}
.say:hover, .say.on { background: var(--orange); }
.card-body { display: flex; gap: 10px; margin-top: 9px; }
.card-body .who { flex: 1; min-width: 0; }
.card-title { font-weight: bold; font-size: 14px; overflow-wrap: anywhere; }
.card-meta { color: var(--muted); font-size: 12px; }
.card-body .who a { display: block; text-decoration: none; }
.card-body a.card-meta:hover { color: var(--text); }
a.avatar { text-decoration: none; }
.rank { color: var(--muted); font-size: 12px; min-width: 2.2em; padding-top: 1px; }

/* the "thumbnail": a word, typeset */
.cover {
  position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden;
  display: grid; place-items: center; padding: 8%;
  color: #fff; background: var(--c, #333);
  container-type: inline-size;
}
.cover .word {
  font: 400 var(--fs, 22cqi)/1 var(--serif);
  text-align: center; overflow-wrap: anywhere;
  text-shadow: 0 2px 12px rgb(0 0 0 / .18);
}
.cover .years {
  position: absolute; top: 7px; left: 9px;
  font: 11px var(--ui); opacity: .8;
}
.cover .dur {
  position: absolute; right: 7px; bottom: 7px;
  background: rgb(0 0 0 / .78); color: #fff;
  font: bold 11px var(--ui); padding: 1px 4px; border-radius: 4px;
}
.cover .hots { position: absolute; left: 7px; bottom: 7px; display: flex; gap: 4px; }
.player .hots { left: 10px; bottom: 54px; }
.cover .hot {
  background: #fff; color: #000;
  font: bold 11px var(--ui); padding: 1px 5px; border-radius: 4px;
}

.avatar {
  flex: none; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--c, #888); color: #fff; font-weight: bold; font-size: 13px;
  text-transform: uppercase;
}

.more { display: block; margin: 26px auto 0; }
.btn {
  border: 0; border-radius: 18px; padding: 8px 16px;
  background: var(--soft); cursor: pointer; text-decoration: none; display: inline-block;
}
.btn:hover { filter: brightness(.96); }
.loading { color: var(--muted); padding: 30px 0; text-align: center; }

/* ---- word page: video page layout ---- */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; }
.player .cover { border-radius: 12px; }
.player .progress { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--orange); width: 0; }
.player .controls {
  position: absolute; left: 10px; bottom: 12px;
  display: flex; align-items: center; gap: 10px;
  font: 12px var(--ui); color: #fff;
}
.player .time { background: rgb(0 0 0 / .55); padding: 2px 8px; border-radius: 10px; }
.player .play {
  width: 44px; height: 32px; border: 0; border-radius: 9px;
  background: rgb(33 33 33 / .8); cursor: pointer;
  display: grid; place-items: center;
}
.player .play:hover, .player .play.on { background: var(--orange); }
.player .play::before {
  content: ""; border-style: solid; border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent #fff; margin-left: 3px;
}
.watch h1 { font: 400 46px/1.05 var(--serif); margin: 14px 0 10px; overflow-wrap: anywhere; }
.channel { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.channel .who { margin-right: auto; }
.channel .who b { display: block; }
.channel .who span { color: var(--muted); font-size: 12px; }

.descr { background: var(--soft); border-radius: 12px; padding: 12px 14px; margin-top: 14px; }
.descr .stats { font-weight: bold; }
.descr .def { font: 400 21px/1.3 var(--serif); margin: 8px 0 2px; }
.descr .def.none { font-style: italic; }
.descr .src { color: var(--muted); font-size: 11px; }
.split { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin: 12px 0 4px; background: var(--line); }
.split span { background: var(--orange); width: 100%; }
.split-l { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }

h2 { font-size: 15px; margin: 26px 0 10px; }
/* mentions per year: a column per year, count over the bar, year under it */
.chart { display: flex; gap: 2px; height: 150px; }
.yr {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px;
  border: 0; padding: 0; background: none; cursor: pointer;
}
.yr:disabled { cursor: default; }
.yr .col { position: relative; flex: 1; margin-top: 14px; }
.yr .b {
  position: absolute; left: 12%; right: 12%; bottom: 0;
  height: var(--h); min-height: 1px; background: var(--orange); border-radius: 2px 2px 0 0;
}
.yr .n {
  position: absolute; left: 50%; bottom: calc(var(--h) + 2px); transform: translateX(-50%);
  font-size: 10px; color: var(--muted); white-space: nowrap;
}
.yr .y { font-size: 10px; color: var(--muted); text-align: center; }
.yr:not(:disabled):hover .b { background: var(--text); }
.chart.picked .yr:not(.on) .b { opacity: .3; }
.yr.on .n, .yr.on .y { color: var(--text); font-weight: bold; }

.comments-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.comments-head h2 { margin-right: auto; }
.sort { display: flex; gap: 6px; }
.sort .btn { padding: 5px 12px; font-size: 12px; }
.sort .btn.on { background: var(--text); color: var(--bg); }

.comment { display: flex; gap: 12px; margin: 0 0 18px; }
.comment .body { min-width: 0; flex: 1; }
.comment .head { font-size: 12px; color: var(--muted); }
.comment .head b { color: var(--text); }
.comment .head b a { color: var(--text); text-decoration: none; }
.comment .head a { color: var(--muted); }
.comment p { margin: 3px 0 5px; overflow-wrap: anywhere; }
.comment mark { background: var(--mark); color: inherit; padding: 0 1px; }
.comment .foot { display: flex; gap: 10px; align-items: center; font-size: 11px; }
.comment .foot a { color: var(--muted); }
.first { border-left: 3px solid var(--orange); padding-left: 12px; }

.side h2 { margin-top: 0; }
.mini { display: flex; gap: 8px; text-decoration: none; margin-bottom: 8px; align-items: center; }
.mini .cover { width: 168px; flex: none; border-radius: 8px; padding: 6%; }
.mini.here .cover { outline: 2px solid var(--orange); outline-offset: 1px; }
.mini .card-title { font-size: 13px; }

/* ---- user page: a channel ---- */
.profile { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 6px 0 4px; }
.profile .who { margin-right: auto; min-width: 0; }
.profile h1 { font: 400 46px/1.05 var(--serif); margin: 0; overflow-wrap: anywhere; }
.avatar.big { width: 80px; height: 80px; font-size: 34px; }
h2 .note { color: var(--muted); font-weight: normal; font-size: 12px; margin-left: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--soft); border-radius: 14px; padding: 4px 10px; text-decoration: none; }
.chip span { color: var(--muted); font-size: 11px; margin-left: 5px; }
.chip:hover { background: var(--orange); color: #000; }
.chip:hover span { color: #000; }

.people { display: flex; flex-wrap: wrap; gap: 8px; }
.person {
  display: flex; align-items: center; gap: 8px; text-decoration: none;
  background: var(--soft); border-radius: 22px; padding: 4px 14px 4px 4px;
}
.person b { display: block; font-size: 13px; }
.person:hover { background: var(--line); }

.notfound { max-width: 640px; }
.notfound h1 { font: 400 46px/1.05 var(--serif); margin: 10px 0; }

.prose { max-width: 680px; background: var(--panel); padding: 6px 22px 18px; }
.prose h1 { font: 400 40px/1.1 var(--serif); margin: 14px 0 6px; }
.prose h2 { margin-top: 22px; }
.byline { color: var(--muted); font-size: 12px; margin: 14px 0 0; }
.byline a { color: var(--text); }
.donate dt { font-weight: bold; margin-top: 12px; }
.donate dd { margin: 4px 0 0; display: flex; gap: 8px; align-items: center; }
.donate code { font: 12px ui-monospace, Consolas, monospace; overflow-wrap: anywhere; min-width: 0; }
.donate .btn { padding: 3px 10px; font-size: 11px; flex: none; }
.prose li { margin-bottom: 4px; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font: 11px var(--ui); background: var(--panel); }

@media (max-width: 960px) {
  .watch { grid-template-columns: minmax(0, 1fr); }
  .mini .cover { width: 140px; }
}
@media (max-width: 640px) {
  .bar { position: static; flex-wrap: wrap; row-gap: 2px; }
  .search { margin-left: 0; width: 100%; padding-bottom: 4px; }
  .search input { width: 100%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 12px; }
  .card-body .avatar { display: none; }
  /* thumbnail beside label, word and definition; stats and button full width below */
  .wotd { grid-template-columns: 120px minmax(0, 1fr); gap: 0 10px; padding: 8px; }
  .wotd-cover { grid-column: 1; grid-row: 1 / span 3; align-self: center; }
  .wotd-text { display: contents; }
  .wotd-text > .card-meta { grid-column: 1 / -1; margin: 8px 0 0; }
  .wotd-cta { grid-column: 1 / -1; }
  .wotd .say { width: 24px; height: 24px; top: 4px; right: 4px; }
  .wotd h2 { font-size: 26px; }
  .wotd-def { font-size: 15px; }
  .wotd-label { font-size: 10px; }
  .yr .n { writing-mode: vertical-rl; transform: translateX(-50%) rotate(180deg); font-size: 9px; }
  .yr .col { margin-top: 26px; }
  .yr .y { font-size: 8px; }
  .intro h1, .prose h1 { font-size: 32px; }
  .watch h1 { font-size: 38px; }
}
