/* Heroes in a Hurry landing page. Everything is laid out in game pixels: --p is one of them for the page (art, spacing),
   --q for screenshots (one screen pixel on phones so a 320 px view fits), --hu for the seaside band up top. All
   three are whole numbers of CSS pixels at every width, so the art is only ever scaled by integers.
   Images carry their native size as --w / --h (site/tools/pack.py stamps them). */
/* Jersey 10 (SIL OFL): a 10 px pixel face, so type is only ever set at 20 / 30 / 40 px and stays on its grid. */
@font-face {
  font-family: "Jersey 10";
  src: url(/site/fonts/Jersey10.woff2) format("woff2");
  font-display: swap;
}
:root {
  --p: 2px;
  --q: 1px;
  --hu: 2px;
  --logo: 2px;
  --fs: 20px;
  --ink: #141b1b;
  --navy: #18202c;
  --deep: #0f151d;
  --cream: #f8f0d0;
  --gold: #ffd84a;
  --dim: #9aa8a4;
  --rust: #a8432a;
  --paper-ink: #2a2418;
  --blue: #3c7ad0;
  --sky: #9fd8ff;
}
@media (min-width: 700px) {
  :root {
    --q: 2px;
  }
}
@media (min-width: 1600px) {
  :root {
    --hu: 3px;
    --logo: 3px;
  }
}
@media (min-width: 2560px) {
  :root {
    --p: 3px;
    --q: 3px;
    --hu: 4px;
    --logo: 4px;
    --fs: 30px;
  }
}
@media (min-width: 3840px) {
  :root {
    --p: 4px;
    --q: 4px;
    --hu: 6px;
    --logo: 6px;
    --fs: 40px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--deep);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  color: var(--cream);
  font: 400 var(--fs) / 1.2 "Jersey 10", ui-monospace, "Courier New", monospace;
  /* a sparse dither over the deep sea colour */
  background:
    repeating-conic-gradient(rgba(255, 255, 255, 0.035) 0 25%, transparent 0 100%) 0 0 / calc(4 * var(--p)) calc(4 * var(--p)),
    var(--deep);
  overflow-wrap: break-word;
}
img {
  image-rendering: pixelated;
  max-width: none;
}
/* art in page pixels (--k: an extra whole multiplier) */
.u {
  width: calc(var(--w) * var(--p) * var(--k, 1));
  height: calc(var(--h) * var(--p) * var(--k, 1));
  flex: none;
}
p {
  margin: 0;
}
a {
  color: var(--gold);
}
:focus-visible {
  outline: calc(1 * var(--p)) solid var(--gold);
  outline-offset: calc(2 * var(--p));
}
.skip {
  position: absolute;
  left: calc(4 * var(--p));
  top: calc(-40 * var(--p));
  z-index: 10;
  padding: calc(3 * var(--p)) calc(6 * var(--p));
  background: var(--ink);
  color: var(--cream);
}
.skip:focus {
  top: calc(4 * var(--p));
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- the seaside band: the title screen, rebuilt ---- */
.hero {
  position: relative;
  height: calc(270 * var(--hu));
  overflow: hidden;
  background: #5cb0ea url(/site/img/ui/scene.png) 50% 100% / auto calc(270 * var(--hu)) repeat-x;
  image-rendering: pixelated;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(26 * var(--hu)) calc(8 * var(--hu)) 0;
  text-align: center;
}
@media (max-width: 699px) {
  /* a phone sees a slice of the scene: the one with the sun in it */
  .hero {
    background-position: 76% 100%;
    padding-top: calc(30 * var(--hu));
  }
}
.hero h1 {
  position: relative;
  margin: 0;
  line-height: 0;
  animation: bob 2.6s ease-in-out infinite;
}
/* The sign hangs on two ropes from the top of the hero to its brackets (the art's rope anchors: x 6 and 125, the
   brackets' tops at y 30; src/ui/logo.ts SIGN_ANCHORS), the ropes running up past the top and clipped there. */
.hero h1::before,
.hero h1::after {
  content: "";
  position: absolute;
  top: calc(30 * var(--logo) - 100vh);
  height: 100vh;
  width: calc(4 * var(--logo));
  background: url(/site/img/ui/rope.png) 0 0 / calc(4 * var(--logo)) calc(4 * var(--logo)) repeat-y;
  image-rendering: pixelated;
}
.hero h1::before {
  left: calc(4 * var(--logo));
}
.hero h1::after {
  left: calc(123 * var(--logo));
}
.hero .logo {
  width: calc(var(--w) * var(--logo));
  height: calc(var(--h) * var(--logo));
  filter: drop-shadow(calc(1 * var(--logo)) calc(2 * var(--logo)) 0 rgba(20, 27, 27, 0.35));
}
.hu {
  width: calc(var(--w) * var(--hu));
  height: calc(var(--h) * var(--hu));
  flex: none;
}
.hero .isle {
  margin-top: calc(8 * var(--hu));
}
.tagline {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(3 * var(--hu)) calc(5 * var(--hu));
  margin: calc(9 * var(--hu)) 0 calc(10 * var(--hu));
}
@keyframes bob {
  50% {
    transform: translateY(calc(2 * var(--logo)));
  }
}

/* The big button: a red slab drawn like the game's ribbons (lit top edge, shaded foot, ink outline). */
.play {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: calc(6 * var(--b));
  --b: var(--hu);
  padding: calc(7 * var(--b)) calc(16 * var(--b)) calc(8 * var(--b)) calc(12 * var(--b));
  background: #d0463c;
  box-shadow:
    inset 0 calc(1 * var(--b)) 0 #ff9a80,
    inset 0 calc(-2 * var(--b)) 0 #9a2c30,
    0 0 0 calc(1 * var(--b)) var(--ink),
    0 calc(4 * var(--b)) 0 calc(1 * var(--b)) var(--ink),
    0 calc(4 * var(--b)) 0 0 #6e1c24;
  text-decoration: none;
  line-height: 0;
}
.play img {
  width: calc(var(--w) * var(--b));
  height: calc(var(--h) * var(--b));
}
.play .arrow {
  --k: 2;
  width: calc(var(--w) * var(--b) * 2);
  height: calc(var(--h) * var(--b) * 2);
  animation: nudge 0.52s steps(1) infinite;
}
@keyframes nudge {
  50% {
    transform: translateX(calc(2 * var(--b)));
  }
}
.play:hover,
.play:focus-visible {
  background: #e85a48;
}
.play:active {
  transform: translateY(calc(3 * var(--b)));
  box-shadow:
    inset 0 calc(1 * var(--b)) 0 #ff9a80,
    inset 0 calc(-2 * var(--b)) 0 #9a2c30,
    0 0 0 calc(1 * var(--b)) var(--ink),
    0 calc(1 * var(--b)) 0 calc(1 * var(--b)) var(--ink);
}
.hero .note {
  margin-top: calc(11 * var(--hu));
  max-width: calc(250 * var(--hu));
  padding: calc(2 * var(--hu)) calc(6 * var(--hu));
  font-size: calc(10 * var(--hu));
  color: #fff4c8;
  background: rgba(16, 22, 30, 0.82);
  box-shadow:
    0 0 0 calc(1 * var(--hu)) var(--ink),
    inset 0 0 0 calc(1 * var(--hu)) rgba(248, 240, 208, 0.25);
}
/* a hero strolls along the sand chasing the golden crow, both facing the way they go (left to right) */
.walker {
  position: absolute;
  left: 0;
  bottom: calc(13 * var(--hu));
  display: flex;
  align-items: flex-end;
  gap: calc(10 * var(--hu));
  animation: stroll 48s linear infinite;
  pointer-events: none;
}
@keyframes stroll {
  from {
    transform: translateX(-12vw);
  }
  to {
    transform: translateX(112vw);
  }
}
/* the dark strip under the title screen */
.strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 calc(12 * var(--p));
  padding: calc(3 * var(--p)) calc(8 * var(--p));
  background: var(--ink);
  border-top: calc(1 * var(--p)) solid #3c4a46;
  color: var(--dim);
  text-align: center;
}

