/* Farm introduction page, dressed like the game: forest and wood-panel sections,
   parchment cards with the game's dark pixel outlines, its gold Pixelify logo and its green
   buttons. Motion follows the Mosaic site: rules that draw in, pixel transitions between
   sections, scrambled headings, pixel buttons and a pixel cursor. The game lives at /play/. */

@font-face {
  font-family: "Pixelify Sans";
  src: url(/assets/pixelify-sans-latin-600-normal-Dd_Dy7u5.woff2) format("woff2");
  font-weight: 600;
  font-display: block;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url(/assets/pixelify-sans-latin-500-normal-DC052d-m.woff2) format("woff2");
  font-weight: 500;
  font-display: block;
}
@font-face {
  font-family: FusionPixel;
  src: url(/site/fonts/fusion-pixel-zh.woff2) format("woff2");
  font-display: block;
}
@font-face {
  font-family: PixelOperator; /* the hero farm's floating numbers (canvas) */
  src: url(/site/fonts/PixelOperator.woff2) format("woff2");
  font-display: block;
}

:root {
  /* The game's palette (assets/game-*.css). */
  --line: #1b130d;
  --ink: #3a2a1f;
  --ink-soft: #6b5442;
  --paper: #f7e6bf;
  --paper-2: #efd6a2;
  --paper-hi: #fff6dc;
  --paper-lo: #e0c088;
  --wood-1: #3b2a1e;
  --wood-2: #2e2117;
  --wood-hi: #5a4030;
  --wood: #d98c4f;
  --wood-dark: #a85d2c;
  --leaf: #5fae4f;
  --leaf-hi: #79c468;
  --leaf-dark: #2f6e3a;
  --sky: #2a3b2c;
  --sky-deep: #1f2c21;
  --gold: #ffd973;
  --gold-2: #ffd24a;
  --gold-dark: #e2b32b;
  --cream: #fff1d0;
  --cream-muted: #c9b48a;
  --bad: #b03a28;

  /* Pixelify Sans (the game's logo face) for the logo and big headings; Fusion Pixel, a true
     bitmap face that stays crisp at multiples of 12 px, for everything small. */
  --font-display: "Pixelify Sans", FusionPixel, "PingFang SC", monospace;
  --font-pixel: FusionPixel, "Pixelify Sans", "PingFang SC", monospace;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --edge: 24px;
  --max: 1728px;
  --ax: max(0px, (100vw - var(--max)) / 2);
  --aw: min(100vw, var(--max));
  --rule-1: calc(var(--ax) + var(--aw) * 0.136);
  --rule-2: calc(var(--ax) + var(--aw) * 0.3785);
  --rule-3: calc(var(--ax) + var(--aw) * 0.6215);
  --rule-4: calc(var(--ax) + var(--aw) * 0.864);
  --pop: cubic-bezier(0.2, 1.2, 0.35, 1);
  --ease: cubic-bezier(0.2, 0.9, 0.2, 1);
}
@media (width <= 1024px) {
  :root {
    --rule-1: var(--edge);
    --rule-4: calc(100vw - var(--edge));
  }
}
@media (width <= 599px) {
  :root {
    --edge: 16px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  font-synthesis: none;
  background: var(--sky);
  color: var(--cream);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  background: var(--sky);
  overflow-x: clip;
}
html.is-loading,
html.is-loading body {
  height: 100%;
  overflow: hidden;
}
a {
  color: inherit;
}
img {
  display: block;
}
button {
  font: inherit;
  color: inherit;
}
::selection {
  background: var(--gold-2);
  color: var(--line);
}

/* ── type ─────────────────────────────────────────────────────────────────────────────── */
.t-h1,
.t-h2 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.01em;
}
.t-h3 {
  font-family: var(--font-pixel);
  margin: 0;
}
.t-h1 {
  font-size: 72px;
  line-height: 1.17;
}
.t-h2 {
  font-size: 48px;
  line-height: 1.25;
}
.t-h3 {
  font-size: 24px;
  line-height: 1.5;
}
.dark .t-h1,
.dark .t-h2 {
  color: var(--cream);
  text-shadow: 4px 4px 0 var(--line);
}
.dark .t-h3 {
  color: var(--cream);
  text-shadow: 2px 2px 0 var(--line);
}
.paper .t-h1,
.paper .t-h2 {
  color: var(--ink);
  text-shadow: 3px 3px 0 var(--paper-lo);
}
.t-h1 em,
.t-h2 em {
  font-style: normal;
  color: var(--gold);
}
.paper .t-h1 em,
.paper .t-h2 em {
  color: var(--leaf-dark);
}
.t-label {
  font-family: var(--font-pixel);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.t-body {
  font-size: 17px;
  line-height: 1.75;
  margin: 0;
}
.t-num {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--accent-text);
}
@media (width <= 767px) {
  .t-h1 {
    font-size: 48px;
  }
  .t-h2 {
    font-size: 36px;
  }
  .dark .t-h1,
  .dark .t-h2 {
    text-shadow: 3px 3px 0 var(--line);
  }
  .t-body {
    font-size: 16px;
  }
}
@media (width <= 380px) {
  .t-h1 {
    font-size: 36px;
  }
}
.ln {
  display: block;
  overflow: hidden;
  padding: 0 0.1em 0.12em 0;
  margin-bottom: -0.12em;
}
.ln > span {
  display: block;
  will-change: transform;
}
[data-scramble],
[data-reveal] {
  opacity: 0;
}
.scramble__c {
  display: inline-block;
  text-align: center;
}
html.no-motion [data-scramble],
html.no-motion [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
}

