/* Hotline Huang landing. Pixel rules: Silkscreen only, font sizes in multiples
   of 8 px (one font pixel = size / 8), spacing on an 8 px grid with 4 px details,
   no rounded corners, no blur, hard offset shadows only, stepped animation. */

@font-face {
  font-family: "Silkscreen";
  src: url("../assets/fonts/Silkscreen-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Silkscreen";
  src: url("../assets/fonts/Silkscreen-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0B0A0F;
  --ink: #E9E5EE;
  --dim: #8F8A9B;
  --line: #24212C;
  --deep: #16141B;
  --pink: #FF2F7A;
  --green: #8CFF2E;
  --gutter: 16px;
  --pixel: "Silkscreen", ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  border-radius: 0;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/24px var(--pixel);
  text-transform: uppercase;
  overflow-x: hidden;
  -webkit-font-smoothing: none;
}

@supports (overflow: clip) {
  body {
    overflow-x: clip;
  }
}

img,
canvas {
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

a {
  color: var(--green);
}

a:focus-visible,
button:focus-visible {
  outline: 4px solid var(--ink);
  outline-offset: 4px;
}

::selection {
  background: var(--pink);
  color: var(--bg);
}

.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;
}

/* ---- stepped motion ---------------------------------------------------- */

.blink {
  animation: blink 1s steps(1, end) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.js-reveal .reveal {
  clip-path: inset(-32px 100% -32px -32px);
}

.js-reveal .reveal.is-in {
  animation: wipe 560ms steps(7, end) forwards;
}

@keyframes wipe {
  from {
    clip-path: inset(-32px 100% -32px -32px);
  }
  to {
    clip-path: inset(-32px -32px -32px -32px);
  }
}

/* ---- typed text ---------------------------------------------------------- */

.type {
  display: block;
  position: relative;
}

.type__live {
  display: none;
}

.js-type .type__ghost {
  color: transparent;
}

.js-type .type__live {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  user-select: none;
}

.js-type [data-state="typing"] .type__live::after {
  content: "_";
  animation: blink 0.5s steps(1, end) infinite;
}

/* ---- first screen ---------------------------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding: 16px var(--gutter) 0;
  overflow: hidden;
}

.hero__stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 32px 0 0;
}

.hero__copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.logo {
  margin: 0;
  font-weight: 700;
}

.logo__text {
  display: block;
  font-size: 40px;
  line-height: 48px;
  color: var(--pink);
  text-shadow: 0.125em 0.125em 0 var(--green);
}

.logo__l2 {
  display: block;
  padding-left: 1em;
}

.logo.is-drawn .logo__text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.logo__canvas {
  display: block;
}

/* What the project is, said at once: what you earn, then what you do. */
.hero__pitch {
  margin: 0;
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
  text-shadow: 0.125em 0.125em 0 var(--bg);
}

.hero__pitch span {
  display: block;
  color: var(--green);
  text-wrap: balance;
}

.hero__pitch .hero__pitch-2 {
  color: var(--ink);
}

.hero__sub {
  margin: -8px 0 0;
  max-width: 36em;
  /* One font pixel of page colour all round: the copy lies over the city. */
  text-shadow: 2px 0 0 var(--bg), -2px 0 0 var(--bg), 0 2px 0 var(--bg), 0 -2px 0 var(--bg);
}

.hero__sub a {
  white-space: nowrap;
}

.hero__play {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
}

.play {
  display: inline-block;
  padding: 16px 40px;
  background: var(--pink);
  color: var(--bg);
  font-size: 32px;
  line-height: 32px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 8px 8px 0 0 var(--green);
}

.play:hover {
  transform: translate(-4px, -4px);
  box-shadow: 12px 12px 0 0 var(--green);
}

.play:active {
  transform: translate(4px, 4px);
  box-shadow: 4px 4px 0 0 var(--green);
}

/* Key art. Mobile: a full-bleed band with the night city behind Huang.
   Desktop: the city covers the whole first screen (see the media query).
   --k is the size of one key-art pixel; the city is drawn at the same size and hangs
   on the heap under Huang's feet (site/city.js, site/widgets.js). The heap rests on the
   token row's top line 16 pixels below the key art, so the bottom paddings keep exactly
   that much room. The top padding leaves sky above his head for the tower's sign. */
.keyart {
  --k: 3px;
  position: relative;
  margin: 0 calc(-1 * var(--gutter));
  min-height: 336px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: calc(48 * var(--k)) var(--gutter) calc(16 * var(--k));
}

.keyart__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
}

/* Scanlines: only here, on the key-art background. */
.keyart__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(11, 10, 15, 0.3) 2px 4px);
}

