/* Aren Games / Jet Jam site. Colours and both typefaces are the game's own. */

@font-face {
  font-family: "Poetsen One";
  src: url("../fonts/poetsen-one.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Alata";
  src: url("../fonts/alata.woff2") format("woff2");
  font-display: swap;
}

:root {
  --navy: #1e2b4f;
  --navy-soft: #4a5680;
  --sky-deep: #2d97e8;
  --sky: #62bcf5;
  --sky-pale: #dff2ff;
  --cloud: #ffffff;
  --jam: #ffc531;
  --tarmac: #7d84a2;
  --tile: #eef0f6;
  --grass: #a5dc3c;

  --red: #d83a34;
  --yellow: #f9d23c;
  --blue: #3c8ef0;
  --green: #2fa84f;
  --purple: #7b3fb8;
  --orange: #ff9a3c;

  --display: "Poetsen One", "Trebuchet MS", sans-serif;
  --body: "Alata", "Segoe UI", system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.7rem;
  --step-3: clamp(2rem, 1.4rem + 2.6vw, 3rem);
  --step-4: clamp(2.6rem, 1.6rem + 4.6vw, 4.5rem);

  --measure: 34rem;
  --page: 70rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--navy);
  background: var(--cloud);
}

img, svg { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p { margin: 0; max-width: var(--measure); text-wrap: pretty; }

a { color: inherit; text-decoration-thickness: 0.09em; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 0.16em; }

:focus-visible { outline: 3px solid var(--jam); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--page)); margin-inline: auto; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  padding: 0.5rem 1rem; background: var(--navy); color: #fff; border-radius: 0.5rem;
}
.skip:focus { top: 1rem; }

/* ---- Sky: the top of every page ----------------------------------------------------------- */

.sky {
  position: relative;
  color: var(--navy);
  background:
    repeating-conic-gradient(from -6deg at 50% -20%, rgb(255 255 255 / 0.09) 0 5deg, transparent 5deg 10deg),
    linear-gradient(var(--sky-deep), var(--sky) 55%, #a8dcfb);
  padding-bottom: 7rem;
  overflow: hidden;
}

/* The cloud bank the sky sits on: scallops in two layers, the back one tinted like the game's clouds. */
.sky::before, .sky::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  pointer-events: none;
}
.sky::before {
  height: 6.5rem;
  background:
    radial-gradient(circle at 50% 100%, #cfeafc 70%, transparent 71%) 3rem 100% / 15rem 5rem repeat-x,
    radial-gradient(circle at 50% 100%, #cfeafc 70%, transparent 71%) 10rem 100% / 9rem 6.5rem repeat-x;
}
.sky::after {
  height: 5rem;
  background:
    linear-gradient(transparent 60%, var(--cloud) 60%),
    radial-gradient(circle at 50% 100%, var(--cloud) 70%, transparent 71%) 0 100% / 12rem 4rem repeat-x,
    radial-gradient(circle at 50% 100%, var(--cloud) 70%, transparent 71%) 5rem 100% / 7rem 5rem repeat-x,
    radial-gradient(circle at 50% 100%, var(--cloud) 70%, transparent 71%) 8rem 100% / 19rem 3.4rem repeat-x;
}

.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 1.1rem;
}
.studio {
  font-family: var(--display); font-size: var(--step-1); color: #fff; text-decoration: none;
  text-shadow: 0 2px 0 var(--navy), 0 0 1px var(--navy);
  -webkit-text-stroke: 5px var(--navy); paint-order: stroke fill;
}
.nav { display: flex; gap: 0.25rem; margin-left: auto; }
.nav a { padding: 0.3rem 0.7rem; font-family: var(--display); text-decoration: none; border-radius: 99px; }
.nav a:hover, .nav a[aria-current] { background: rgb(255 255 255 / 0.4); }
@media (max-width: 30rem) { .masthead { flex-wrap: wrap; } .nav { order: 3; margin-left: -0.7rem; flex-basis: 100%; } }
.langs { display: flex; gap: 0.25rem; margin: 0; padding: 0.2rem; list-style: none; background: rgb(255 255 255 / 0.35); border-radius: 99px; }
.langs a {
  display: block; min-width: 2.75rem; padding: 0.3rem 0.7rem; text-align: center;
  font-size: var(--step--1); text-decoration: none; border-radius: 99px;
}
.langs a[aria-current] { background: var(--navy); color: #fff; }
.langs a:not([aria-current]):hover { background: rgb(255 255 255 / 0.6); }

/* ---- Jet Jam hero ------------------------------------------------------------------------- */

.hero {
  display: grid; gap: 1.5rem 3.5rem;
  padding-top: clamp(0.25rem, 3vw, 2.5rem);
}
.hero__logo { margin: 0 0 0.9rem -0.4rem; width: min(72%, 27rem); }
.hero__logo img { width: 100%; }
.hero__lead { font-size: clamp(1.1rem, 0.9rem + 0.9vw, var(--step-1)); line-height: 1.4; }
.rules { margin: 0; padding: 0; list-style: none; counter-reset: rule; max-width: var(--measure); }
.rules li {
  counter-increment: rule; position: relative;
  padding: 0.55rem 0 0.55rem 3rem;
}
.rules li::before {
  content: counter(rule);
  position: absolute; left: 0; top: 0.5rem;
  width: 2rem; height: 2rem; display: grid; place-items: center;
  font-family: var(--display); color: #fff; background: var(--navy); border-radius: 50%;
}
.soon {
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin-top: 1.6rem; padding: 0.6rem 1.1rem 0.6rem 0.9rem;
  font-family: var(--display); font-size: var(--step-0);
  background: var(--cloud); border: 3px solid var(--navy); border-radius: 0.9rem;
  box-shadow: 0 4px 0 var(--navy);
}
.soon svg { width: 1.3rem; flex: none; }

@media (min-width: 58rem) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 27rem); grid-template-rows: auto 1fr; }
  .hero__top { align-self: end; }
  .hero__logo { width: min(100%, 27rem); margin-bottom: 1.25rem; }
  .hero .apron { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}

