/* Pentum_Graph — one quiet look, in one light.
 *
 * There is no dark theme any more (Bobby, 2026-09-07: "Sonne Mond raus — nur
 * Light Mode"). Paper, ink, and the thumbnails as the only colour; a channel's
 * accent appears once, as a thin identity mark on its tile and as its node in
 * the graph.
 *
 * ONE type scale for the whole site, and importance decides where a piece of
 * text sits in it (Bobby, 2026-09-07/09). Seven steps, one family, three
 * weights — nothing sets a font-size that is not on this ladder:
 *
 *   --fs-brand   28    —    (nothing — see below)
 *   --fs-nav     20   700   the store's name
 *   --fs-h1    17.5    —    (nothing — see below)
 *   --fs-h2      16   600   what this card is
 *   --fs-body    15   400   the text itself, and the navigation
 *   --fs-meta    13   400   facts about the text (channel, time, country)
 *   --fs-micro 11.5   400   labels on boxes, and the language choice
 *
 * The HEAD came down two steps on 2026-09-15 (Bobby): the store's name is the
 * size the navigation used to be, the navigation is the size the language
 * choice used to be, and the language choice is two steps below that. Nothing
 * in the navigation is bold any more — where you ARE is said by ink and by
 * the rule under the word, which is what a tab is marked by in any case.
 * The head is quieter than the page it sits over now, which is the point: it
 * is a signpost, not a headline.
 *
 * That leaves the ladder's top step and its page-title step carrying nothing.
 * They are kept, not deleted: the ladder is the set of sizes this site is
 * allowed to use, and a step nothing stands on today is still the step
 * anything would stand on tomorrow. (--fs-h1 has been empty since the
 * filtered timeline stopped announcing its filter, 2026-09-11.)
 *
 * The steps are wide at the top and narrow at the bottom (28→20 is a 40%
 * jump, 16→15 is 7%), which is how a type scale is supposed to behave: the
 * display sizes exist to be told apart at a glance and to carry the eye,
 * while the reading sizes sit close together so a page of text stays one
 * texture instead of a staircase. Weight and colour do the rest of the work, so nothing has to be
 * made big merely to look important.
 *
 * Monospace is not decoration: it means "this is verbatim, byte for byte" —
 * the video's own title, its original hashtags. Nothing else. (What the model
 * answered used to be shown too; since 2026-09-10 that stays in the vault.)
 *
 * Links are underlined and carry no arrow (Bobby, 2026-09-07). Navigation
 * tabs, chips and icon buttons are controls, not links in running text, and
 * are marked by position and state instead.
 */

:root {
  --bg: #f7f6f3;
  --panel: #fdfcfa;
  --ink: #1d1d1b;
  --muted: #6e6c66;
  --line: #d9d6cf;
  --line-soft: #e7e4dd;
  --chip: #efede8;
  --chip-ink: #3a3934;
  --danger: #8a2a1e;
  --backdrop: rgba(30, 28, 24, 0.4);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.18);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --fs-brand: 28px;
  --fs-nav: 20px;
  --fs-h1: 17.5px;
  --fs-h2: 16px;
  --fs-body: 15px;
  --fs-meta: 13px;
  --fs-micro: 11.5px;

  --pad-x: 22px;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-body)/1.55 var(--sans);
  /* Header, page, footer as one column: the graph page then gets exactly the
     height that is left, and the footer sits under it without a scrollbar. */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Links: underlined, nothing else. */
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 { font-weight: 600; }

/* -- head ------------------------------------------------------------------ */

.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  padding: 14px var(--pad-x) 0;
}

.masthead {
  display: flex;
  align-items: baseline;
  gap: 14px;
  max-width: 1200px;
  margin: 0 auto;
}

.brand {
  font-size: var(--fs-nav);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.2px;
  text-decoration: none;
  white-space: nowrap;
}

/* The lines that say what this is: the smallest thing in the head on purpose,
   so it explains without competing with the name above it. Never more than
   three lines (Bobby, 2026-09-09) — two on a normal window. */
