/* One deliberate look: white light on black. Type follows benkeimpe.com
   (Roboto for headings and labels, Lato for running text). */
:root {
  --bg: #000000;
  --ink: #f4f3f0;
  --ink-2: #b4b4b4;
  --muted: #7a7a7a;
  --dim: #464646;
  --dim-line: #262626;
  --hair: #1b1b1b;
  --panel: #070707;
  --glow: 255, 247, 232;              /* warm white light, used as rgba(var(--glow), a) */
  --font-head: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-body: "Lato", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; overscroll-behavior: none; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.app { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }

/* ---------- Header (benkeimpe.com nav, on black) ---------- */
.site-header {
  position: relative; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 40px);
}
.brand {
  font: 700 1.3rem/1 var(--font-head); letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
}
.site-nav { display: flex; gap: 2rem; }
.site-nav a {
  font: 400 16px/1.2 var(--font-body); color: #8b8b8b; text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a.active { color: var(--ink); text-shadow: 0 0 12px rgba(var(--glow), 0.5); }
.nav-toggle, .nav-toggle-label { display: none; }

/* ---------- Opening screen ---------- */
.splash {
  position: fixed; inset: 0; z-index: 25;
  display: grid; place-items: center; padding: 80px 20px 40px;
  background: var(--bg); text-align: center; overflow-y: auto;
}
.splash[hidden] { display: none; }
.splash.out {
  opacity: 0; transform: scale(1.03); filter: blur(7px); pointer-events: none;
  transition: opacity 0.6s ease, transform 0.9s ease, filter 0.6s ease;
}
.splash-in { max-width: 640px; display: flex; flex-direction: column; align-items: center; }
.splash-photo {
  width: clamp(150px, 22vh, 208px); height: auto; margin-bottom: 14px;
  filter: grayscale(1) contrast(1.04);
  animation: rise 0.9s 0.05s both cubic-bezier(0.2, 0.8, 0.2, 1);
}
.splash-name {
  margin: 0; font: 300 clamp(30px, 5vw, 44px)/1.1 var(--font-head); letter-spacing: 0.01em;
  color: var(--ink); text-shadow: 0 0 28px rgba(var(--glow), 0.25);
  animation: rise 0.9s 0.2s both cubic-bezier(0.2, 0.8, 0.2, 1);
}
.splash-lead {
  margin: 18px 0 0; font: 400 clamp(16px, 2.1vw, 19px)/1.5 var(--font-head); color: var(--ink-2);
  text-wrap: balance; animation: rise 0.9s 0.34s both cubic-bezier(0.2, 0.8, 0.2, 1);
}
.splash-lead span { display: block; margin-top: 4px; font-family: var(--font-body); font-size: 0.92em; color: #8f8f8f; }
.splash-sub {
  margin: 14px 0 0; font: 400 clamp(14px, 1.7vw, 16px)/1.5 var(--font-body); color: var(--muted);
  text-wrap: balance; animation: rise 0.9s 0.46s both cubic-bezier(0.2, 0.8, 0.2, 1);
}
.splash-go {
  margin-top: 34px; padding: 13px 28px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28); background: transparent; color: var(--ink);
  font: 500 14px/1 var(--font-head); letter-spacing: 0.03em; cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
  animation: rise 0.9s 0.58s both cubic-bezier(0.2, 0.8, 0.2, 1);
}
.splash-go:hover { border-color: rgba(255, 255, 255, 0.75); box-shadow: 0 0 26px rgba(var(--glow), 0.22); background: rgba(255, 255, 255, 0.04); }
.splash-go:focus-visible { outline: 1px solid rgba(var(--glow), 0.8); outline-offset: 4px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Timeline frame ---------- */
.frame {
  position: relative; overflow: hidden; isolation: isolate;
  touch-action: none; user-select: none; -webkit-user-select: none;
  cursor: grab; outline: none;
}
.frame.dragging, .frame.dragging * { cursor: grabbing !important; }
.frame:focus-visible { box-shadow: inset 0 0 0 1px rgba(var(--glow), 0.3); }
.content { position: absolute; left: 0; top: 0; width: 100%; z-index: 1; will-change: transform; }

.spine {
  position: absolute; left: var(--sx); top: 0; width: 1px; margin-left: -0.5px;
  background: linear-gradient(to bottom, var(--dim-line), var(--dim-line) calc(100% - 260px), transparent);
  transform-origin: 0 0;
  transition: transform 1.1s cubic-bezier(0.12, 0.8, 0.2, 1), opacity 0.3s ease;
}
.spine-lit {
  position: absolute; left: var(--sx); top: 0; width: 2px; margin-left: -1px; border-radius: 1px;
  background: linear-gradient(to bottom, rgba(var(--glow), 0.3), rgba(var(--glow), 0.8) calc(100% - 180px), rgb(var(--glow)));
  box-shadow: 0 0 6px rgba(var(--glow), 0.55), 0 0 18px rgba(var(--glow), 0.22);
  transition: opacity 0.4s ease;
}

.tk { position: absolute; left: 0; top: 0; width: var(--sx); height: 0; transition: opacity 0.25s ease; }
.tk span {
  position: absolute; right: 16px; top: -7px;
  font: 400 11px/14px var(--font-head); letter-spacing: 0.1em; color: #3c3c3c;
  font-variant-numeric: tabular-nums; transition: color 0.6s ease;
}
.tk i { position: absolute; right: 0; top: 0; width: 6px; height: 1px; background: #2a2a2a; transition: background-color 0.6s ease; }
.tk.dec span { font-weight: 500; }
.tk.lit span { color: #7f7f7f; }
.tk.lit i { background: #5c5c5c; }
.tk.near { opacity: 0; }

/* The spark: 15 December 1999 */
.spark { position: absolute; left: var(--sx); top: 0; width: 0; height: 0; z-index: 3; pointer-events: none; }
.spark-core {
  position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 10px 3px rgba(var(--glow), 0.9), 0 0 34px 10px rgba(var(--glow), 0.3);
}
.spark-rays { position: absolute; left: -19px; top: -19px; width: 38px; height: 38px; animation: twinkle 4.5s ease-in-out infinite; }
.spark-rays::before, .spark-rays::after { content: ""; position: absolute; left: 50%; top: 50%; }
.spark-rays::before { width: 38px; height: 1px; margin: -0.5px 0 0 -19px; background: linear-gradient(90deg, transparent, rgba(var(--glow), 0.95), transparent); }
.spark-rays::after { width: 1px; height: 38px; margin: -19px 0 0 -0.5px; background: linear-gradient(transparent, rgba(var(--glow), 0.95), transparent); }
@keyframes twinkle {
  0%, 100% { transform: rotate(0deg) scale(1); opacity: 0.85; }
  50% { transform: rotate(45deg) scale(0.7); opacity: 1; }
}
@keyframes charge {
  0% { transform: scale(0); opacity: 0; }
  25% { opacity: 1; }
  78% { transform: scale(2.4); }
  100% { transform: scale(1); }
}
/* Waiting behind the opening screen: nothing at all yet */
.frame.wait .spark { opacity: 0; animation: none; }

/* Entries */
.ti {
  position: absolute; left: var(--ix); top: 0; max-width: var(--iw);
  display: block; margin: 0; padding: 0; border: 0; background: none;
  color: var(--dim); text-align: left; font: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent; outline: none;
  transition: opacity 0.4s ease;
}
.ti-node {
  position: absolute; left: calc(var(--sx) - var(--ix)); top: 12px;
  width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%;
  background: #3a3a3a; transition: background-color 0.5s ease, box-shadow 0.5s ease, transform 0.3s ease;
}
.ti-title {
  display: block; font: 500 16px/24px var(--font-head);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color 0.5s ease, text-shadow 0.5s ease;
}
.ti-sub {
  display: block; font: 500 10.5px/16px var(--font-head); letter-spacing: 0.12em; text-transform: uppercase;
  color: #383838; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translateY(-3px);
  transition: opacity 0.35s ease, transform 0.35s ease, color 0.5s ease;
}
.ti.t1 .ti-title { font-size: 19px; }
.ti.t3 .ti-title { font-size: 14.5px; font-weight: 400; }

/* Lit: at or before the playhead */
.ti.lit { color: #e6e5e2; }
.ti.lit.t1 { color: var(--ink); }
.ti.lit.t3 { color: #bdbdbb; }
.ti.lit .ti-title { text-shadow: 0 0 10px rgba(var(--glow), 0.2); }
.ti.lit .ti-node { background: rgb(var(--glow)); box-shadow: 0 0 6px rgba(var(--glow), 0.8); }
.ti.lit .ti-sub { color: #8e8e8e; }
/* Time relevancy zone: details show, and lesser entries appear */
.ti.zone .ti-sub { opacity: 1; transform: none; }
.ti.lit.zone .ti-title { text-shadow: 0 0 12px rgba(var(--glow), 0.34); }
.ti.t2:not(.zone), .ti.t3:not(.inner) { opacity: 0; pointer-events: none; }
/* Under the playhead */
.ti.focus .ti-title { text-shadow: 0 0 7px rgba(var(--glow), 0.6), 0 0 24px rgba(var(--glow), 0.42); }
.ti.focus.lit { color: #fff; }
.ti.sel .ti-node { transform: scale(1.6); }
.ti:hover .ti-title { color: #fff; }
.ti:not(.lit):hover .ti-title { color: #8a8a8a; }
.ti:focus-visible { outline: 1px solid rgba(var(--glow), 0.6); outline-offset: 4px; border-radius: 4px; }
.ti.k-first .ti-node { display: none; }
.ti.k-now .ti-node::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 1px solid rgba(var(--glow), 0.7); animation: ping 2.6s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(0.4); opacity: 0.9; } 100% { transform: scale(2.4); opacity: 0; } }

/* Playhead: fixed in the frame while time slides past */
.beam {
  position: absolute; left: var(--sx); top: var(--ph); z-index: 2; height: 1px;
  width: min(560px, calc(100% - var(--sx)));
  background: linear-gradient(90deg, rgba(var(--glow), 0.26), rgba(var(--glow), 0.05) 60%, transparent);
  pointer-events: none; transition: opacity 0.6s ease;
}
.head { position: absolute; left: var(--sx); top: var(--ph); z-index: 2; width: 0; height: 0; pointer-events: none; transition: opacity 0.6s ease; }
.head::before {
  content: ""; position: absolute; left: -70px; top: -70px; width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--glow), 0.2) 0, rgba(var(--glow), 0.06) 38%, transparent 70%);
}
.head::after {
  content: ""; position: absolute; left: -3.5px; top: -3.5px; width: 7px; height: 7px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 10px 3px rgba(var(--glow), 0.85), 0 0 26px 8px rgba(var(--glow), 0.3);
}
.readout {
  position: absolute; left: 0; top: var(--ph); z-index: 3; width: calc(var(--sx) - 16px);
  transform: translateY(-50%); text-align: right; white-space: nowrap; pointer-events: none;
  font: 500 11px/1 var(--font-head); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink); text-shadow: 0 0 10px rgba(var(--glow), 0.55); font-variant-numeric: tabular-nums;
  transition: opacity 0.6s ease;
}
.vignette {
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: linear-gradient(to bottom, var(--bg) 0, rgba(0, 0, 0, 0) 17%, rgba(0, 0, 0, 0) 80%, var(--bg) 100%);
}
.fx { position: absolute; inset: 0; z-index: 5; width: 100%; height: 100%; pointer-events: none; }
.hint {
  position: absolute; left: 50%; bottom: 12px; z-index: 6; margin: 0;
  transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  font: 400 12px/1.4 var(--font-body); letter-spacing: 0.02em; color: #707070;
  opacity: 0; transition: opacity 0.8s ease;
}
.hint.show { opacity: 1; }

/* Before the big bang only the spark exists */
.frame.pre .spine { transform: scaleY(0); opacity: 0; }
.frame.pre .spine-lit, .frame.pre .tk, .frame.pre .ti,
.frame.pre .head, .frame.pre .beam, .frame.pre .readout { opacity: 0 !important; }
.frame.pre:not(.wait) .spark { animation: charge 0.7s cubic-bezier(0.3, 0.7, 0.3, 1) both; }

/* ---------- Preview panel ---------- */
.pv {
  position: relative; z-index: 10;
  height: clamp(240px, 34vh, 330px);
  padding: 22px clamp(16px, 4vw, 40px) 20px;
  background: var(--panel); border-top: 1px solid var(--hair);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.pv.hidden { opacity: 0; transform: translateY(28px); pointer-events: none; }
.pv-body {
  height: 100%; max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(240px, 330px) minmax(0, 1fr); gap: 28px;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.pv-body.out { opacity: 0; transform: translateY(6px); }
.pv-info { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.pv-kick { font: 500 10.5px/1.4 var(--font-head); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.pv-title {
  margin: 6px 0 0; font: 500 clamp(20px, 2.1vw, 26px)/1.2 var(--font-head); color: var(--ink);
  text-shadow: 0 0 18px rgba(var(--glow), 0.25); text-wrap: balance;
}
.pv-role { margin-top: 3px; font: 400 14px/1.4 var(--font-head); color: var(--ink-2); }
.pv-text {
  margin: 10px 0 0; font: 400 14px/1.55 var(--font-body); color: #a8a8a8;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.pv-links { margin-top: auto; padding-top: 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.pv-link {
  font: 500 13px/1.4 var(--font-head); color: var(--ink); text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3); padding-bottom: 2px;
  transition: border-color 0.2s ease, text-shadow 0.2s ease;
}
.pv-link:hover { border-color: var(--ink); text-shadow: 0 0 10px rgba(var(--glow), 0.5); }
.pv-back {
  appearance: none; -webkit-appearance: none; margin: 0; padding: 0; border: 0; background: none;
  font: 400 13px/1.4 var(--font-head); color: var(--muted); cursor: pointer; transition: color 0.2s ease;
}
.pv-back:hover { color: var(--ink); }
.pv-link:focus-visible, .pv-back:focus-visible, .chip:focus-visible, .tile:focus-visible {
  outline: 1px solid rgba(var(--glow), 0.7); outline-offset: 3px;
}
.pv-media {
  position: relative; min-width: 0; height: 100%;
  display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent);
  transition: opacity 0.2s ease;
}
.pv-media::-webkit-scrollbar { display: none; }
.pv-media.out { opacity: 0; }
.tile {
  position: relative; flex: none; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 8px;
  overflow: hidden; background: #111; color: inherit; text-decoration: none; cursor: pointer;
  display: block; scroll-snap-align: start;
}
.tile img {
  display: block; height: 100%; width: auto; max-width: none;
  opacity: 0; transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tile img.ok { opacity: 1; }
.tile:hover img { transform: scale(1.03); }
.tile .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 12px 10px;
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.82));
  font: 500 13px/1.3 var(--font-head); color: var(--ink); text-align: left;
}
.tile .cap small {
  display: block; margin-bottom: 2px;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: #b2b2b2;
}
.pv-year {
  align-self: center; user-select: none;
  font: 300 clamp(72px, 11vw, 150px)/1 var(--font-head); letter-spacing: -0.02em;
  color: transparent; -webkit-text-stroke: 1px #353535;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  appearance: none; -webkit-appearance: none; flex: none;
  padding: 7px 12px; border: 1px solid #2c2c2c; border-radius: 999px; background: transparent;
  font: 500 12px/1 var(--font-head); color: #9a9a9a; white-space: nowrap; cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.chip:hover { color: var(--ink); border-color: #555; }
.chip[aria-pressed="true"] { color: #000; background: var(--ink); border-color: var(--ink); box-shadow: 0 0 16px rgba(var(--glow), 0.3); }

/* ---------- Phones ---------- */
@media (max-width: 759px) {
  .site-header { padding: 14px 16px; }
  .brand { font-size: 1.15rem; }
  .nav-toggle-label { display: block; position: relative; width: 26px; height: 20px; cursor: pointer; }
  .nav-toggle-label span, .nav-toggle-label span::before, .nav-toggle-label span::after {
    content: ""; position: absolute; left: 0; right: 0; height: 2px; border-radius: 2px; background: var(--ink);
  }
  .nav-toggle-label span { top: 50%; transform: translateY(-50%); }
  .nav-toggle-label span::before { top: -7px; }
  .nav-toggle-label span::after { top: 7px; }
  .site-nav {
    position: absolute; top: 100%; right: 16px; display: none; flex-direction: column; gap: 14px;
    padding: 16px 22px; border: 1px solid var(--hair); border-radius: 12px; background: #0c0c0c;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  }
  .nav-toggle:checked ~ .site-nav { display: flex; }
  .splash { padding: 70px 20px 30px; }
  .splash-lead { margin-top: 14px; }
  .pv { height: clamp(250px, 41dvh, 350px); padding: 14px 16px 16px; }
  .pv-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
  .pv-title { margin-top: 3px; font-size: 19px; }
  .pv-text { margin-top: 6px; font-size: 13px; -webkit-line-clamp: 2; }
  .pv-fav .pv-text { display: none; }
  .pv-links { margin-top: 0; padding-top: 8px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 10px -16px 0; padding: 0 16px; }
  .ti.t1 .ti-title { font-size: 17px; }
  .ti .ti-title { font-size: 15px; }
  .ti.t3 .ti-title { font-size: 14px; }
  .pv-year { font-size: 84px; }
}
@media (prefers-reduced-motion: reduce) {
  .spark-rays, .ti.k-now .ti-node::after, .splash-photo, .splash-name, .splash-lead, .splash-sub, .splash-go { animation: none; }
  .ti, .ti-title, .ti-sub, .tk, .tk span, .pv, .pv-body, .tile img, .splash { transition: none; }
}