/* ---- sections ---- */
main {
  display: block;
}
.wrap {
  width: min(100% - calc(20 * var(--p)), calc(520 * var(--p)));
  margin: 0 auto;
}
section {
  padding-top: calc(40 * var(--p));
}
h2 {
  margin: 0 0 calc(16 * var(--p));
  text-align: center;
  line-height: 0;
}
h2 .lg {
  display: none;
}
@media (min-width: 700px) {
  h2 .lg {
    display: inline;
  }
  h2 .sm {
    display: none;
  }
}
h3 {
  margin: 0;
  line-height: 0;
  font-size: inherit;
}
b,
dt {
  font-weight: 400;
}
small {
  font-size: inherit;
}
.k2 {
  --k: 2;
}
.dim {
  color: var(--dim);
}
/* the one loud line: the body face doubled, still on its pixel grid */
.big {
  font-size: calc(2 * var(--fs));
  line-height: 1.1;
  text-align: center;
  text-wrap: balance;
}

/* panels: the game's parchment and dialog boxes as border images */
.parch {
  border: calc(8 * var(--p)) solid transparent;
  border-image: url(/site/img/ui/parchment.png) 8 fill / calc(8 * var(--p)) round;
  image-rendering: pixelated;
  color: var(--paper-ink);
}
.box {
  border: calc(4 * var(--p)) solid transparent;
  border-image: url(/site/img/ui/box.png) 4 fill / calc(4 * var(--p)) stretch;
  image-rendering: pixelated;
  padding: calc(6 * var(--p)) calc(8 * var(--p)) calc(8 * var(--p));
}
.frame {
  border: calc(8 * var(--p)) solid transparent;
  border-image: url(/site/img/ui/frame-blue.png) 8 fill / calc(8 * var(--p)) stretch;
  image-rendering: pixelated;
}