.lede {
  margin: 0;
  padding-left: 14px;
  border-left: 1px solid var(--line);
  font-size: var(--fs-meta);
  line-height: 1.45;
  color: var(--muted);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.navrow {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1200px;
  margin: 12px auto 0;
}

/* Where you are, and where you can go — at reading size, and in no weight of
   its own (Bobby, 2026-09-15). Where you ARE is said by ink against grey and
   by the rule under the word; a tab is marked by state, and never needed a
   second voice saying the same thing louder.
   The bars between them are Bobby's (2026-09-09) and are drawn like every
   other separator on the site — a hairline, not a word. */
.tabs { display: flex; align-items: baseline; gap: 12px; flex: 1; }

.tabs a {
  text-decoration: none;
  color: var(--muted);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.2;
  padding-bottom: 8px;
  border-bottom: 2px solid transparent;
}
.tabs a.active { color: var(--ink); border-bottom-color: var(--ink); }
.tabs a:hover { color: var(--ink); }
.tabs .sep { color: var(--line); font-size: var(--fs-body); padding-bottom: 8px; }

/* Two steps below the navigation: the smallest thing in the head, because
   choosing a language is the rarest thing anyone does up there. */
.lang { font-size: var(--fs-micro); color: var(--muted); padding-bottom: 8px; }
.lang a { text-decoration: none; color: var(--muted); padding: 0 2px; }
.lang a.active { color: var(--ink); font-weight: 600; }
.lang .sep { padding: 0 2px; color: var(--line); }

main { flex: 1 1 auto; min-height: 0; padding: 24px var(--pad-x) 40px; }

/* -- foot ------------------------------------------------------------------ */

.sitefoot {
  border-top: 1px solid var(--line);
  background: var(--panel);
  padding: 12px var(--pad-x);
  font-size: var(--fs-meta);
  color: var(--muted);
}
.sitefoot .sep { padding: 0 8px; }
.sitefoot a:hover { color: var(--ink); }

.btn {
  font: 400 var(--fs-meta)/1.4 var(--sans);
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
}
.btn:hover { border-color: var(--muted); }

/* -- channels -------------------------------------------------------------- */

.channel-grid {
  display: grid;
  /* Wide enough that the line of facts — tagline | country | language — fits
     without being cut, which is the whole reason it is one line. */
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
  max-width: 1200px;
  margin: 0 auto;
}

.channel-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent, var(--line));
  border-radius: 8px;
  padding: 14px 16px;
}
.channel-card:hover { border-color: var(--muted); border-left-color: var(--accent, var(--muted)); }

.channel-card h2 { margin: 0; font-size: var(--fs-h2); }

/* One line, never two: a long tagline is cut, not wrapped (Bobby,
   2026-09-07: "nichts darf umbrechen. Wenn zu lang dann …"). */