.keyart__bg .diorama {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
}

/* Huang stands a little left of the band's centre (by half this margin); the tower and
   the heap follow him. */
.keyart__fg {
  position: relative;
  z-index: 1;
  display: block;
  width: max-content;
  margin-right: 20vw;
}

.keyart__canvas {
  display: block;
  width: calc(62 * var(--k));
  height: calc(80 * var(--k));
}

/* Token row. Its top line runs edge to edge: it is the ground the city stands on. */
.ledger {
  position: relative;
  z-index: 1;
  display: grid;
  border-top: 4px solid var(--line);
}

.ledger::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -50vw;
  right: -50vw;
  height: 4px;
  background: var(--line);
}

.ledger__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  padding: 16px 0;
  min-width: 0;
}

.ledger__item + .ledger__item {
  border-top: 4px solid var(--line);
}

.ledger__label {
  color: var(--dim);
}

.ledger__ca {
  min-width: 0;
  font-family: var(--mono);
  font-size: 16px;
  text-transform: none;
  word-break: break-all;
  color: var(--ink);
  user-select: all;
}

.ledger__ca.is-tba {
  font-family: var(--pixel);
  text-transform: uppercase;
  user-select: auto;
}

.btn {
  margin: 0;
  padding: 4px 12px;
  background: transparent;
  color: var(--green);
  border: 4px solid var(--green);
  font: 700 16px/24px var(--pixel);
  text-transform: uppercase;
  cursor: pointer;
}

.btn:hover:not(:disabled) {
  background: var(--green);
  color: var(--bg);
}

.btn:disabled {
  color: var(--dim);
  border-color: var(--line);
  cursor: not-allowed;
}

.ledger__link {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.ledger__link:hover {
  color: var(--bg);
  background: var(--green);
}

.ledger__link[aria-disabled="true"] {
  color: var(--dim);
  text-decoration: none;
  background: none;
  cursor: not-allowed;
}

.ledger__value {
  font-weight: 700;
  font-size: 24px;
  line-height: 24px;
  color: var(--green);
}

.ledger__sub {
  color: var(--dim);
}

/* ---- story beats --------------------------------------------------------------- */

.beat,
.chapters {
  width: min(100% - 32px, 1200px);
  margin-inline: auto;
  padding-top: 96px;
}

.kicker {
  margin: 0 0 16px;
  color: var(--pink);
}

.title {
  margin: 0 0 24px;
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
  color: var(--pink);
  text-shadow: 0.125em 0.125em 0 var(--green);
}

.beat__bridge {
  margin: 0;
  max-width: 40em;
  color: var(--dim);
}

.facts {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  display: grid;
  gap: 16px;
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
}

.facts li {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 24px;
}

.facts time {
  color: var(--green);
}

.beat--call {
  display: grid;
  gap: 24px;
  align-items: center;
}

.call__portrait {
  display: block;
  width: 192px;
  height: 192px;
  background: var(--deep);
  box-shadow: 8px 8px 0 0 var(--pink);
}

.call__head {
  margin: 0 0 16px;
  color: var(--dim);
}

.call__head .blink {
  color: var(--pink);
  font-weight: 700;
}

.call__line {
  margin: 0;
  color: var(--ink);
}

/* Chapters timeline: one cell per day, Nov 12 to Nov 23. */
.timeline {
  margin: 0 0 48px;
}

.timeline__days {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 4px;
}

.timeline__days li {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--line);
  color: var(--bg);
  font-weight: 700;
}

.timeline__days li.is-ch {
  background: var(--accent);
}

.timeline__ends {
  margin: 8px 0 0;
  display: flex;
  justify-content: space-between;
  color: var(--dim);
}

.chapters__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 48px 32px;
}

.chapter {
  min-width: 0;
}

.chapter__view {
  position: relative;
  height: 288px;
  overflow: hidden;
  background: var(--deep);
  border-bottom: 4px solid var(--accent);
}

.chapter__view .diorama {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
}

.chapter__meta {
  margin: 16px 0 0;
  color: var(--accent);
}

.chapter__name {
  margin: 8px 0;
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
}

.chapter__text {
  margin: 0 0 16px;
  color: var(--dim);
}

.swatches {
  display: flex;
  gap: 4px;
}

.swatches i {
  display: block;
  width: 24px;
  height: 16px;
}

.beat--finale {
  display: grid;
  gap: 24px;
  align-items: end;
}