/* the pitch and the eight heroes on their grass */
.pitch {
  padding-top: calc(30 * var(--p));
}
.pitch .big {
  max-width: calc(400 * var(--p));
  margin: 0 auto;
}
.heroes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(18 * var(--p)) calc(6 * var(--p));
  margin-top: calc(30 * var(--p));
}
.heroes .pad {
  display: grid;
  place-items: center;
  width: calc(44 * var(--p));
  height: calc(26 * var(--p));
  /* the select screen's grass disc */
  background: radial-gradient(closest-side, #7ad068 0 62%, #4aa850 62% 80%, #2c7a44 80% 99%, transparent 100%);
}
.heroes .pad img {
  --k: 2;
  margin-top: calc(-14 * var(--p));
}
.heroes .pad:nth-child(even) {
  transform: translateY(calc(8 * var(--p)));
}

/* the run in three beats */
#run {
  padding-top: calc(34 * var(--p));
}
.beats {
  display: grid;
  margin: 0;
  padding: calc(4 * var(--p)) 0;
  list-style: none;
  text-align: center;
}
.beats li {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: calc(6 * var(--p));
  padding: calc(10 * var(--p)) calc(8 * var(--p));
}
.beats li + li {
  border-top: calc(1 * var(--p)) dashed #a89a80;
}
@media (min-width: 900px) {
  .beats {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .beats li + li {
    border-top: 0;
    border-left: calc(1 * var(--p)) dashed #a89a80;
  }
}
.beats .art {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: calc(6 * var(--p));
  height: calc(66 * var(--p));
}
.beats .art img {
  --k: 2;
}
.beats p {
  max-width: calc(130 * var(--p));
}
.glint {
  position: relative;
  line-height: 0;
}
.glint .spark {
  position: absolute;
  left: calc(12 * var(--p));
  top: calc(-18 * var(--p));
}
.clock {
  padding: calc(4 * var(--p)) calc(7 * var(--p)) calc(3 * var(--p));
  background: var(--navy);
  box-shadow:
    inset 0 0 0 calc(1 * var(--p)) var(--cream),
    0 0 0 calc(1 * var(--p)) var(--ink);
  line-height: 0;
}
.clock img {
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0.25;
  }
}
.gems {
  display: flex;
  align-items: center;
  gap: calc(3 * var(--p));
  min-height: calc(16 * var(--p));
}