.channel-card .meta {
  margin: 4px 0 0;
  font-size: var(--fs-meta);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* How the channel describes itself on YouTube — at most three lines. */
.channel-card .about {
  margin: 8px 0 0;
  font-size: var(--fs-meta);
  line-height: 1.5;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* -- timeline -------------------------------------------------------------- */

.page-timeline { max-width: 760px; margin: 0 auto; width: 100%; }

/* The hashtag heap: three rows, no frame, the most-carried hashtag first and
   then on across the rows. It drifts on its own and stops under the pointer,
   where it can be swiped instead (Bobby's blueprint (3), 2026-09-07). */
.heap {
  position: relative;
  margin: 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 18px;
}

/* The one hint on the page: an overlay that lays a hand over the heap, swipes
   it left and right a couple of times, and gets out of the way (Bobby,
   2026-09-09). It never blocks what it explains — pointer-events: none — so a
   reader can start dragging while it is still fading. */
.heap-hint {
  position: absolute;
  top: -6px;
  left: -10px;
  right: -10px;
  bottom: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  /* A plain translucent scrim: enough to push the hashtags back for the
     couple of seconds the hand is over them, and nothing to composite. */
  background: rgba(253, 252, 250, 0.88);
  /* Ink, not muted: the hand is the message, and it is on top of text. */
  color: var(--ink);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease;
  z-index: 3;
}
.heap-hint.show { opacity: 1; }

.heap-hint-gesture { display: block; line-height: 0; }
.heap-hint-text {
  display: none;
  font-size: var(--fs-meta);
  white-space: nowrap;
}

/* The gesture itself: the hand travels, and the chevron it travels towards
   lights up. One and a half round trips is all the reader gets. */
.heap-hint .hand {
  animation: heap-hand 1.15s ease-in-out infinite;
}
.heap-hint .chev { opacity: 0.15; }
.heap-hint .chev-l { animation: heap-chev-left 1.15s ease-in-out infinite; }
.heap-hint .chev-r { animation: heap-chev-right 1.15s ease-in-out infinite; }

@keyframes heap-hand {
  0%, 100% { transform: translateX(-11px); }
  50% { transform: translateX(11px); }
}
@keyframes heap-chev-left {
  0%, 100% { opacity: 0.85; }
  40%, 60% { opacity: 0.12; }
}
@keyframes heap-chev-right {
  0%, 100% { opacity: 0.12; }
  40%, 60% { opacity: 0.85; }
}

/* A reader who asked for no motion gets the sentence instead of the gesture. */
@media (prefers-reduced-motion: reduce) {
  .heap-hint { transition: none; }
  .heap-hint .hand,
  .heap-hint .chev-l,
  .heap-hint .chev-r { animation: none; }
  .heap-hint-gesture { display: none; }
  .heap-hint-text { display: block; }
}

.heap-row {
  overflow: hidden;
  cursor: grab;
  /* Dragging the heap is a gesture, not a text selection. */
  -webkit-user-select: none;
  user-select: none;
  /* The finger (Bobby, 2026-09-10: "mit Finger auch verschiebbar"). Without
     this the browser owns every touch on a 30px-tall row: it starts the
     gesture, decides a moment later that a near-horizontal swipe is a page
     scroll, fires `pointercancel` and takes it away — so the drag died on a
     phone after its first few pixels. `pan-y` hands the vertical axis back to
     the browser, which is what a reader scrolling the page wants, and keeps
     the horizontal one here, which is what the heap is. */
  touch-action: pan-y;
  /* The rows fade out at both ends instead of being cut off square. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}
.heap-row.dragging { cursor: grabbing; }
.heap-track {
  display: flex;
  align-items: baseline;
  gap: 12px;
  width: max-content;
  will-change: transform;
}

.heap .tag {
  -webkit-user-drag: none;
  text-decoration: none;
  color: var(--chip-ink);
  white-space: nowrap;
  font-size: var(--fs-meta);
  padding: 2px 0;
}
.heap .tag:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
/* Every hashtag in the heap is written the same: one family, one size, one
   weight (Bobby, 2026-09-14). Size used to be importance, which quietly made
   the reel a ranking — and a ranking is the one thing a reel is not. */

.timeline-head { display: flex; align-items: center; gap: 14px; }

.timeline-list { display: flex; flex-direction: column; gap: 22px; margin-top: 10px; }

.snip {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}
.snip:hover { border-color: var(--muted); }

/* Channel left, when and how long right (blueprint (4)). */
.snip .head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--fs-meta);
  color: var(--muted);
}
.snip .head .when { white-space: nowrap; }
.snip .head a { color: var(--muted); }
.snip .head a:hover { color: var(--ink); }

/* A title is not a link and must not read like one: no pointer, no underline
   on hover, nothing that offers a click there is nothing behind (Bobby,
   2026-09-14). */
.snip h3 { margin: 5px 0 10px; font-size: var(--fs-h2); line-height: 1.35; }

/* The still, with how long the video runs written into its bottom right —
   small, the way every player writes it (Bobby, 2026-09-14). The badge is
   inside the link, so it never takes a click away from the thumbnail. */
.snip .thumbwrap { display: block; position: relative; }
.snip .thumbwrap .dur {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 1px 5px 2px;
  border-radius: 4px;
  font-size: var(--fs-micro);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  /* Its own dark ground rather than the page's tokens: it sits on a
     photograph, which can be any colour at all, and a duration that is
     sometimes unreadable is worse than none. */
  background: rgba(20, 19, 16, 0.78);
  color: #fdfcfa;
  pointer-events: none;
}
.snip .thumbwrap img {
  display: block;
  width: 100%;
  max-width: 100%;
  /* The space a still will occupy is reserved before it arrives. Without
     this a lazy-loaded thumbnail is 0px high until it loads, so the page
     grows under the reader while scrolling — and a restored scroll position
     lands on the wrong card (measured 2026-09-03: 1500px restored as
     2580px, exactly the height of the images above). */
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--chip);
  border-radius: 6px;
  border: 1px solid var(--line-soft);
}

