:root {
  --paper: #f3efe6;
  --surface: #fffdf8;
  --ink: #16140f;
  --muted: #6b6559;
  --line: #d9d2c3;
  --tape: #ffd23f;
  --tape-ink: #16140f;
  --ok: #1f8a4c;
  --bad: #c2321f;
  --shirt: #d7382a;
  --brass: #d9a82b;
  --stone: #eadcbf;
  --stone-edge: #b59f79;
  --scene-dim: none;
  --ghost: grayscale(1);
  --radius: 14px;
  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12110e;
    --surface: #1c1a16;
    --ink: #f1ece1;
    --muted: #a39c8e;
    --line: #34302a;
    --ok: #4cc47f;
    --bad: #ff6b55;
    --shirt: #ff6a55;
    --stone: #4a4234;
    --stone-edge: #2a251d;
    /* Golden hour turns to dusk: same art, lower light. */
    --scene-dim: brightness(0.62) saturate(0.9);
    --ghost: grayscale(1) brightness(2.2);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 48px;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }

/* A railway track across the top: sleepers on turmeric, two steel rails. */
.rail-bar {
  width: calc(100% + 32px);
  height: 14px;
  margin: 0 -16px 24px;
  background:
    linear-gradient(var(--tape-ink) 0 0) 0 3px / 100% 2px no-repeat,
    linear-gradient(var(--tape-ink) 0 0) 0 9px / 100% 2px no-repeat,
    repeating-linear-gradient(90deg, rgb(22 20 15 / 0.55) 0 5px, transparent 5px 17px) 0 0 / 100% 100%,
    var(--tape);
}

main { width: 100%; max-width: 560px; }

/* Brand: a yellow station nameboard, Hindi over English like the real ones. */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  text-decoration: none;
  color: inherit;
  width: fit-content;
}
.board {
  display: grid;
  justify-items: center;
  padding: 3px 12px 5px;
  background: var(--tape);
  color: var(--tape-ink);
  border: 2px solid var(--tape-ink);
  border-radius: 6px;
  box-shadow: 0 2px 0 var(--tape-ink);
  line-height: 1;
}
.board small { font-size: 11px; font-weight: 700; letter-spacing: 0.02em; margin-bottom: 2px; }
.board b { font-size: 19px; font-weight: 800; letter-spacing: 0.16em; margin-right: -0.16em; }
.brand > span:last-child { font-size: 13px; color: var(--muted); line-height: 1.25; }

h1 {
  font-size: clamp(30px, 8.4vw, 44px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin: 0 0 10px;
  text-wrap: balance;
}
.lede { color: var(--muted); margin: 0 0 22px; text-wrap: pretty; }

.card {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.eyebrow {
  display: block;
  font: 700 11px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ─── Platform scene (landing + gone) ───────────────────────────────────── */

.scene {
  --h: clamp(270px, 78vw, 400px);
  position: relative;
  height: var(--h);
  width: max(100%, min(800px, 100vw - 48px));
  left: 50%;
  translate: -50% 0;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid var(--tape-ink);
  box-shadow: 0 4px 0 var(--tape-ink);
  background: #f2d7a0;
  margin: 4px 0 30px;
  isolation: isolate;
}
.scene-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 62% 58%;
  filter: var(--scene-dim);
}
/* Stone platform in the foreground: dark coping, pale lip, the yellow safety line. */
.slab {
  position: absolute;
  inset: auto 0 0;
  height: 22%;
  z-index: 2;
  background:
    linear-gradient(
      var(--stone-edge) 0 5px,
      color-mix(in srgb, var(--stone) 70%, white) 5px 11px,
      var(--tape) 11px 17px,
      transparent 17px
    ),
    repeating-linear-gradient(90deg, transparent 0 70px, rgb(0 0 0 / 0.06) 70px 72px),
    var(--stone);
  box-shadow: 0 -2px 0 rgb(0 0 0 / 0.15);
}
.lane {
  position: absolute;
  left: 0;
  width: 100%;
  pointer-events: none;
}
.train-lane { bottom: 13%; z-index: 1; }
.train {
  --th: calc(var(--h) * 0.4);
  height: var(--th);
  width: auto;
  max-width: none;
  filter: var(--scene-dim);
}
.walk-lane { bottom: 7%; z-index: 3; }
.walker {
  --wh: calc(var(--h) * 0.74);
  position: relative;
  width: calc(var(--wh) * 0.4944);
  height: var(--wh);
}
.walker img, .rester img { width: 100%; height: 100%; max-width: none; }
.walker::after, .rester::after {
  /* Contact shadow so the coolie stands on the stone instead of floating. */
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -3%;
  height: 7%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(40 25 5 / 0.35), transparent);
  z-index: -1;
}

.walk-lane { animation: stroll 17s linear infinite; }
.walker img { animation: bob 0.56s ease-in-out infinite; transform-origin: 50% 100%; }
.train-lane .train { animation: pass 13s cubic-bezier(0.45, 0, 0.3, 1) 1.2s infinite both; }

@keyframes stroll {
  from { transform: translateX(calc(var(--h) * -0.4)); }
  to { transform: translateX(100%); }
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1.2deg); }
  50% { transform: translateY(-3.5%) rotate(1.2deg); }
}
/* A train rolls through right to left, then the platform is quiet for a while. */
@keyframes pass {
  0% { transform: translateX(calc(100vw + 20px)); }
  42% { transform: translateX(calc(var(--th) * -3.4)); }
  100% { transform: translateX(calc(var(--th) * -3.4)); }
}

