/* ===========================================================================
   timeline.css — the CV as a spacetime diagram.

   Everything is chalk on the same slate as the rest of the site. The only
   colour that carries meaning is the ochre: it marks NOW, and it marks the
   light cone of whatever you are pointing at.
   =========================================================================== */

html { scroll-behavior: auto; }
body { overflow-x: hidden; }

.sky {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(60% 44% at 30% 18%, rgb(214 226 218 / .07), transparent 66%),
    radial-gradient(46% 34% at 76% 62%, rgb(214 226 218 / .05), transparent 68%),
    radial-gradient(130% 104% at 50% 44%, transparent 50%, rgb(0 0 0 / .46) 100%),
    linear-gradient(168deg, var(--board-lift), var(--board) 46%, var(--board-deep));
}
.sky::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  opacity: .22; mix-blend-mode: overlay;
  background-image: var(--grain); background-size: 220px 220px;
}

#stage { position: fixed; inset: 0; z-index: 1; }
.stage { inline-size: 100%; block-size: 100%; display: block; overflow: visible; }
#runway { position: relative; z-index: 0; }

/* ------------------------------------------------------------------ grid */
.hyper {
  fill: none; stroke: #79807a; stroke-width: .8; opacity: .3;
  stroke-dasharray: 1.5 6;
}
.tick line { stroke: var(--chalk-hair); stroke-width: 1; }
.tick text {
  font-family: var(--sans); font-size: 10px; letter-spacing: .12em;
  fill: var(--chalk-faint);
}
.tick.on line { stroke: var(--chalk-ochre); }
.tick.on text { fill: var(--chalk-ochre); }