.snip .snippet { margin: 10px 0 0; }
.snip .snippet:empty { display: none; }

.tagrow { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  font-size: var(--fs-micro);
  background: var(--chip);
  color: var(--chip-ink);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 1px 9px 2px;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--sans);
}
.chip:hover { border-color: var(--muted); text-decoration: none; }
.chip.static { cursor: default; }
.chip.muted { background: transparent; color: var(--muted); }
/* Same rule as in the heap: one video only means the way out, not deeper in. */
.chip.outside { background: transparent; color: var(--muted); border-style: dashed; }
.chip.outside::after { content: "↗"; font-size: 0.85em; margin-left: 3px; }

/* The foot of a snippet: where you came from on the left, where you can go
   on the right (blueprint (4), 2026-09-07). */
.snip .foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.navbtns { display: flex; align-items: center; gap: 6px; }
.navbtns .sep { color: var(--line); font-size: var(--fs-meta); }
.navbtns button {
  font: 400 var(--fs-meta)/1 var(--sans);
  min-width: 30px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.navbtns button:hover:not(:disabled) { color: var(--ink); border-color: var(--muted); }
.navbtns button:disabled { opacity: 0.32; cursor: default; }

.outlinks { display: flex; align-items: center; gap: 12px; }
.outlinks a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: var(--fs-meta);
  text-decoration: none;
}
.outlinks a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
/* -- the mark that says "this leaves the site" ------------------------------
   One mark for EVERY text link that goes off-site (Bobby, 2026-09-15): the
   two in a snippet's foot, the channel name above it, the channel name on
   Quellen, and both links in the page foot. It is not a logo — an arrow
   stepping out of a box — and it is drawn in the text colour and nothing
   else, never a brand colour (Bobby, 2026-09-07/09).

   Sized in `em`, so it is the size of whatever it stands next to: the foot is
   13px and a channel heading is 16px, and one fixed pixel size would be wrong
   in both places. */
.extlink {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.extmark {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  flex: none;
}
.outlinks .sep { color: var(--line); }

.timeline-foot { text-align: center; margin-top: 24px; }

/* -- graph ----------------------------------------------------------------- */

.page-graph { padding: 0; display: flex; }

/* The stage: paper with a soft depth, glassy controls, hairline edges.
   graph.js reads the --stage-* tokens from this element at load. */
#graph-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  --stage-bg: #f2f1ed;
  --stage-glow: #fdfcfa;
  --stage-surface: rgba(255, 255, 255, 0.65);
  --stage-line: rgba(29, 29, 27, 0.14);
  --stage-ink: #1d1d1b;
  --stage-muted: #6e6c66;
  --stage-accent: #3d6ed0;
  --stage-edge-rgb: 87, 96, 111;
  --stage-node-rim: rgba(29, 29, 27, 0.25);
  --stage-hover-ring: rgba(16, 18, 22, 0.8);
  background:
    radial-gradient(1100px 700px at 50% 38%, var(--stage-glow), transparent 72%),
    var(--stage-bg);
}

/* Fullscreen, both ways. Native (desktop) hands the element the screen; the
   pinned fallback is for iOS Safari, which has no element fullscreen at all.
   `dvh` keeps the phone's shrinking address bar from cropping the stage, with
   vh for browsers that lack it. */
#graph-wrap:fullscreen,
#graph-wrap:-webkit-full-screen {
  height: 100vh;
  height: 100dvh;
}

