@font-face {
  font-family: "Anek";
  src: url("../fonts/anek-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "Anek";
  src: url("../fonts/anek-latin-ext.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0;
}
@font-face {
  font-family: "Anek";
  src: url("../fonts/anek-devanagari.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
  unicode-range: U+0900-097F, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "Mono";
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --ink: #f6f1e7;
  --dim: rgba(246, 241, 231, 0.68);
  --faint: rgba(246, 241, 231, 0.4);
  --amber: #ffb45a;
  --hot: #ff6a55;
  --cold: #a9c9ff;
  --night: #05070c;
  --s: 1;
  --rise: cubic-bezier(0.16, 0.8, 0.2, 1);
  color-scheme: dark;
}

html, body { height: 100%; margin: 0; background: var(--night); overflow: hidden; }
body {
  color: var(--ink);
  font-family: "Anek", "Noto Sans Devanagari", "Nirmala UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}
body.idle { cursor: none; }

#world { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
body.no-gl #world {
  background:
    radial-gradient(120% 90% at 70% 60%, #1b2440 0%, transparent 60%),
    radial-gradient(80% 60% at 20% 20%, #3a1d24 0%, transparent 60%),
    var(--night);
}

/* ---- the 1920x1080 stage ------------------------------------------------ */

#stage {
  position: fixed; left: 0; top: 0;
  width: 1920px; height: 1080px;
  transform-origin: 0 0;
  pointer-events: none;
}

.slide {
  position: absolute; inset: 0;
  box-sizing: border-box;
  padding: 96px 112px 112px;
  display: flex; flex-direction: column; align-items: flex-start;
  text-shadow: 0 2px 34px rgba(2, 4, 9, 0.7), 0 0 4px rgba(2, 4, 9, 0.35);
  transition: opacity 0.4s ease;
}
.slide.out { opacity: 0; }
.slide.top { justify-content: flex-start; }
.slide.middle { justify-content: center; }
.slide.bottom { justify-content: flex-end; }
.slide.center { justify-content: center; align-items: center; text-align: center; }
.slide.right { align-items: flex-end; text-align: right; }

/* A soft shadow behind the type, so it reads over bright ground. */
.slide::before {
  content: "";
  position: absolute; inset: -10%;
  z-index: -1;
  opacity: 0;
  transition: opacity 1.2s ease 0.3s;
  background: radial-gradient(72% 64% at 20% 22%, rgba(3, 5, 10, 0.9), rgba(3, 5, 10, 0.55) 45%, transparent 74%);
}
.slide.in::before { opacity: 1; }
.slide.middle::before { background: radial-gradient(56% 70% at 20% 50%, rgba(3, 5, 10, 0.8), transparent 72%); }
.slide.bottom::before { background: radial-gradient(64% 62% at 22% 80%, rgba(3, 5, 10, 0.82), transparent 72%); }
.slide.center::before { background: radial-gradient(60% 55% at 50% 50%, rgba(3, 5, 10, 0.72), transparent 72%); }
.slide.right::before { transform: scaleX(-1); }
.slide.wide::before { background: linear-gradient(180deg, rgba(3, 5, 10, 0.85), rgba(3, 5, 10, 0.5) 38%, transparent 62%); }
.slide.bare::before { display: none; }

/* ---- type --------------------------------------------------------------- */

.k {
  font: 500 21px/1.2 "Mono", ui-monospace, monospace;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 30px;
  display: flex; align-items: baseline; gap: 22px;
}
.k b {
  font: 500 27px/1 "Anek", sans-serif;
  letter-spacing: 0;
  color: var(--faint);
  text-transform: none;
}

.h {
  margin: 0;
  font-weight: 640;
  font-stretch: 116%;
  font-size: 104px;
  line-height: 1.0;
  letter-spacing: -0.022em;
  max-width: 1180px;
  text-wrap: balance;
}
.h.xl { font-size: 156px; line-height: 0.94; letter-spacing: -0.03em; max-width: 1500px; }
.h.l { font-size: 128px; line-height: 0.96; max-width: 1400px; }
.h.m { font-size: 84px; line-height: 1.02; }
.h.s { font-size: 62px; line-height: 1.06; font-weight: 600; max-width: 1000px; }
.h + .h { margin-top: 0.18em; }
.center .h { max-width: 1560px; }
.em { color: var(--amber); }
.hot { color: var(--hot); }
.cold { color: var(--cold); }
.ghost { color: rgba(246, 241, 231, 0.52); }

/* Words rise out of their own line. */
.h .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.1em 0.04em 0.16em; margin: -0.1em -0.04em -0.16em; }
.h .w > i {
  display: inline-block; font-style: normal;
  transform: translateY(112%) rotate(4deg);
  transform-origin: 0 100%;
  transition: transform 1s var(--rise);
  transition-delay: calc(var(--d) + var(--i) * 0.045s);
}
.slide.in .h .w > i { transform: none; }

.r {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(8px);
  transition: opacity 0.8s ease, transform 1s var(--rise), filter 0.8s ease;
  transition-delay: var(--d);
}
.slide.in .r { opacity: 1; transform: none; filter: none; }

.p {
  margin: 34px 0 0;
  font-size: 38px; line-height: 1.26;
  font-weight: 400; font-stretch: 100%;
  color: var(--dim);
  max-width: 900px;
  text-wrap: pretty;
}
.p b { color: var(--ink); font-weight: 600; }
.p.s { font-size: 30px; max-width: 820px; }
.center .p { max-width: 1100px; }

.n {
  margin: 0;
  font-weight: 760; font-stretch: 122%;
  font-size: 270px; line-height: 0.86;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.n.m { font-size: 190px; }
.n.s { font-size: 130px; }
.n small { font-size: 0.34em; font-weight: 600; letter-spacing: -0.01em; margin-left: 0.12em; color: var(--dim); }

.facts { display: flex; gap: 64px; margin-top: 48px; align-items: flex-start; }
.right .facts { justify-content: flex-end; }
.f { flex: none; }
.f b {
  display: block;
  font-weight: 700; font-stretch: 116%;
  font-size: 78px; line-height: 0.95; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.f b small { font-size: 0.5em; font-weight: 600; color: var(--dim); margin-left: 0.08em; }
.f span {
  display: block; margin-top: 14px;
  font: 500 21px/1.4 "Mono", ui-monospace, monospace;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--dim);
  max-width: 330px;
}
.f.em b { color: var(--amber); }
.f.hot b { color: var(--hot); }
.f.cold b { color: var(--cold); }

.chips { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; max-width: 1000px; }
.chips span {
  font: 500 21px/1 "Mono", ui-monospace, monospace;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 14px 22px 13px;
  border: 1px solid rgba(246, 241, 231, 0.34);
  border-radius: 999px;
  background: rgba(5, 7, 12, 0.5);
  backdrop-filter: blur(6px);
}
.chips .hot { border-color: rgba(255, 106, 85, 0.6); }
.chips .em { border-color: rgba(255, 180, 90, 0.6); }

.src {
  position: absolute; left: 112px; bottom: 54px;
  font: 400 18px/1.45 "Mono", ui-monospace, monospace;
  letter-spacing: 0.05em;
  color: rgba(246, 241, 231, 0.52);
  max-width: 1400px;
}
.src.flow { position: static; margin: 30px 0 0; }
.right .src { left: auto; right: 112px; }
.center .src { left: 0; right: 0; max-width: none; text-align: center; }

/* A row of dated events. */
.dates { display: flex; margin-top: 56px; border-top: 1px solid rgba(246, 241, 231, 0.3); }
.dates div { padding: 22px 46px 0 0; margin-right: 46px; position: relative; max-width: 300px; }
.dates div::before {
  content: ""; position: absolute; left: 0; top: -6px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 18px var(--amber);
}
.dates .hot::before { background: var(--hot); box-shadow: 0 0 18px var(--hot); }
.dates b { display: block; font-weight: 680; font-stretch: 114%; font-size: 40px; letter-spacing: -0.015em; white-space: nowrap; }
.dates span { display: block; margin-top: 8px; font-size: 25px; line-height: 1.25; color: var(--dim); }

/* A chain of causes, read left to right. */
.chain { display: flex; align-items: stretch; margin-top: 54px; gap: 0; }
.chain div {
  padding: 20px 34px 20px 0; margin-right: 34px;
  border-right: 1px solid rgba(246, 241, 231, 0.26);
  font-size: 30px; line-height: 1.15; font-weight: 600; font-stretch: 108%;
  max-width: 230px;
}
.chain div:last-child { border: 0; margin: 0; color: var(--hot); }
.chain small {
  display: block; margin-bottom: 12px;
  font: 500 15px/1 "Mono", ui-monospace, monospace; letter-spacing: 0.14em; color: var(--amber);
}

/* Two statements side by side. */
.duo { display: flex; gap: 110px; width: 100%; }
.duo > div { flex: 1; }
.narrow { max-width: 760px; }

/* The real QR code, laid over the lights that formed it. */
.qrbox { position: absolute; left: 1150px; top: 250px; width: 560px; height: 560px; }
.qr { display: block; width: 100%; height: 100%; border-radius: 12px; box-shadow: 0 0 90px rgba(255, 214, 160, 0.35); }
.qr.r { transition-delay: calc(var(--d) + 1.5s); }

/* A huge word in Devanagari, drawn in outline behind the slide. */
.deva {
  position: absolute; right: 70px; bottom: 40px; z-index: -1;
  margin: 0;
  font-weight: 800; font-stretch: 125%;
  font-size: 400px; line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px rgba(246, 241, 231, 0.22);
  text-shadow: none;
  white-space: nowrap;
}
.deva.left { right: auto; left: 96px; }

/* Text placed at stage coordinates, to sit beside a formation of lights. */
.tag {
  position: absolute;
  font: 500 20px/1.3 "Mono", ui-monospace, monospace;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
}
.tag b { display: block; font: 660 44px/1 "Anek", sans-serif; font-stretch: 114%; letter-spacing: -0.01em; text-transform: none; color: var(--ink); margin-bottom: 8px; }
.tag.c { transform: translateX(-50%); text-align: center; }
.tag.c.r { transform: translate(-50%, 26px); }
.slide.in .tag.c.r { transform: translateX(-50%); }

/* ---- labels pinned to places on the map ---------------------------------- */

#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.wl { position: absolute; left: 0; top: 0; opacity: 0; transition: opacity 0.6s ease; transition-delay: 0s; will-change: transform; }
.wl.in { opacity: 1; transition-delay: var(--d); }
.wl i {
  position: absolute; left: calc(-5px * var(--s)); top: calc(-5px * var(--s));
  width: calc(10px * var(--s)); height: calc(10px * var(--s));
  box-sizing: border-box; border-radius: 50%;
  border: calc(2px * var(--s)) solid var(--ink);
  box-shadow: 0 0 calc(14px * var(--s)) rgba(255, 255, 255, 0.7);
}
.wl span {
  position: absolute; left: calc(46px * var(--s)); top: calc(-74px * var(--s));
  white-space: nowrap;
  padding: calc(9px * var(--s)) calc(15px * var(--s)) calc(8px * var(--s));
  border-radius: calc(8px * var(--s));
  background: rgba(5, 7, 12, 0.74);
  backdrop-filter: blur(8px);
}
.wl span::before {
  content: ""; position: absolute;
  right: 100%; top: calc(28px * var(--s));
  width: calc(56px * var(--s)); height: 1px;
  background: rgba(246, 241, 231, 0.6);
  transform-origin: 100% 0; transform: rotate(-44deg);
}
.wl.left span { left: auto; right: calc(46px * var(--s)); text-align: right; }
.wl.left span::before { right: auto; left: 100%; transform-origin: 0 0; transform: rotate(44deg); }
.wl b { display: block; font-weight: 640; font-stretch: 112%; font-size: calc(27px * var(--s)); letter-spacing: -0.005em; }
.wl small { display: block; margin-top: calc(3px * var(--s)); font: 500 calc(15px * var(--s))/1.3 "Mono", ui-monospace, monospace; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.wl.hot b { color: var(--hot); } .wl.hot i { border-color: var(--hot); box-shadow: 0 0 calc(14px * var(--s)) var(--hot); }
.wl.em b { color: var(--amber); } .wl.em i { border-color: var(--amber); box-shadow: 0 0 calc(14px * var(--s)) var(--amber); }
.wl.cold b { color: var(--cold); } .wl.cold i { border-color: var(--cold); }

/* ---- presenter chrome ---------------------------------------------------- */

#chrome { position: fixed; inset: 0; pointer-events: none; font: 500 12px/1 "Mono", ui-monospace, monospace; letter-spacing: 0.16em; text-transform: uppercase; }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(246, 241, 231, 0.08); }
.progress i { display: block; height: 100%; background: var(--amber); transform-origin: 0 0; transform: scaleX(0); transition: transform 0.8s var(--rise); }
.counter { position: absolute; left: 28px; bottom: 20px; color: var(--faint); font-variant-numeric: tabular-nums; }
.hud { position: absolute; right: 28px; bottom: 20px; color: var(--faint); }
.hint { position: absolute; left: 0; right: 0; bottom: 20px; text-align: center; color: var(--faint); transition: opacity 0.8s ease; }
.hint.gone { opacity: 0; }

.notes {
  position: absolute; left: 0; right: 0; bottom: 0;
  pointer-events: auto;
  padding: 22px 32px 30px;
  background: rgba(7, 9, 15, 0.94);
  border-top: 1px solid rgba(246, 241, 231, 0.14);
  max-height: 36vh; overflow: auto;
}
.notes p {
  margin: 0 auto; max-width: 78ch;
  font: 400 clamp(16px, 1.5vw, 22px)/1.6 "Noto Sans Devanagari", "Nirmala UI", "Anek", system-ui, sans-serif;
  letter-spacing: 0; text-transform: none; color: var(--ink);
  white-space: pre-line; user-select: text;
}

.overview {
  position: absolute; inset: 0;
  pointer-events: auto;
  background: rgba(5, 7, 12, 0.95);
  overflow: auto;
  padding: 44px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px;
  align-content: start;
}
.overview[hidden], .notes[hidden] { display: none; }
.overview button {
  all: unset; cursor: pointer; box-sizing: border-box;
  padding: 16px 18px; min-height: 96px;
  border: 1px solid rgba(246, 241, 231, 0.14); border-radius: 6px;
  display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-content: start;
}
.overview button:hover, .overview button:focus-visible { border-color: var(--amber); background: rgba(255, 180, 90, 0.07); }
.overview b { color: var(--amber); font-weight: 500; }
.overview span { font: 600 18px/1.2 "Anek", sans-serif; font-stretch: 108%; letter-spacing: 0; text-transform: none; color: var(--ink); }
.overview small { grid-column: 2; color: var(--faint); font-size: 10px; }

#loading {
  position: fixed; inset: 0; z-index: 10;
  display: grid; place-content: center; gap: 14px; text-align: center;
  background: var(--night);
  font: 500 12px/1.6 "Mono", ui-monospace, monospace; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--faint);
  transition: opacity 1.4s ease;
}
#loading.done { opacity: 0; pointer-events: none; }
#loading b { display: block; font: 640 30px/1 "Anek", sans-serif; font-stretch: 116%; letter-spacing: -0.01em; text-transform: none; color: var(--ink); }

/* On a phone held upright the stage is small: ask for landscape. */
.turn { display: none; position: absolute; left: 0; right: 0; top: 18px; text-align: center; color: var(--dim); }
@media (orientation: portrait) and (max-width: 700px) { .turn { display: block; } }

@media (prefers-reduced-motion: reduce) {
  .h .w > i, .r { transition-duration: 0.01s; transition-delay: 0s; }
}