/* ── shared pieces in the game's style ────────────────────────────────────────────────── */
/* A game window: parchment, dark outline, wooden ring (the game's #modal .card). */
.win {
  position: relative;
  color: var(--ink);
  background: linear-gradient(var(--paper-hi), var(--paper));
  border: 3px solid var(--line);
  border-radius: 12px;
  box-shadow:
    inset 0 -4px 0 var(--paper-lo),
    0 0 0 6px var(--wood-2),
    0 0 0 9px var(--line),
    0 24px 60px rgba(0, 0, 0, 0.45);
}
/* A HUD tile: parchment with a bevel (the game's .tile). */
.slab {
  position: relative;
  color: var(--ink);
  background: var(--paper-hi);
  border: 3px solid var(--line);
  border-radius: 8px;
  box-shadow:
    inset 0 -4px 0 var(--paper-lo),
    inset 0 3px 0 #fffaf0,
    0 5px 0 rgba(27, 19, 13, 0.28);
}
/* A wooden panel (the game's HUD bar and dock). */
.plank {
  position: relative;
  color: var(--cream);
  background: linear-gradient(var(--wood-1), var(--wood-2));
  border: 3px solid var(--line);
  border-radius: 10px;
  box-shadow:
    inset 0 1px 0 var(--wood-hi),
    0 8px 22px rgba(10, 16, 8, 0.45),
    0 3px 0 rgba(0, 0, 0, 0.35);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  font-family: var(--font-pixel);
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--paper-2);
  border: 2px solid var(--line);
  white-space: nowrap;
}
.logo {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--gold);
  text-shadow: 2px 2px 0 var(--line);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