#graph-wrap.maximised {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 40;
}

/* Nothing behind the pinned stage should scroll under it. */
body.has-maximised-graph { overflow: hidden; }

#graph-canvas { display: block; width: 100%; height: 100%; cursor: grab; }
#graph-canvas.dragging { cursor: grabbing; }
/* Moving the graph rather than turning it — the cursor says which. */
#graph-canvas.panning { cursor: move; }

#graph-tools {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#graph-tools button {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid var(--stage-line);
  background: var(--stage-surface);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--stage-muted);
  font: 400 15px/1 var(--sans);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
/* The icon is drawn at the size of the ＋ and − glyphs beside it — the old
   15px mark read as a smaller control than its neighbours (Bobby,
   2026-09-14). Both states live in the button; JS shows the one that says
   where the next press goes. */
#graph-tools button .ic { width: 20px; height: 20px; display: block; }
/* Which of the two is drawn is decided HERE, off the one class the button
   already carries — not by hiding an element from JavaScript.
   `hidden` is a property of HTMLElement, and an <svg> is not one: assigning
   `icon.hidden = true` writes a JS expando that never reaches the DOM and
   never moves a pixel. It reads back `true` afterwards, which is exactly why
   it looked like it worked (measured in the browser, 2026-09-14). CSS has no
   such trap: `.active` is set through classList, which really is an
   attribute. */
#graph-tools button .ic-out { display: none; }
#graph-tools button.active .ic-in { display: none; }
#graph-tools button.active .ic-out { display: block; }

#graph-tools button:hover {
  color: var(--stage-ink);
  border-color: var(--stage-muted);
}
#graph-tools button.active { color: var(--stage-accent); border-color: var(--stage-accent); }

#graph-empty {
  position: absolute;
  top: 40%;
  left: 0;
  right: 0;
  text-align: center;
  margin: 0;
  font-size: var(--fs-body);
  color: var(--stage-muted);
  pointer-events: none;
}

#graph-filter {
  position: absolute;
  top: 12px;
  left: 16px;
  margin: 0;
  font-size: var(--fs-meta);
  color: var(--stage-muted);
  background: var(--stage-surface);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--stage-line);
  border-radius: 999px;
  padding: 4px 14px;
}
#graph-filter .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent, var(--stage-muted));
  margin-right: 8px;
  vertical-align: -1px;
}
#graph-filter a { color: var(--stage-muted); }
#graph-filter a:hover { color: var(--stage-ink); }

/* There is no video window, so there is no CSS for one (Bobby, 2026-09-14).
   The overlay, its glass data column, the reference box and the entry title
   all went with it — a stylesheet that still dressed a window nothing opens
   is the same dead weight as an API that still served it. */

/* What went wrong, said in one line: above the list on the timeline, and as
   the whole of a 404 page. Never a raw JavaScript error (Bobby, 2026-09-10). */
#tl-note {
  margin: 0 0 4px;
  font-size: var(--fs-meta);
  color: var(--danger);
}
/* The same 1200 column the head and the source grid stand in, so the one
   sentence on the page does not sit further left than everything else. */
.page-error { max-width: 1200px; margin: 0 auto; width: 100%; }
.page-error .errornote {
  margin: 40px 0 0;
  font-size: var(--fs-h2);
  color: var(--muted);
}

@media (max-width: 720px) {
  .masthead { flex-direction: column; gap: 4px; }
  .lede { padding-left: 0; border-left: none; -webkit-line-clamp: 3; line-clamp: 3; }
}

@media (max-width: 640px) {
  :root { --pad-x: 14px; }
  .topbar { padding-top: 12px; }
  main { padding: 18px var(--pad-x) 30px; }
  .snip .foot { flex-wrap: wrap; }
}

/* The card ≪ brought the reader back to. It fades out on its own: this is a
   "you were here", not a selected state — nothing in the timeline is
   selectable, and a mark that stayed would start claiming otherwise. */
.snip.landed {
  box-shadow: 0 0 0 2px var(--accent, #4a6fa5);
  transition: box-shadow 1.2s ease-out;
}
