/* AstralNexxus's website (home, about, mods, not found). Its look comes from the channel's banner:
   a violet night sky with constellations, a neon sign in cyan ("Astral") and pink ("Nexxus"), and
   screens with cut corners. ModTinker has its own page in the app's own colors (modtinker.css).
   No web fonts, scripts or outside files. */

:root {
  color-scheme: dark;
  --night: #150b3d;
  --panel-top: #221361;
  --panel-bottom: #190e4b;
  --star: #f4f0ff;
  --haze: #cbc2f3;
  --line: rgba(170, 140, 255, 0.32);
  --cyan: #3be8ff;
  --cyan-glow: rgba(59, 232, 255, 0.55);
  --pink: #ff5ad9;
  --pink-hover: #ff82e4;
  --pink-glow: rgba(255, 90, 217, 0.5);
  --pink-ink: #24052f;
  --violet: #8f4dff;
  --display: Bahnschrift, "DIN Alternate", "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  color: var(--star);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  background-color: var(--night);
  /* A quiet star field (a few dots, tiled) under a violet glow at the top, like the banner's sky. */
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.75) 0 1px, transparent 1.6px),
    radial-gradient(circle at 67% 41%, rgba(255, 255, 255, 0.5) 0 1px, transparent 1.6px),
    radial-gradient(circle at 36% 77%, rgba(190, 240, 255, 0.55) 0 1px, transparent 1.6px),
    radial-gradient(circle at 88% 86%, rgba(255, 200, 245, 0.6) 0 1.2px, transparent 1.8px),
    radial-gradient(circle at 52% 7%, rgba(255, 255, 255, 0.45) 0 0.8px, transparent 1.4px),
    radial-gradient(ellipse 90% 100% at 50% 0%, #2c1677 0%, transparent 70%);
  background-size: 360px 360px, 360px 360px, 360px 360px, 360px 360px, 360px 360px, 100% 1100px;
  background-repeat: repeat, repeat, repeat, repeat, repeat, no-repeat;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--cyan);
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

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

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 10;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--cyan);
  color: var(--night);
  font-weight: 700;
}

.skip:focus {
  top: 12px;
}

.top,
main > *,
.site-footer {
  width: min(1120px, 100% - 40px);
  margin-inline: auto;
}

.astral {
  color: var(--cyan);
}

.nexxus {
  color: var(--pink);
}

/* Buttons: Subscribe is the loud pink one, the others are a cyan outline. */
.button-sub,
.button-ghost {
  display: inline-block;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 120ms ease-out, box-shadow 120ms ease-out;
}

.button-sub {
  padding: 12px 24px;
  background: var(--pink);
  color: var(--pink-ink);
}

.button-sub:hover {
  background: var(--pink-hover);
  box-shadow: 0 0 22px var(--pink-glow);
}

.button-ghost {
  padding: 10px 22px;
  border: 2px solid var(--cyan);
  color: var(--cyan);
}

.button-ghost:hover {
  background: rgba(59, 232, 255, 0.12);
  box-shadow: 0 0 18px rgba(59, 232, 255, 0.35);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Header: the channel picture and the two-color name, the pages, and Subscribe. */
.top {
  display: flex;
  align-items: center;
  gap: 12px 28px;
  padding-block: 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
}

.logo img {
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--cyan), 0 0 14px var(--cyan-glow);
}

.top nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
}

.top nav a {
  padding-block: 4px;
  color: var(--haze);
  font-weight: 600;
  text-decoration: none;
}

.top nav a:hover {
  color: var(--star);
}

.top nav a[aria-current="page"] {
  color: var(--star);
  box-shadow: inset 0 -2px 0 var(--pink);
}

.top .button-sub {
  padding: 8px 18px;
}

/* Screens with cut corners, like the ones in the banner: a neon edge (the outer box's gradient
   showing through 1.5px of padding) around a dark inside cut the same way. */
.panel {
  --cut: 18px;
  display: flex;
  padding: 1.5px;
  background: linear-gradient(140deg, var(--cyan), var(--violet) 55%, var(--pink));
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}

.panel-in {
  --inner-cut: calc(var(--cut) - 0.9px);
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 26px 24px 22px;
  background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
  clip-path: polygon(var(--inner-cut) 0, 100% 0, 100% calc(100% - var(--inner-cut)), calc(100% - var(--inner-cut)) 100%, 0 100%, 0 var(--inner-cut));
}

.panel-in > :last-child {
  margin-bottom: 0;
}

