/* About: the journey. Owned by the About journey section agent (About page 100x, 2026-09-24).
   One scene: a map that flies from stop to stop (journey.js draws it on a canvas) beside the list of
   stops. On a wide, tall screen the scene pins while the page scrolls through the stops; on a phone the
   map sticks above the list and the stops scroll beneath it. Hover or focus on a stop flies the map
   there at once. The list is plain text and real logos, complete with no script at all. */

.about-journey {
  --about-journey-ease: cubic-bezier(0.28, 0.11, 0.32, 1);
  --about-journey-step: 40vh;
  position: relative;
  padding-block: clamp(2.25rem, 5vw, 4rem) clamp(3.5rem, 7vw, 6rem);
  background: var(--paper);
}
.about-journey-h { max-width: 20ch; }
.about-journey-track { position: relative; margin-top: clamp(1.5rem, 3vw, 2.5rem); }
.about-journey-scene { position: relative; }

/* ---------- the stage: one 18px tile holding the map ---------- */
.about-journey-stage {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  isolation: isolate;
  background: var(--accent-tint);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-1);
}
html:not(.js) .about-journey-stage { display: none; }
.about-journey-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.about-journey-cards { position: absolute; inset: 0; pointer-events: none; }
.about-journey-say { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* a place card: the institution's own logo, standing over its city. It arrives the Apple way: a
   cross-fade with a slight rise and a blur that settles to sharp. */
.about-journey-card {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0.7rem 0.85rem;
  background: #fff;
  border-radius: var(--r-card);
  box-shadow: 0 1px 2px rgba(10, 13, 18, 0.06), 0 12px 32px rgba(10, 13, 18, 0.14);
  opacity: 0;
  filter: blur(6px);
  translate: 0 10px;
  scale: 0.96;
  transform-origin: var(--about-journey-tail, 50%) 100%;
  transition: opacity 0.45s var(--about-journey-ease), filter 0.5s var(--about-journey-ease), translate 0.55s var(--about-journey-ease), scale 0.55s var(--about-journey-ease);
  will-change: transform, opacity;
}
.about-journey-card::after {
  content: '';
  position: absolute;
  left: var(--about-journey-tail, 50%);
  bottom: -6px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: #fff;
  border-radius: 0 0 3px 0;
  rotate: 45deg;
  box-shadow: 4px 4px 8px rgba(10, 13, 18, 0.06);
}
.about-journey-card--left { transform-origin: 100% var(--about-journey-tail, 50%); translate: -10px 0; }
.about-journey-card--left::after { left: auto; right: -6px; bottom: auto; top: var(--about-journey-tail, 50%); margin: -6px 0 0; border-radius: 0 3px 0 0; box-shadow: 4px -4px 8px rgba(10, 13, 18, 0.05); }
.about-journey-card.is-on { opacity: 1; filter: blur(0); translate: 0 0; scale: 1; }
.about-journey-card__logo { position: relative; z-index: 1; display: block; width: auto; height: var(--about-journey-card-h, 28px); }
/* staggered parts: the plate lands first, then what is on it */
.about-journey-card > * { opacity: 0; translate: 0 4px; transition: opacity 0.4s var(--about-journey-ease), translate 0.5s var(--about-journey-ease); }
.about-journey-card.is-on > * { opacity: 1; translate: 0 0; transition-delay: 0.08s; }
.about-journey-card.is-on > * + * { transition-delay: 0.16s; }
.about-journey-card__logo--ur { --about-journey-card-h: 36px; }
.about-journey-card__logo--tum { --about-journey-card-h: 26px; }
.about-journey-card__logo--utsw { --about-journey-card-h: 32px; }
.about-journey-card__logo--nnuh { --about-journey-card-h: 22px; }
.about-journey-card__logo--uw { --about-journey-card-h: 15px; }
.about-journey-card__logo--swedish { --about-journey-card-h: 26px; }
.about-journey-card--photo { width: 16.5rem; padding: 0.5rem 0.5rem 0.7rem; }
.about-journey-card--photo .about-journey-photo { margin: 0 0 0.65rem; max-width: none; aspect-ratio: 16 / 9; }
.about-journey-card--photo .about-journey-card__logo { margin-left: 0.3rem; }

/* ---------- the stops ---------- */
.about-journey-list { position: relative; }
html:not(.js) .about-journey-list { max-width: 48rem; }
.about-journey-reel { position: relative; transition: transform 0.7s var(--about-journey-ease); }
.about-journey-stops { list-style: none; margin: 0; padding: 0; }
/* the plate glides by script (journey.js), because on a wide screen the rows it follows are
   changing height as they fold and unfold; a CSS transition would chase where they were */
.about-journey-hl {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(10, 13, 18, 0.04), 0 6px 16px rgba(10, 13, 18, 0.05);
  opacity: 0;
  transition: opacity 0.4s var(--about-journey-ease);
  pointer-events: none;
}
.about-journey-has-hl .about-journey-hl { opacity: 1; }
.about-journey-stop {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 4.1rem minmax(0, 1fr);
  gap: 0 1rem;
  padding: 0.95rem 1.15rem;
  border-radius: 18px;
  outline: none;
  transition: translate 0.5s var(--about-journey-ease);
}
.about-journey-stop:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.about-journey-yr {
  font-family: var(--label);
  font-weight: 700;
  font-size: clamp(1.4rem, 1.75vw, 1.75rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--muted);
  transition: color 0.4s var(--about-journey-ease);
}
.about-journey-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.3rem 1rem; min-height: 1.75rem; }
.about-journey-head h3 { font-size: clamp(1.12rem, 1.3vw, 1.3rem); line-height: 1.2; }
.about-journey-logo { display: block; width: auto; height: var(--about-journey-logo-h, 20px); opacity: 0.6; transition: opacity 0.4s var(--about-journey-ease); }
.about-journey-logo--ur { --about-journey-logo-h: 25px; }
.about-journey-logo--tum { --about-journey-logo-h: 18px; }
.about-journey-logo--utsw { --about-journey-logo-h: 23px; }
.about-journey-logo--nnuh { --about-journey-logo-h: 16px; }
.about-journey-logo--uw { --about-journey-logo-h: 11px; }
.about-journey-logo--swedish { --about-journey-logo-h: 19px; }
.about-journey-body p { margin-top: 0.3rem; max-width: 46ch; font-size: 0.97rem; line-height: 1.5; color: var(--muted); transition: color 0.4s var(--about-journey-ease); }
.about-journey-photo { margin-top: 0.9rem; max-width: 22rem; aspect-ratio: 16 / 9; }
.about-journey-stop.is-active .about-journey-yr { color: var(--ink); }
.about-journey-stop.is-active .about-journey-logo { opacity: 1; }
.about-journey-stop.is-active .about-journey-body p { color: var(--ink-2); }
/* once the map is live it carries each institution's logo on its card, so the list does not repeat it */
.about-journey-live .about-journey-logo { display: none; }
@media (hover: hover) and (pointer: fine) {
  .about-journey-live .about-journey-stop { cursor: pointer; }
  .about-journey-live .about-journey-stop:hover:not(.is-active) .about-journey-logo { opacity: 0.8; }
}