/* Gone: the coolie rests on a trunk with his chai while the train leaves. */
.scene.quiet { --h: clamp(250px, 68vw, 340px); }
.scene.quiet .train-lane .train { animation: depart 5.5s cubic-bezier(0.55, 0, 0.8, 0.4) 0.5s 1 both; }
.rester {
  --wh: calc(var(--h) * 0.6);
  position: absolute;
  right: 8%;
  bottom: 7%;
  z-index: 3;
  height: var(--wh);
  width: calc(var(--wh) * 0.829);
}
.rester img { animation: sip 4.5s ease-in-out infinite; transform-origin: 40% 100%; }
@keyframes depart {
  from { transform: translateX(6%); }
  to { transform: translateX(calc(var(--th) * -3.6)); }
}
@keyframes sip {
  0%, 70%, 100% { transform: rotate(0); }
  80%, 90% { transform: rotate(-1.5deg); }
}

/* ─── Steps (landing) ───────────────────────────────────────────────────── */

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 16px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; }
.steps li::before {
  /* Numbered like the brass badge on a coolie's armband. */
  content: counter(step);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font: 800 16px/1 var(--font);
  color: #3b2a06;
  background: radial-gradient(circle at 35% 30%, #ffe89a, var(--brass) 55%, #9c7414);
  box-shadow: inset 0 0 0 2px #7a5a10, 0 2px 0 var(--tape-ink);
}
.steps b { font-weight: 800; }
.steps p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.steps strong { display: block; font-size: 18px; line-height: 1.25; letter-spacing: -0.015em; padding-top: 5px; }

/* ─── Upload page ───────────────────────────────────────────────────────── */

.manifest { display: grid; gap: 10px; padding: 16px 18px; }
.manifest .eyebrow { margin: 0; }
.manifest p { margin: 0; font-size: 15px; color: var(--muted); }
.manifest p b { color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 12px 4px 4px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--tape) 22%, var(--surface));
  border: 1.5px solid color-mix(in srgb, var(--tape) 60%, var(--line));
  font-weight: 600;
  font-size: 15px;
}
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip i {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--shirt);
  color: #fff;
  font: normal 800 12px/1 var(--font);
}
.chip.channel i { background: var(--muted); color: var(--surface); }

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 190px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  padding: 22px;
  margin-bottom: 16px;
  transition: border-color 0.15s, background 0.15s, min-height 0.25s;
}
.drop img { width: 72px; margin-bottom: 8px; transition: transform 0.2s; }
.drop:hover, .drop.over { border-color: var(--ink); }
.drop:hover img, .drop.over img { transform: translateY(-3px) rotate(-3deg); }
.drop.over { background: color-mix(in srgb, var(--tape) 18%, var(--surface)); }
.drop strong { font-size: 20px; letter-spacing: -0.02em; }
.drop small { color: var(--muted); }
.drop input { display: none; }
.drop.compact { min-height: 0; flex-direction: row; gap: 12px; padding: 12px 16px; justify-content: flex-start; text-align: left; }
.drop.compact img { width: 40px; margin: 0; }
.drop.compact strong { font-size: 17px; }
.drop.compact small { display: none; }

/* Track: the coolie walks the platform as bytes move; trunks pile up at the far end. */
.track { padding: 14px 16px 12px; }
.rail {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: 124px;
  margin: 0 -2px 10px;
  border-bottom: 8px solid var(--stone);
  box-shadow: 0 3px 0 var(--tape);
}
.rail::before {
  /* Sleepers along the platform floor. */
  content: "";
  position: absolute;
  inset: auto 0 -8px;
  height: 8px;
  background: repeating-linear-gradient(90deg, var(--stone-edge) 0 3px, transparent 3px 22px);
  opacity: 0.5;
}
.path { position: relative; flex: 1; height: 100%; }
.runner {
  position: absolute;
  bottom: 0;
  left: calc(var(--p, 0) * (100% - 56px));
  width: 56px;
  height: 112px;
  transition: left 0.6s linear;
}
.runner img { width: 100%; height: 100%; max-width: none; transform-origin: 50% 100%; }
.runner.moving img { animation: bob 0.56s ease-in-out infinite; }
.pile { display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 2px; padding-left: 6px; flex: none; }
.pile .col { display: flex; flex-direction: column-reverse; }
.pile img { width: 34px; height: 26px; object-fit: contain; margin-top: -1px; transition: opacity 0.3s, filter 0.3s; }
.pile img.waiting { opacity: 0.3; filter: var(--ghost); }
.pile img.arrived { animation: land 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); }
.pile .more { align-self: flex-start; font: 700 12px/1 var(--mono); color: var(--muted); padding: 0 2px 4px; }
@keyframes land {
  from { transform: translateY(-18px) rotate(-8deg); opacity: 0.4; }
  to { transform: none; opacity: 1; }
}
.pct { font: 800 22px/1 var(--font); letter-spacing: -0.03em; color: var(--ink); }

