:root {
  --ink: #f4fff8;
  --muted: #d5eee2;
  --gold: #f0c56a;
  --gold-ink: #1c1406;
  color-scheme: dark;
}

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

html {
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  background: #06110d;
  overflow-x: clip;
}

body::before {
  content: "";
  position: fixed;
  inset: -12vmax;
  z-index: -1;
  background:
    radial-gradient(closest-side at 12% 8%, rgba(126, 214, 154, 0.34), transparent 72%),
    radial-gradient(closest-side at 92% 12%, rgba(46, 140, 104, 0.4), transparent 70%),
    radial-gradient(closest-side at 70% 110%, rgba(214, 168, 72, 0.16), transparent 62%),
    #06110d;
}

body.roblox::before {
  background:
    radial-gradient(closest-side at 18% 0%, rgba(168, 112, 255, 0.28), transparent 70%),
    radial-gradient(closest-side at 100% 30%, rgba(64, 120, 96, 0.35), transparent 68%),
    #06110d;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 30;
  padding: 8px 12px;
  background: #fff;
  color: #102117;
  border-radius: 10px;
}

.skip:focus {
  top: 12px;
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top));
  padding-left: max(14px, env(safe-area-inset-left));
  padding-right: max(14px, env(safe-area-inset-right));
  background: rgba(10, 24, 18, 0.46);
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}

.brand,
.home-link {
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.home-link {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
}

.brand {
  margin-right: auto;
  font-size: 1.15rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav {
  display: none;
  gap: 14px;
  font-size: 0.92rem;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
}

.play {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--gold-ink);
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.glass {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 28px;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.46);
  backdrop-filter: blur(22px) saturate(1.45);
  -webkit-backdrop-filter: blur(22px) saturate(1.45);
}

.kicker {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0 0 10px;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

h1 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
}

h2 {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
}

p,
li,
dd {
  color: var(--muted);
  line-height: 1.45;
}

.lede {
  font-size: 1.05rem;
}

.doors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: min(1040px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.door {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 280px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
}

.door::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.22), transparent 34%, transparent 68%, rgba(255, 255, 255, 0.08));
}

.door img {
  width: 100%;
  height: 190px;
  object-fit: contain;
  border-radius: 18px;
}

.door .cover {
  height: auto;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.2);
}

.door h2 {
  margin-top: 4px;
}

.door p {
  margin: 0;
}

.go {
  margin-top: auto;
  align-self: flex-start;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: var(--ink);
  font-weight: 700;
}

.intro-page {
  width: min(1040px, calc(100% - 28px));
  margin: 0 auto;
  padding: 8px 0 0;
}

.intro-page h1 {
  margin-bottom: 8px;
}

.page {
  width: min(860px, calc(100% - 28px));
  margin: 0 auto;
  padding: 16px 0 36px;
  display: grid;
  gap: 14px;
}

.page .glass {
  padding: 16px;
}

.cover-frame {
  padding: 10px;
}

.cover-frame img {
  display: block;
  width: 100%;
  border-radius: 18px;
}

.play.block {
  margin: 14px 0 0;
}

body.deck-page {
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.stage {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 12px 10px max(10px, env(safe-area-inset-bottom));
}

.deck {
  position: relative;
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.track {
  --n: 7;
  --i: 0;
  display: flex;
  height: 100%;
  width: calc(var(--n) * 100%);
  transform: translateX(calc(var(--i) * -100% / var(--n)));
}

.deck.is-ready .track {
  transition: transform 0.45s cubic-bezier(0.22, 0.8, 0.28, 1);
}

.slide {
  flex: 0 0 calc(100% / var(--n));
  width: calc(100% / var(--n));
  min-width: 0;
  height: 100%;
  padding: 0 4px;
}

.card {
  height: 100%;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 18px 16px 16px;
}

.card h2,
.card h3,
.card p,
.card ol,
.card ul,
.card dl {
  margin-top: 0;
}

.intro {
  display: grid;
  gap: 8px;
}

.frog,
.chest {
  display: block;
  width: min(210px, 68%);
  margin: 0 auto 8px;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.35));
}

.steps,
.ladder,
.slots,
.facts {
  margin: 8px 0 12px;
  padding: 0;
  list-style: none;
}

.steps li,
.ladder li,
.slots li,
.facts li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.slots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.slots li {
  margin: 0;
}

.num,
.bead {
  flex: 0 0 auto;
}