/* ---- The playable apron: laid out like the game's board (terminal, five gates, grid) ---------- */

.apron {
  position: relative;
  width: min(100%, 26rem); margin-inline: auto;
  padding: 0.8rem;
  background: var(--grass);
  border: 4px solid var(--navy); border-radius: 1.75rem;
  box-shadow: 0 0.6rem 0 var(--navy);
  font-family: var(--display);
  user-select: none; -webkit-user-select: none;
}
.apron__head { display: flex; align-items: center; justify-content: space-between; padding: 0 0.3rem 0.55rem; }
.apron__head strong {
  font-weight: 400; color: #fff; background: var(--navy);
  padding: 0.15rem 0.9rem; border-radius: 99px;
}
.apron__terminal {
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.4rem 0.5rem 0.25rem;
  background: #f4f1e6; border: 3px solid var(--navy); border-radius: 0.9rem;
}
/* The line's head is bottom left, next to the gates; it fills to the right, then the row above (as on the game's board). */
.apron__queue { flex: 1; display: flex; flex-wrap: wrap-reverse; align-content: flex-start; gap: 1px 0; aspect-ratio: 8 / 3.25; }
.pax { flex: none; width: 12.5%; aspect-ratio: 82 / 132; object-fit: contain; transition: transform 95ms ease-in, opacity 95ms; }
.pax.is-boarding { transform: translateY(60%) scale(0.6); opacity: 0; }
.apron__more { flex: none; width: 2.1rem; font-size: var(--step--1); color: var(--navy-soft); text-align: right; }

