/* Landing page for Nudge to the Right. The hero is a playable slice of the
   game; everything below it stays calm and lets the art carry the page. */

:root {
  --navy: #161a33;
  --panel: #1d2245;
  --panel-light: #2a3062;
  --ink: #141228;
  --text: #f5f7ff;
  --muted: #a9b0d6;
  --orange: #ff8a3d;
  --orange-deep: #b9561c;
  --gold: #ffd23f;
  --gem: #4fe3ff;

  /* Hero palette; swapped by marketing.js when the road reaches a new biome. */
  --sky-top: #5bb8f5;
  --sky-bottom: #d6f1ff;
  --hill-far: #9ad7a8;
  --hill-near: #5fb878;
  --soil: #7a5a3a;
  --grass: #6cc04a;

  --display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --body: "Nunito", "Segoe UI", system-ui, sans-serif;
}

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

html { background: var(--navy); }

body {
  margin: 0;
  color: var(--text);
  background: var(--navy);
  font: 500 1.125rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

:focus-visible {
  outline: 4px solid var(--gem);
  outline-offset: 4px;
  border-radius: 8px;
}

/* --- Type ---------------------------------------------------------------- */

.display,
.section-title {
  font-family: var(--display);
  font-weight: 800;
  line-height: 0.95;
  margin: 0;
  color: var(--gold);
  -webkit-text-stroke: 0.08em var(--ink);
  paint-order: stroke fill;
  text-wrap: balance;
}

.display {
  font-size: clamp(3.25rem, 9vw, 7.5rem);
  letter-spacing: -0.01em;
}

.section-title {
  font-size: clamp(2.1rem, 4.6vw, 3.5rem);
  max-width: 18ch;
}

.lede,
.section-lede {
  max-width: 34rem;
  margin: 1.25rem 0 0;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 700;
}

/* --- Buttons: the game's chunky 3D style --------------------------------- */

.btn {
  display: inline-block;
  font: 800 1.35rem/1 var(--display);
  text-decoration: none;
  color: #fff;
  padding: 1.05rem 1.9rem 0.85rem;
  border-radius: 1.25rem;
  border-bottom: 6px solid var(--orange-deep);
  background: var(--orange);
  text-shadow: 0 2px 0 rgb(0 0 0 / 0.25);
  transition: transform 80ms ease, border-bottom-width 80ms ease, background-color 120ms ease;
}

.btn:hover { background: #ff9b57; }

.btn:active {
  transform: translateY(4px);
  border-bottom-width: 2px;
}

/* --- Hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: linear-gradient(var(--sky-top), var(--sky-bottom) 72%);
  color: var(--ink);
  overflow: hidden;
  cursor: pointer;
  transition: background 1.2s ease;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem clamp(1rem, 4vw, 3rem);
  position: relative;
  z-index: 3;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font: 800 1.35rem/1 var(--display);
  color: var(--ink);
}

.brand-mark { width: 2.4rem; height: 2.4rem; }

.topbar-play {
  font: 800 1.05rem/1 var(--display);
  text-decoration: none;
  color: var(--ink);
  background: rgb(255 255 255 / 0.65);
  padding: 0.7rem 1.1rem 0.55rem;
  border-radius: 999px;
}

.topbar-play:hover { background: #fff; }

.hero-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  padding: 1rem clamp(1rem, 6vw, 6rem) 2rem;
  cursor: auto;
}

.hero-copy .lede { color: var(--ink); }

.hero-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.hero-note {
  margin: 0;
  max-width: 22rem;
  font-size: 1rem;
  font-weight: 700;
  color: rgb(20 18 40 / 0.72);
}

/* The road: hills, grass, soil and the actor. */

.road {
  position: relative;
  height: clamp(17rem, 36vh, 22rem);
}

.road::before,
.road::after {
  content: "";
  position: absolute;
  inset: auto 0 calc(clamp(6.5rem, 14vh, 8.5rem) - 2px) 0;
  height: 9rem;
  background: var(--hill-far);
  clip-path: polygon(0 70%, 8% 45%, 18% 58%, 30% 30%, 42% 52%, 55% 26%, 68% 48%, 80% 22%, 92% 44%, 100% 34%, 100% 100%, 0 100%);
  transition: background 1.2s ease;
}

.road::after {
  height: 5.5rem;
  background: var(--hill-near);
  clip-path: polygon(0 55%, 12% 30%, 26% 52%, 38% 24%, 52% 46%, 66% 20%, 78% 44%, 90% 28%, 100% 48%, 100% 100%, 0 100%);
}

.ground {
  position: absolute;
  inset: auto 0 0 0;
  height: clamp(6.5rem, 14vh, 8.5rem);
  border-top: 4px solid var(--ink);
  background:
    linear-gradient(var(--grass) 0 1.2rem, transparent 1.2rem),
    repeating-linear-gradient(115deg, rgb(0 0 0 / 0.12) 0 2.5rem, transparent 2.5rem 5rem),
    var(--soil);
  background-position: var(--scroll, 0) 0, var(--scroll, 0) 0, 0 0;
  z-index: 1;
  transition: background-color 1.2s ease;
}

.flags {
  position: absolute;
  inset: auto 0 calc(clamp(6.5rem, 14vh, 8.5rem) - 4px) 0;
  height: 5rem;
  z-index: 1;
  pointer-events: none;
}

.flags span {
  position: absolute;
  bottom: 0;
  left: var(--x, 0);
  width: 0.55rem;
  height: 4.6rem;
  background: #8b5a2b;
  border: 3px solid var(--ink);
  border-radius: 4px;
}

.flags span::after {
  content: "";
  position: absolute;
  left: 0.3rem;
  top: -0.1rem;
  width: 2.3rem;
  height: 1.5rem;
  background: #ff4f5e;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.actor {
  position: absolute;
  left: 50%;
  bottom: calc(clamp(6.5rem, 14vh, 8.5rem) - 0.4rem);
  width: clamp(6.5rem, 12vw, 8.5rem);
  aspect-ratio: 1;
  translate: -50% 0;
  z-index: 2;
}

.nudgy {
  width: 100%;
  height: 100%;
  transform-origin: 50% 100%;
  rotate: var(--lean, 0deg);
  transition: rotate 300ms ease;
}

.actor.is-poked .nudgy { animation: squash 260ms cubic-bezier(.3, 1.6, .5, 1); }
.actor.is-crit .nudgy { animation: squash-big 340ms cubic-bezier(.3, 1.8, .5, 1); }

.actor-shadow {
  position: absolute;
  left: 8%;
  right: -2%;
  bottom: -0.55rem;
  height: 1rem;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.22);
  z-index: -1;
}

.glove {
  position: absolute;
  right: 100%;
  top: 40%;
  height: 3.6rem;
  width: 60vw;
  translate: -60vw 0;
  pointer-events: none;
}

.actor.is-poked .glove,
.actor.is-crit .glove { animation: jab 240ms ease-out; }

.glove-arm {
  position: absolute;
  inset: 1.1rem 2.4rem 1.1rem 0;
  background: #d94a4a;
  border: 4px solid var(--ink);
  border-left: 0;
}

.glove-fist {
  position: absolute;
  right: -0.4rem;
  top: 0;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  background: #f4f4f8;
  border: 4px solid var(--ink);
}

.road-meter {
  position: absolute;
  left: 50%;
  bottom: calc(clamp(6.5rem, 14vh, 8.5rem) + clamp(7.5rem, 14vw, 10rem));
  translate: -50% 0;
  z-index: 2;
  font: 800 2.2rem/1 var(--display);
  color: #fff;
  -webkit-text-stroke: 0.14em var(--ink);
  paint-order: stroke fill;
  white-space: nowrap;
}

.road-biome {
  position: absolute;
  right: clamp(1rem, 4vw, 3rem);
  bottom: 1.2rem;
  z-index: 2;
  font: 800 1.1rem/1 var(--display);
  color: var(--gold);
  -webkit-text-stroke: 0.15em var(--ink);
  paint-order: stroke fill;
}

.road-sky-hint {
  position: absolute;
  left: 50%;
  bottom: 1.3rem;
  translate: -50% 0;
  z-index: 2;
  font: 800 1.05rem/1 var(--display);
  color: #fff;
  -webkit-text-stroke: 0.15em var(--ink);
  paint-order: stroke fill;
  transition: opacity 400ms ease;
}

.road-sky-hint.is-done { opacity: 0; }

.pop {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  font: 800 1.6rem/1 var(--display);
  color: #fff;
  -webkit-text-stroke: 0.15em var(--ink);
  paint-order: stroke fill;
  animation: pop 700ms ease-out forwards;
}

.pop.is-crit { color: var(--gold); font-size: 2.2rem; }

@keyframes squash {
  30% { scale: 0.86 1.12; }
  70% { scale: 1.04 0.97; }
}

@keyframes squash-big {
  30% { scale: 0.76 1.22; }
  70% { scale: 1.08 0.94; }
}

@keyframes jab {
  0% { translate: -60vw 0; }
  30% { translate: 0 0; }
  100% { translate: -60vw 0; }
}

@keyframes pop {
  from { opacity: 1; translate: 0 0; scale: 1.4; }
  20% { scale: 1; }
  to { opacity: 0; translate: 0 -5rem; }
}

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

.section {
  padding: clamp(4rem, 10vw, 8rem) clamp(1rem, 6vw, 6rem);
  max-width: 82rem;
  margin: 0 auto;
}

/* Progression: the game's own distance posts mark each step. */

.milestones {
  list-style: none;
  padding: 0;
  margin: 3.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 2.5rem 2rem;
  position: relative;
}

.milestones::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 4.6rem;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--panel-light) 0 1.2rem, transparent 1.2rem 2rem);
}

