/* ==========================================================================
   LIMIN — landing page
   One full-screen pixel scene. Ade runs left to right through six cities,
   stops to check in on the phone, and Zest pops over the head (landing.js).
   The art is 384 x 216; --px is the size of one scene pixel on screen.
   ========================================================================== */

:root {
  /* The city on screen sets these (landing.js); the defaults are the first city. */
  --sky: #8FD0EE;
  --ink: #20241F;
  --dim: #3A4A55;
  --word: #20241F;
  --cta: #20241F;
  --cta-on: #FFFFFF;
  --foot: #20241F;

  --px: max(calc(100vw / 384), calc(100vh / 216));
  --u: min(1vw, 1.3vh);
  --swap: 0.5s steps(5);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--sky); }

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  background: var(--sky);
  color: var(--ink);
  font-family: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 800;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--swap), color var(--swap);
}
a { color: inherit; }
a:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: #20241F; color: #CBEC3F; padding: 10px 16px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Scene ---------- */
.lm-scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.lm-world, .lm-actors { position: absolute; bottom: 0; height: calc(var(--px) * 216); }
.lm-world { left: 50%; z-index: 0; width: calc(var(--px) * 384); transform: translateX(-50%); }
.js .lm-world { left: 0; transform: none; }
.lm-actors { left: 0; z-index: 1; width: 100%; }

.lm-city {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none;
  image-rendering: crisp-edges; image-rendering: pixelated;
  opacity: 0; transition: opacity var(--swap);
}
.lm-city.is-on { opacity: 1; z-index: 2; }
/* The city being left stays solid underneath while the next one dissolves in. */
.lm-city.was-on { opacity: 1; z-index: 1; transition: none; }

.lm-ade {
  position: absolute; left: 0; top: 0;
  width: calc(var(--px) * 34); height: calc(var(--px) * 28);
  visibility: hidden; will-change: transform;
}
.lm-ade.is-in { visibility: visible; }
.lm-ade canvas { display: block; width: 100%; height: 100%; image-rendering: crisp-edges; image-rendering: pixelated; }
.lm-ade.is-flip canvas { transform: scaleX(-1); }

.lm-pop {
  position: absolute; left: 50%; bottom: 100%;
  display: flex; align-items: center; gap: calc(var(--px) * 1);
  transform: translateX(-50%); opacity: 0; white-space: nowrap;
  font-family: "Jersey 10", ui-monospace, monospace; font-weight: 400;
  font-size: calc(var(--px) * 13); line-height: 0.8; color: #FFFFFF;
  text-shadow:
    calc(var(--px) * 0.6) 0 0 #20241F, calc(var(--px) * -0.6) 0 0 #20241F,
    0 calc(var(--px) * 0.6) 0 #20241F, 0 calc(var(--px) * -0.6) 0 #20241F,
    calc(var(--px) * 0.6) calc(var(--px) * 0.6) 0 #20241F, calc(var(--px) * -0.6) calc(var(--px) * 0.6) 0 #20241F,
    calc(var(--px) * 0.6) calc(var(--px) * -0.6) 0 #20241F, calc(var(--px) * -0.6) calc(var(--px) * -0.6) 0 #20241F;
}
.lm-pop img { display: block; width: calc(var(--px) * 10); height: calc(var(--px) * 10); }
.lm-pop.is-on { animation: lm-pop 0.7s steps(7) both; }
@keyframes lm-pop {
  0% { opacity: 0; transform: translate(-50%, calc(var(--px) * 8)) scale(0.3); }
  35% { opacity: 1; transform: translate(-50%, calc(var(--px) * -4)) scale(1.18); }
  55% { opacity: 1; transform: translate(-50%, calc(var(--px) * -1)) scale(1); }
  100% { opacity: 1; transform: translate(-50%, calc(var(--px) * -2)) scale(1); }
}