/* Sections. */
.section {
  padding-block: 56px;
}

.section > h2,
.page-head h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
}

.section-intro {
  max-width: 60ch;
  margin: 10px 0 28px;
  color: var(--haze);
}

/* Home: the neon sign, a few words, and the channel picture in its ring. */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: 48px;
  padding-block: 64px 72px;
}

.sky {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.neon {
  font-size: clamp(2.6rem, 9.6vw, 6.4rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
}

.neon span {
  display: inline-block;
  color: var(--tube);
  filter: drop-shadow(0 0 0.05em var(--tube)) drop-shadow(0 0 0.22em var(--tube-glow));
}

.neon .astral {
  --tube: var(--cyan);
  --tube-glow: var(--cyan-glow);
}

.neon .nexxus {
  --tube: var(--pink);
  --tube-glow: var(--pink-glow);
}

/* Glass tubes, where the browser can outline text: a thick outline painted first, then the
   letter filled dark on top. That leaves the outer half of the outline showing, and hides the
   lines where the font's own strokes overlap (inside an A, N or x). */
@supports (-webkit-text-stroke: 1px black) and (paint-order: stroke fill) {
  .neon span {
    color: #23115f;
    -webkit-text-stroke: 0.064em var(--tube);
    paint-order: stroke fill;
  }
}

.tagline {
  margin: 18px 0 22px;
  font-family: var(--display);
  font-size: clamp(1.05rem, 2.2vw, 1.4rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lead {
  max-width: 44ch;
  color: var(--haze);
  font-size: 1.2rem;
  line-height: 1.55;
}

.hero .actions {
  margin-top: 28px;
}

.hero-art {
  position: relative;
  justify-self: center;
  width: min(100%, 400px);
  margin: 0;
  aspect-ratio: 1;
}

.hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--cyan), 0 0 0 10px rgba(143, 77, 255, 0.3), 0 0 60px rgba(59, 232, 255, 0.35), 0 0 120px rgba(255, 90, 217, 0.25);
}

/* An orbit around the picture. */
.hero-art::after {
  content: "";
  position: absolute;
  inset: -26px;
  border: 1.5px dashed rgba(255, 90, 217, 0.55);
  border-radius: 50%;
}

/* What's on the channel. */
.topics {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.icon {
  width: 36px;
  height: 36px;
  margin-bottom: 16px;
  color: var(--cyan);
  filter: drop-shadow(0 0 6px var(--cyan-glow));
}

.topics li:nth-child(even) .icon {
  color: var(--pink);
  filter: drop-shadow(0 0 6px var(--pink-glow));
}

.topics h3,
.series h3 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.topics p,
.series p {
  color: var(--haze);
}

.topics a,
.series a {
  margin-top: auto;
  font-weight: 600;
}

/* Join the Nexxus: the last word, a big Subscribe. */
.join {
  --cut: 28px;
  margin-block: 24px 72px;
}

.join .panel-in {
  align-items: center;
  padding: 48px 32px 44px;
  text-align: center;
  background:
    radial-gradient(ellipse 60% 90% at 50% 0%, rgba(143, 77, 255, 0.35), transparent 70%),
    linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
}

.join h2 {
  font-size: clamp(2rem, 4.6vw, 3.2rem);
}

.join p {
  max-width: 46ch;
  margin: 14px 0 26px;
  color: var(--haze);
  font-size: 1.15rem;
}

.fineprint {
  margin: 0;
  font-size: 0.95rem;
}

/* A texture on a see-through checkerboard in a wooden frame, like ModTinker's pixel painter.
   Inside the frame it's 256px: 16px a pixel of the texture. */
.canvas-frame {
  --paper-a: #ffffff;
  --paper-b: #e2e9f2;
  --plank: #b9773d;
  --plank-dark: #8a5528;
  width: 272px;
  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(--paper-a) 0 25%, var(--paper-b) 0 50%) 0 0 / 12.5% 12.5%;
  overflow: hidden;
}

.canvas-frame img {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* About and Mods: a page title, then the page. */
.page-head {
  padding-block: 48px 8px;
}

.page-head .lead {
  margin-top: 14px;
}

.page-head + .section {
  padding-top: 32px;
}

.channel-art {
  margin: 32px 0 8px;
  padding: 3px;
  border-radius: 24px;
  background: linear-gradient(115deg, var(--cyan), var(--violet) 50%, var(--pink));
  box-shadow: 0 0 30px rgba(59, 232, 255, 0.25), 0 0 64px rgba(255, 90, 217, 0.16);
}

.channel-art img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 21px;
}

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  align-items: start;
  gap: 56px;
}

.about-main h2 {
  margin: 48px 0 14px;
  font-size: 1.9rem;
}

.about-main h2:first-child {
  margin-top: 0;
}

.about-main > p {
  max-width: 62ch;
  color: var(--haze);
}

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

.game {
  margin-bottom: 6px;
  color: var(--pink);
  font-weight: 600;
}

.about-side {
  position: sticky;
  top: 24px;
}

.about-side h2 {
  margin-bottom: 14px;
  font-size: 1.3rem;
}

.about-side h2:not(:first-child) {
  margin-top: 26px;
}

.about-side p {
  color: var(--haze);
}

.chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips li {
  padding: 3px 12px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
}

/* Mods: the Ruby Pack, how to get it, and everything in it with its recipe. */
.mod-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 48px;
}