/* The pixel-art icon (app/site/brand/), always at a whole multiple of its 16/32 grid. */
.logo__icon,
.loader__icon,
.ftr__icon {
  flex: none;
  image-rendering: pixelated;
}
a.logo:has(.logo__icon) {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.logo__icon {
  width: 32px;
  height: 32px;
  filter: drop-shadow(2px 2px 0 var(--line));
}

/* ── loader ───────────────────────────────────────────────────────────────────────────── */
.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: var(--sky);
}
.loader__tiles {
  position: absolute;
  inset: 0;
  display: grid;
}
.loader__tiles i {
  background: var(--sky);
}
.loader__tiles i.is-off {
  visibility: hidden;
}
.loader__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
html.is-return .loader__inner {
  visibility: hidden;
}
.loader__mark {
  font-size: 40px;
  line-height: 1;
  text-shadow: 3px 3px 0 var(--line);
}
.loader__icon {
  width: 64px;
  height: 64px;
  filter: drop-shadow(3px 3px 0 var(--line));
}
.loader__bar {
  width: 220px;
  height: 16px;
  padding: 2px;
  background: var(--wood-2);
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}
.loader__bar i {
  display: block;
  height: 100%;
  background: linear-gradient(#a7e08e, var(--leaf) 55%, #4f9a3f);
  transform: scaleX(0);
  transform-origin: 0 50%;
}
.loader__count {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--cream-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

/* ── rules, scroll pixel, edge blur ───────────────────────────────────────────────────── */
.rules {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  mix-blend-mode: difference;
}
.rules__line {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: var(--paper);
  opacity: 0.1;
  transform: scaleY(0);
  transform-origin: top;
}
.rules__line:nth-child(1) {
  left: var(--rule-1);
}
.rules__line:nth-child(2) {
  left: var(--rule-2);
}
.rules__line:nth-child(3) {
  left: var(--rule-3);
}
.rules__line:nth-child(4) {
  left: var(--rule-4);
}
.rules__progress {
  position: absolute;
  top: 0;
  left: var(--rule-4);
  width: 8px;
  height: 8px;
  margin-left: -3px;
  background: var(--paper);
}
html.is-loading .rules__progress {
  opacity: 0;
}
html.no-motion .rules__line {
  transform: none;
}
@media (width <= 1024px) {
  .rules__line:nth-child(2),
  .rules__line:nth-child(3),
  .rules__progress {
    display: none;
  }
  .rules__line {
    opacity: 0.06;
  }
}
@media (width <= 599px) {
  .rules {
    display: none;
  }
}
.edge-blur {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 104px;
  z-index: 90;
  pointer-events: none;
}
.edge-blur i {
  position: absolute;
  inset: 0;
}
.edge-blur i:nth-child(1) {
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  mask-image: linear-gradient(to bottom, #000 40%, transparent);
}
.edge-blur i:nth-child(2) {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  mask-image: linear-gradient(to bottom, #000 15%, transparent 60%);
}
.edge-blur i:nth-child(3) {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  mask-image: linear-gradient(to bottom, #000, transparent 35%);
}

/* ── header ───────────────────────────────────────────────────────────────────────────── */
.hdr {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 var(--edge);
  color: var(--cream);
  transition: color 0.35s;
  pointer-events: none;
}
.hdr > * {
  pointer-events: auto;
}
html.on-paper .hdr {
  color: var(--ink);
}
.hdr__mark {
  grid-column: 2;
  font-size: 30px;
  line-height: 1;
  text-decoration: none;
}
.hdr__nav {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  gap: 2px;
  font-family: var(--font-pixel);
  font-size: 12px;
}
.hdr__nav a {
  text-decoration: none;
  padding: 6px 10px;
  opacity: 0.72;
  transition: opacity 0.25s;
  position: relative;
}
.hdr__nav a:hover,
.hdr__nav a.is-current {
  opacity: 1;
}
.hdr__nav a.is-current::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -3px;
  background: var(--gold-2);
  box-shadow: 0 0 0 1px var(--line);
}
.hdr__end {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}
.hdr__lang {
  background: none;
  border: 0;
  padding: 6px 4px;
  cursor: pointer;
  font-family: var(--font-pixel);
  font-size: 12px;
  opacity: 0.8;
}
.hdr__lang:hover {
  opacity: 1;
}
@media (width <= 1024px) {
  .hdr__nav {
    display: none;
  }
  .hdr {
    grid-template-columns: auto 1fr;
  }
  .hdr__mark {
    grid-column: 1;
    font-size: 24px;
  }
  .hdr__end {
    grid-column: 2;
  }
}
@media (width <= 420px) {
  .hdr__mark {
    font-size: 19px;
  }
}

/* ── pixel buttons in the game's style ────────────────────────────────────────────────── */
.pbtn {
  --bg: var(--leaf);
  --tile: var(--leaf-hi);
  --fg: #fff;
  --shade: var(--leaf-dark);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-grid;
  place-items: center;
  height: 58px;
  padding: 0 26px;
  border: 3px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-pixel);
  font-size: 24px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow:
    inset -3px -3px 0 rgba(27, 19, 13, 0.25),
    inset 3px 3px 0 rgba(255, 255, 255, 0.4),
    0 5px 0 var(--line);
  transition:
    transform 0.08s,
    box-shadow 0.08s;
}
.pbtn:active {
  transform: translateY(4px);
  box-shadow:
    inset -3px -3px 0 rgba(27, 19, 13, 0.25),
    inset 3px 3px 0 rgba(255, 255, 255, 0.4),
    0 1px 0 var(--line);
}
.pbtn__label {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-shadow: 2px 2px 0 var(--shade);
  pointer-events: none;
}
.pbtn--paper {
  --bg: var(--paper-2);
  --tile: #f9dfa6;
  --fg: var(--ink);
  --shade: rgba(255, 255, 255, 0.6);
}
.pbtn--gold {
  --bg: var(--gold-2);
  --tile: #ffe48a;
  --fg: var(--ink);
  --shade: rgba(255, 255, 255, 0.55);
}
.pbtn--wood {
  --bg: var(--wood-1);
  --tile: var(--wood-hi);
  --fg: var(--cream);
  --shade: var(--line);
}
.pbtn--sm {
  height: 40px;
  padding: 0 14px;
  font-size: 14px;
  border-width: 2px;
  box-shadow:
    inset -2px -2px 0 rgba(27, 19, 13, 0.25),
    inset 2px 2px 0 rgba(255, 255, 255, 0.4),
    0 3px 0 var(--line);
}
.pbtn__tiles {
  position: absolute;
  inset: 0;
  display: grid;
  pointer-events: none;
}
.pbtn__tiles i {
  visibility: hidden;
  background: var(--tile);
}
.pbtn__tiles i.is-on {
  visibility: visible;
}
.pbtn:focus-visible {
  outline: 3px solid var(--gold-2);
  outline-offset: 4px;
}
.pbtn.is-done .pbtn__label > :not(.flash),
.copy-mini.is-done > :not(.flash) {
  display: none;
}
@media (width <= 599px) {
  .pbtn:not(.pbtn--sm) {
    height: 54px;
    padding: 0 20px;
  }
}

/* ── sections and pixel transitions ───────────────────────────────────────────────────── */
main {
  position: relative;
  z-index: 1;
}
.sec {
  position: relative;
  padding: 160px 0;
}
.dark {
  color: var(--cream);
  --muted: var(--cream-muted);
  --line-soft: rgba(255, 241, 208, 0.14);
  --accent-text: var(--gold);
}
.paper {
  color: var(--ink);
  --muted: var(--ink-soft);
  --line-soft: rgba(58, 42, 31, 0.16);
  --accent-text: var(--wood-dark);
}
.forest {
  background: var(--sky);
  --pxt-color: var(--sky);
}
.wood {
  background: repeating-linear-gradient(to bottom, var(--wood-2) 0 62px, #291d14 62px 64px);
  --pxt-color: var(--wood-2);
}
.paper {
  background: var(--paper);
  --pxt-color: var(--paper);
}
.pxt {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  z-index: 3;
  display: grid;
  pointer-events: none;
}
.pxt i {
  background: var(--pxt-color);
  visibility: hidden;
}
.pxt i.is-on {
  visibility: visible;
}
html.no-motion .pxt {
  display: none;
}
.wrap {
  position: relative;
  margin: 0 var(--rule-1);
  width: calc(var(--rule-4) - var(--rule-1));
}
@media (width <= 1024px) {
  .sec {
    padding: 112px 0;
  }
}
@media (width <= 599px) {
  .wrap {
    margin: 0 var(--edge);
    width: auto;
  }
  .sec {
    padding: 96px 0;
  }
}
.sec__head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 0;
  margin-bottom: 80px;
}
.sec__kicker {
  margin-bottom: 22px;
}
.sec__lead {
  color: var(--muted);
  align-self: end;
  max-width: 460px;
  justify-self: end;
}
@media (width <= 1024px) {
  .sec__head {
    grid-template-columns: 1fr;
    margin-bottom: 56px;
  }
  .sec__lead {
    justify-self: start;
  }
}

/* ── sprites ──────────────────────────────────────────────────────────────────────────── */
.spr {
  --s: 4;
  display: block;
  image-rendering: pixelated;
  background-repeat: no-repeat;
  width: calc(var(--fw) * var(--s) * 1px);
  height: calc(var(--fh) * var(--s) * 1px);
  background-image: var(--img);
  background-size: calc(var(--sw) * var(--s) * 1px) calc(var(--sh) * var(--s) * 1px);
  background-position: calc(var(--fx, 0) * var(--fw) * var(--s) * -1px) calc(var(--fy, 0) * var(--fh) * var(--s) * -1px);
}
@keyframes spr-run {
  to {
    background-position-x: calc(var(--frames) * var(--fw) * var(--s) * -1px);
  }
}
.spr--run {
  animation: spr-run var(--dur, 0.8s) steps(var(--frames)) infinite;
}
html.no-motion .spr--run {
  animation: none;
}

/* ── hero ─────────────────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  padding: 96px var(--edge) 56px;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  align-items: center;
  gap: 40px;
  background:
    radial-gradient(90% 60% at 50% 36%, #3a5236 0%, transparent 70%),
    linear-gradient(var(--sky-deep), var(--sky) 40%, var(--sky));
  overflow: hidden;
}
.hero__fireflies {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero__fireflies i {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--gold);
  box-shadow: 0 0 10px 2px rgba(255, 217, 115, 0.55);
  opacity: 0;
  animation: firefly var(--d, 6s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes firefly {
  0%,
  100% {
    opacity: 0;
    translate: 0 0;
  }
  25%,
  60% {
    opacity: 0.9;
  }
  50% {
    translate: var(--dx, 20px) var(--dy, -30px);
  }
}
html.no-motion .hero__fireflies {
  display: none;
}
.hero__stage {
  position: relative;
  perspective: 1400px;
  display: grid;
  place-items: center;
}
.card {
  position: relative;
  padding: 8px;
  transform-style: preserve-3d;
  will-change: transform;
}
.card canvas {
  display: block;
  image-rendering: pixelated;
  border: 2px solid var(--line);
  border-radius: 4px;
}
.card__chip {
  position: absolute;
  z-index: 2;
}
.card__chip--tl {
  top: 18px;
  left: 18px;
}
.card__chip--br {
  right: 18px;
  bottom: 18px;
}
.live {
  width: 8px;
  height: 8px;
  background: #4fe07a;
  box-shadow: 0 0 0 2px var(--line);
  animation: blink 1.6s steps(2) infinite;
}
@keyframes blink {
  50% {
    opacity: 0.3;
  }
}
.hero__copy {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 18px;
}
.hero__sub {
  max-width: 640px;
  color: var(--cream-muted);
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
}
.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 2px;
  height: 40px;
  background: linear-gradient(var(--cream), transparent);
  opacity: 0.35;
  animation: drip 2.4s var(--ease) infinite;
}
@keyframes drip {
  0% {
    transform: scaleY(0);
    transform-origin: top;
  }
  50% {
    transform: scaleY(1);
    transform-origin: top;
  }
  51% {
    transform-origin: bottom;
  }
  100% {
    transform: scaleY(0);
    transform-origin: bottom;
  }
}
@media (width >= 1100px) {
  .hero .t-h1 .ln {
    display: inline-block;
  }
  .hero .t-h1 .ln + .ln {
    margin-left: 0.35em;
  }
}
@media (width <= 767px) {
  .hero {
    padding-top: 96px;
  }
  .card__chip--br {
    display: none;
  }
  .card {
    padding: 6px;
  }
  .card__chip--tl {
    top: 12px;
    left: 12px;
  }
}

/* ── how it works ─────────────────────────────────────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.step {
  padding: 22px 22px 28px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 12px;
  min-height: 360px;
}
.step h3 {
  min-height: 3em;
}
.step__icon {
  margin: 8px 0 4px;
  height: 64px;
  display: flex;
  align-items: flex-end;
}
.step p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
  margin: 0;
}
.step p b {
  color: var(--ink);
  font-weight: 600;
}
@media (width <= 1024px) {
  .steps {
    grid-template-columns: 1fr 1fr;
  }
}
@media (width <= 599px) {
  .steps {
    grid-template-columns: 1fr;
  }
  .step {
    min-height: 0;
  }
  .step h3 {
    min-height: 0;
  }
}

/* ── the life of a plot (pinned) ──────────────────────────────────────────────────────── */
.story {
  padding: 0;
}
.story__pin {
  position: relative;
  height: 100svh;
  min-height: 640px;
  display: grid;
  grid-template-columns: var(--rule-1) calc(var(--rule-2) - var(--rule-1)) calc(var(--rule-3) - var(--rule-2)) calc(var(--rule-4) - var(--rule-3)) 1fr;
  align-items: center;
  overflow: hidden;
}
.story__text {
  grid-column: 2;
  padding-right: 32px;
  display: grid;
  gap: 18px;
}
.story__count {
  color: var(--muted);
}
.story__count b {
  color: var(--gold);
  font-weight: 600;
}
.story__title {
  min-height: 1.25em;
}
.story__body {
  color: var(--muted);
  min-height: 7.5em;
}
.story__bar {
  display: flex;
  gap: 6px;
}
.story__bar i {
  width: 28px;
  height: 8px;
  background: var(--wood-1);
  border: 2px solid var(--line);
}
.story__bar i.is-on {
  background: var(--gold-2);
}
.story__scene {
  grid-column: 3;
  justify-self: center;
  position: relative;
  width: 336px;
  height: 352px;
}
.story__scene::before {
  content: "";
  position: absolute;
  left: -36px;
  right: -36px;
  bottom: 36px;
  height: 92px;
  background:
    radial-gradient(circle at 20% 30%, #6dba55 0 2px, transparent 3px) 0 0 / 24px 20px,
    radial-gradient(circle at 70% 70%, #4f9a3f 0 2px, transparent 3px) 0 0 / 28px 24px,
    #58a646;
  border: 3px solid var(--line);
  border-radius: 6px;
  box-shadow: inset 0 3px 0 #7cc265, 0 6px 0 rgba(0, 0, 0, 0.35);
}
.plot {
  position: absolute;
  bottom: 64px;
  width: 96px;
  height: 48px;
  background:
    repeating-linear-gradient(to bottom, #c08250 0 4px, #a86c40 4px 12px, #8c5632 12px 16px),
    #a86c40;
  border: 3px solid #5c361d;
  border-radius: 3px;
}
.plot:nth-child(1) {
  left: 0;
}
.plot:nth-child(2) {
  left: 120px;
}
.plot:nth-child(3) {
  left: 240px;
}
.plot .spr {
  position: absolute;
  left: 50%;
  bottom: 12px;
  margin-left: -48px;
  --s: 6;
  transform-origin: 50% 100%;
}
.plot__pop {
  position: absolute;
  left: 50%;
  top: -56px;
  transform: translateX(-50%);
  font-family: var(--font-pixel);
  font-size: 24px;
  color: var(--gold);
  text-shadow: 2px 2px 0 var(--line);
  opacity: 0;
  white-space: nowrap;
}
.story__ledger {
  grid-column: 4;
  justify-self: stretch;
  margin-left: 40px;
  padding: 20px;
  display: grid;
  gap: 12px;
  font-size: 14px;
}
.ledger__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  color: var(--ink-soft);
}
.ledger__row b {
  font-family: var(--font-pixel);
  font-size: 24px;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.ledger__row--total {
  border-top: 2px dashed var(--paper-lo);
  padding-top: 12px;
}
.ledger__row--total b {
  color: var(--leaf-dark);
}
.ledger__note {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}
.story__coin {
  position: absolute;
  --s: 3;
  opacity: 0;
  pointer-events: none;
}
@media (width <= 1024px) {
  .story__pin {
    grid-template-columns: var(--edge) 1fr var(--edge);
    grid-template-rows: auto auto auto;
    align-content: center;
    gap: 32px;
  }
  .story__text {
    grid-column: 2;
    padding: 0;
  }
  .story__scene {
    grid-column: 2;
    grid-row: 2;
    transform: scale(0.8);
    margin: -24px 0;
  }
  .story__ledger {
    grid-column: 2;
    grid-row: 3;
    margin: 0 9px;
  }
  .story__body {
    min-height: 5.5em;
  }
}
@media (width <= 599px) {
  .story__scene {
    transform: scale(0.62);
    margin: -64px auto;
  }
  .story__ledger {
    display: none;
  }
}

/* ── the world ────────────────────────────────────────────────────────────────────────── */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.tile {
  min-height: 340px;
  padding: 24px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  overflow: hidden;
  transition: transform 0.25s var(--pop);
}
.tile:hover {
  transform: translateY(-4px);
}
.tile__art {
  height: 120px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: -6px -6px 0;
  padding: 0 6px 10px;
  background:
    radial-gradient(circle at 30% 40%, #6dba55 0 1.5px, transparent 2.5px) 0 0 / 18px 16px,
    #5fae4f;
  border: 2px solid var(--line);
  border-radius: 5px;
  box-shadow: inset 0 3px 0 #7cc265;
}
.tile p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}
.tile__nums {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tile__nums span {
  font-family: var(--font-pixel);
  font-size: 12px;
  line-height: 1;
  padding: 6px 8px;
  background: var(--paper-2);
  border: 2px solid var(--line);
}
.tile--wide {
  grid-column: span 3;
  min-height: 0;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: none;
  align-items: center;
  gap: 32px;
}
.tile--wide .tile__art {
  height: auto;
  margin: 0;
  padding: 10px 14px;
}
.hall-levels {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}
.hall-levels span {
  width: 40px;
  background: var(--wood-1);
  color: var(--cream);
  border: 2px solid var(--line);
  font-family: var(--font-pixel);
  font-size: 12px;
  display: grid;
  place-items: end center;
  padding-bottom: 6px;
}
.hall-levels span:last-child {
  background: var(--gold-2);
  color: var(--ink);
}
@media (width <= 1024px) {
  .tiles {
    grid-template-columns: 1fr 1fr;
  }
  .tile--wide {
    grid-column: span 2;
    grid-template-columns: 1fr;
  }
}
@media (width <= 599px) {
  .tiles {
    grid-template-columns: 1fr;
  }
  .tile--wide {
    grid-column: auto;
  }
  .tile {
    min-height: 0;
  }
}

/* ── economy ──────────────────────────────────────────────────────────────────────────── */
.formula {
  padding: 44px 32px 36px;
  text-align: center;
  display: grid;
  gap: 18px;
  margin: 9px;
}
.formula__eq {
  font-family: var(--font-pixel);
  font-size: 36px;
  line-height: 1.3;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0 0.35em;
}
.formula__eq .hl {
  color: var(--leaf-dark);
  text-shadow: 2px 2px 0 var(--paper-lo);
}
.formula__note {
  color: var(--ink-soft);
  font-size: 14px;
}
.econ__live {
  justify-self: center;
}
@media (width <= 767px) {
  .formula {
    padding: 32px 14px;
  }
  .formula__eq {
    font-size: 24px;
  }
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 48px;
}
.stat {
  padding: 18px 20px 20px;
  display: grid;
  gap: 8px;
  align-content: start;
}
.stat__v {
  font-family: var(--font-pixel);
  font-size: 36px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.stat__v small {
  font-size: 13px;
  color: var(--ink-soft);
  margin-left: 6px;
}
.stat__k {
  color: var(--ink-soft);
  font-size: 13px;
}
.stat--hl {
  background: linear-gradient(#e9f7d8, #d4efbd);
  box-shadow:
    inset 0 -4px 0 #a9d58f,
    inset 0 3px 0 #f4fbec,
    0 5px 0 rgba(27, 19, 13, 0.28);
}
.stat--hl .stat__v {
  color: var(--leaf-dark);
}
@media (width <= 1024px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }
}
@media (width <= 599px) {
  .stat__v {
    font-size: 24px;
  }
  .stat {
    padding: 14px;
  }
}
.split {
  margin-top: 40px;
  padding: 16px;
  display: grid;
  gap: 14px;
}
.split__bar {
  display: grid;
  grid-template-columns: repeat(var(--cols, 60), 1fr);
  gap: 2px;
  height: 30px;
}
.split__bar i {
  background: var(--wood-hi);
}
.split__keys {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 13px;
  color: var(--cream-muted);
}
.split__keys span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.split__keys i {
  width: 12px;
  height: 12px;
  border: 2px solid var(--line);
}
.split__keys b {
  color: var(--cream);
  font-weight: 600;
}
.rules-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding: 0;
  margin: 72px 0 0;
  list-style: none;
}
.rules-list li {
  display: grid;
  gap: 10px;
  align-content: start;
  padding-top: 18px;
  border-top: 3px solid var(--line-soft);
}
.rules-list p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}
@media (width <= 1024px) {
  .rules-list {
    grid-template-columns: 1fr 1fr;
  }
}
@media (width <= 599px) {
  .rules-list {
    grid-template-columns: 1fr;
  }
}

/* ── skill ────────────────────────────────────────────────────────────────────────────── */
.skill {
  display: grid;
  grid-template-columns: calc(var(--rule-2) - var(--rule-1)) 1fr;
}
.skill__steps {
  padding: 8px 40px 0 0;
  display: grid;
  gap: 32px;
  align-content: start;
}
.skill__step {
  display: grid;
  gap: 8px;
}
.skill__step p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}
.skill__step code,
.qa code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: rgba(168, 93, 44, 0.14);
  padding: 1px 5px;
  overflow-wrap: anywhere;
}
.skill__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.skill__main {
  min-width: 0;
}
.term {
  overflow: hidden;
  min-width: 0;
}
.term__bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 10px 10px 14px;
  border-bottom: 3px solid var(--line);
  background: linear-gradient(var(--wood-hi), var(--wood-1));
}
.term__dots {
  display: flex;
  gap: 6px;
  margin-right: 12px;
}
.term__dots i {
  width: 10px;
  height: 10px;
  border: 2px solid var(--line);
  background: var(--wood-2);
}
.term__dots i:nth-child(1) {
  background: var(--bad);
}
.term__dots i:nth-child(2) {
  background: var(--gold-2);
}
.term__dots i:nth-child(3) {
  background: var(--leaf);
}
.term__tab {
  background: none;
  border: 2px solid transparent;
  padding: 6px 10px;
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--cream-muted);
  cursor: pointer;
}
.term__tab[aria-selected="true"] {
  color: var(--ink);
  background: var(--paper-2);
  border-color: var(--line);
}
.term__copy {
  margin-left: auto;
}
.term__body {
  position: relative;
  height: 460px;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--wood-2);
}
.term__body pre {
  margin: 0;
  padding: 20px 24px 32px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  color: #e9d8b4;
}
.term__body pre .k {
  color: var(--gold);
}
.term__body pre .c {
  color: #9b8466;
}
.term__body pre .h {
  color: #fff;
  font-weight: 600;
}
.term__panel[hidden] {
  display: none;
}
.term__body::-webkit-scrollbar {
  width: 10px;
}
.term__body::-webkit-scrollbar-thumb {
  background: var(--wood-hi);
  border: 2px solid var(--wood-2);
}
.addrs {
  margin-top: 28px;
  padding: 6px 18px;
}
.addr {
  display: grid;
  grid-template-columns: minmax(160px, 230px) 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  font-size: 14px;
}
.addr + .addr {
  border-top: 2px dashed var(--paper-lo);
}
.addr span {
  color: var(--ink-soft);
}
.addr code {
  font-family: var(--font-mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.copy-mini {
  background: var(--paper-2);
  border: 2px solid var(--line);
  padding: 6px 10px;
  font-family: var(--font-pixel);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
  box-shadow:
    inset -2px -2px 0 rgba(58, 42, 31, 0.25),
    inset 2px 2px 0 rgba(255, 255, 255, 0.45);
}
.copy-mini:hover {
  background: #f9dfa6;
}
.copy-mini.is-done {
  background: var(--leaf);
  color: #fff;
}
@media (width <= 1024px) {
  .skill {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .skill__steps {
    padding-right: 0;
  }
  .term__body {
    height: 380px;
  }
}
@media (width <= 599px) {
  .addr {
    grid-template-columns: 1fr auto;
  }
  .addr code {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .term__tab {
    padding: 6px;
  }
  .term__dots {
    display: none;
  }
}

/* ── faq ──────────────────────────────────────────────────────────────────────────────── */
.faq {
  display: grid;
  grid-template-columns: calc(var(--rule-2) - var(--rule-1)) 1fr;
}
.faq__side {
  padding-right: 32px;
}
.faq__side .t-body {
  color: var(--muted);
  margin-top: 24px;
}
.faq__side a {
  color: var(--gold);
}
.faq__list {
  display: grid;
  gap: 14px;
}
.qa {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  padding: 20px 22px;
  gap: 8px 28px;
}
.qa__q {
  display: grid;
  gap: 8px;
  align-content: start;
}
.qa__q h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
}
.qa__a {
  color: var(--cream-muted);
  font-size: 15px;
  line-height: 1.8;
}
.qa__a p {
  margin: 0;
}
@media (width <= 1024px) {
  .faq {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}
@media (width <= 767px) {
  .qa {
    grid-template-columns: 1fr;
  }
}

/* ── closing call and footer ──────────────────────────────────────────────────────────── */
.cta {
  text-align: center;
  padding: 180px 0 200px;
}
.cta__inner {
  display: grid;
  justify-items: center;
  gap: 28px;
}
.cta__row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.cta__farm {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  padding: 0 18px;
  background: linear-gradient(transparent 70%, #5fae4f 70%);
  border-bottom: 3px solid var(--line);
}
.cta .t-body {
  color: var(--muted);
  max-width: 560px;
}
.ftr {
  position: relative;
  z-index: 2;
  background: var(--sky);
  color: var(--cream);
  --pxt-color: var(--sky);
}
.ftr__inner {
  padding: 96px 0 32px;
}
.ftr__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  font-size: 14px;
}
.ftr__cols h4 {
  margin: 0 0 14px;
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--gold);
}
.ftr__cols a {
  display: block;
  text-decoration: none;
  padding: 3px 0;
  opacity: 0.85;
}
.ftr__cols a:hover {
  opacity: 1;
  color: var(--gold);
}
.ftr__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.18em;
  font-size: min(11.5vw, 200px);
  line-height: 0.9;
  text-align: center;
  margin: 88px 0 0;
  text-shadow: 0.04em 0.04em 0 var(--line);
  user-select: none;
}
.ftr__icon {
  width: 128px;
  height: 128px;
  filter: drop-shadow(6px 6px 0 var(--line));
}
@media (width <= 700px) {
  .ftr__icon {
    width: 64px;
    height: 64px;
    filter: drop-shadow(3px 3px 0 var(--line));
  }
}
.ftr__mark span {
  display: inline-block;
}
.ftr__base {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 24px;
  margin-top: 32px;
  border-top: 2px solid rgba(255, 241, 208, 0.12);
  color: var(--cream-muted);
  font-size: 12px;
}
@media (width <= 1024px) {
  .ftr__cols {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── cursor, page cover, toast ────────────────────────────────────────────────────────── */
html.has-cursor,
html.has-cursor * {
  cursor: none !important;
}
html.has-cursor .term__body,
html.has-cursor .term__body * {
  cursor: text !important;
}
.cursor {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  mix-blend-mode: difference;
  opacity: 0;
  transition: opacity 0.3s;
}
.cursor.is-visible {
  opacity: 1;
}
.cursor__trail i {
  position: absolute;
  top: 0;
  left: 0;
  width: 14px;
  height: 14px;
  background: var(--paper);
  visibility: hidden;
}
.cursor__trail i.is-on {
  visibility: visible;
}
.cursor__dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  background: var(--paper);
  transition:
    width 0.35s var(--ease),
    height 0.35s var(--ease),
    margin 0.35s var(--ease),
    background-color 0.2s;
}
.cursor.is-hover .cursor__dot {
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  background: transparent;
  border: 2px solid var(--paper);
}
.cursor.is-down .cursor__dot {
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: var(--paper);
}
.cursor__label {
  position: absolute;
  top: 0;
  left: 0;
  margin: 28px 0 0 28px;
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--paper);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}
.cursor.has-label .cursor__label {
  opacity: 1;
}
.page-cover {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: none;
  pointer-events: none;
}
.page-cover.is-active {
  display: grid;
  pointer-events: auto;
}
.page-cover i {
  background: var(--leaf);
  visibility: hidden;
}
.page-cover i.is-on {
  visibility: visible;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 260;
  transform: translate(-50%, 20px);
  opacity: 0;
  color: var(--cream);
  background: linear-gradient(var(--wood-1), var(--wood-2));
  border: 2px solid var(--line);
  border-radius: 9px;
  padding: 11px 18px;
  font-family: var(--font-pixel);
  font-size: 12px;
  box-shadow:
    inset 0 1px 0 var(--wood-hi),
    0 10px 30px rgba(0, 0, 0, 0.35);
  transition:
    opacity 0.25s,
    transform 0.35s var(--pop);
  pointer-events: none;
}
.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (prefers-reduced-motion: reduce) {
  .live,
  .hero__scroll {
    animation: none;
  }
}