/* ------------------------------------------------------------ world line */
.branch {
  fill: none; stroke-width: 2.2; stroke-linecap: round;
  filter: url(#chalk-line);
}
.branch.physics  { stroke: var(--chalk); opacity: .92; }
.branch.teaching { stroke: var(--chalk-soft); opacity: .62; stroke-width: 1.9; }
.span {
  stroke: var(--chalk-soft); stroke-width: 7; stroke-linecap: round;
  opacity: .1; filter: url(#chalk-line);
}

/* --------------------------------------------------- the null grid (spacetime)
   Every line here is a possible light ray. They are what make the picture read
   as a spacetime diagram rather than as a chart with a diagonal in it. */
.null { stroke: #757d77; stroke-width: .75; opacity: .26; }
.null.v { opacity: .2; }

/* ------------------------------------------------------------- light cones
   Drawn as chalk: the interior is a wash, and the two edges — the only lines
   in the picture that are exactly light — get the same rough stroke as
   everything else on the board. */
.pastcone { fill: rgb(216 178 94 / .05); stroke: none; }
.futurecone {
  fill: rgb(216 178 94 / .075); stroke: none;
  animation: cone-open .55s var(--ease-out) both;
}
.nullray {
  fill: none; stroke: rgb(216 178 94 / .5); stroke-width: 1.6;
  stroke-linecap: round; filter: url(#chalk-line);
}
.nullray.lit { stroke: rgb(216 178 94 / .8); stroke-width: 1.9;
               animation: ray-draw .55s var(--ease-out) both; }
.causal {
  fill: none; stroke: var(--chalk-ochre); stroke-width: 1.4; opacity: .75;
  stroke-linecap: round; filter: url(#chalk-line);
  animation: ray-draw .6s var(--ease-out) .12s both;
}
@keyframes cone-open { from { opacity: 0; scale: 1 .8; } }
@keyframes ray-draw  { from { opacity: 0; } }
.cones { transform-box: fill-box; }

.simul {
  stroke: var(--chalk-ochre); stroke-width: 1; opacity: .5;
  stroke-dasharray: 1 6;
}
.observer { fill: var(--chalk-ochre); filter: drop-shadow(0 0 8px rgb(216 178 94 / .75)); }

/* light in transit — an event whose news has not reached you yet */
.ray {
  fill: none; stroke: var(--chalk-ochre); stroke-width: 1.1; opacity: .42;
  stroke-linecap: round;
}

/* ---------------------------------------------------------------- events */
.ev { cursor: pointer; outline: none; }
.ev .halo { fill: transparent; }
.ev .dot {
  fill: none; stroke: var(--chalk-soft); stroke-width: 1.6;
  transition: stroke .35s var(--ease-out), fill .35s var(--ease-out),
              opacity .5s var(--ease-out), scale .4s var(--spring);
  transform-box: fill-box; transform-origin: center;
}
.ev.k-letter .dot, .ev.k-paper .dot { }
.ev.w-3 .dot { stroke-width: 2.1; }
/* Captions are one colour, always. What changes is how brightly they are lit,
   and the renderer never takes that below 0.55 — 4.8:1 on the board — while
   an event is on screen. The dark halo is what lets a faint caption stay
   readable where the null grid runs straight through the letterforms. */
.ev .lab {
  font-family: var(--sans); font-size: 11px; letter-spacing: .015em;
  fill: var(--chalk); pointer-events: none;
  paint-order: stroke fill;
  stroke: rgb(15 18 17 / .82); stroke-width: 2.8px; stroke-linejoin: round;
  transition: fill .35s var(--ease-out);
}
/* the resting size — the diagram's ground note. The caption you are actually
   looking at steps up to 11.5px; everything else stays here. */
.ev .lab.sm { font-size: 9.5px; letter-spacing: .02em; }
.ev .lab:not(.sm) { font-size: 11.5px; }

/* the hairline that ties a displaced caption back to its own event */
.tie { stroke: var(--chalk-hair); stroke-width: .9; }

/* not yet seen: the light is still on its way */
.ev.is-travelling .dot { stroke: var(--chalk-soft); opacity: .74; }
/* still in your future — present, but not yet yours */
.ev.is-future .dot { stroke: var(--chalk-faint); opacity: .55; stroke-dasharray: 2.5 2.5; }
/* seen */
.ev.is-seen .dot   { stroke: #f2efe4; opacity: 1;
  filter: drop-shadow(0 0 6px rgb(230 227 216 / .35)); }
.ev.is-seen.w-3 .dot { fill: rgb(230 227 216 / .16); }

.ev:hover .dot, .ev:focus-visible .dot { stroke: var(--chalk-ochre); scale: 1.45; }
.ev:hover .lab, .ev:focus-visible .lab { fill: var(--chalk-ochre); }
.ev:focus-visible .halo { fill: rgb(216 178 94 / .12); }

.ev.lit .dot   { stroke: var(--chalk-ochre); }
.ev.lit .lab   { fill: var(--chalk-ochre); }
.ev.shade .dot { opacity: .34; }


/* =========================================================== the furniture */
.hud { position: fixed; z-index: 5; pointer-events: none; font-family: var(--sans); }
.hud a, .hud button { pointer-events: auto; }

.topbar {
  inset-block-start: 0; inset-inline: 0;
  display: flex; align-items: baseline; gap: 1.4rem;
  padding: 1.1rem clamp(1rem, 3vw, 2.4rem);
  font-size: .7rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--chalk-faint);
  background: linear-gradient(180deg, rgb(18 22 20 / .9), transparent);
}
.topbar .who { color: var(--chalk); letter-spacing: .2em; }
.topbar a { color: var(--chalk-faint); text-decoration: none; }
.topbar a:hover { color: var(--chalk-ochre); }
.topbar .right { margin-inline-start: auto; display: flex; gap: 1.4rem; }

/* the year, sitting on the now-line */
.yearbox {
  inset-inline-start: clamp(1rem, 3vw, 2.4rem);
  inset-block-start: calc(42% - 2.6rem);
  display: grid; gap: .25rem;
}
#year {
  font-size: clamp(2.2rem, 4vw, 3.2rem); font-weight: 300; letter-spacing: .06em;
  color: var(--chalk-ochre); line-height: 1; font-variant-numeric: tabular-nums;
  filter: drop-shadow(0 0 14px rgb(216 178 94 / .3));
}
.yearbox small { font-size: .6rem; letter-spacing: .18em; color: var(--chalk-faint); }
#yearFrac { inline-size: 78px; block-size: 2px; background: rgb(216 178 94 / .22); }
#yearFrac::after { content: ''; display: block; block-size: 2px; inline-size: calc(var(--f, 0) * 100%);
                   background: var(--chalk-ochre); }

/* the axis, named honestly */
.axis {
  inset-block-end: 0; inset-inline: 0;
  display: flex; justify-content: space-between; align-items: end;
  padding: 0 clamp(1rem, 3vw, 2.4rem) 1rem;
  font-size: .62rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--chalk-faint);
  background: linear-gradient(0deg, rgb(18 22 20 / .97) 40%, rgb(18 22 20 / .8) 70%, transparent);
  padding-block-start: 2.2rem;
}
.axis .mid { text-align: center; color: var(--chalk-hair); text-transform: none;
             letter-spacing: .04em; font-size: .64rem; max-inline-size: 46ch; }
.axis .mid b { color: var(--chalk-faint); font-weight: 400; }

.axis .corner { display: grid; gap: .5rem; justify-items: start; }
#legend { display: grid; grid-template-columns: repeat(2, auto); gap: .18rem .9rem; }
.lg { display: inline-flex; align-items: center; gap: .35rem; font-size: .58rem;
      letter-spacing: .12em; color: var(--chalk-faint); }
.lg i { inline-size: 7px; block-size: 7px; border: 1.4px solid var(--chalk-soft); }
.lg.k-letter i, .lg.k-paper i { border-radius: 50%; }
.lg.k-letter i { background: rgb(230 227 216 / .2); }
.lg.k-invited i, .lg.k-talk i { border: 0; background:
  conic-gradient(from 0deg, var(--chalk-soft) 0 2deg, transparent 2deg 43deg,
                 var(--chalk-soft) 45deg 47deg, transparent 47deg 88deg,
                 var(--chalk-soft) 90deg 92deg, transparent 92deg 133deg,
                 var(--chalk-soft) 135deg 137deg, transparent 137deg 178deg,
                 var(--chalk-soft) 180deg 182deg, transparent 182deg 223deg,
                 var(--chalk-soft) 225deg 227deg, transparent 227deg 268deg,
                 var(--chalk-soft) 270deg 272deg, transparent 272deg 313deg,
                 var(--chalk-soft) 315deg 317deg, transparent 317deg 360deg); }

.axislabel { color: var(--chalk-faint); font-size: .64rem; letter-spacing: .2em; }
.axislabel.ct { inset-block-start: 50%; inset-inline-start: .8rem; translate: 0 -50%;
                writing-mode: vertical-rl; rotate: 180deg; opacity: .55; }

.conenote {
  inset-block-end: 6.2rem; inset-inline: 0; margin: 0; text-align: center;
  font-size: .64rem; letter-spacing: .1em; color: var(--chalk-ochre);
  opacity: .85; animation: fade-up .4s var(--ease-out) both;
}
@keyframes fade-up { from { opacity: 0; translate: 0 6px; } }
.conenote[hidden] { display: none; }

/* the card */
#card {
  position: fixed; z-index: 6;
  inset-inline-end: clamp(1rem, 3vw, 5.5rem);
  inset-block-start: 50%; translate: 0 -50%;
  inline-size: min(34ch, 42vw);
  padding: 1.15rem 1.25rem;
  background: rgb(20 25 22 / .93);
  border: 1px solid rgb(216 178 94 / .28);
  border-radius: 2px;
  box-shadow: 0 22px 50px -30px #000;
  backdrop-filter: blur(7px);
  animation: card-in .32s var(--ease-out) both;
}
@keyframes card-in { from { opacity: 0; translate: 10px -50%; } }
#card[hidden] { display: none; }
#card .sec { margin: 0 0 .5rem; font-family: var(--sans); font-size: .56rem;
             letter-spacing: .18em; text-transform: uppercase; color: var(--chalk-faint); }
