/* The videos' own look: black ground, CMU Serif, the Manim palette (kit/common_v3.py).
   Yellow means "look here" and has one job on the site too: the moment a note is pinned to. */
@font-face { font-family: "CMU Serif"; src: url("/assets/fonts/cmunrm.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "CMU Serif"; src: url("/assets/fonts/cmunti.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --bg: #000000;
  --panel: #0e0e0e;
  --line: #222222;      /* GREY_E */
  --line-2: #444444;    /* GREY_D */
  --text: #ffffff;
  --text-2: #dddddd;    /* GREY_A */
  --muted: #888888;     /* GREY_C */
  --blue: #58c4dd;      /* BLUE_3 */
  --blue-dim: #1c758a;  /* BLUE_3E */
  --teal: #5cd0b3;
  --yellow: #ffff00;
  --red: #fc6255;
  --gold: #f0ac5f;
  --serif: "CMU Serif", "Latin Modern Roman", "Computer Modern", Georgia, serif;
  --gutter: 24px;
  --max: 1120px;
  color-scheme: dark;
}
@media (max-width: 640px) { :root { --gutter: 16px; } }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 18px/1.5 var(--serif); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--muted); }
.meta { color: var(--muted); font-size: 15px; }

/* header */
.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: baseline; gap: 16px; height: 60px; align-items: center; }
.brand { color: var(--text); font-size: 22px; letter-spacing: .01em; }
.brand:hover { text-decoration: none; }
.brand i { color: var(--blue); }
.top .spacer { flex: 1; }
.top a.small { color: var(--muted); font-size: 15px; }

