/* ModTinker's page on the website (/modtinker). Colors come from the app icon (a pixel block: sky-blue top, wooden
   sides, a dark outline and a gold sparkle) and from the app itself (its green buttons).
   No web fonts, scripts or outside files: the page loads only itself. */

:root {
  --paper: #eef5fc;
  --panel: #e1ebf7;
  --ink: #1a2230;
  --muted: #46526a;
  --line: #c6d4e5;
  --link: #1f56ad;
  --plank: #b9773d;
  --plank-dark: #8a5528;
  --gold: #f2c230;
  --grass: #3fb64a;
  --grass-hover: #36a741;
  --grass-shade: #2a8533;
  --grass-ink: #0b220e;
  --canvas-a: #ffffff;
  --canvas-b: #e2e9f2;
  --swatch-edge: #c6d4e5;
  /* The gem's colors (and the painter's swatches). */
  --px-o: #1a2230;
  --px-w: #eaf5ff;
  --px-l: #8cc4f5;
  --px-b: #3f86e0;
  --px-d: #1f5bb8;
  --px-g: #f2c230;
  --px-y: #fff1b0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121820;
    --panel: #19222d;
    --ink: #e8eef7;
    --muted: #a9b5c8;
    --line: #2b3747;
    --link: #8ab8ff;
    --plank: #a86b33;
    --plank-dark: #7a4a20;
    --grass: #5fd068;
    --grass-hover: #6fdc77;
    --grass-shade: #3a9a43;
    /* The canvas stays light, like the painter's, so the gem's dark outline shows. */
    --canvas-a: #e9eef5;
    --canvas-b: #d3dbe6;
    /* Lighter than --line, so the darkest swatch still has an edge on the dark page. */
    --swatch-edge: #55657c;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0;
}

h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--link);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

.site-header,
main > section,
.site-footer {
  width: min(1080px, 100% - 40px);
  margin-inline: auto;
}

/* The site's menu, the same on every page of astralnexxus.org, in the channel's colors. */
.site-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 10px max(20px, calc((100% - 1080px) / 2));
  background: #150b3d;
  color: #f4f0ff;
}

.site-bar a {
  color: #cbc2f3;
  font-weight: 600;
  text-decoration: none;
}

.site-bar a:hover,
.site-bar a[aria-current="page"] {
  color: #ffffff;
}

.site-bar a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 #ff5ad9;
}

.site-bar :focus-visible {
  outline-color: #3be8ff;
}

.site-bar-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
}

.site-bar-logo img {
  border-radius: 50%;
}

.site-bar .astral {
  color: #3be8ff;
}

.site-bar .nexxus {
  color: #ff5ad9;
}

.site-bar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.site-bar nav a {
  padding-block: 3px;
}

/* Header: the icon and the pixel wordmark. */
.site-header {
  padding-block: 22px 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.wordmark {
  display: block;
  height: 21px;
  width: auto;
}

/* Hero: what ModTinker is, the download, and the painter canvas. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: 56px;
  padding-block: 48px 72px;
}

.hero h1 {
  font-size: clamp(2.3rem, 4.8vw, 3.6rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.025em;
  max-width: 14ch;
  margin-bottom: 1.25rem;
}

.lead {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 34ch;
}

.download {
  margin: 1.75rem 0 0.75rem;
}

.button {
  display: inline-block;
  padding: 14px 26px;
  border-radius: 10px;
  background: var(--grass);
  color: var(--grass-ink);
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  /* A solid edge underneath, like the side of a block. */
  box-shadow: 0 5px 0 var(--grass-shade);
  transition: transform 80ms ease-out, box-shadow 80ms ease-out, background-color 80ms ease-out;
}

.button:hover {
  background: var(--grass-hover);
}

.button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--grass-shade);
}

.fineprint {
  font-size: 0.95rem;
  color: var(--muted);
}

/* The painter: a 16x16 canvas on a see-through checkerboard, in a wooden frame. */
.painter {
  margin: 0;
  justify-self: end;
  width: min(100%, 360px);
}

.canvas {
  aspect-ratio: 1;
  border: 8px solid var(--plank);
  border-radius: 12px;
  outline: 2px solid var(--plank-dark);
  outline-offset: -2px;
  box-shadow: 0 6px 0 var(--plank-dark);
  background: repeating-conic-gradient(var(--canvas-a) 0 25%, var(--canvas-b) 0 50%) 0 0 / 12.5% 12.5%;
  overflow: hidden;
}

.gem {
  display: block;
  width: 100%;
  height: 100%;
}

.gem rect {
  transform-box: fill-box;
  transform-origin: center;
}