.files { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.file {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.file .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file .meta { grid-column: 1; font: 13px/1.4 var(--mono); color: var(--muted); }
.file .meta.bad { color: var(--bad); }
.file .actions { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 6px; }
.bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width 0.2s; }
.file.done .bar i { background: var(--ok); }

button, .button {
  font: 600 16px/1 var(--font);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.primary {
  width: 100%;
  min-height: 56px;
  padding: 0 20px;
  background: var(--tape);
  color: var(--tape-ink);
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 3px 0 var(--tape-ink);
}
.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--tape-ink); }
.primary:disabled { opacity: 0.45; cursor: default; transform: none; box-shadow: 0 3px 0 var(--tape-ink); }
.ghost {
  min-height: 36px;
  padding: 0 12px;
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
  font-size: 14px;
}
.ghost:hover { border-color: var(--ink); }
.icon { width: 36px; padding: 0; font-size: 18px; }

.summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font: 13px/1.4 var(--mono);
  color: var(--muted);
  margin: 0;
}
.summary { flex-wrap: wrap; row-gap: 2px; }
.summary span { white-space: nowrap; }
.summary span:last-child { margin-left: auto; }

.notice { font-size: 14px; color: var(--muted); margin: 12px 0 0; text-align: center; text-wrap: pretty; }
.error { color: var(--bad); font-weight: 600; }

/* ─── Arrival (finished / ready) ────────────────────────────────────────── */

.arrival { display: grid; justify-items: center; text-align: center; padding-top: 4px; }
.arrival h1, .arrival .lede { max-width: 30ch; }
.waver {
  position: relative;
  width: 150px;
  height: 286px;
  margin-bottom: 14px;
  animation: arrive 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.waver img { width: 100%; height: 100%; max-width: none; transform-origin: 50% 100%; animation: sway 2.6s ease-in-out 0.6s 3; }
.waver::after {
  content: "";
  position: absolute;
  left: -30%;
  right: -30%;
  bottom: -10px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--tape) 70%, transparent), transparent);
  z-index: -1;
}
@keyframes arrive {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes sway {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(-2deg); }
  60% { transform: rotate(1.5deg); }
}

.report { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; text-align: left; }
.report li {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 2px 12px;
  align-items: center;
  padding: 11px 0;
  border-top: 1.5px solid var(--line);
}
.report li:first-child { border-top: 0; padding-top: 2px; }
.report .mark {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font: 800 15px/1 var(--font);
  color: #fff;
  background: var(--ok);
}
.report .channel .mark { background: var(--tape); color: var(--tape-ink); }
.report .failed .mark { background: var(--bad); }
.report .pending .mark { background: var(--line); color: var(--ink); }
.report b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.report small { font-size: 14px; color: var(--muted); line-height: 1.3; }
.report .failed small { color: var(--bad); }
.done-card { margin-top: 8px; }
.done-card .linkbox { margin-top: 14px; }

.linkbox {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.linkbox input {
  flex: 1;
  min-width: 0;
  font: 14px var(--mono);
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
}

/* Download page header: title beside a small waving coolie. */
.ready-head { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; margin-bottom: 18px; }
.ready-head h1 { font-size: clamp(26px, 7vw, 38px); }
.ready-head .lede { margin: 0; }
.ready-head img { width: 64px; height: 122px; animation: arrive 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }

.gone-copy { text-align: center; }
.gone-copy h1, .gone-copy .lede { margin-inline: auto; max-width: 28ch; }

code {
  font: 0.92em var(--mono);
  background: color-mix(in srgb, var(--tape) 35%, transparent);
  padding: 1px 6px;
  border-radius: 6px;
}

.hidden { display: none !important; }

footer { margin-top: 32px; font-size: 13px; color: var(--muted); text-align: center; }

@media (min-width: 700px) {
  body { padding-bottom: 72px; }
  .rail-bar { margin-bottom: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .walk-lane { transform: translateX(58%); }
  .train-lane .train { transform: translateX(4%); }
  .scene.quiet .train-lane .train { transform: translateX(-12%); }
}