.mod-intro h2 {
  margin-bottom: 14px;
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
}

.mod-intro > div > p {
  max-width: 56ch;
  color: var(--haze);
}

.mod-art {
  margin: 0;
}

.mod-intro h3 {
  margin: 28px 0 12px;
  font-size: 1.35rem;
}

.steps {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: 12px;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  color: var(--haze);
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--cyan);
  border-radius: 8px;
  color: var(--cyan);
  font-family: var(--display);
  font-weight: 700;
  box-shadow: 0 0 12px rgba(59, 232, 255, 0.35);
}

.steps strong {
  color: var(--star);
}

.mod-intro .fineprint {
  margin-top: 14px;
  color: var(--haze);
}

.items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

/* 96px: six screen pixels for each pixel of the texture. */
.item-art {
  width: 96px;
  height: 96px;
  margin-bottom: 14px;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
}

.items h3 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.items p {
  color: var(--haze);
}

.recipe {
  margin-top: auto;
  padding-top: 8px;
}

.recipe-kind {
  margin-bottom: 8px;
  color: var(--cyan);
  font-size: 0.9rem;
  font-weight: 600;
}

.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  gap: 4px;
}

.grid1 {
  display: grid;
  grid-template-columns: 44px;
}

.cell {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: rgba(10, 5, 35, 0.55);
}

/* 32px: two screen pixels for each pixel of the texture. */
.cell img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

/* The page-not-found page. */
.missing {
  min-height: 55vh;
  padding-block: 64px;
}

.missing h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.2rem);
}

.missing p {
  margin-top: 12px;
  color: var(--haze);
}

/* Footer: contact, the pages, ModTinker's legal pages, and the small print. */
.site-footer {
  padding-block: 44px 56px;
  border-top: 1px solid var(--line);
  color: var(--haze);
  font-size: 0.95rem;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  margin-bottom: 28px;
}

.site-footer h2 {
  margin-bottom: 12px;
  color: var(--star);
  font-size: 1.2rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

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

/* Tablets. */
@media (max-width: 980px) {
  .topics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .about-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .about-side {
    position: static;
  }
}

/* Phones. */
@media (max-width: 760px) {
  .top {
    flex-wrap: wrap;
  }

  .top nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 18px;
    overflow-x: auto;
  }

  .top .button-sub {
    margin-left: auto;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 56px;
    padding-block: 36px 48px;
  }

  .hero-art {
    width: min(100% - 52px, 300px);
  }

  .canvas-frame {
    width: 208px;
  }

  .series,
  .mod-intro {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .footer-top > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .top,
  main > *,
  .site-footer {
    width: min(1120px, 100% - 32px);
  }

  .logo {
    font-size: 1.2rem;
  }

  .topics,
  .items {
    grid-template-columns: minmax(0, 1fr);
  }

  .join .panel-in {
    padding: 36px 20px 32px;
  }
}

/* Motion, only if it's welcome: the neon sign switches on once when the home page opens. */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .neon .astral {
    animation: neon-on 1.3s linear 0.2s both;
  }

  .neon .nexxus {
    animation: neon-on 1.3s linear 0.55s both;
  }
}

@keyframes neon-on {
  0% {
    opacity: 0.12;
  }

  10% {
    opacity: 1;
  }

  14% {
    opacity: 0.25;
  }

  20% {
    opacity: 1;
  }

  24% {
    opacity: 0.55;
  }

  30%,
  100% {
    opacity: 1;
  }
}