/* section title with the tapered underline from the videos */
.title { position: relative; display: inline-block; font-weight: 400; margin: 0 0 6px; padding-bottom: 8px; }
.title::after { content: ""; position: absolute; left: -4%; right: -4%; bottom: 0; height: 3px;
  background: radial-gradient(ellipse at center, #fff 0%, #fff 25%, rgba(255,255,255,.35) 55%, transparent 72%); }
h1.title { font-size: 40px; line-height: 1.15; }
h2.title { font-size: 26px; }
@media (max-width: 640px) { h1.title { font-size: 30px; } h2.title { font-size: 22px; } }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 16px; border-radius: 6px;
  border: 1px solid var(--line-2); background: transparent; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--text-2); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #000; }
.btn.primary:hover { background: #7ad3e7; }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .5; cursor: default; }
.btn .key { font-size: 13px; opacity: .7; }
kbd { font: 13px/1 var(--serif); border: 1px solid var(--line-2); border-radius: 4px; padding: 2px 5px; color: var(--text-2); }
.btn.primary kbd { color: #000; border-color: rgba(0,0,0,.35); }

/* video list: rows with hairlines, full-bleed on phones (no cards) */
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list > li { border-bottom: 1px solid var(--line); }
.row { display: flex; gap: 20px; padding: 18px 0; color: var(--text); align-items: flex-start; }
.row:hover { text-decoration: none; }
.row:hover h3 { color: var(--blue); }
.row .thumb { position: relative; flex: 0 0 240px; aspect-ratio: 16/9; background: #111; border-radius: 4px; overflow: hidden; }
.row .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row .dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.8); font-size: 13px; padding: 1px 6px; border-radius: 3px; }
.row h3 { margin: 0 0 4px; font-size: 22px; font-weight: 400; line-height: 1.25; }
.row p { margin: 0 0 4px; color: var(--text-2); font-size: 16px; }
@media (max-width: 640px) {
  .list { margin: 0 calc(-1 * var(--gutter)); }
  .row { padding: 12px var(--gutter); gap: 12px; }
  .row .thumb { flex-basis: 132px; }
  .row h3 { font-size: 18px; }
  .row p.desc { display: none; }
}

/* watch page */
.player { position: relative; background: #000; }
/* Capped so the note box stays in view beneath it; the letterbox is black on black. */
.player video { display: block; width: 100%; aspect-ratio: 16/9; max-height: 60vh; background: #000; border: 1px solid var(--line); }
@media (max-width: 640px) { .player { margin: 0 calc(-1 * var(--gutter)); } .player video { border: 0; } }
.strip { position: relative; height: 10px; margin: 6px 0 0; }
.strip .mark { position: absolute; top: 0; width: 3px; height: 10px; margin-left: -1px; background: var(--yellow); border: 0; padding: 0; cursor: pointer; border-radius: 1px; }
.strip .mark:hover { transform: scaleY(1.5); }
.watch-head { margin: 24px 0 14px; }
.watch-head h1.title { font-size: 32px; }
@media (max-width: 640px) { .watch-head { margin: 16px 0 12px; } .watch-head h1.title { font-size: 24px; } }
.watch-head .meta { margin: 0; }

/* the note box: always under the video, always ready */
.note-box { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; padding: 14px 0 20px; border-bottom: 1px solid var(--line); }
.moment { display: grid; gap: 6px; align-content: start; }
.frame { aspect-ratio: 16/9; background: var(--panel); border: 1px solid var(--line); max-width: 100%; }
.frame.pinned { border-color: var(--yellow); }
.frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.moment-line { display: flex; gap: 8px; align-items: baseline; }
.stamp { color: var(--muted); font-size: 20px; }
.frame.pinned + .moment-line .stamp { color: var(--yellow); }
.linkish { background: none; border: 0; padding: 0; color: var(--blue); cursor: pointer; text-align: left; font-size: 15px; }
.compose { min-width: 0; }
textarea.note { width: 100%; min-height: 96px; resize: vertical; background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; padding: 10px 12px; line-height: 1.45; }
textarea.note:focus, input.field:focus, select.field:focus { outline: none; border-color: var(--blue); }
.actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.actions .spacer { flex: 1; }
.actions .name { flex: 0 1 220px; min-width: 0; }
.mic[aria-pressed="true"] { border-color: var(--red); color: var(--red); }
.mic[aria-pressed="true"] .dot { animation: pulse 1s infinite; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; display: inline-block; }
@keyframes pulse { 50% { opacity: .25; } }
input.field, select.field { background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; padding: 7px 10px; min-height: 40px; }
@media (max-width: 760px) {
  .note-box { grid-template-columns: 1fr; gap: 10px; }
  /* The video is right above: a thumbnail beside the time is enough. */
  .moment { grid-template-columns: 112px 1fr; align-items: center; }
  .moment .linkish { grid-column: 2; }
  .actions .name { flex: 1 1 100%; order: 3; }
}
/* Touch screens: no keyboard to hint at. */
@media (hover: none) { kbd { display: none; } }

/* the viewer's own notes */
.mine { margin: 0 0 32px; }
.mine ul { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--line); }
.mine li { display: flex; gap: 14px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mine .t { color: var(--yellow); background: none; border: 0; padding: 0; cursor: pointer; min-width: 52px; text-align: left; }
.mine .txt { flex: 1; color: var(--text-2); font-size: 16px; overflow-wrap: anywhere; }
.mine .tag { color: var(--muted); font-size: 14px; }

.intro { margin: 40px 0 28px; max-width: 68ch; }
.intro p { color: var(--text-2); margin: 10px 0 0; }
.intro b { font-weight: 400; color: var(--text); }
.general { margin: 48px 0 0; max-width: 760px; }
.general .meta { margin: 0 0 12px; }

.desc-block { color: var(--text-2); max-width: 70ch; margin: 0 0 36px; white-space: pre-line; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #111; border: 1px solid var(--line-2); border-radius: 8px;
  padding: 10px 16px; display: flex; gap: 14px; align-items: center; z-index: 50; box-shadow: 0 8px 30px rgba(0,0,0,.6); max-width: calc(100vw - 32px); }
.toast button { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 0; }

/* impressum */
.legal { padding-block: 32px 8px; }
.legal > * { max-width: 72ch; }
.legal h2 { font-size: 20px; font-weight: 400; margin: 28px 0 6px; color: var(--text); }
.legal p, .legal dd { color: var(--text-2); margin: 0; }
.legal dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 20px; margin: 0; }
.legal dt { color: var(--muted); }
.legal dd { margin: 0; }
@media (max-width: 640px) { .legal dl { grid-template-columns: 1fr; } .legal dd { margin-bottom: 8px; } }

.empty { color: var(--muted); padding: 40px 0; }
footer.foot { border-top: 1px solid var(--line); margin-top: 48px; padding: 18px 0 32px; color: var(--muted); font-size: 14px; }
footer.foot a { color: var(--muted); }