/* screenshots: native size times a whole number, cropped (never squeezed) when the window is narrower */
.shot {
  display: flex;
  justify-content: center;
  overflow: hidden;
  background: var(--ink);
  line-height: 0;
}
/* the centrepiece: 640 game px wide, as many whole screen pixels per pixel as the window holds */
#chaos {
  padding-top: calc(44 * var(--p));
}
.screen {
  --bq: 1px;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
}
.screen .frame {
  width: min(100%, 640 * var(--bq) + 16 * var(--p));
  box-shadow: 0 calc(6 * var(--p)) 0 rgba(0, 0, 0, 0.35);
}
.screen img {
  width: calc(var(--w) * var(--bq));
  height: calc(var(--h) * var(--bq));
  flex: none;
}
@media (min-width: 1280px) {
  .screen {
    --bq: 2px;
  }
}
@media (min-width: 2560px) {
  .screen {
    --bq: 3px;
  }
}
@media (min-width: 3840px) {
  .screen {
    --bq: 5px;
  }
}
figcaption {
  margin-top: calc(12 * var(--p));
  padding: 0 calc(10 * var(--p));
  text-align: center;
  color: var(--dim);
}

/* the chart, mostly under cloud */
.chart {
  margin: 0;
  display: grid;
  justify-items: center;
}
.sea {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  max-width: 100%;
  line-height: 0;
  box-shadow:
    0 0 0 calc(1 * var(--p)) var(--paper-ink),
    0 0 0 calc(3 * var(--p)) #c0c0b0,
    0 0 0 calc(4 * var(--p)) var(--ink);
  --k: 1;
}
@media (min-width: 800px) {
  .sea {
    --k: 2;
  }
}
.mark {
  position: absolute;
  --k: 1;
}
.mark.start {
  left: 29%;
  top: 46%;
}
.mark.q1 {
  left: 8%;
  top: 44%;
}
.mark.q2 {
  left: 80%;
  top: 40%;
}
.mark.q3 {
  left: 62%;
  top: 70%;
}
.cloud {
  position: absolute;
  animation: drift 26s ease-in-out infinite alternate;
}
.c1 {
  left: 2%;
  top: 6%;
}
.c2 {
  left: 30%;
  top: 2%;
  animation-duration: 34s;
  animation-direction: alternate-reverse;
}
.c3 {
  left: 58%;
  top: 14%;
  animation-duration: 30s;
}
.c4 {
  left: 6%;
  top: 60%;
  animation-duration: 38s;
}
.c5 {
  left: 64%;
  top: 56%;
  animation-direction: alternate-reverse;
}
@keyframes drift {
  to {
    transform: translateX(calc(14 * var(--p) * var(--k)));
  }
}
/* three postcards, pinned out of line */
.cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(14 * var(--p)) calc(16 * var(--p));
  margin: calc(24 * var(--p)) 0 0;
  padding: 0;
  list-style: none;
}
.cards li {
  position: relative;
  width: calc(128 * var(--p));
  padding: calc(8 * var(--p)) calc(8 * var(--p)) calc(7 * var(--p));
  background: #e8e4d0;
  color: var(--paper-ink);
  text-align: center;
  box-shadow:
    0 0 0 calc(1 * var(--p)) var(--ink),
    calc(3 * var(--p)) calc(4 * var(--p)) 0 rgba(0, 0, 0, 0.4);
}
.cards li::before {
  /* the pin */
  content: "";
  position: absolute;
  left: calc(50% - 3 * var(--p));
  top: calc(-3 * var(--p));
  width: calc(6 * var(--p));
  height: calc(6 * var(--p));
  background: #d0463c;
  box-shadow:
    inset calc(2 * var(--p)) calc(2 * var(--p)) 0 #ff9a80,
    0 0 0 calc(1 * var(--p)) var(--ink);
}
.cards img {
  display: block;
  box-shadow: 0 0 0 calc(1 * var(--p)) var(--ink);
}
.cards p {
  margin-top: calc(7 * var(--p));
}
@media (min-width: 700px) {
  .cards li:nth-child(2) {
    top: calc(12 * var(--p));
  }
  .cards {
    padding-bottom: calc(12 * var(--p));
  }
}
@media (max-width: 699px) {
  .cards li:nth-child(odd) {
    left: calc(-10 * var(--p));
  }
  .cards li:nth-child(even) {
    left: calc(10 * var(--p));
  }
}

