/* Andreas Vetter: base styles. Mobile-first, system fonts, no external resources. */

:root {
  --bg: #ffffff;
  --text: #161616;
  --muted: #666666;
  --line: #e4e4e4;
  --placeholder: #e9e9e9;
  --accent: #e6007e;
  --accent-contrast: #ffffff;
  --hero-bg: #111111;
  --hero-text: #ffffff;
  --hero-veil: rgba(235, 235, 235, 0.35); /* light veil over the hero video, adjust strength here */
  --img-veil: rgba(235, 235, 235, 0.65); /* grey veil over all photos (tiles, cards, today, video previews) */

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-slab: "Rockwell", "Roboto Slab", "Museo Slab", "Zilla Slab", "Courier New", Georgia, serif;
  --measure: 68ch;
  --wide: 1100px;
  --gutter: 16px;
  --space: clamp(4rem, 9vw, 7rem);
  --tile-gap: clamp(5rem, 12vw, 9rem);
  --radius: 4px;
  --raised: #ffffff;
  --frame: rgba(230, 0, 126, 0.55);
  --frame-bg: #ffffff;
  --line-tl: rgba(230, 0, 126, 0.6);
  --head-bg: #f2f2f2;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --text: #ececec;
    --muted: #a0a0a0;
    --line: #2a2a2a;
    --placeholder: #242424;
    --accent: #ff3fa4;
    --accent-contrast: #111111;
    --hero-bg: #000000;
    --hero-veil: rgba(20, 20, 20, 0.30);
    --img-veil: rgba(20, 20, 20, 0.65);
    --raised: #1a1a1a;
    --frame: rgba(255, 63, 164, 0.55);
    --frame-bg: #000000;
    --line-tl: rgba(255, 63, 164, 0.6);
    --head-bg: #141414;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
}
@media (min-width: 768px) {
  body { font-size: 1.0625rem; }
}

img, video, iframe { max-width: 100%; display: block; }

a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--font-slab);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.6em;
}
h2 { font-size: 1.375rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; left: var(--gutter); top: -3rem; z-index: 10;
  background: var(--accent); color: var(--accent-contrast);
  padding: 0.5rem 0.9rem; border-radius: var(--radius);
}
.skip-link:focus { top: var(--gutter); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--hero-bg);
  color: var(--hero-text);
  overflow: hidden;
}
.hero__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero__veil {
  position: absolute; inset: 0;
  background: var(--hero-veil);
}
.hero__hint {
  position: absolute;
  left: 50%; bottom: 1.5rem;
  width: 2.75rem; height: 2.75rem;
  margin-left: -1.375rem;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  opacity: 0.6;
}
.hero__hint:hover, .hero__hint:focus-visible { opacity: 1; }
.hero__hint span {
  width: 0.75rem; height: 0.75rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

/* ---------- Sections ---------- */
.section {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: var(--space) var(--gutter) 0;
}
.section--wide { max-width: calc(var(--wide) + 2 * var(--gutter)); }

.intro { text-align: center; }
.intro p { margin: 0 auto; color: var(--muted); max-width: 92ch; text-wrap: balance; }
.intro p + p { margin-top: 0.75rem; }
.intro p br { display: none; }
@media (min-width: 46rem) { .intro p br { display: inline; } }
.intro__line {
  font-size: clamp(1.5rem, 4vw, 1.75rem);
  margin-bottom: 0.8em;
}
.intro__line::after {
  content: "";
  display: block;
  width: 2.5rem; height: 3px;
  margin: 0.6em auto 0;
  background: var(--accent);
}

/* ---------- Two-click embeds: thumbnail with play icon, consent text below; full width once loaded ---------- */
.embed { position: relative; }
.embed__media { position: relative; background: var(--placeholder); }
.embed__media::before { content: ""; position: absolute; inset: 0; z-index: 1; background: var(--img-veil); pointer-events: none; }
.embed__thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.embed__play {
  position: absolute; z-index: 2; left: 50%; top: 50%;
  width: 56px; height: 56px; margin: -28px 0 0 -28px; padding: 10px;
  color: var(--accent); cursor: pointer;
}
.embed__consent {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 0.4rem; padding: 0.5rem 0 0;
}
.embed__title { margin: 0; font-weight: 600; font-size: 0.8125rem; line-height: 1.4; }
.embed__note { margin: 0; font-size: 0.75rem; line-height: 1.45; color: var(--muted); max-width: 40ch; }
.embed__button {
  font: inherit; font-size: 0.8125rem; font-weight: 600;
  padding: 0.4rem 0.8rem;
  border: 0; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-contrast);
  cursor: pointer;
}
.embed__button:hover { filter: brightness(1.08); }
.embed--loaded { float: none; clear: both; width: 100%; margin: 0.75rem 0 1rem; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; }
.embed iframe { display: block; width: 100%; height: 100%; border: 0; }

/* ---------- Contact ---------- */
.contact { padding-top: var(--tile-gap); padding-bottom: var(--space); text-align: center; }
.contact .button { margin-bottom: 0.75rem; }
.button {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius);
  background: var(--accent); color: var(--accent-contrast);
  font-weight: 600;
  text-decoration: none;
}
.button:hover { filter: brightness(1.08); }
.contact__mail { overflow-wrap: anywhere; }

