/* /end: the Jevtown end credits. Two modes. Without script or with reduced motion, the credits are one page you scroll,
   under a still of the night street. With motion (html.play, set by end.js) the street fills the screen and the credits
   roll one card at a time above it. Pixels scale by whole numbers only; no gradients, no glow, no rounded pixel art. */

.endpage { background: var(--bg); }
.endpage .end-controls { display: flex; gap: 8px; margin-left: auto; }
.endpage .end-controls .ghost-btn { padding: 8px 11px; font-size: 12.5px; }

.stage { position: relative; overflow: hidden; background: var(--bg); }
.stage canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.progress { display: none; }

/* ---------- the credits as text (static mode, and the base for play mode) ---------- */
.credits { max-width: 780px; margin: 0 auto; padding: 8px var(--pad) 40px; text-align: center; }
.card { padding: clamp(44px, 7vw, 72px) 0; border-top: 1px solid var(--line); }
.card:first-child { border-top: 0; padding-top: 28px; }
.card .eyebrow { margin-bottom: 18px; }
.px { font-family: "Pixel", var(--mono); font-weight: 400; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ember); line-height: 1; margin: 0; }
h1.px { font-size: clamp(56px, 15vw, 120px); }
.serifline { margin: 18px 0 0; font: 400 clamp(26px, 5vw, 40px)/1.1 var(--serif); color: var(--gold); }
.role { margin: 0 0 12px; font: 500 13px/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.name { margin: 0; font: 400 clamp(28px, 6vw, 44px)/1.08 var(--serif); color: var(--ink); text-wrap: balance; }
.name.big { font-size: clamp(34px, 8vw, 62px); }
.name a { color: inherit; text-decoration: underline; text-decoration-color: var(--ember); text-underline-offset: 6px; text-decoration-thickness: 2px; }
.huge { margin: 0; font: 500 clamp(72px, 22vw, 150px)/1 var(--mono); letter-spacing: -0.05em; color: var(--ink); }
.huge.serif { font: 400 clamp(64px, 17vw, 128px)/1 var(--serif); letter-spacing: -0.02em; color: var(--gold); margin-top: 14px; }
.small { max-width: 30em; margin: 16px auto 0; font-size: 15.5px; line-height: 1.5; color: var(--soft); text-wrap: balance; }
.src, .nums i, .honest i { display: block; margin-top: 6px; font: 500 11px/1.35 var(--mono); font-style: normal; letter-spacing: 0.02em; color: var(--dim); }

.nums { display: grid; gap: clamp(14px, 2.4vh, 26px); margin-top: 20px; }
.nums > div { display: grid; justify-items: center; }
.nums b { font: 500 clamp(46px, 13vw, 84px)/1 var(--mono); letter-spacing: -0.045em; color: var(--jev); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nums span { max-width: 26em; margin-top: 6px; font-size: 15px; line-height: 1.4; color: var(--soft); text-wrap: balance; }
.c-final .nums b, .card[data-scene="busy"] .nums b { color: var(--ink); }
.honest { max-width: 32em; margin: 22px auto 0; font-size: 14.5px; line-height: 1.45; color: var(--soft); text-wrap: balance; }
.credit { max-width: 32em; margin: 14px auto 0; font-size: 14px; line-height: 1.45; color: var(--ink); text-wrap: balance; }
.credit a { color: var(--jev); }

.handles { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font: 500 clamp(20px, 5.4vw, 30px)/1.25 var(--mono); letter-spacing: -0.02em; color: var(--ink); }
.handles li::before { content: "@"; color: var(--dim); }
.handles .dim { font-size: 0.5em; letter-spacing: 0.1em; text-transform: uppercase; margin-left: 6px; vertical-align: 0.3em; }

.minor { display: grid; gap: 8px; margin: 22px 0 0; }
.minor div { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 10px; font-size: 14.5px; }
.minor dt { font: 500 11.5px/1.9 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.minor dd { margin: 0; color: var(--soft); }

.c-twist .name.big { font-size: clamp(30px, 7vw, 54px); }
.theend { font-size: clamp(40px, 11vw, 76px); margin-bottom: 26px; }
.lab { max-width: 22em; margin: 14px auto 0; font: 400 clamp(21px, 4.6vw, 30px)/1.2 var(--serif); color: var(--soft); text-wrap: balance; }
.lab em { color: var(--gold); display: block; }
.soon { display: inline-block; margin: 18px 0 0; padding: 6px 10px; border: 1px solid var(--line); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.end-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 26px; }
.btn.alt { background: var(--panel); color: var(--ink); box-shadow: 0 4px 0 #000, inset 0 0 0 1px var(--line); }
.btn.alt:active { box-shadow: 0 0 0 #000, inset 0 0 0 1px var(--line); }
.again { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 22px 0 0; }
.again .ghost-btn { padding: 9px 12px; font-size: 12.5px; }
.end-foot { max-width: 780px; margin: 0 auto; padding: 28px var(--pad) 48px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.55; color: var(--dim); text-align: center; }
.end-foot a { color: var(--soft); }

/* static mode keeps a still of the street as a banner */
html.still .stage { height: var(--stage-h, 260px); border-bottom: 1px solid var(--line); }

/* ---------- play mode ---------- */
html.play, html.play body { height: 100%; overflow: hidden; }
html.play .navwrap { position: fixed; inset: 0 0 auto; background: transparent; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
html.play.rolling .primary { display: none; }
html.play .stage { position: fixed; inset: 0; z-index: 0; }
html.play .stage canvas { position: absolute; left: 0; top: 0; }
html.play .progress { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; height: 4px; background: var(--line); }
html.play .progress i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--ember); }
html.play .end-foot { display: none; }
html.play .credits { position: fixed; z-index: 2; left: 0; right: 0; top: var(--text-top, 64px); height: var(--text-h, 60vh); max-width: none; padding: 0 var(--pad); }
html.play .card { position: absolute; inset: 0; margin: 0 auto; max-width: 780px; padding: 0 var(--pad); border: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transform: translateY(24px); transition: opacity 0.3s steps(3), transform 0.3s steps(3), visibility 0s 0.3s; }
html.play .card.on { opacity: 1; visibility: visible; transform: none; transition: opacity 0.6s steps(6) 0.3s, transform 0.6s steps(6) 0.3s, visibility 0s 0.3s; }
html.play .card.off { transform: translateY(-24px); }
html.play .card .nums { margin-top: 14px; }
html.play .c-final { justify-content: safe center; }
html.play .c-twist .huge { opacity: 0; transition: opacity 0.6s steps(6) 2.1s; }
html.play .c-twist.on .huge { opacity: 1; }

/* a phone held upright: tighter, so three numbers fit above the street */
@media (max-width: 640px) {
  html.play .nums b { font-size: clamp(38px, 11.5vw, 56px); }
  html.play .nums span { font-size: 13.5px; margin-top: 3px; }
  html.play .nums i { font-size: 10px; margin-top: 3px; }
  html.play .card .small, html.play .honest { font-size: 14px; }
  html.play .huge { font-size: clamp(68px, 24vw, 110px); }
  .end-cta .btn { width: 100%; justify-content: center; }
}
@media (max-height: 700px) {
  html.play .nums { gap: 10px; }
  html.play .nums b { font-size: clamp(34px, 9vw, 52px); }
}
/* no transitions until the first card is up (and never in a frozen ?frame= view) */
html.play:not(.armed) .card, html.play:not(.armed) .c-twist .huge { transition: none !important; }
.again .ghost-btn { background: var(--bg); }
@media (max-width: 640px) {
  html.play .theend { margin-bottom: 16px; }
  html.play .c-final .name.big { font-size: 36px; }
  html.play .c-final .lab { font-size: 20px; margin-top: 8px; }
  html.play .c-final .soon { margin-top: 12px; }
  html.play .end-cta { gap: 12px 10px; margin-top: 18px; }
  html.play .end-cta .btn.alt { width: calc(50% - 5px); padding: 13px 8px; font-size: 14.5px; }
}
/* wide screens: numbers side by side, so a card of three still sits above the street */
@media (min-width: 900px) {
  .nums { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0 clamp(24px, 3vw, 48px); max-width: 1100px; margin-inline: auto; }
  html.play .credits .card { max-width: 1160px; }
  .nums b { font-size: clamp(46px, 5.4vw, 84px); }
}
html.play.done .credits { overflow-y: auto; }

/* Readability over the street: while the credits play, every line gets a hard 2px black pixel outline (no blur, no
   glow), and the small grey notes use a lighter grey (about 7:1 on the page background) at 12px or more. */
.endpage { --dim: #aaa191; }
html.play .card, html.play .card a { text-shadow: 2px 0 0 #000, -2px 0 0 #000, 0 2px 0 #000, 0 -2px 0 #000, 2px 2px 0 #000, -2px 2px 0 #000, 2px -2px 0 #000, -2px -2px 0 #000; }
.src, .nums i, .honest i, .minor dt { font-size: 12px; }
.soon { font-size: 12.5px; }
/* Buttons sit on their own solid backgrounds: no outline on their text. */
html.play .card .btn, html.play .card .btn *, html.play .card .ghost-btn, html.play .card .ghost-btn * { text-shadow: none; }

/* ---------- reading view ("Read every credit", reduced motion, no script) ----------
   A designed page, not a long list: stats sit in pixel-edged cards in a grid, numbers are sized to their column so
   they never collide, and the sections are tighter. */
html:not(.play) .credits { max-width: 920px; padding-bottom: 64px; }
html:not(.play) .card { padding: clamp(34px, 5vw, 56px) 0; }
html:not(.play) .nums {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 12px;
  margin-top: 22px;
  text-align: left;
}
html:not(.play) .nums > div {
  justify-items: start;
  align-content: start;
  padding: 18px 18px 16px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line), 0 4px 0 #000;
}
html:not(.play) .nums b { font-size: clamp(34px, 4.2vw, 50px); letter-spacing: -0.04em; white-space: nowrap; }
html:not(.play) .nums span { margin-top: 8px; font-size: 14.5px; text-wrap: pretty; }
html:not(.play) .nums i { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); width: 100%; }
html:not(.play) .huge { font-size: clamp(64px, 12vw, 120px); }
html:not(.play) .handles { font-size: clamp(18px, 3vw, 24px); gap: 4px; }
html:not(.play) .card .role { color: var(--jev); }
@media (max-width: 480px) {
  html:not(.play) .nums > div { padding: 16px 14px 14px; }
}