.apron__field {
  margin-top: 0.55rem; padding: 0.6rem;
  background: var(--tarmac); border: 3px solid var(--navy); border-radius: 1.1rem;
}
.apron__gates { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.4rem; margin: 0 0 0.6rem; padding: 0; list-style: none; }
.gate {
  position: relative; aspect-ratio: 1 / 1.3; min-width: 0; overflow: visible;
  border: 3px dashed rgb(255 255 255 / 0.75); border-radius: 0.6rem;
  background: rgb(255 255 255 / 0.12);
}
.gate img {
  /* Out of the flow and sized by the stand, so a docked plane can never stretch the gate row. */
  position: absolute; inset: 5%; left: 5%; top: 5%;
  width: 90% !important; height: 90% !important; transform: none !important;
  object-fit: contain; animation: dock 220ms ease-out;
  filter: drop-shadow(0 2px 0 rgb(30 43 79 / 0.3));
}
.gate .badge { display: none; }
.gate b {
  position: absolute; left: -0.3rem; bottom: -0.3rem;
  min-width: 1.45rem; padding: 0 0.25rem; line-height: 1.45rem; text-align: center;
  font-weight: 400; font-size: var(--step--1); color: #fff;
  background: var(--navy); border: 2px solid #fff; border-radius: 99px;
}
.gate.is-departing img { animation: depart 420ms ease-in forwards; }
.gate.is-departing b { opacity: 0; }
.apron__gates.is-full .gate { border-color: var(--red); border-style: solid; }