/* ---------- Header (legal pages) & footer ---------- */
.site-header {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 1.25rem var(--gutter);
  border-bottom: 1px solid var(--line);
}
.site-header a { color: var(--text); font-family: var(--font-slab); font-weight: 700; text-decoration: none; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem var(--gutter);
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}
.site-footer p { margin: 0; }
.site-footer a { color: inherit; }

.legal { padding-bottom: var(--space); }
.legal h1 { font-size: clamp(1.75rem, 5vw, 2.25rem); }
.legal h2 { font-size: 1.125rem; margin-top: 2rem; }
.legal .subtitle { color: var(--muted); }

/* ---------- Reveal on scroll (enabled by JS only) ---------- */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js-reveal .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- CV: two symbols, two lines ---------- */
.cv {
  max-width: calc(1100px + 2 * var(--gutter));
  margin: 0 auto;
  padding: var(--space) var(--gutter) 0;
}
.cv__heads {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 520px; margin: 0 auto;
  padding: 1.75rem 0.5rem 1.5rem;
  background: var(--head-bg); border: 1px solid var(--line); border-radius: var(--radius);
}
.cv__head { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; text-align: center; color: var(--accent); }
.cv__head svg { width: 72px; height: 72px; overflow: visible; }
.cv__head p { margin: 0; color: var(--text); font-family: var(--font-slab); font-weight: 700; font-size: 0.9375rem; line-height: 1.3; }
@media (min-width: 768px) {
  .cv__head svg { width: 96px; height: 96px; }
  .cv__head p { font-size: 1.125rem; }
}
.cv__fork, .cv__join { display: block; fill: none; stroke: var(--line-tl); stroke-width: 1; overflow: visible; }
.cv__join circle { fill: var(--accent); stroke: none; }
.cv__fork--wide { width: 320px; height: 72px; margin: 0 auto; }
.cv__join--wide { width: 56px; height: 72px; margin: 0 auto; }
.cv__fork--narrow { width: 100%; height: 64px; }
.cv__join--narrow { width: 100%; height: 72px; }
.cv__join--narrow path { stroke: var(--line-tl); }
@media (max-width: 767px) { .cv__fork--wide, .cv__join--wide { display: none; } }
@media (min-width: 768px) { .cv__fork--narrow, .cv__join--narrow { display: none; } }

/* ---------- Timeline ---------- */
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before, .tl::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-tl);
}
.st { position: relative; }
.st::before { /* dot */
  content: ""; position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
}
.st__head {
  all: unset; box-sizing: border-box; cursor: pointer;
  display: flex; gap: 1.25rem; align-items: flex-start;
}
.st__head:focus-visible, .pill:focus-visible, .today__head:focus-visible, .contact__about:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.st__text { display: block; min-width: 0; max-width: 340px; }
.st__text > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st__year { font-size: 12px; letter-spacing: 0.2em; line-height: 1.6; color: var(--muted); }
.st__field { font-family: var(--font-slab); font-weight: 700; font-size: 19px; line-height: 1.3; margin-top: 2px; }
.st__where { font-size: 15px; line-height: 1.45; }
.st__role { font-size: 14px; line-height: 1.45; color: var(--muted); }
.plus { color: var(--accent); }
.st__head:hover .st__field, .st__head:hover .st__where,
.st__head[aria-expanded="true"] .st__field, .st__head[aria-expanded="true"] .st__where { color: var(--accent); }

.frame {
  display: block; position: relative; box-sizing: border-box;
  padding: 5px; background: var(--frame-bg); border: 1px solid var(--frame); border-radius: var(--radius);
  overflow: hidden;
}
.frame img { display: block; position: absolute; top: 5px; left: 5px; width: calc(100% - 10px); height: calc(100% - 10px); object-fit: cover; }
.frame::after { content: ""; position: absolute; inset: 5px; background: var(--img-veil); pointer-events: none; }
.st__thumb { flex: none; width: 132px; height: 88px; }
.st__thumb img { transition: transform 0.6s ease; }
/* the picture belongs to the linked pill: it reacts only when that pill is hovered */
.st__thumb { transition: border-color 0.3s ease; }
.frame::after { transition: opacity 0.3s ease; }
.st__thumb.is-linked { border-color: var(--accent); }
.st__thumb.is-linked img { transform: scale(1.04); }
.st__thumb.is-linked::after { opacity: 0.35; }
.st__link { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 1; }
.st__link path { fill: none; stroke: var(--accent); stroke-width: 1; transition: stroke-dashoffset 0.35s ease; }
.st__link circle { fill: var(--accent); }