.finale__sprite {
  display: block;
  width: 128px;
  height: 136px;
}

.title--xl {
  font-size: 32px;
  line-height: 40px;
}

.howto__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 24px;
}

.howto__list li {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
}

.howto__n {
  font-size: 24px;
  line-height: 24px;
  font-weight: 700;
  color: var(--pink);
  text-shadow: 0.125em 0.125em 0 var(--green);
}

.howto__list b {
  color: var(--green);
  font-weight: 700;
}

.reward__lead {
  margin: 0;
  max-width: 40em;
}

.reward__rules {
  list-style: none;
  margin: 24px 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-width: 48em;
}

.reward__rules li {
  position: relative;
  padding-left: 24px;
  color: var(--dim);
}

.reward__rules li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  background: var(--green);
}

.reward__now {
  margin: 0;
  padding: 16px 0;
  border-top: 4px solid var(--line);
  border-bottom: 4px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}

.reward__num {
  font-weight: 700;
  font-size: 24px;
  line-height: 24px;
  color: var(--green);
}

.reward__upd {
  color: var(--dim);
}

.footer {
  width: min(100% - 32px, 1200px);
  margin: 96px auto 0;
  padding: 32px 0 48px;
  border-top: 4px solid var(--line);
  color: var(--dim);
}

.footer p {
  margin: 0 0 16px;
  max-width: 48em;
}

.footer .footer__small {
  margin: 0;
  color: #4A4659;
}

/* ---- tablet ------------------------------------------------------------------- */

@media (min-width: 720px) {
  :root {
    --gutter: 32px;
  }

  .logo__text {
    font-size: 64px;
    line-height: 72px;
  }

  .hero__pitch {
    font-size: 32px;
    line-height: 40px;
  }

  .keyart {
    --k: 4px;
  }

  .title {
    font-size: 32px;
    line-height: 40px;
  }

  .title--xl {
    font-size: 48px;
    line-height: 56px;
  }

  .facts {
    font-size: 32px;
    line-height: 40px;
  }

  .beat--call,
  .beat--finale {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 48px;
  }

  .call__portrait {
    width: 256px;
    height: 256px;
  }

  .call__line {
    font-size: 24px;
    line-height: 32px;
  }

  .finale__sprite {
    width: 192px;
    height: 204px;
  }

  .chapters__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reward__lead {
    font-size: 24px;
    line-height: 32px;
  }

  .beat,
  .chapters {
    width: min(100% - 64px, 1200px);
    padding-top: 128px;
  }

  .footer {
    width: min(100% - 64px, 1200px);
  }
}

/* ---- desktop: the city becomes the whole first screen -------------------------------- */

@media (min-width: 1024px) {
  .hero {
    padding: 24px 48px 0;
  }

  .hero__stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 48px;
    padding: 48px 0 32px;
  }

  .hero__copy {
    align-self: center;
  }

  /* Beside the key art the column is narrow: each pitch line stays on one row. */
  .hero__pitch {
    font-size: 24px;
    line-height: 32px;
  }

  .keyart {
    position: static;
    margin: 0;
    min-height: 0;
    padding: 0 0 calc(8 * var(--k));
    display: block;
  }

  /* Off the right edge, so the tower and the far slope of the heap are in view. */
  .keyart__fg {
    margin-right: calc(24 * var(--k));
  }

  .ledger {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.2fr);
  }

  .ledger__item {
    padding: 16px 24px;
  }

  .ledger__item:first-child {
    padding-left: 0;
  }

  .ledger__item + .ledger__item {
    border-top: 0;
    border-left: 4px solid var(--line);
  }

  .facts {
    font-size: 40px;
    line-height: 48px;
  }

  .title--xl {
    font-size: 64px;
    line-height: 72px;
  }
}

@media (min-width: 1100px) {
  .chapters__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1320px) {
  .hero__pitch {
    font-size: 32px;
    line-height: 40px;
  }
}

/* A short desktop window: less air over the logo (the logo itself also steps down
   in site/widgets.js), so the first screen still ends with the token row. */
@media (min-width: 1024px) and (max-height: 800px) {
  .hero__stage {
    padding-top: 24px;
  }
}

/* ---- reduced motion: everything holds still ------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .blink,
  .js-type .type__live::after {
    animation: none !important;
  }

  .js-reveal .reveal,
  .js-reveal .reveal.is-in {
    clip-path: none;
    animation: none;
  }

  .play:hover,
  .play:active {
    transform: none;
  }
}
