:root {
  --ink: #151510;
  --paper: #eee8d9;
  --orange: #ee4b2b;
  --yellow: #f2d23f;
  --photo: #272465;
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 30;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--yellow);
  border: 2px solid var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.glass {
  background: rgb(16 17 15 / 84%);
  border: 1px solid rgb(255 255 255 / 32%);
  box-shadow: 0 18px 55px rgb(0 0 0 / 22%), inset 0 1px rgb(255 255 255 / 20%);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.site-nav {
  position: fixed;
  z-index: 20;
  top: max(18px, env(safe-area-inset-top));
  left: max(20px, env(safe-area-inset-left));
  right: max(20px, env(safe-area-inset-right));
  min-height: 56px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f7f2e5;
  border-radius: 18px;
}

.logo {
  font-size: 25px;
  font-weight: 950;
  letter-spacing: -0.075em;
  text-decoration: none;
}

.logo b {
  color: var(--yellow);
}

.nav-links {
  display: flex;
  gap: 19px;
}

.nav-links a {
  color: rgb(255 255 255 / 72%);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-decoration: none;
  text-transform: uppercase;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: #fff;
}

.hub-shell {
  position: relative;
  width: min(100%, 1280px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 94px 20px 20px;
  display: grid;
  grid-template-columns: minmax(270px, 0.78fr) minmax(450px, 1.22fr);
  gap: 15px;
  isolation: isolate;
}

.hub-shell::before {
  position: absolute;
  z-index: -1;
  left: -60px;
  bottom: -110px;
  width: 270px;
  aspect-ratio: 1;
  content: "";
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 50%;
}

.hub-shell::after {
  position: absolute;
  z-index: -1;
  right: -82px;
  top: 55px;
  width: 230px;
  aspect-ratio: 1;
  content: "";
  background: var(--orange);
  border: 3px solid var(--ink);
  transform: rotate(16deg);
}

.manifesto {
  position: relative;
  min-height: 535px;
  overflow: hidden;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--orange);
  border: 3px solid var(--ink);
}

.arabic {
  position: absolute;
  right: -13px;
  top: -26px;
  margin: 0;
  font-size: clamp(108px, 17vw, 205px);
  font-weight: 950;
  line-height: 0.85;
}

.burst {
  position: absolute;
  left: 21px;
  top: 24px;
  width: 86px;
  aspect-ratio: 1;
  margin: 0;
  display: grid;
  place-items: center;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 950;
  line-height: 1.05;
  text-align: center;
  transform: rotate(-8deg);
}

.manifesto-copy {
  position: relative;
  z-index: 1;
}

.manifesto h1 {
  margin: 0;
  font-size: clamp(44px, 6vw, 78px);
  line-height: 0.83;
  letter-spacing: -0.08em;
}

.manifesto-copy p {
  max-width: 300px;
  margin: 15px 0 0;
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.45;
}

.worlds {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 15px;
}

.world-button {
  --world-hover-shadow: 8px 8px 0 #151510;
  position: relative;
  min-height: 258px;
  overflow: hidden;
  padding: 18px 18px 17px;
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1.2fr);
  gap: 14px;
  color: #f8f4e9;
  background: var(--photo);
  border: 3px solid var(--ink);
  text-decoration: none;
  touch-action: pan-y;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.world-button.glow {
  color: #f4fff4;
  background: #101512;
  border-color: #31483d;
  box-shadow: inset 0 0 0 6px #151d18;
}

.world-button.nightkindle {
  color: #fff3cf;
  background: #1a1b3d;
  border-color: #292a57;
  box-shadow: inset 0 0 0 6px #22234d;
}

@media (hover: hover) and (pointer: fine) {
  .world-button:hover {
    transform: translate(-4px, -4px);
    box-shadow: var(--world-hover-shadow);
    outline: 4px solid var(--yellow);
    outline-offset: -7px;
  }
}

.world-button:focus-visible {
  transform: translate(-4px, -4px);
  box-shadow: var(--world-hover-shadow);
  outline: 4px solid var(--yellow);
  outline-offset: -7px;
}

.world-copy {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.world-index {
  font-size: 0.6rem;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.world-title {
  margin: auto 0 7px;
  font-size: clamp(31px, 4.6vw, 58px);
  line-height: 0.82;
  letter-spacing: -0.065em;
}

.world-meta {
  opacity: 0.72;
  font-size: 0.66rem;
  line-height: 1.35;
}

.launch {
  position: absolute;
  z-index: 6;
  right: 14px;
  bottom: 13px;
  width: 43px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 50%;
  font-size: 20px;
  font-weight: 950;
}

.glow .launch {
  color: #07140d;
  background: #74f2a1;
  border-color: #07140d;
  box-shadow: 0 0 22px rgb(116 242 161 / 28%);
}

.nightkindle .launch {
  color: #211a32;
  background: #ffd36b;
  border-color: #211a32;
  box-shadow: 0 0 22px rgb(255 211 107 / 24%);
}

.maze-poster {
  position: relative;
  min-height: 218px;
  overflow: hidden;
  background: #070a1b;
  border: 1px solid rgb(82 247 255 / 28%);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgb(158 92 255 / 15%), 0 0 22px rgb(82 247 255 / 9%);
}

.maze-grid {
  position: absolute;
  z-index: 1;
  inset: 6px;
  display: grid;
  grid-template-columns: repeat(23, 1fr);
  grid-template-rows: repeat(13, 1fr);
  gap: 1px;
}

.maze-cell {
  position: relative;
  height: 100%;
  aspect-ratio: 1;
  justify-self: center;
}

.maze-cell.wall {
  background: #151744;
  border: 1px solid rgb(82 247 255 / 58%);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgb(158 92 255 / 26%);
}

.maze-cell.path::after {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  aspect-ratio: 1;
  content: "";
  background: #ffd84d;
  border-radius: 50%;
  box-shadow: 0 0 5px rgb(255 216 77 / 80%);
  transform: translate(-50%, -50%);
}

.maze-cell.house::after,
.maze-cell.gate::after {
  display: none;
}

.maze-cell.house {
  background: #9e5cff;
  border: 1px solid #52f7ff;
  border-radius: 2px;
  opacity: 0.35;
}

.maze-cell.gate {
  background: #ff79cf;
  border-radius: 99px;
  transform: scale(0.75, 0.28);
}

.maze-cell.power::after {
  width: 9px;
  background: #ffe24d;
  box-shadow: 0 0 12px rgb(255 240 122 / 95%);
}

.pacman-sprite {
  position: absolute;
  z-index: 5;
  left: 10%;
  bottom: 6%;
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 0 11px rgb(255 216 77 / 85%));
}

.ghost {
  --ghost: #ff4b5c;
  position: absolute;
  z-index: 4;
  width: 51px;
  height: 58px;
}

.ghost img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top center;
  border-radius: 15px;
  filter: drop-shadow(0 0 8px var(--ghost));
}

.ghost::before {
  position: absolute;
  z-index: 1;
  left: -24px;
  top: 18px;
  width: 30px;
  height: 3px;
  content: "";
  background: var(--ghost);
  border-radius: 99px;
  box-shadow: -8px 10px 0 var(--ghost);
  opacity: 0.68;
}

.ghost::after {
  position: absolute;
  z-index: 0;
  left: 3px;
  right: 3px;
  bottom: -3px;
  height: 13px;
  content: "";
  background: var(--ghost);
  border-radius: 50%;
  opacity: 0.52;
  filter: blur(4px);
}

.ghost.red {
  --ghost: #ff4b5c;
  right: 33%;
  top: 31%;
}

.ghost.pink {
  --ghost: #ff79cf;
  right: 15%;
  top: 33%;
  transform: scale(0.92);
}

.ghost.cyan {
  --ghost: #52f7ff;
  right: 31%;
  bottom: 16%;
  transform: scale(0.88);
}

.ghost.orange {
  --ghost: #ffad42;
  right: 13%;
  bottom: 12%;
  transform: scale(0.98);
}

.trail-poster {
  position: relative;
  min-height: 218px;
  overflow: hidden;
  background: #07100d;
  border: 1px solid rgb(73 104 90 / 95%);
  border-radius: 6px;
  box-shadow: inset 0 0 0 5px rgb(116 242 161 / 2.5%), 0 0 24px rgb(116 242 161 / 14%);
}

.trail-poster::before {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  top: 62%;
  height: 1px;
  content: "";
  background: rgb(116 242 161 / 30%);
  box-shadow: 0 0 15px 5px rgb(116 242 161 / 7%);
}

.trail-grid {
  position: absolute;
  z-index: 1;
  inset: 0;
}

.grid-v,
.grid-h {
  position: absolute;
  background: rgb(116 242 161 / 10%);
}

.grid-v.major,
.grid-h.major {
  background: rgb(116 242 161 / 22%);
}

.grid-v {
  top: 0;
  bottom: 0;
  width: 1px;
}

.grid-h {
  left: 0;
  right: 0;
  height: 1px;
}

.snake-segment {
  position: absolute;
  z-index: 3;
  width: 23px;
  height: 23px;
  display: block;
  background: #74f2a1;
  border: 1px solid #102116;
  border-radius: 6px;
  box-shadow: 0 0 13px rgb(114 226 139 / 66%);
}

.snake-segment.tail { left: 30%; top: 55%; }
.snake-segment.body { left: 39%; top: 55%; }
.snake-segment.head { left: 48%; top: 55%; background: #a6ffba; box-shadow: 0 0 22px rgb(114 226 139 / 95%); }

.snake-segment.head::before,
.snake-segment.head::after {
  position: absolute;
  right: 4px;
  width: 5px;
  height: 5px;
  content: "";
  background: #102116;
  border-radius: 50%;
}

.snake-segment.head::before {
  top: 4px;
}

.snake-segment.head::after {
  bottom: 4px;
}

.core {
  position: absolute;
  z-index: 4;
  left: 30%;
  top: 25%;
  width: 24px;
  height: 24px;
  background: #f4bf49;
  border: 3px solid #fff4bd;
  border-radius: 50%;
  box-shadow: 0 0 22px rgb(244 191 73 / 78%), 0 0 0 10px rgb(244 191 73 / 10%), 0 0 0 19px rgb(244 191 73 / 6%);
}

.glow-label {
  position: absolute;
  z-index: 5;
  right: 9px;
  top: 8px;
  min-height: 27px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #f4fff4;
  background: #13231a;
  border: 1px solid #49685a;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.09em;
}

.glow-label::before {
  width: 7px;
  aspect-ratio: 1;
  content: "";
  background: #74f2a1;
  border-radius: 50%;
  box-shadow: 0 0 9px rgb(116 242 161 / 80%);
}

.kindle-poster {
  position: relative;
  min-height: 218px;
  overflow: hidden;
  background: #292a57;
  border: 1px solid #4a3b61;
  border-radius: 6px;
  box-shadow: inset 0 0 0 5px rgb(255 211 107 / 3%), 0 0 24px rgb(255 211 107 / 10%);
}

.kindle-poster::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  border: 7px solid rgb(26 27 61 / 38%);
  pointer-events: none;
}

.kindle-stars {
  position: absolute;
  z-index: 1;
  inset: 0;
}

.kindle-stars i {
  position: absolute;
  width: 3px;
  aspect-ratio: 1;
  display: block;
  background: #ffd36b;
  box-shadow: 0 0 7px rgb(255 211 107 / 72%);
  transform: rotate(45deg);
}

.kindle-stars i:nth-child(1) { left: 12%; top: 21%; }
.kindle-stars i:nth-child(2) { left: 24%; top: 12%; width: 2px; }
.kindle-stars i:nth-child(3) { left: 39%; top: 26%; }
.kindle-stars i:nth-child(4) { left: 51%; top: 10%; width: 2px; }
.kindle-stars i:nth-child(5) { left: 62%; top: 35%; width: 2px; }
.kindle-stars i:nth-child(6) { left: 72%; top: 18%; }
.kindle-stars i:nth-child(7) { left: 87%; top: 47%; width: 2px; }

.kindle-crescent {
  position: absolute;
  z-index: 2;
  right: 23%;
  top: 12%;
  width: 48px;
  aspect-ratio: 1;
  display: block;
  overflow: hidden;
  background: #ffd36b;
  border-radius: 50%;
  box-shadow: 0 0 0 10px rgb(255 211 107 / 8%), 0 0 20px rgb(255 211 107 / 22%);
}

.kindle-crescent::after {
  position: absolute;
  left: 17px;
  top: -6px;
  width: 44px;
  aspect-ratio: 1;
  content: "";
  background: #292a57;
  border-radius: 50%;
}

.kindle-rooftops {
  position: absolute;
  z-index: 2;
  left: -4%;
  right: -4%;
  bottom: -1px;
  height: 35%;
  display: block;
  background: #343059;
  clip-path: polygon(0 48%, 8% 31%, 15% 44%, 24% 19%, 33% 46%, 41% 29%, 50% 49%, 60% 24%, 69% 43%, 78% 18%, 88% 39%, 94% 27%, 100% 47%, 100% 100%, 0 100%);
}

.kindle-rooftops::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -18%;
  height: 72%;
  content: "";
  background: #49334e;
  clip-path: polygon(0 39%, 12% 19%, 23% 43%, 36% 12%, 48% 42%, 62% 17%, 75% 41%, 88% 8%, 100% 39%, 100% 100%, 0 100%);
}