/* couch and online */
.duo {
  display: grid;
  gap: calc(10 * var(--p));
}
@media (min-width: 900px) {
  .duo {
    grid-template-columns: 1fr 1fr;
  }
}
.box h3 {
  margin-bottom: calc(6 * var(--p));
}
.box p + p {
  margin-top: calc(6 * var(--p));
}
.pads {
  display: flex;
  flex-wrap: wrap;
  gap: calc(4 * var(--p));
  margin: calc(8 * var(--p)) 0 0;
  padding: 0;
  list-style: none;
}
.pads li {
  padding: calc(3 * var(--p)) calc(4 * var(--p));
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 calc(1 * var(--p)) var(--ink);
  line-height: 0;
}

/* the way out: the shore again */
.outro {
  margin-top: calc(44 * var(--p));
  padding: calc(26 * var(--hu)) calc(8 * var(--p)) calc(64 * var(--hu));
  display: grid;
  justify-items: center;
  gap: calc(12 * var(--hu));
  background: #c4ecfa url(/site/img/ui/scene.png) 30% 100% / auto calc(270 * var(--hu)) repeat-x;
  image-rendering: pixelated;
  border-top: calc(1 * var(--p)) solid var(--ink);
  overflow: hidden;
}
.outro .big {
  color: #fff4c8;
  text-shadow:
    calc(1 * var(--p)) 0 0 var(--ink),
    calc(-1 * var(--p)) 0 0 var(--ink),
    0 calc(1 * var(--p)) 0 var(--ink),
    0 calc(-1 * var(--p)) 0 var(--ink),
    calc(1 * var(--p)) calc(2 * var(--p)) 0 var(--ink);
}

/* footer */
footer {
  margin-top: 0;
  padding: calc(4 * var(--p)) 0 calc(20 * var(--p));
  background: var(--ink);
  border-top: calc(1 * var(--p)) solid #3c4a46;
  text-align: center;
}
footer h2 {
  margin-top: calc(-14 * var(--p));
}
.credits {
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, calc(130 * var(--p))), 1fr));
  gap: calc(10 * var(--p)) calc(8 * var(--p));
  max-width: calc(620 * var(--p));
}
.credits dt {
  color: var(--gold);
}
.credits dd {
  margin: 0;
}
small {
  font-size: inherit;
}
.credits small,
.fine {
  display: block;
  color: var(--dim);
}
.fine {
  max-width: calc(420 * var(--p));
  margin: 0 auto;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hero h1,
  .play .arrow,
  .walker,
  .cloud,
  .clock img {
    animation: none;
  }
  .walker {
    left: 12%;
  }
}