#card .when { margin: 0 0 .3rem; font-family: var(--sans); font-size: .7rem;
              color: var(--chalk-ochre); }
#card h3 { margin: 0; font-size: .98rem; line-height: 1.35; color: var(--chalk); font-weight: 700; }
#card h3 a { color: inherit; text-decoration: none; border-block-end: 1px solid rgb(216 178 94 / .4); }
#card .meta { margin: .45rem 0 0; font-size: .78rem; line-height: 1.5; color: var(--chalk-soft); }
#card .desc { margin: .4rem 0 0; font-size: .78rem; font-style: italic; color: var(--chalk-faint); }
#card .after { margin: .7rem 0 0; padding-block-start: .55rem; font-size: .68rem;
               font-style: italic; color: var(--chalk-faint);
               border-block-start: 1px dashed rgb(216 178 94 / .3); }

/* the opening note, which fades once you start moving */
.intro {
  position: fixed; inset: 0; z-index: 7; display: grid; place-items: center;
  pointer-events: none; text-align: center;
  animation: intro-out 1s var(--ease-out) 4.2s both;
}
.intro div { max-inline-size: 42ch; }
.intro p { font-family: var(--serif); font-size: 1rem; line-height: 1.6;
           color: var(--chalk-soft); margin: 0 0 .4rem; }
.intro small { font-family: var(--sans); font-size: .62rem; letter-spacing: .18em;
               text-transform: uppercase; color: var(--chalk-faint); }
@keyframes intro-out { to { opacity: 0; visibility: hidden; } }

@media (max-width: 780px) {
  #card { inline-size: auto; inset-inline: clamp(.8rem, 4vw, 2rem);
          inset-block: auto 5.5rem; translate: none; }
  @keyframes card-in { from { opacity: 0; translate: 0 10px; } }
  .yearbox { inset-block-start: calc(42% - 2rem); }
  #year { font-size: 1.8rem; }
  .axis .mid { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .futurecone, #card, .intro { animation: none; }
  .ev .dot { transition: none; }
}

/* Asked for maximum contrast, the depth-of-field goes and every caption on
   screen is lit the same. The hierarchy was never carrying meaning the text
   does not also carry. */
@media (prefers-contrast: more) {
  .ev .lab { opacity: 1 !important; stroke-width: 3.4px; stroke: var(--board); }
  .ev.shade .dot { opacity: .7; }
  .null { opacity: .14; }
  .hyper { opacity: .16; }
}