/* ---------- Corners ---------- */
.lm-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 6;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(14px, calc(var(--u) * 2.4)) max(20px, calc(var(--u) * 4));
}
.lm-mark { display: inline-flex; align-items: center; min-height: 44px; }
.lm-mark img { display: block; width: max(46px, calc(var(--u) * 4.6)); height: auto; image-rendering: pixelated; }
.lm-mark .on-dark, .is-dark .lm-mark .on-light { display: none; }
.is-dark .lm-mark .on-dark { display: block; }
.lm-ig { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--ink); transition: color var(--swap); }
.lm-ig svg { width: 26px; height: 26px; }

.lm-foot {
  position: absolute; left: 0; bottom: 0; z-index: 6;
  display: flex; align-items: center; gap: max(20px, calc(var(--u) * 2.6));
  padding: max(6px, calc(var(--u) * 1)) max(20px, calc(var(--u) * 4));
  padding-bottom: max(6px, calc(var(--u) * 1), env(safe-area-inset-bottom));
  font-size: 14px;
}
.lm-foot a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: var(--foot); transition: color var(--swap); }
.lm-foot a:hover { text-decoration: underline; }

/* ---------- Wordmark and menu ---------- */
.lm-main {
  position: relative; z-index: 2;
  width: calc(var(--u) * 100); max-width: 100%;
  padding: calc(var(--u) * 6) 0 0;
  display: flex; flex-direction: column; align-items: center;
}
.lm-word {
  margin: 0;
  font-family: "Jersey 10", ui-monospace, monospace; font-weight: 400;
  font-size: calc(var(--u) * 38); line-height: 0.6;
  color: var(--word); white-space: nowrap;
  transition: color var(--swap);
}
.lm-menu {
  max-width: 100%; margin-top: calc(var(--u) * 3.6); padding: 0 16px;
  display: flex; flex-direction: column; align-items: flex-start; gap: calc(var(--u) * 1.6);
}
.lm-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px max(22px, calc(var(--u) * 5)); }
.lm-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 max(18px, calc(var(--u) * 3.2)); }
.lm-nav a {
  position: relative; display: inline-flex; align-items: center; min-height: 44px;
  font-size: max(16px, calc(var(--u) * 1.5)); text-decoration: none; color: var(--dim);
}
.lm-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 4px;
  background: var(--ink); transform: scaleX(0); transform-origin: left center;
  transition: transform 0.25s steps(5);
}
.lm-nav a.is-on, .no-js .lm-nav a:hover { color: var(--ink); }
.lm-nav a.is-on::after, .no-js .lm-nav a:hover::after { transform: scaleX(1); }

.lm-cta {
  display: inline-flex; align-items: center; gap: max(10px, calc(var(--u) * 1.2));
  min-height: max(54px, calc(var(--u) * 6)); padding: 0 max(26px, calc(var(--u) * 3));
  background: var(--cta); color: var(--cta-on);
  font-size: max(17px, calc(var(--u) * 1.6)); text-decoration: none;
  box-shadow: max(5px, calc(var(--u) * 0.5)) max(5px, calc(var(--u) * 0.5)) 0 rgba(14, 16, 13, 0.34);
  transition: transform 0.1s steps(2), background-color var(--swap), color var(--swap);
}
.lm-cta:hover { transform: translate(-3px, -3px); }
.lm-cta svg { width: max(26px, calc(var(--u) * 2.6)); height: auto; transition: transform 0.2s steps(3); }
.lm-cta:hover svg { transform: translateX(6px); }

.lm-caption {
  margin: 0; min-height: 1.1em;
  font-family: "EB Garamond", Georgia, serif; font-style: italic; font-weight: 400;
  font-size: max(18px, calc(var(--u) * 2)); line-height: 1.1;
  color: var(--ink); transition: color var(--swap);
}

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  .lm-main { padding-top: 78px; }
  .lm-word { font-size: 50vw; }
  .lm-menu { margin-top: 20px; align-items: center; gap: 14px; }
  .lm-nav { gap: 0 14px; }
  .lm-nav a { font-size: 15px; }
  .lm-caption { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  body, .lm-city, .lm-word, .lm-caption, .lm-cta, .lm-cta svg, .lm-ig, .lm-foot a, .lm-nav a::after { transition: none; }
  .lm-pop.is-on { animation: none; opacity: 1; transform: translate(-50%, calc(var(--px) * -2)); }
}