.pills { list-style: none; margin: 0.75rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.pill {
  font: inherit; font-size: 14px; line-height: 1.2; color: var(--text);
  padding: 0.45rem 0.75rem; background: none; cursor: pointer;
  border: 1px solid var(--frame); border-radius: 999px; white-space: nowrap;
}
.pill:hover { border-color: var(--accent); }

/* mobile: one line per screen edge */
@media (max-width: 767px) {
  .tl::before { left: 0; }
  .tl::after { right: 0; }
  .st { padding: 20px 0; }
  .st--e { padding-left: 24px; padding-right: 56px; }
  .st--d { padding-left: 56px; padding-right: 24px; }
  .st::before { top: 48px; }
  .st--e::before { left: -4px; }
  .st--d::before { right: -4px; }
  .st::after { content: ""; position: absolute; top: 52px; width: 16px; height: 1px; background: var(--accent); }
  .st--e::after { left: 0; }
  .st--d::after { right: 0; }
  .st__thumb { display: none; }
  .st__head { display: block; width: 100%; }
  .st__text { max-width: 100%; }
  .st--d .st__head, .st--d .st__text { text-align: right; }
  .st--e .pills { align-items: flex-start; }
  .st--d .pills { align-items: flex-end; }
}

/* desktop: zipper, both lines close together in the middle */
@media (min-width: 768px) {
  .tl::before { left: calc(50% - 14px); }
  .tl::after { left: calc(50% + 14px); }
  .st { display: grid; grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); }
  .st > * { grid-row: 1; }
  .st--e > .st__head, .st--e > .pills { grid-column: 1; }
  .st--d > .st__head, .st--d > .pills { grid-column: 3; }
  .st__head { padding: 24px 0 0; }
  .st > .pills { grid-row: 2; margin-bottom: 0; }
  .st { padding-bottom: 24px; }
  .st--e .st__head { justify-content: flex-end; text-align: right; padding-right: 24px; }
  .st--d .st__head { padding-left: 24px; }
  .st--e .pills { align-items: flex-end; padding-right: 24px; }
  .st--d .pills { align-items: flex-start; padding-left: 24px; }
  .st::before { top: 53px; }
  .st--e::before { left: calc(50% - 18px); }
  .st--d::before { left: calc(50% + 10px); }
}

/* ---------- Today (navel) ---------- */
.today { text-align: center; padding-top: 1rem; }
.today__head {
  box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; width: 100%;
}
.today__head > span { display: block; }
.today__kicker { font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.today__field { font-family: var(--font-slab); font-weight: 700; font-size: 1.375rem; margin: 0.25rem 0 0.1rem; }
.today__where { font-size: 15px; }
.today__role { font-size: 14px; color: var(--muted); }
.today__media { width: 520px; max-width: 100%; aspect-ratio: 2 / 1; margin: 1.25rem 0; }
.today__media img { object-position: center 35%; }
.today__media::after { background: rgba(20, 20, 20, 0.3); }
@media (prefers-color-scheme: light) { .today__media::after { background: rgba(235, 235, 235, 0.3); } }
.today > p { max-width: 62ch; margin: 0 auto 0.9rem; text-align: left; }
/* today__head is no longer clickable (no pop-up) */

/* ---------- Contact: About me link ---------- */
.contact__about {
  font: inherit; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
  background: none; border: 0; cursor: pointer; padding: 0.75rem 1rem; margin-top: 1.5rem;
}
.contact__about:hover { color: var(--text); }

/* ---------- Details: pop-up content (listed at the end when JS is off) ---------- */
.details { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter) var(--space); }
.js .details { display: none; }
.detail + .detail { margin-top: 3rem; border-top: 1px solid var(--line); padding-top: 2rem; }
.detail__kicker { margin: 0 0 0.4rem; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); }
.detail h3 { font-size: 1.375rem; margin: 0 0 0.4rem; padding-right: 2.5rem; }
.detail__meta { font-size: 0.875rem; color: var(--muted); }
.detail__media { margin: 1.25rem 0; }
.detail__media .frame { aspect-ratio: 16 / 9; }
.detail__media figcaption { margin-top: 0.4rem; font-size: 0.8125rem; color: var(--muted); overflow-wrap: anywhere; }
.detail__media.embed .embed__media { aspect-ratio: 16 / 9; }
.detail__quote { margin: 1rem 0 0; padding-left: 1rem; border-left: 2px solid var(--accent); font-style: italic; }
.detail__quote p { margin: 0 0 0.35rem; }
.detail__quote footer { font-size: 0.8125rem; font-style: normal; color: var(--muted); }