/* ---------- wide and tall: the scene pins, the page scrolls through the stops ---------- */
@media (min-width: 1024px) and (min-height: 600px) {
  /* journey.js sets the units from the flights themselves: a leg across the Atlantic is given more
     scroll than a hop across Bavaria, so every flight moves at a speed the eye reads as the same */
  .js .about-journey-track { height: calc(100vh + var(--about-journey-units, 8) * var(--about-journey-step)); }
  .js .about-journey-scene {
    position: sticky;
    top: var(--nav-h);
    height: calc(100vh - var(--nav-h));
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    gap: clamp(1.5rem, 2.6vw, 2.75rem);
    align-items: center;
  }
  .js .about-journey-stage { height: min(calc(100vh - var(--nav-h) - 6vh), 820px); }
  .js .about-journey-list { max-height: calc(100vh - var(--nav-h) - 3vh); overflow: hidden; }
  .js .about-journey-list.is-clip-bottom {
    -webkit-mask-image: linear-gradient(#000 calc(100% - 2.5rem), transparent);
    mask-image: linear-gradient(#000 calc(100% - 2.5rem), transparent);
  }
  .js .about-journey-list.is-clip-top {
    -webkit-mask-image: linear-gradient(transparent, #000 2.5rem);
    mask-image: linear-gradient(transparent, #000 2.5rem);
  }
  .js .about-journey-list.is-clip-top.is-clip-bottom {
    -webkit-mask-image: linear-gradient(transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent);
    mask-image: linear-gradient(transparent, #000 2.5rem, #000 calc(100% - 2.5rem), transparent);
  }
  .js .about-journey-stop { padding-block: clamp(0.55rem, 1.25vh, 0.95rem); }
  .js .about-journey-body p { font-size: 0.95rem; line-height: 1.48; }

  /* The list reads as an index: year and place, with only the stop on the map opened. The line
     unfolds as the row takes the plate and settles from a blur, the Apple way. */
  .about-journey-live .about-journey-more {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.55s var(--about-journey-ease);
  }
  .about-journey-live .about-journey-more-in {
    min-height: 0;
    overflow: hidden;
    opacity: 0;
    filter: blur(5px);
    translate: 0 -4px;
    transition: opacity 0.3s var(--about-journey-ease), filter 0.4s var(--about-journey-ease), translate 0.5s var(--about-journey-ease);
  }
  .about-journey-live .about-journey-stop.is-active .about-journey-more { grid-template-rows: 1fr; }
  .about-journey-live .about-journey-stop.is-active .about-journey-more-in {
    opacity: 1;
    filter: blur(0);
    translate: 0 0;
    transition-delay: 0.12s;
  }
  .about-journey-live .about-journey-body p { margin-top: 0.35rem; color: var(--ink-2); }
  .about-journey-live .about-journey-stop:not(.is-active) .about-journey-head h3 { color: var(--ink-2); }
  .about-journey-live .about-journey-stop { padding-block: clamp(0.6rem, 1.35vh, 0.95rem); }
}

/* ---------- narrow or short: the map sticks above the stops ---------- */
@media not all and (min-width: 1024px) and (min-height: 600px) {
  .js .about-journey-stage {
    position: sticky;
    top: calc(var(--nav-h) + 0.6rem);
    z-index: 3;
    height: min(44vh, 27rem);
  }
  .js .about-journey-list { margin-top: 0.75rem; }
  /* the room between stops is margin, so the highlight hugs the text and not the scroll distance.
     journey.js sizes each gap to the flight that follows it: a long flight gets a long gap */
  .js .about-journey-stop { margin-bottom: var(--about-journey-gap, 26vh); scroll-margin-top: calc(var(--nav-h) + min(44vh, 27rem) + 1.5rem); }
  .js .about-journey-stop:last-child { margin-bottom: 0; }
  .about-journey-card--photo { width: 8.75rem; }
}
@media (max-width: 560px) {
  .about-journey-stop { grid-template-columns: 3.4rem minmax(0, 1fr); gap: 0 0.75rem; padding-inline: 0.85rem; }
  .about-journey-yr { font-size: 1.35rem; }
  .about-journey-card { padding: 0.55rem 0.65rem; }
  .about-journey-card__logo--ur { --about-journey-card-h: 28px; }
  .about-journey-card__logo--tum { --about-journey-card-h: 20px; }
  .about-journey-card__logo--utsw { --about-journey-card-h: 24px; }
  .about-journey-card__logo--nnuh { --about-journey-card-h: 15px; }
  .about-journey-card__logo--uw { --about-journey-card-h: 11px; }
  .about-journey-card__logo--swedish { --about-journey-card-h: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .about-journey-more, .about-journey-more-in, .about-journey-reel { transition: none !important; }
}