.apron__grid {
  --cols: 5; --rows: 6;
  position: relative; overflow: hidden; container-type: inline-size;
  border: 3px solid var(--navy); border-radius: 0.8rem;
  background-color: #c9cddd;
  background-image:
    linear-gradient(#c9cddd 3px, transparent 3px),
    linear-gradient(90deg, #c9cddd 3px, transparent 3px),
    linear-gradient(var(--tile), var(--tile));
  background-size: calc(100% / var(--cols)) calc(100% / var(--rows)), calc(100% / var(--cols)) calc(100% / var(--rows)), 100% 100%;
}
.plane {
  --tint: var(--blue);
  position: absolute; margin: 0; padding: 0; cursor: pointer;
  background: none; border: 0;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform 150ms ease-out;
}
/* The coloured stand under each plane, as on the game's board. */
.plane::before {
  content: ""; position: absolute; inset: 4px;
  background: color-mix(in srgb, var(--tint) 26%, #fff);
  border: 3px solid var(--tint); border-radius: 0.55rem;
}
.plane img {
  position: absolute; left: 50%; top: 50%; max-width: none;
  filter: drop-shadow(0 3px 0 rgb(30 43 79 / 0.28));
}
.plane:hover::before { background: color-mix(in srgb, var(--tint) 40%, #fff); }
.plane:active img { scale: 0.95; }
.plane:focus-visible { outline-offset: -2px; z-index: 1; }
.plane.is-moving { transition: transform 150ms ease-in-out; }
.plane.is-leaving { transition: transform 460ms cubic-bezier(0.5, 0, 0.9, 0.6); z-index: 2; }
.plane.is-leaving::before, .plane.is-leaving .badge { opacity: 0; }
.plane.is-refused { animation: refuse 320ms ease-in-out; }
.plane.is-hint::after {
  content: ""; position: absolute; inset: 0;
  border: 4px solid var(--navy); border-radius: 0.7rem;
  animation: hint 1.4s ease-in-out infinite;
}

/* One badge shape per colour (BadgeFactory.ShapeByColor), so colour is never the only cue. */
.badge {
  position: absolute; right: 8%; bottom: 6%;
  width: calc(100cqw / var(--cols) * 0.34); aspect-ratio: 1;
  background: #fff; border: 2px solid var(--navy); border-radius: 50%;
}
.badge::after { content: ""; position: absolute; inset: 22%; background: var(--tint); }
.badge--red::after { clip-path: polygon(50% 4%, 100% 92%, 0 92%); }
.badge--blue::after { inset: 27%; }
.badge--yellow::after { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.badge--green::after { clip-path: polygon(34% 0, 66% 0, 66% 34%, 100% 34%, 100% 66%, 66% 66%, 66% 100%, 34% 100%, 34% 66%, 0 66%, 0 34%, 34% 34%); }
.badge--orange::after { border-radius: 50%; }
.badge--purple::after { clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); }

.is-red { --tint: var(--red); }
.is-blue { --tint: var(--blue); }
.is-yellow { --tint: var(--yellow); }
.is-green { --tint: var(--green); }
.is-orange { --tint: var(--orange); }
.is-purple { --tint: var(--purple); }
.is-yellow .badge::after { background: #b98a00; }

.apron__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.6rem 0.75rem; margin-top: 0.7rem; }
.apron__status { flex: 1 1 12rem; max-width: none; min-height: 2.7em; margin: 0; padding-inline: 0.2rem; font-family: var(--body); font-size: var(--step--1); line-height: 1.35; }
.pips { display: flex; gap: 0.3rem; margin: 0; padding: 0; list-style: none; }
.pips li {
  width: 1.6rem; height: 1.6rem; display: grid; place-items: center;
  font-size: var(--step--1); border: 2px solid var(--navy); border-radius: 50%; background: rgb(255 255 255 / 0.5);
}
.pips li[aria-current] { background: var(--navy); color: #fff; }
.pips li.is-done { background: var(--jam); }
.button {
  font: inherit; font-family: var(--display); color: var(--navy); cursor: pointer;
  padding: 0.45rem 0.95rem; background: var(--cloud);
  border: 3px solid var(--navy); border-radius: 0.8rem; box-shadow: 0 3px 0 var(--navy);
}
.button:active { translate: 0 3px; box-shadow: none; }
.button--go { background: var(--jam); }
.button[hidden] { display: none; }
.apron.is-won .apron__grid { background-image: none; background-color: #d9f3b0; }
.apron.is-lost .gate { border-color: var(--red); border-style: solid; }

@keyframes dock { from { transform: translateY(60%); opacity: 0; } }
@keyframes depart { to { transform: translateY(-320%) scale(1.5); opacity: 0; } }
@keyframes hint { 50% { inset: -5px; opacity: 0.25; } }
@keyframes refuse { 25% { translate: -4px 0; } 75% { translate: 4px 0; } }

/* ---- Sections ----------------------------------------------------------------------------- */

.band { padding-block: clamp(3.5rem, 8vw, 6rem); }
.band--pale { background: var(--sky-pale); }
.band > .wrap > h2 + p { margin-top: 1rem; }

.tour { display: grid; gap: 2rem 4rem; align-items: center; }
.tour__art { width: min(100%, 24rem); margin-inline: auto; }
@media (min-width: 52rem) { .tour { grid-template-columns: 22rem minmax(0, 1fr); } }

/* Fifty city names joined by the dashed flight path from the world art. */
.route {
  display: flex; flex-wrap: wrap; gap: 0.35rem 0; margin: 2.5rem 0 0; padding: 0; list-style: none;
  font-family: var(--display); font-size: var(--step-1); line-height: 1.5;
}
.route li { display: flex; align-items: center; white-space: nowrap; }
.route li:not(:last-child)::after {
  content: ""; width: 1.6rem; margin-inline: 0.6rem;
  border-top: 3px dashed var(--sky-deep);
}

.twists { columns: 2 14rem; column-gap: 3rem; margin: 1.75rem 0 0; padding: 0; list-style: none; max-width: 44rem; }
.twists li { break-inside: avoid; padding: 0.5rem 0; border-bottom: 2px solid var(--sky-pale); }

.reel {
  display: flex; gap: 1.25rem; margin: 2.5rem 0 0; padding: 0.5rem var(--gutter) 1.5rem; list-style: none;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
  scrollbar-width: thin; scrollbar-color: var(--navy) transparent;
}
.reel li { flex: none; width: min(62vw, 15rem); scroll-snap-align: start; }
.reel img {
  width: 100%; aspect-ratio: 440 / 956;
  border: 4px solid var(--navy); border-radius: 1.5rem; box-shadow: 0 0.4rem 0 var(--navy);
  background: var(--sky-pale);
}
.reel figure { margin: 0; }
.reel figcaption { margin-top: 1rem; font-size: var(--step--1); line-height: 1.4; }
@media (min-width: 76rem) { .reel { padding-inline: max(var(--gutter), calc((100vw - var(--page)) / 2)); scroll-padding-inline: max(var(--gutter), calc((100vw - var(--page)) / 2)); } }

.facts { display: grid; gap: 1.75rem 3rem; margin: 2.25rem 0 0; }
.facts h3 { margin-bottom: 0.4rem; }
@media (min-width: 44rem) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fine { margin-top: 2.5rem; font-size: var(--step--1); color: var(--navy-soft); }

/* ---- Studio home -------------------------------------------------------------------------- */

.intro { padding-top: clamp(2rem, 6vw, 4.5rem); }
.intro h1 { font-size: var(--step-4); color: #fff; -webkit-text-stroke: 0.22em var(--navy); paint-order: stroke fill; text-shadow: 0 0.09em 0 var(--navy); }
.intro p { margin-top: 1.25rem; font-size: var(--step-1); line-height: 1.4; }

.poster {
  position: relative; display: block; overflow: hidden; text-decoration: none;
  border: 4px solid var(--navy); border-radius: 1.75rem; box-shadow: 0 0.6rem 0 var(--navy);
  background: #4cc1ee;
}
/* The art's top is empty sky: crop to the lower right, where the jammed apron is. */
.poster > img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: 100% 100%; }
.poster__text { display: block; padding: 1.25rem 1.5rem 1.5rem; background: var(--cloud); border-top: 4px solid var(--navy); }
.poster__text img { width: 14rem; margin-left: -0.3rem; }
.poster__go { display: inline-block; margin-top: 0.9rem; font-family: var(--display); text-decoration: underline; text-underline-offset: 0.2em; }
@media (min-width: 52rem) {
  .poster > img { aspect-ratio: 2.35 / 1; }
  .poster__text { position: absolute; left: 4%; top: 50%; translate: 0 -50%; width: 46%; padding: 0; background: none; border: 0; }
  .poster__text img { width: 100%; }
}
.games h2 { margin-bottom: 1.75rem; }

.poster__line { display: block; margin-top: 0.5rem; }
@media (min-width: 52rem) { .poster__line { font-size: var(--step-1); line-height: 1.35; max-width: 19rem; } }
.card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 2rem; margin: 2.5rem 0 0; }
@media (min-width: 44rem) { .card { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card dt { font-size: var(--step--1); color: var(--navy-soft); }
.card dd { margin: 0.1rem 0 0; font-family: var(--display); font-size: var(--step-1); line-height: 1.25; }
.links { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; margin-top: 2rem; max-width: none; font-family: var(--display); }
.mail { margin-top: 1.25rem; font-family: var(--display); font-size: var(--step-2); overflow-wrap: anywhere; }
.intro .links { margin-top: 1.5rem; }
.intro p + p { margin-top: 0.75rem; }

/* ---- Plain text pages (privacy, 404) ------------------------------------------------------ */

.sky--short { padding-bottom: 6rem; }
.sky--short h1 { font-size: var(--step-3); padding-top: 1.5rem; }
.prose { padding-block: 2rem 4rem; max-width: 44rem; }
.prose h2 { font-size: var(--step-1); margin: 2.2rem 0 0.6rem; }
.prose p, .prose ul { max-width: none; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.4rem; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1rem; font-size: var(--step--1); }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem 0.6rem 0; border-bottom: 2px solid var(--sky-pale); }
.prose th { font-family: var(--display); font-weight: 400; font-size: var(--step-0); }
.prose a { overflow-wrap: anywhere; }

/* ---- Footer ------------------------------------------------------------------------------- */

.foot { background: var(--navy); color: #fff; padding-block: 2.5rem; font-size: var(--step--1); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; align-items: baseline; }
.foot strong { font-family: var(--display); font-weight: 400; font-size: var(--step-1); margin-right: auto; }
.foot :focus-visible { outline-color: var(--jam); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