/* ---------- Modal ---------- */
.modal {
  width: calc(100% - 32px); max-width: 720px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--raised); color: var(--text); overflow: auto; cursor: pointer;
}
.modal::backdrop { background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.modal__body { padding: 1.25rem; }
@media (min-width: 768px) { .modal__body { padding: 2rem; } }
.modal .detail__media, .modal a, .modal iframe { cursor: auto; }
.modal__close {
  position: sticky; top: 0; float: right; z-index: 2;
  width: 44px; height: 44px; margin: 0.5rem 0.5rem 0 0;
  font: inherit; font-size: 28px; line-height: 1; color: var(--accent);
  background: none; border: 0; cursor: pointer;
}
html.has-modal { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .st__thumb img { transition: none; }
}

.about-portrait {
  display: block;
  width: 120px; height: 120px;
  margin: 1.75rem auto 0;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  padding: 4px;
  background: #000;
}

@media (max-width: 767px) {
  .modal__close {
    -webkit-appearance: none; appearance: none;
    width: 36px; height: 36px; margin: 0.25rem 0.25rem 0 0;
    padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
    font-size: 0; color: var(--accent); opacity: 0.8;
  }
  .modal__close::before {
    content: "+"; display: block;
    font-size: 22px; font-weight: 300; line-height: 36px;
    transform: rotate(45deg);
  }
}

/* Close button: no square (focus ring, native button frame) on any device. */
.modal__close {
  -webkit-appearance: none; appearance: none;
  border: 0; border-radius: 0; background: none; box-shadow: none;
  outline: none; -webkit-tap-highlight-color: transparent;
}
.modal__close:focus, .modal__close:focus-visible { outline: none; box-shadow: none; }
.modal__close, .modal__close:focus, .modal__close:focus-visible { color: var(--accent); }
.modal__close:active { color: var(--text); opacity: 1; }

/* ---------- Speech bubble: short addition instead of a pop-up ----------
   Phone: opens below the title. Desktop: a line grows from the dot across the
   timeline and the bubble pops up on the other side. */
.bubble {
  position: absolute; z-index: 3;
  visibility: hidden; pointer-events: none;
  transition: visibility 0s linear 0.4s;
}
.bubble.is-open { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.bubble__line { display: none; }
.bubble__body {
  position: relative;
  width: max-content; max-width: min(330px, calc(100vw - 64px));
  margin-top: 12px; padding: 0.8rem 1rem;
  background: var(--raised); color: var(--text);
  border: 1px solid var(--frame); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28), 0 0 0 4px color-mix(in srgb, var(--accent) 8%, transparent);
  font-size: 14px; line-height: 1.4; text-align: left;
  opacity: 0; transform: translateY(6px) scale(0.85); transform-origin: 24px 0;
  transition: opacity 0.2s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.bubble.is-open .bubble__body { opacity: 1; transform: none; }
.bubble__body::before {
  content: ""; position: absolute; top: -6px; left: 20px; width: 10px; height: 10px;
  background: var(--raised); border-left: 1px solid var(--frame); border-top: 1px solid var(--frame);
  transform: rotate(45deg);
}
.bubble__body p {
  display: grid; grid-template-columns: auto 1fr; column-gap: 0.65rem; align-items: baseline;
  margin: 0;
  opacity: 0; transform: translateX(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.bubble__body p + p { margin-top: 0.6rem; }
.bubble.is-open .bubble__body p { opacity: 1; transform: none; transition-delay: 0.15s; }
.bubble.is-open .bubble__body p + p { transition-delay: 0.25s; }
.bubble__tag {
  grid-row: span 2;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; line-height: 1;
  padding: 0.3em 0.55em; border-radius: 999px;
  background: var(--accent); color: var(--accent-contrast);
}
.bubble__title { font-weight: 600; white-space: nowrap; }
.bubble__sub { grid-column: 2; color: var(--muted); font-size: 13px; }

.st--e > .bubble { left: 24px; }
.st--d > .bubble { right: 24px; }
.st--d .bubble__body { transform-origin: calc(100% - 24px) 0; }
.st--d .bubble__body::before { left: auto; right: 20px; }

@media (min-width: 768px) {
  /* the bubble starts at the station's dot (centre 57px from the top) */
  .bubble { top: 57px; }
  .st--e > .bubble { left: calc(50% - 13.5px); right: auto; }
  .st--d > .bubble { right: calc(50% - 14.5px); left: auto; }
  .bubble__line {
    display: block; position: absolute; top: 0; width: 54px; height: 1px;
    background: var(--accent);
    transform: scaleX(0); transition: transform 0.2s ease;
  }
  .bubble__line::after {
    content: ""; position: absolute; top: -3px; width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent);
  }
  .st--e .bubble__line { left: 0; transform-origin: left center; }
  .st--e .bubble__line::after { right: -3px; }
  .st--d .bubble__line { right: 0; transform-origin: right center; }
  .st--d .bubble__line::after { left: -3px; }
  .bubble.is-open .bubble__line { transform: scaleX(1); }

  .bubble__body {
    position: absolute; top: 0; margin: 0;
    transform: translateY(-50%) scale(0.6);
    transition-delay: 0.12s;
  }
  .bubble.is-open .bubble__body { transform: translateY(-50%); }
  .bubble__body::before { display: none; }
  .st--e .bubble__body { left: 54px; transform-origin: left center; }
  .st--d .bubble__body { right: 54px; transform-origin: right center; }
  .bubble.is-open .bubble__body p { transition-delay: 0.3s; }
  .bubble.is-open .bubble__body p + p { transition-delay: 0.4s; }
}
@media (prefers-reduced-motion: reduce) {
  .bubble__line, .bubble__body, .bubble__body p { transition: none; }
}

/* bullets inside a bubble */
.bubble__list { list-style: none; margin: 0; padding: 0; }
.bubble__list li {
  position: relative; padding-left: 1rem; max-width: 290px;
  opacity: 0; transform: translateX(-6px); transition: opacity 0.25s ease, transform 0.25s ease;
}
.bubble__list li + li { margin-top: 0.4rem; }
.bubble__list li::before {
  content: ""; position: absolute; left: 0; top: 0.5em; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.bubble.is-open .bubble__list li { opacity: 1; transform: none; transition-delay: 0.15s; }
.bubble.is-open .bubble__list li + li { transition-delay: 0.25s; }
.bubble.is-open .bubble__list li + li + li { transition-delay: 0.35s; }
/* bubbles of a pill start at the pill, not at the dot */
@media (min-width: 768px) {
  .bubble { --reach: 54px; }
  .bubble__line { width: var(--reach); }
  .st--e .bubble__body { left: var(--reach); }
  .st--d .bubble__body { right: var(--reach); }
  .bubble.is-open .bubble__list li { transition-delay: 0.3s; }
  .bubble.is-open .bubble__list li + li { transition-delay: 0.4s; }
  .bubble.is-open .bubble__list li + li + li { transition-delay: 0.5s; }
  .bubble--pill { --reach: 92px; }
  .st--e > .bubble--pill { left: calc(50% - 52px); }
  .st--d > .bubble--pill { right: calc(50% - 52px); }
}
@media (prefers-reduced-motion: reduce) {
  .bubble__list li, .st__link path { transition: none; }
}

/* station picture cropped from the top (keeps the bottom of a portrait photo) */
.st__thumb--bottom img { object-position: center bottom; }

/* wide bubble with two pictures and a sentence (EMI) */
.bubble--wide .bubble__body { width: min(400px, calc(100vw - 64px)); max-width: none; }
.bubble__pics { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 0.7rem; }
.bubble__pics img {
  width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px;
  filter: grayscale(1) contrast(1.1) brightness(0.9); /* both photos in the same tone */
}
.bubble__text { opacity: 0; transform: translateY(4px); transition: opacity 0.25s ease, transform 0.25s ease; }
.bubble.is-open .bubble__text { opacity: 1; transform: none; transition-delay: 0.3s; }
@media (min-width: 768px) {
  .bubble--wide .bubble__body { transform: translateY(-65%) scale(0.6); }
  .bubble--wide.is-open .bubble__body { transform: translateY(-65%); }
}
@media (prefers-reduced-motion: reduce) { .bubble__text { transition: none; } }

/* pop-up pictures: 4:3 frames, pairs side by side */
.detail__media--4x3 .frame { aspect-ratio: 4 / 3; }
.detail__media--top img { object-position: center 30%; }
.detail__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 1.25rem 0; }
.detail__pair .detail__media { margin: 0; }

/* ---------- Mind map: pictures and clusters ---------- */
.pill { position: relative; }
.pill.is-linked { border-color: var(--accent); }
.st__thumb--linked { cursor: pointer; }
.st__cluster { display: none; }
@media (min-width: 768px) {
  /* picture sits next to its pill instead of next to the title */
  .st__thumb--high { align-self: flex-start; margin-top: -24px; }  /* sticks out above the station */
  /* several pictures of one station, one below the other */
  .st__cluster { display: block; position: relative; flex: none; width: 132px; height: 88px; }
  .st__cluster .st__thumb { position: absolute; left: 0; width: 132px; height: 88px; }
  .st__cluster .st__thumb:nth-child(1) { top: 0; }
  .st__cluster .st__thumb:nth-child(2) { top: 136px; }
  .st__cluster .st__thumb.is-linked { z-index: 2; }
  .st--cluster { padding-bottom: 24px; }
}


/* bubble with a single picture and a credit line */
.bubble__pics--one { grid-template-columns: 1fr; }
.bubble__pics--one img { aspect-ratio: 16 / 9; filter: none; }
.bubble__credit { display: block; margin-top: 0.35rem; font-size: 11px; color: var(--muted); }

/* ---------- Pop-up pictures: no pink frame, smaller on desktop ---------- */
.detail .frame { border-color: transparent; }
.detail h4 { font-family: var(--font-slab); font-size: 1.0625rem; line-height: 1.3; margin: 1.6rem 0 0.4rem; }
.detail__media--contain .frame { aspect-ratio: 800 / 368; }
@media (min-width: 768px) {
  .detail__media, .detail__pair { width: 70%; margin-left: auto; margin-right: auto; }
  .detail__pair .detail__media, .detail__media.embed--loaded { width: 100%; }
}
/* vertical video */
.detail__media.embed--vertical { width: min(100%, 260px); margin-left: auto; margin-right: auto; }
.detail__media.embed--vertical .embed__media { aspect-ratio: 9 / 16; }
.detail__media.embed--vertical.embed--loaded { width: min(100%, 340px); aspect-ratio: 9 / 16; margin-left: auto; margin-right: auto; }
/* graphics (no photo): no grey veil */
.detail__media--plain .frame::after { display: none; }
/* self-hosted vertical video in a pop-up */
.detail__video { display: block; width: min(100%, 340px); aspect-ratio: 9 / 16; margin: 1.25rem auto; border-radius: var(--radius); background: #000; cursor: auto; }

/* station title that opens a pop-up: its picture lights up on hover */
.st__head[data-open] { position: relative; }
@media (hover: hover) and (pointer: fine) {
  .st__head[data-open]:hover .st__thumb { border-color: var(--accent); }
  .st__head[data-open]:hover .st__thumb img { transform: scale(1.04); }
  .st__head[data-open]:hover .st__thumb::after { opacity: 0.35; }
}
@media (min-width: 768px) {
  /* the title box hugs its content */
  .st--d > .st__head[data-open] { justify-self: start; }
  .st--e > .st__head[data-open] { justify-self: end; }
}

/* longer bubble: heading, paragraph and quote */
.bubble__head { display: block; font-family: var(--font-slab); font-size: 15px; line-height: 1.3; }
.bubble__text p { display: block; margin: 0.5rem 0 0; opacity: 1; transform: none; }
.bubble__quote { margin: 0.6rem 0 0; padding-left: 0.7rem; border-left: 2px solid var(--accent); font-style: italic; font-size: 13px; }
.bubble__quote footer { margin-top: 0.25rem; font-style: normal; font-size: 11px; color: var(--muted); }

/* first line of a tagged bubble: about the institution */
.bubble__body p.bubble__lead { display: block; max-width: 290px; }

/* company labels in bubbles: label and short description without a bullet, bullets below */
.bubble__tag { white-space: nowrap; }
.bubble__desc { max-width: 230px; }
.bubble__body p + .bubble__list, .bubble__chips + .bubble__list { margin-top: 0.7rem; }
.bubble__tag--inline { display: inline-block; margin-right: 0.4em; vertical-align: 1px; }
.bubble__chips {
  display: flex; flex-wrap: wrap; gap: 6px; max-width: 290px;
  opacity: 0; transform: translateX(-6px); transition: opacity 0.25s ease, transform 0.25s ease;
}
.bubble.is-open .bubble__chips { opacity: 1; transform: none; transition-delay: 0.15s; }
@media (min-width: 768px) { .bubble.is-open .bubble__chips { transition-delay: 0.3s; } }
@media (prefers-reduced-motion: reduce) { .bubble__chips { transition: none; } }

/* ---------- Bubble layout B: label(s) as headline, description, indented bullets ---------- */
.bubble__org { display: flex; flex-wrap: wrap; gap: 6px; max-width: 290px; }
.bubble__about { margin-top: 0.5rem; max-width: 290px; color: var(--muted); }
.bubble__list--in { margin-top: 0.7rem; padding-left: 0.6rem; }
.bubble__list--in li { max-width: 280px; }
/* key figures (HDI TH!NX campus) */
.bubble__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; width: 290px; max-width: 100%; margin-top: 0.7rem; }
.bubble__stat { padding: 0.5rem 0.55rem; border-radius: 8px; background: color-mix(in srgb, var(--text) 7%, transparent); }
.bubble__num { display: block; font-family: var(--font-slab); font-weight: 700; font-size: 20px; line-height: 1.2; color: var(--accent); white-space: nowrap; }
.bubble__unit { display: block; margin-top: 0.15rem; font-size: 12px; line-height: 1.35; color: var(--muted); }
.bubble__org, .bubble__about, .bubble__stats {
  opacity: 0; transform: translateX(-6px); transition: opacity 0.25s ease, transform 0.25s ease;
}
.bubble.is-open .bubble__org, .bubble.is-open .bubble__about, .bubble.is-open .bubble__stats { opacity: 1; transform: none; transition-delay: 0.15s; }
.bubble.is-open .bubble__stats { transition-delay: 0.25s; }
@media (min-width: 768px) {
  .bubble.is-open .bubble__org, .bubble.is-open .bubble__about { transition-delay: 0.3s; }
  .bubble.is-open .bubble__stats { transition-delay: 0.4s; }
}
@media (prefers-reduced-motion: reduce) { .bubble__org, .bubble__about, .bubble__stats { transition: none; } }
.bubble__pics--below { margin-top: 0.7rem; }

/* ---------- small pink "+": marks everything that opens a pop-up ---------- */
.pill[data-open] { display: inline-flex; align-items: center; gap: 0.5rem; transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease; }
.pill[data-open]::after, .st__head[data-open] .st__field::after, .contact__about .plus {
  content: ""; display: inline-block; flex: none; width: 9px; height: 9px;
  color: var(--accent);
  /* drawn, not typed, so it sits exactly in the middle */
  background-image: linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor);
  background-size: 9px 1.5px, 1.5px 9px; background-position: center; background-repeat: no-repeat;
  transition: color 0.25s ease;
}
.st__head[data-open] .st__field::after { margin-left: 0.55rem; vertical-align: 4px; }
.contact__about .plus { margin-left: 0.45rem; font-size: 0; vertical-align: 1px; }
.pill[data-open]:hover, .pill[data-open].is-linked, .pill[data-open]:focus-visible { border-color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .pill[data-open], .pill[data-open]::after, .st__head[data-open] .st__field::after, .contact__about .plus { transition: none; } }

/* a picture that sits right next to its pill */
.pills li { position: relative; }
@media (min-width: 768px) {
  .pills .st__thumb--side { position: absolute; top: 50%; transform: translateY(-50%); }
  .st--d .pills .st__thumb--side { left: calc(100% + 1.25rem); }
  .st--e .pills .st__thumb--side { right: calc(100% + 1.25rem); }
  .st--cluster { padding-bottom: 72px; }
}

/* hover preview: a pop-up's first picture next to its pill */
.st__thumb--peek { opacity: 0; pointer-events: none; transition: opacity 0.25s ease, border-color 0.3s ease; }
.st__thumb--peek.is-linked { opacity: 1; pointer-events: auto; }
@media (max-width: 767px) { .st__thumb--peek { display: none; } }

/* "open story": rises out of a picture that opens a pop-up, on hover */
.story-label {
  position: absolute; z-index: 4; pointer-events: none; white-space: nowrap;
  font-size: 11px; letter-spacing: 0.14em; color: var(--muted);
  opacity: 0; transform: translate(-50%, -100%) translateY(12px);
  transition: opacity 0.25s ease, transform 0.35s ease;
}
.story-label.is-on { opacity: 1; transform: translate(-50%, -100%) translateY(-6px); }
@media (prefers-reduced-motion: reduce) { .story-label { transition: opacity 0.2s ease; } }
.story-label--below { transform: translate(-50%, 0) translateY(-12px); }
.story-label--below.is-on { transform: translate(-50%, 0) translateY(6px); }

/* connection lines run behind texts, pills and pictures */
.st__link { z-index: 0; }
.st__head, .st > .pills { position: relative; z-index: 1; }
/* only on the desktop, where the picture lines exist; on the phone it would cut gaps into the pink edge lines */
@media (min-width: 768px) {
  .st__text { background: var(--bg); }
  .pill { background: var(--bg); }
}

/* pop-up head: one title with the year in small pink, partners in grey below */
.detail__year {
  margin-left: 0.6rem; white-space: nowrap; vertical-align: 3px;
  font-family: var(--font); font-size: 12px; font-weight: 400; letter-spacing: 0.2em; color: var(--accent);
}

/* pop-ups: pictures and video previews without the grey veil */
.detail .frame::after, .detail .embed__media::before { display: none; }

/* hovering a station title: its picture lights up like a linked picture (no "open story") */
@media (hover: hover) and (pointer: fine) {
  .st__head:hover .st__thumb { border-color: var(--accent); }
  .st__head:hover .st__thumb img { transform: scale(1.04); }
  .st__head:hover .st__thumb::after { opacity: 0.35; }
}

/* photo credit inside a picture */
.photo-credit {
  position: absolute; z-index: 2; right: 12px; bottom: 9px;
  font-size: 7px; letter-spacing: 0.06em; line-height: 1; color: rgba(255, 255, 255, 0.55); opacity: 0.4;
  pointer-events: none;
}

/* ---------- Symbols: alive, dissolve while scrolling into the lines; energy flows down the timeline ---------- */
.cv__head svg .cv__draw { stroke-width: 5.5; }                 /* = about 2px at 72px */
@media (min-width: 768px) { .cv__head svg .cv__draw { stroke-width: 4.2; } }  /* = about 2px at 96px */
.tl.is-drawing::before, .tl.is-drawing::after { transform: scaleY(var(--tl-grow, 1)); transform-origin: top; }
.tl__flow { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--tl-grow, 1) * 100%); overflow: hidden; pointer-events: none; z-index: 0; }
.tl__pulse {
  position: absolute; top: -160px; width: 3px; height: 160px; margin-left: -1px;
  background: linear-gradient(to bottom, transparent, var(--accent) 70%, transparent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: 2px; opacity: 0.9;
  animation: tl-flow 5s linear infinite;
}
.tl__pulse--b { animation-delay: 2.5s; }
@keyframes tl-flow { to { top: 100%; } }
@media (max-width: 767px) { .tl__pulse--a { left: 0; } .tl__pulse--b { left: 100%; } }
@media (min-width: 768px) { .tl__pulse--a { left: calc(50% - 14px); } .tl__pulse--b { left: calc(50% + 14px); } }
@media (prefers-reduced-motion: reduce) { .tl__flow { display: none; } }
.photo-credit--dark { color: rgba(0, 0, 0, 0.5); }  /* on light pictures */

/* the symbols are alive: electrons orbit (SVG animateMotion), the speech bubbles talk in turns, someone types */
.cv__talk { transform-box: fill-box; transform-origin: center; animation: cv-talk 3.2s ease-in-out infinite; }
.cv__talk--b { animation-delay: 1.6s; }
@keyframes cv-talk { 0%, 30%, 100% { transform: scale(1); } 12% { transform: scale(var(--talk, 1.06)); } }
.cv__typing circle { animation: cv-type 1.2s ease-in-out infinite; }
.cv__typing circle:nth-child(2) { animation-delay: 0.2s; }
.cv__typing circle:nth-child(3) { animation-delay: 0.4s; }
@keyframes cv-type { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }
/* the energy spark that leaves the symbols and runs down the forks */
.cv__fork .cv__spark { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; opacity: 0; filter: drop-shadow(0 0 4px var(--accent)); }
@media (prefers-reduced-motion: reduce) {
  .cv__live, .cv__spark { display: none; }
  .cv__talk { animation: none; }
}

/* hero arrow: only a hint, not a link */
.hero__hint { pointer-events: none; }

/* energy that arrives at the end of the timeline runs on through the join into the dot */
.cv__join .cv__spark--join { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; fill: none; opacity: 0; filter: drop-shadow(0 0 4px var(--accent)); }
.cv__join { overflow: visible; }
.cv__end { transform-box: fill-box; transform-origin: center; transition: transform 0.35s ease, filter 0.35s ease; }
.cv__end.is-hit { transform: scale(1.6); filter: drop-shadow(0 0 6px var(--accent)); }
.tl__pulse.is-js { animation: none; top: 0; }

/* pop-up body text two steps smaller (desktop 17 -> 15px, phone 16 -> 14px) */
.modal__body { font-size: 0.875rem; }
@media (min-width: 768px) { .modal__body { font-size: 0.9375rem; } }

/* energy comet: one continuous route per side (timeline line, join curve, dot) */
.cv { position: relative; }
.cv__energy { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 0; }
.cv__comet { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.cv__comet--head { filter: drop-shadow(0 0 4px var(--accent)); }
@media (prefers-reduced-motion: reduce) { .cv__energy { display: none; } }

/* pills: border at half the previous strength (the plus keeps its full colour) */
.pill { border-color: color-mix(in srgb, var(--accent) 28%, transparent); }
/* picture frames on the home page: 65% transparent */
.frame { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
/* the navel picture: full pink frame */
.today__media.frame { border-color: var(--accent); }

/* wide bubbles never run out of the window on medium screens */
@media (min-width: 768px) {
  .bubble--wide .bubble__body { width: min(400px, calc(50vw - 170px)); }
}

/* all bubbles share one width on the desktop and use the space up to the window edge */
@media (min-width: 768px) {
  .bubble__body, .bubble--wide .bubble__body { width: min(440px, calc(50vw - 64px)); max-width: none; }
  .bubble__about, .bubble__org, .bubble__chips, .bubble__desc, .bubble__list li, .bubble__list--in li,
  .bubble__body p.bubble__lead { max-width: none; }
  .bubble__stats { width: 100%; }
}

/* ---------- More room between the stations (+50%: 48px -> 72px) ---------- */
@media (min-width: 768px) {
  .st__head { padding-top: 36px; }
  .st { padding-bottom: 36px; }
  .st::before { top: 65px; }                 /* dot stays level with the title */
  .bubble { top: 69px; }                     /* title bubbles start at the dot */
  .st__thumb--high { margin-top: -36px; }    /* still sticks out to the middle of the gap */
  .st.st--cluster { padding-bottom: 84px; }
}
@media (max-width: 767px) {
  .st { padding-top: 30px; padding-bottom: 30px; }   /* top/bottom only: the side spacers to the pink lines stay */
  .st::before { top: 58px; }
  .st::after { top: 62px; }
}

/* ---------- Station pictures: alignment with the text lines ---------- */
@media (min-width: 768px) {
  .st--d .st__head { gap: 1.875rem; }                       /* right side: 50% more room between text and picture */
  .st__thumb--end { align-self: flex-end; margin-top: 0; }   /* bottom edge level with the last text line */
  .st__thumb--where { margin-top: var(--where-shift, -20px); } /* bottom edge level with the place line (set by JS) */
}

/* bubbles can slide down (JS sets --shift) so they keep clear of the station above; the line stays put */
@media (min-width: 768px) {
  .bubble__body { transform: translateY(calc(-50% + var(--shift, 0px))) scale(0.6); }
  .bubble.is-open .bubble__body { transform: translateY(calc(-50% + var(--shift, 0px))); }
  .bubble--wide .bubble__body { transform: translateY(calc(-65% + var(--shift, 0px))) scale(0.6); }
  .bubble--wide.is-open .bubble__body { transform: translateY(calc(-65% + var(--shift, 0px))); }
}

/* mail address: quiet grey instead of a bright link, pink on hover */
.contact__mail { color: var(--muted); text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.contact__mail:hover { color: var(--accent); }

/* "About me +": plus centred on the text line */
.contact__about { display: inline-flex; align-items: center; gap: 0.3rem; }
.contact__about .plus { margin-left: 0; vertical-align: 0; }

/* Bubble pictures: source credit inside the picture, like the pop-ups */
.bubble__pics--one { position: relative; }

/* Phone: bubbles open above the title or pill (JS sets .bubble--up when there is room), arrow points down */
@media (max-width: 767px) {
  .bubble--up .bubble__body { margin-top: 0; transform: translateY(calc(-100% - 6px)) scale(0.85); transform-origin: 24px 100%; }
  .bubble--up.is-open .bubble__body { transform: translateY(calc(-100% - 12px)); }
  .st--d > .bubble--up .bubble__body { transform-origin: calc(100% - 24px) 100%; }
  .bubble--up .bubble__body::before { top: auto; bottom: -6px; border: 0; border-right: 1px solid var(--frame); border-bottom: 1px solid var(--frame); }
}