.gem .px-o { fill: var(--px-o); }
.gem .px-w { fill: var(--px-w); }
.gem .px-l { fill: var(--px-l); }
.gem .px-b { fill: var(--px-b); }
.gem .px-d { fill: var(--px-d); }
.gem .px-g { fill: var(--px-g); }
.gem .px-y { fill: var(--px-y); }

.swatches {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.swatch {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  border: 2px solid var(--swatch-edge);
}

.swatch.px-o { background: var(--px-o); }
.swatch.px-w { background: var(--px-w); }
.swatch.px-l { background: var(--px-l); }
.swatch.px-b { background: var(--px-b); }
.swatch.px-d { background: var(--px-d); }
.swatch.px-g { background: var(--px-g); }
.swatch.px-y { background: var(--px-y); }

.swatch.selected {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* The one moment of motion: the gem paints itself in, row by row, then sparkles. */
@media (prefers-reduced-motion: no-preference) {
  .gem rect {
    animation: paint 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  .gem .r3 { animation-delay: 150ms; }
  .gem .r4 { animation-delay: 240ms; }
  .gem .r5 { animation-delay: 330ms; }
  .gem .r6 { animation-delay: 420ms; }
  .gem .r7 { animation-delay: 510ms; }
  .gem .r8 { animation-delay: 600ms; }
  .gem .r9 { animation-delay: 690ms; }
  .gem .r10 { animation-delay: 780ms; }
  .gem .r11 { animation-delay: 870ms; }
  .gem .r12 { animation-delay: 960ms; }
  .gem .r13 { animation-delay: 1050ms; }

  .gem .spark {
    animation: sparkle 520ms ease-out 1250ms both;
  }
}

@keyframes paint {
  from {
    opacity: 0;
    transform: scale(0.2);
  }
}

@keyframes sparkle {
  0% {
    opacity: 0;
    transform: scale(0);
  }

  60% {
    opacity: 1;
    transform: scale(1.7);
  }

  100% {
    opacity: 1;
    transform: none;
  }
}

/* What you can make, and where it plays. */
.makes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px;
  padding-block: 56px;
  border-top: 1px solid var(--line);
}

.pixel-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 62ch;
}

.pixel-list li {
  position: relative;
  padding-left: 24px;
  margin-block: 10px;
}

/* A one-pixel bullet, from the gem's palette. */
.pixel-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.6em;
  width: 8px;
  height: 8px;
  background: var(--px-b);
  box-shadow: 2px 2px 0 var(--px-d);
}

/* How it works: three steps, in order. */
.steps {
  padding-block: 56px;
  border-top: 1px solid var(--line);
}

.steps ol {
  list-style: none;
  counter-reset: step;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
}

.steps li {
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: 4px 4px 0 var(--plank);
}

.steps p {
  color: var(--muted);
  max-width: 34ch;
}

/* The Ruby Pack: the sample mod inside the app, each texture in a little painter frame. */
.ruby {
  padding-block: 56px;
  border-top: 1px solid var(--line);
}

.ruby > p {
  max-width: 62ch;
  color: var(--muted);
}

.slots {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px 14px;
}

.slots li {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 2px;
  text-align: center;
}

/* 64px: four screen pixels for each pixel of the texture. */
.slots img {
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
  padding: 8px;
  box-sizing: content-box;
  border: 3px solid var(--plank);
  border-radius: 8px;
  background: repeating-conic-gradient(var(--canvas-a) 0 25%, var(--canvas-b) 0 50%) 0 0 / 20px 20px;
  image-rendering: pixelated;
}

.slot-name {
  font-weight: 700;
  line-height: 1.25;
}

.slot-stat {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.ruby-more {
  margin: 26px 0 0;
  font-weight: 600;
}

@media (max-width: 820px) {
  .slots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Safe to share: for players and the people who look out for them. */
.safety {
  margin-block: 24px 64px;
  padding: 36px 40px 28px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.safety > p {
  color: var(--muted);
  max-width: 60ch;
}

.site-footer {
  padding-block: 36px 56px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 1rem;
}

.small {
  font-size: 0.85rem;
  max-width: 78ch;
}

@media (max-width: 820px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    padding-block: 28px 56px;
  }

  .painter {
    justify-self: start;
    width: min(100%, 300px);
  }

  .makes,
  .steps ol {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .safety {
    padding: 28px 22px 18px;
  }
}

@media (max-width: 480px) {
  .site-header,
  main > section,
  .site-footer {
    width: min(1080px, 100% - 32px);
  }

  .lead {
    font-size: 1.15rem;
  }
}
