/* nex-orion.com — the game's own palette (Docs/PALETTE.md) and its own nine-slice sprites.
   No scripts anywhere: the little motion on the page is CSS, and it stops for anyone who asked
   their system for less of it. */

@font-face { font-family: "Gothic A1"; font-weight: 700; src: url("/fonts/GothicA1-Bold.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Gothic A1"; font-weight: 400; src: url("/fonts/GothicA1-400.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Gothic A1"; font-weight: 500; src: url("/fonts/GothicA1-500.woff2") format("woff2"); font-display: swap; }

:root {
  --ink: #37201e;
  --wood-dark: #582f2a;
  --wood: #9d643f;
  --wood-light: #c98463;
  --cream: #f0ecbf;
  --paper: #f4f9fd;
  --gold: #f6c95b;
  --leaf-light: #8acfb7;
  --leaf: #59837e;
  --sky: #8fb8cf;
  --tile: 128px;          /* one game tile on this screen; assets ship at 128 (4x native) */
}

* { box-sizing: border-box; }
html { background: var(--ink); }
body {
  margin: 0;
  font-family: "Gothic A1", system-ui, sans-serif;
  color: var(--cream);
  line-height: 1.5;
}
img { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }

/* ---- sky ---------------------------------------------------------------------------- */

.sky {
  position: relative;
  overflow: hidden;
  background: var(--sky);
  padding: clamp(72px, 14vh, 120px) 16px 0;
  text-align: center;
}
.sun {
  position: absolute; top: 30px; right: 8%;
  width: 120px; height: auto;
  animation: breathe 6s ease-in-out infinite;
}
.cloud { position: absolute; width: 132px; height: auto; }
/* Negative delays: the clouds are already mid-sky when the page opens, not queued offstage. */
.cloud-a { top: 46px; left: -20px; animation: drift 58s linear -24s infinite; }
.cloud-b { top: 130px; left: -20px; width: 92px; animation: drift 84s linear -70s infinite; }

.hero { position: relative; max-width: 640px; margin: 0 auto; }
.wordmark {
  margin: 0;
  font-size: clamp(52px, 12vw, 104px);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--paper);
  text-shadow: 4px 4px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink);
}
.tagline {
  margin: 14px 0 26px;
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 500;
  color: var(--ink);
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* Buttons drawn in CSS from the palette: leaf for the one that matters, wood for the other,
   the ink outline and the darker lip the game's buttons have. */
.button {
  display: inline-block;
  padding: 12px 22px 13px;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
  color: #fff;
  text-decoration: none;
  text-shadow: 0 2px 0 var(--ink);
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: linear-gradient(var(--wood-light), var(--wood));
  box-shadow: inset 0 2px 0 rgba(255, 240, 210, .45), inset 0 -6px 0 var(--wood-dark);
  transition: transform .08s ease-out;
}
.button-primary { background: linear-gradient(var(--leaf-light), var(--leaf)); box-shadow: inset 0 2px 0 rgba(230, 255, 240, .5), inset 0 -6px 0 #3a5a56; }
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(1px) scale(.98); }
.button:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }

/* ---- the ground the hero stands on ------------------------------------------------- */

.ground {
  position: relative;
  /* Two rows of ground plus headroom for a whole tile standing on it: the props are one tile
     tall and must not climb into the buttons. */
  height: calc(var(--tile) * 3 + 16px);
  margin-top: 24px;
  background:
    url("/assets/tiles/grass.png") repeat-x left bottom var(--tile) / var(--tile) var(--tile),
    url("/assets/tiles/dirt.png") repeat-x left bottom / var(--tile) var(--tile);
}
.player, .prop {
  position: absolute;
  bottom: calc(var(--tile) * 2 - var(--tile) / 32);
  width: var(--tile); height: var(--tile);
}
.player { left: calc(50% - var(--tile) / 2); animation: idle 2.4s ease-in-out infinite; }
.player img { position: absolute; inset: 0; width: 100%; height: 100%; }
.player-shut { opacity: 0; animation: blink 4.6s step-end infinite; }
.prop-sign { left: calc(50% - var(--tile) * 2.25); }
.prop-lock { left: calc(50% + var(--tile) * 1.25); }
.prop-tomato { left: calc(50% + var(--tile) * 2.5); animation: idle 3.1s ease-in-out infinite; }

@media (max-width: 520px) {
  :root { --tile: 64px; }
  .prop-tomato { display: none; }
}

/* ---- underground ------------------------------------------------------------------- */

.dirt {
  background: var(--wood-dark);
  padding: 40px 16px 56px;
}
.cards {
  list-style: none;
  margin: 0 auto; padding: 0;
  max-width: 1000px;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
/* Panels wear the game's panel sprite (24/20). */
.card {
  border: 12px solid transparent;
  border-top-width: 10px; border-bottom-width: 10px;
  border-image: url("/assets/ui/panel.png") 20 24 fill;
  padding: 12px 14px 16px;
  color: var(--cream);
}
.card img { width: 64px; height: 64px; margin-bottom: 6px; }
.card h2 { margin: 0 0 6px; font-size: 22px; color: var(--paper); text-shadow: 0 2px 0 var(--ink); }
.card p { margin: 0; font-size: 16px; }

.shelf {
  list-style: none;
  margin: 40px auto 0; padding: 0;
  max-width: 1000px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
}
.shelf li {
  width: 60px; height: 60px;
  display: grid; place-items: center;
  border: 10px solid transparent; border-bottom-width: 14px;
  border-image: url("/assets/ui/slot.png") 20 20 28 20 fill;
}
.shelf img { width: 32px; height: 32px; margin-top: -4px; }

/* ---- footer ------------------------------------------------------------------------ */

.bedrock {
  background: var(--ink) url("/assets/tiles/bedrock.png") repeat-x top / 64px 64px;
  padding: 88px 16px 40px;
  text-align: center;
  font-size: 15px;
  color: var(--cream);
}
.bedrock p { margin: 0 0 8px; }
.links a { color: var(--gold); font-weight: 700; text-decoration: none; margin: 0 10px; }
.links a:hover { text-decoration: underline; }

/* ---- motion ------------------------------------------------------------------------ */

@keyframes drift { from { transform: translateX(-160px); } to { transform: translateX(100vw); } }
@keyframes breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes idle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(calc(var(--tile) / -32)); } }
@keyframes blink { 0%, 93%, 100% { opacity: 0; } 94%, 97% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .sun, .cloud, .player, .prop-tomato, .player-shut { animation: none; }
  .button { transition: none; }
}