.milestones li { position: relative; }

.flag-post {
  position: relative;
  display: block;
  width: 0.55rem;
  height: 4.8rem;
  background: #8b5a2b;
  border: 3px solid var(--ink);
  border-radius: 4px;
}

.flag-cloth {
  position: absolute;
  left: 0.3rem;
  top: 0;
  width: 2.4rem;
  height: 1.55rem;
  background: var(--orange);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.milestones li:last-child .flag-cloth { background: var(--gold); }

.milestone-distance {
  display: block;
  margin-top: 1rem;
  font: 800 2.4rem/1 var(--display);
  color: var(--text);
}

.milestones p {
  margin: 0.6rem 0 0;
  max-width: 22rem;
  color: var(--muted);
}

/* Cards */

.cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 3rem;
}

.cards-copy p {
  max-width: 32rem;
  margin: 1.4rem 0 0;
  color: var(--muted);
}

.rates {
  margin: 2rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.rates div {
  padding: 0.55rem 0.9rem;
  border-radius: 0.9rem;
  background: var(--panel);
  border: 2px solid var(--rarity);
}

.rates div:nth-child(1) { --rarity: #aab4c3; }
.rates div:nth-child(2) { --rarity: #4aa3ff; }
.rates div:nth-child(3) { --rarity: #b366ff; }
.rates div:nth-child(4) { --rarity: #ffb020; }
.rates div:nth-child(5) { --rarity: #ff4f7b; }

.rates dt { display: inline; font-weight: 800; color: var(--rarity); }
.rates dd { display: inline; margin: 0 0 0 0.4rem; font-weight: 700; }

.fan {
  position: relative;
  height: clamp(20rem, 38vw, 28rem);
}

.fan-card {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: clamp(9rem, 17vw, 13rem);
  height: auto;
  transform-origin: 50% 120%;
  translate: -50% 0;
  filter: drop-shadow(0 12px 18px rgb(0 0 0 / 0.35));
}

.fan-card-0 { rotate: -28deg; }
.fan-card-1 { rotate: -14deg; }
.fan-card-2 { rotate: 0deg; }
.fan-card-3 { rotate: 14deg; }
.fan-card-4 { rotate: 28deg; }

/* Biomes */

.section-lede { color: var(--muted); font-weight: 600; }

.biome-band {
  list-style: none;
  padding: 0;
  margin: 3rem 0 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(6.4rem, 1fr);
  gap: 0;
  overflow-x: auto;
  border-radius: 1.5rem;
  border: 4px solid var(--ink);
  scroll-snap-type: x mandatory;
}

.biome-band li {
  position: relative;
  min-height: 15rem;
  padding: 1rem 0.9rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(transparent 62%, var(--ink) 62% calc(62% + 3px), var(--ground) calc(62% + 3px) 72%, rgb(0 0 0 / 0.55) 72%),
    radial-gradient(120% 40% at 30% 62%, var(--hill) 50%, transparent 51%),
    linear-gradient(var(--sky-top), var(--sky-bottom) 62%);
  scroll-snap-align: start;
}

.biome-zone { font-weight: 800; font-size: 0.85rem; color: rgb(255 255 255 / 0.75); }
.biome-name { font: 800 1.25rem/1.1 var(--display); color: #fff; }

/* Video + leaderboard */

.proof {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.phone {
  width: clamp(14rem, 26vw, 19rem);
  aspect-ratio: 9 / 16;
  border-radius: 2.2rem;
  border: 10px solid #0b0d1d;
  box-shadow: 0 0 0 3px var(--panel-light), 0 30px 60px rgb(0 0 0 / 0.45);
  overflow: hidden;
  background: #000;
}

.phone video { width: 100%; height: 100%; object-fit: cover; }

.leader-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  max-width: 32rem;
}

.leader-list li {
  display: grid;
  grid-template-columns: 3.2rem 1fr auto;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 2px dashed var(--panel-light);
}

.leader-rank { font: 800 1.5rem/1 var(--display); color: var(--muted); }
.leader-list li:first-child .leader-rank { color: var(--gold); }
.leader-name { font-weight: 800; overflow-wrap: anywhere; }
.leader-distance { font: 800 1.35rem/1 var(--display); color: var(--gold); }

.leader-total {
  margin: 1.4rem 0 2rem;
  color: var(--muted);
  max-width: 32rem;
}

/* Footer */

.footer {
  padding: 0 1rem 3rem;
  text-align: center;
  color: var(--muted);
}

.footer-road {
  height: 3.5rem;
  margin: 0 calc(-1rem) 2.5rem;
  border-top: 4px solid var(--ink);
  background:
    linear-gradient(#6cc04a 0 0.9rem, transparent 0.9rem),
    repeating-linear-gradient(115deg, rgb(0 0 0 / 0.12) 0 2.5rem, transparent 2.5rem 5rem),
    #7a5a3a;
}

.footer p { margin: 0.3rem auto; max-width: 40rem; }
.footer-small { font-size: 0.9rem; opacity: 0.8; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.4rem;
  margin-top: 0.9rem;
  font-size: 0.95rem;
}

.footer-links a { color: var(--text); text-underline-offset: 3px; }

/* --- Legal pages ---------------------------------------------------------- */

.legal-topbar .brand,
.legal-topbar .brand span { color: var(--text); }

.legal {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 4vw, 2rem) 4rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

.legal-title {
  font: 800 clamp(2.2rem, 6vw, 3.2rem)/1.05 var(--display);
  color: var(--gold);
  margin: 1rem 0 0.25rem;
}

.legal-date { color: var(--muted); margin: 0 0 2rem; }

.legal h2 {
  font: 800 1.45rem/1.25 var(--display);
  color: var(--text);
  margin: 2.6rem 0 0.6rem;
  scroll-margin-top: 1rem;
}

.legal h3 {
  font: 800 1.1rem/1.3 var(--body);
  color: var(--gold);
  margin: 1.6rem 0 0.3rem;
}

.legal p,
.legal li { color: #dfe3fb; }

.legal ul,
.legal ol { padding-left: 1.3rem; }

.legal li { margin: 0.45rem 0; }

.legal a { color: var(--gem); text-underline-offset: 3px; }

.legal strong { color: var(--text); }

.legal-callout {
  background: var(--panel);
  border-left: 6px solid var(--orange);
  border-radius: 12px;
  padding: 1rem 1.2rem;
}

.legal-caps { text-transform: uppercase; font-size: 0.95rem; letter-spacing: 0.01em; }

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 860px) {
  .cards,
  .proof { grid-template-columns: 1fr; }

  .phone { margin: 0 auto; }

  .fan { order: -1; }
}

@media (max-width: 560px) {
  .topbar-play { display: none; }

  .hero-actions .btn { width: 100%; text-align: center; }

  .milestones::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}

/* Purchase return page */

.purchase-return {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
}

.purchase-return .section-title,
.purchase-return .section-lede { margin-left: auto; margin-right: auto; }

.purchase-nudgy { width: 8rem; height: 8rem; }

/* Skins */

.skin-rack {
  margin-top: 3rem;
  display: grid;
  gap: 2rem;
}

.skin-row {
  list-style: none;
  margin: 0;
  padding: 0 0 0.5rem;
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}

.skin-row li {
  flex: 0 0 auto;
  width: 9.5rem;
  display: grid;
  justify-items: center;
  text-align: center;
  scroll-snap-align: start;
}

.skin-row img { width: 8.5rem; height: auto; }
.skin-row-pokers li { width: 11rem; }
.skin-row-pokers img { width: 10.5rem; }

.skin-name { font: 800 1.15rem/1.2 var(--display); margin-top: 0.4rem; }
.skin-price { font-weight: 800; color: var(--gold); }

/* Shared result pages (/s/:token) */
.share-page { text-align: center; }
.share-shot {
  display: block;
  width: 100%;
  max-width: 720px;
  height: auto;
  margin: 24px auto;
  border-radius: 16px;
}
.share-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 720px;
  margin: 20px auto 0;
}
@media (min-width: 640px) { .share-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.share-stat {
  background: var(--panel);
  border-radius: 12px;
  padding: 10px 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.share-stat dt { font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.share-stat dd { margin: 2px 0 0; font: 800 1.35rem/1.2 var(--display); }
.share-stat-wide { grid-column: 1 / -1; }
.share-stickers { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 1rem !important; }
.share-edition { font-size: 0.7rem; padding: 1px 6px; border-radius: 8px; background: var(--gold); color: #1b1b1b; }
.share-play { font-size: 1.4rem; padding: 16px 36px; }