.kindle-opening {
  position: absolute;
  z-index: 3;
  right: 7%;
  width: 58px;
  display: block;
  background: #49334e;
  border: 2px solid #15152f;
  box-shadow: 5px 6px 0 rgb(8 10 28 / 42%);
}

.kindle-opening::after {
  position: absolute;
  left: -6px;
  width: calc(100% + 12px);
  height: 10px;
  content: "";
  background: #c57358;
  border: 2px solid #15152f;
}

.kindle-opening.top {
  top: -2px;
  height: 29%;
}

.kindle-opening.top::after {
  bottom: -5px;
}

.kindle-opening.bottom {
  bottom: -2px;
  height: 31%;
}

.kindle-opening.bottom::after {
  top: -5px;
}

.nim-sprite {
  position: absolute;
  z-index: 5;
  left: 24%;
  top: 37%;
  width: 104px;
  height: 104px;
  overflow: visible;
  filter: drop-shadow(0 6px 0 rgb(8 10 27 / 36%)) drop-shadow(0 0 10px rgb(255 211 107 / 28%));
  transform: rotate(3deg);
}

@media (max-width: 800px) {
  .hub-shell {
    min-height: 970px;
    grid-template-columns: 1fr;
    grid-template-rows: 300px 1fr;
  }

  .manifesto {
    min-height: 300px;
  }

  .arabic {
    font-size: 135px;
  }

  .world-button {
    grid-template-columns: 0.8fr 1.2fr;
  }
}

@media (max-width: 540px) {
  .site-nav {
    left: 12px;
    right: 12px;
  }

  .hub-shell {
    min-height: 1150px;
    padding-inline: 12px;
  }

  .world-button {
    grid-template-columns: 1fr;
    grid-template-rows: auto 190px;
  }

  .world-copy {
    min-height: 112px;
  }

  .maze-poster,
  .trail-poster,
  .kindle-poster {
    min-height: 190px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .world-button:focus-visible {
    transform: none;
    box-shadow: var(--world-hover-shadow);
  }
}

@media (prefers-reduced-motion: reduce) and (hover: hover) and (pointer: fine) {
  .world-button:hover {
    transform: none;
    box-shadow: var(--world-hover-shadow);
  }
}
