:root {
  --bg: #10110E;
  --surface: #1A1C16;
  --text: #F4F2EA;
  --text-secondary: #B7B8AE;
  --line: #2C2E26;
  --accent: #E2F36B;
  --accent-text: #14160A;
  --ink: #F4F2EA;
  --muted: #B7B8AE;
  --gold: #E2F36B;
  --gold-ink: #14160A;
  color-scheme: dark;
}

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

html {
  overflow-x: clip;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background: var(--bg);
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  overflow-x: clip;
}

body::before,
body.roblox::before {
  content: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

a {
  color: var(--text);
}

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

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 30;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
}

.skip:focus {
  top: 12px;
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  backdrop-filter: none;
}

.brand,
.home-link {
  text-decoration: none;
  font-family: Manrope, system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0;
}

.home-link {
  width: 48px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  flex: 0 0 auto;
}

.home-link:active {
  background: var(--surface);
}

.brand {
  margin-right: auto;
  font-size: 20px;
  line-height: 26px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav {
  display: none;
  gap: 16px;
  font-size: 16px;
  line-height: 24px;
}

.nav a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 600;
}

.play {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 16px;
  line-height: 20px;
  font-weight: 600;
  box-shadow: none;
  transition: filter 80ms linear, transform 80ms linear;
}

.play:active {
  filter: brightness(0.92);
  transform: scale(0.98);
}

.glass {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: none;
  backdrop-filter: none;
}

.kicker {
  margin: 0 0 8px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

h1,
h2,
h3 {
  margin: 0 0 8px;
  font-family: Manrope, system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text);
}

h1 {
  font-size: 24px;
  line-height: 30px;
}

h2 {
  font-size: 17px;
  line-height: 22px;
}

h3 {
  font-size: 17px;
  line-height: 22px;
}

p,
li,
dd {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 24px;
}

.lede {
  font-size: 16px;
  line-height: 24px;
  margin: 0;
}

.doors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  width: 100%;
  margin: 24px 0 0;
  padding: 0 0 8px;
}

.door {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform 80ms linear;
}

.door:active {
  transform: scale(0.98);
}

.door::after {
  content: none;
}

.door img {
  width: 100%;
  height: 190px;
  object-fit: contain;
  border-radius: 12px;
  background: var(--bg);
}

.door .cover {
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg);
}

.door h2 {
  margin: 0;
}

.door p {
  margin: 0;
}

.go {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
  line-height: 20px;
}

.door .go {
  border: 0;
  background: var(--accent);
  color: var(--accent-text);
}

.intro-page {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 24px 16px calc(32px + env(safe-area-inset-bottom));
}

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

.page {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 24px 16px calc(32px + env(safe-area-inset-bottom));
  display: grid;
  gap: 24px;
}

.page .glass {
  padding: 16px;
}

.cover-frame {
  padding: 8px;
}

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

.play.block {
  width: 100%;
  height: 48px;
  margin: 16px 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: 16px 16px max(16px, 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 200ms ease-out;
}

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

.card {
  height: 100%;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 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: none;
}

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

.steps li,
.ladder li,
.slots li,
.facts li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 8px 12px;
  min-height: 48px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
}

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

.slots li {
  margin: 0;
}

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

.num {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.bead {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: none;
}

.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: none;
}

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

.finals div {
  padding: 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.finals dt {
  font-weight: 700;
  color: var(--text);
  font-family: Manrope, system-ui, sans-serif;
}

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

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

.arrow {
  position: static;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  box-shadow: none;
  backdrop-filter: none;
}

.arrow:active {
  background: var(--surface);
}

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

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

.dots button::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: var(--line);
}

.dots button[aria-current="true"]::before {
  width: 20px;
  background: var(--accent);
}

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

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

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

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

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

a.mail {
  color: var(--text);
  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;
    gap: 16px;
  }

  .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: 900px) {
  .brand {
    font-size: 24px;
    line-height: 30px;
  }

  h1 {
    font-size: 28px;
    line-height: 34px;
  }
}

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

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

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

@media (hover: hover) and (pointer: fine) {
  .play:hover,
  .door:hover .go,
  .actions a.go.is-play:hover {
    filter: brightness(0.92);
  }

  .nav a:hover,
  a.more-projects:hover,
  a.mail:hover {
    color: var(--text);
  }
}

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

  .play,
  .door,
  .actions a.go.is-play {
    transition: none;
  }

  .play:active,
  .door:active,
  .actions a.go.is-play:active {
    transform: none;
  }
}

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

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

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

.projects a {
  overflow-wrap: anywhere;
}

.hint {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 18px;
}

.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: 48px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 16px;
  line-height: 20px;
  text-align: center;
  white-space: normal;
  box-shadow: none;
  backdrop-filter: none;
  appearance: none;
  -webkit-appearance: none;
}

.tabs button:active,
.chips button:active,
.projects button.go:active {
  background: var(--surface);
}

.tabs button[aria-selected="true"],
.chips button[aria-pressed="true"] {
  background: var(--bg);
  color: var(--text);
  border-color: var(--accent);
}

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

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

.detail {
  margin: 8px 0 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
}

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

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

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

.actions a.go.is-play {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
  transition: filter 80ms linear, transform 80ms linear;
}

.actions a.go.is-play:active {
  filter: brightness(0.92);
  transform: scale(0.98);
}

.sources {
  margin: 16px 0 0;
  font-size: 13px;
  line-height: 18px;
}

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

a.more-projects {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.stage > a.more-projects {
  flex: 0 0 auto;
  align-self: center;
  margin-top: 8px;
  font-size: 16px;
  line-height: 24px;
}

.mountain {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 0;
  margin-top: 8px;
  padding: 16px;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.stone {
  aspect-ratio: 1;
  min-width: 0;
  min-height: 36px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #2C2E26;
  color: transparent;
  box-shadow: none;
}

.stone:active {
  filter: brightness(0.92);
}

.stone.is-dug {
  background: var(--bg);
  border-color: var(--line);
}

.stone.is-spark {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
}

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