.num {
  width: 1.5rem;
  height: 1.5rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.bead {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.r1 { background: #9aa399; }
.r2 { background: #5cae62; }
.r3 { background: #3d93c9; }
.r4 { background: #8c64d6; }
.r5 { background: #d2b48a; }
.r6 { background: #e08a3c; }
.r7 { background: #d4544a; }
.r8 { background: #e58cb8; }
.r9 { background: conic-gradient(from 30deg, #f6e7ff, #ffe7a3, #ffd0e6, #f6e7ff); }
.r10 { background: #e6b43c; }
.r11 {
  background: #f4fff6;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08), 0 0 12px rgba(244, 255, 246, 0.45);
}

.finals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 12px;
}

.finals div {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.finals dt {
  font-weight: 700;
  color: var(--ink);
}

.finals dd {
  margin: 4px 0 0;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 0 0 auto;
  padding-top: 6px;
}

.arrow {
  position: static;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: rgba(16, 32, 26, 0.45);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.dots {
  display: flex;
  justify-content: center;
  gap: 0;
  padding: 0;
  flex: 0 1 auto;
}

.dots button {
  width: 36px;
  height: 36px;
  border: 0;
  padding: 0;
  background: transparent;
  display: grid;
  place-items: center;
}

.dots button::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.38);
}

.dots button[aria-current="true"]::before {
  width: 20px;
  background: #fff;
}

.status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.studio {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 16px;
}

.studio p {
  margin: 0 0 10px;
}

.studio p:last-child {
  margin-bottom: 0;
}

a.mail {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.dev-line {
  min-width: 0;
  overflow-wrap: break-word;
}

.intro > .dev-line {
  margin: 0;
}

@media (min-width: 800px) {
  .intro,
  .split {
    display: grid;
    grid-template-columns: 220px 1fr;
    align-items: center;
  }

  .intro > .dev-line {
    grid-column: 1 / -1;
    align-self: start;
  }

  .frog,
  .chest {
    width: 220px;
    margin: 0;
  }

  .split .chest {
    grid-row: 1 / span 4;
  }
}

@media (min-width: 980px) {
  .nav {
    display: flex;
  }
}

@media (max-width: 800px) {
  .doors {
    grid-template-columns: 1fr;
  }

  .finals,
  .slots {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .deck.is-ready .track {
    transition: none;
  }
}

#projects {
  grid-column: 1 / -1;
  min-width: 0;
  max-width: 100%;
  padding: 16px;
  scroll-margin-top: 84px;
}

#projects [hidden] {
  display: none !important;
}

.projects p,
.projects h2 {
  overflow-wrap: break-word;
}

.projects a {
  overflow-wrap: anywhere;
}

.hint {
  margin: 0 0 10px;
  font-size: 0.9rem;
}

.tabs,
.chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 0;
}

.tabs button,
.chips button,
.projects button {
  font: inherit;
  cursor: pointer;
}

.tabs button,
.chips button {
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  appearance: none;
  -webkit-appearance: none;
}

.tabs button[aria-selected="true"],
.chips button[aria-pressed="true"] {
  background: rgba(240, 197, 106, 0.22);
  border-color: rgba(240, 197, 106, 0.75);
}

.proj-arrows {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 12px;
}

.proj-panel {
  min-width: 0;
}

.detail {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

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

.projects .go {
  margin-top: 0;
  align-self: center;
  text-decoration: none;
}

.projects button.go {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.sources {
  margin: 12px 0 0;
  font-size: 0.86rem;
}

.sources a,
a.more-projects {
  color: var(--gold);
  font-weight: 700;
}

a.more-projects {
  text-decoration: none;
}

.stage > a.more-projects {
  flex: 0 0 auto;
  align-self: center;
  margin-top: 4px;
  font-size: 0.92rem;
}

.mountain {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  min-width: 0;
  margin-top: 8px;
  padding: 10px;
  border-radius: 72px 72px 18px 18px;
  background:
    radial-gradient(closest-side at 50% 28%, rgba(168, 112, 255, 0.35), transparent 72%),
    rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.stone {
  aspect-ratio: 1;
  min-width: 0;
  min-height: 36px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(92, 122, 104, 0.55);
  color: transparent;
}

.stone.is-dug {
  background: rgba(0, 0, 0, 0.38);
  border-color: rgba(255, 255, 255, 0.08);
}

.stone.is-spark {
  background: radial-gradient(circle, #f0c56a 0%, #a070ff 72%);
  border-color: rgba(240, 197, 106, 0.9);
  box-shadow: 0 0 14px rgba(168, 112, 255, 0.85);
}

@media (min-width: 800px) {
  .tabs,
  .chips {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
