/* Monkey Buddys applications in the in-game UI's textures: charcoal panels with a dark rim and a
   pressed-in bottom edge, cream chunky text, mint buttons, orange and blue highlights.
   Colours were sampled from in-game screenshots. */
:root {
  --page: #1b1a20;
  --frame: #141318;
  --board: #201f27;
  --panel: #302a36;
  --tile: #3e3a43;
  --tile-hi: #4a4551;
  --inset: #17151a;
  --cream: #fffbb9;
  --text: #fbe9c1;
  --muted: #d9c8a3;
  --faint: #a59a86;
  --orange: #fdab19;
  --orange-deep: #b8770a;
  --green: #a1f796;
  --green-deep: #5f9e57;
  --green-dark: #528155;
  --blue: #6d95d3;
  --blue-deep: #44689f;
  --red: #ec6a5c;
  --accent: var(--orange);

  /* names used across the pages */
  --bg: var(--board);
  --bg-2: #27262e;
  --bg-3: var(--inset);
  --field: var(--inset);
  --card: var(--panel);
  --card-solid: var(--panel);
  --panel-hi: var(--tile);
  --line: #3f3945;
  --line-2: #514b5a;
  --yellow: var(--orange);
  --gold: var(--orange);
  --leaf: var(--green);
  --outline: var(--frame);
  --yellow-deep: var(--orange-deep);
  --radius: 16px;
  --display: 'Lilita One', 'Arial Rounded MT Bold', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Lilita One', 'Arial Rounded MT Bold', 'Trebuchet MS', system-ui, sans-serif;
  --outline-text: 0 4px 0 rgba(0, 0, 0, 0.55);
  --spring: linear(0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1.004 83.8%, 1);
  --spring-soft: linear(0, 0.006, 0.025 2.8%, 0.101 6.1%, 0.539 18.9%, 0.721 25.3%, 0.849 31.5%, 0.937 38.1%, 0.968 41.8%, 0.991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001);
  /* the in-game hand as the mouse pointer; the fingertip is the hotspot */
  --hand: url('/img/cursor-hand.svg') 15 1, url('/img/cursor-hand.png') 15 1;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  cursor: var(--hand), auto;
}
a,
button,
label,
select,
summary,
[role='button'],
.opt,
.btn {
  cursor: var(--hand), pointer;
}
input:not([type='radio']):not([type='checkbox']),
textarea {
  cursor: text;
}
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--page);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .95 0 0 0 0 .85 0 0 0 .035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--text);
  font: 400 18px/1.45 var(--body);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img,
svg,
canvas {
  display: block;
}
img {
  max-width: 100%;
  height: auto;
}
[hidden] {
  display: none !important;
}
a {
  color: inherit;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
::selection {
  background: var(--orange);
  color: var(--frame);
}
:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
  border-radius: 8px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.icon {
  flex: none;
}
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--cream);
  text-transform: uppercase;
  text-wrap: balance;
}
.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding-inline: max(16px, env(safe-area-inset-left, 0px));
}
.muted {
  color: var(--muted);
}
.label {
  display: block;
  margin: 14px 0 8px;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}
.underline {
  display: block;
  width: 84px;
  height: 7px;
  margin: 12px 0 0;
  border-radius: 99px;
  background: var(--orange);
}
.underline.center {
  margin: 14px auto 16px;
}

/* ---------- background layers ---------- */
.fireflies {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}
.burst {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 100;
}
.page {
  position: relative;
  z-index: 1;
}

/* ---------- panels: the in-game texture ---------- */
.glass,
.panel,
.tile {
  background: var(--panel);
  border: 3px solid rgba(0, 0, 0, 0.38);
  border-radius: var(--radius);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.24), inset 0 2px 0 rgba(255, 255, 255, 0.04), 0 6px 0 rgba(0, 0, 0, 0.35);
}
.panel {
  padding: 22px;
}
.panel h2 {
  margin: 0 0 12px;
  font-size: 26px;
  line-height: 1.08;
  color: var(--cream);
}
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.list li {
  position: relative;
  padding-left: 26px;
}
.list li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.42em;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--orange);
  box-shadow: 0 2px 0 var(--orange-deep);
}
.list.checks li::before {
  width: 7px;
  height: 13px;
  top: 0.2em;
  left: 6px;
  border-radius: 0;
  background: none;
  box-shadow: none;
  border: solid var(--green);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 24px 10px;
  border: 0;
  border-radius: 12px;
  background: var(--tile);
  color: var(--cream);
  font: 400 20px/1 var(--display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  user-select: none;
  box-shadow: 0 6px 0 var(--inset);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
}
.btn:hover {
  filter: brightness(1.07);
}
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--inset);
}
.btn[disabled] {
  filter: grayscale(0.7);
  opacity: 0.65;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--green);
  color: var(--inset);
  box-shadow: 0 6px 0 var(--green-deep);
}
.btn-primary:active {
  box-shadow: 0 2px 0 var(--green-deep);
}
.btn-green-dark {
  background: var(--green-dark);
  color: var(--inset);
  box-shadow: 0 6px 0 #33553a;
}
.btn-green-dark:active {
  box-shadow: 0 2px 0 #33553a;
}
.btn-lg {
  min-height: 64px;
  padding: 15px 32px 12px;
  font-size: 26px;
}
.btn-sm {
  min-height: 38px;
  padding: 8px 14px 6px;
  font-size: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 0 var(--inset);
}
.btn-primary.btn-sm {
  box-shadow: 0 4px 0 var(--green-deep);
}
.btn-ghost {
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}
.btn-ghost:hover {
  color: var(--cream);
  background: rgba(255, 255, 255, 0.05);
}
.btn-danger {
  color: var(--red);
}
.btn .arrow {
  transition: translate 0.45s var(--spring);
}
.btn:hover .arrow {
  translate: 4px 0;
}

/* ---------- status pill ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px 7px;
  border-radius: 12px;
  background: var(--inset);
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream);
  white-space: nowrap;
}
.status i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}
.status.closed i {
  background: var(--red);
  animation: none;
}
.status.draft i {
  background: #b48cff;
  animation: none;
}
.status.small {
  padding: 6px 10px 4px;
  font-size: 13px;
  gap: 7px;
}
.status.small i {
  width: 8px;
  height: 8px;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(161, 247, 150, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(161, 247, 150, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(161, 247, 150, 0);
  }
}

/* ---------- floating nav ---------- */
.floatnav {
  position: absolute;
  top: 14px;
  right: max(14px, env(safe-area-inset-right, 0px));
  z-index: 20;
  display: flex;
  gap: 8px;
}
.floatnav a {
  padding: 10px 16px 8px;
  border-radius: 12px;
  background: var(--board);
  color: var(--cream);
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 5px 0 var(--frame);
}
.floatnav a:hover {
  background: var(--panel);
}
.floatnav .staff {
  background: var(--orange);
  color: var(--inset);
  box-shadow: 0 5px 0 var(--orange-deep);
}

/* ---------- hero (the in-game cabin) ---------- */
.hero {
  position: relative;
  min-height: min(84vh, 820px);
  display: grid;
  place-items: center;
  padding: 70px 16px 110px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(20, 19, 24, 0.35) 0%, rgba(20, 19, 24, 0.62) 58%, var(--page) 100%), url('/img/cabin.webp') center 42% / cover no-repeat var(--board);
}
.hero.short {
  min-height: 0;
  padding: 70px 16px 74px;
}
.hero-inner {
  position: relative;
  z-index: 3;
  max-width: 860px;
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
  pointer-events: none;
}
.hero-inner a,
.hero-inner button {
  pointer-events: auto;
}
.logo {
  width: min(300px, 62vw);
  height: auto;
  filter: drop-shadow(0 7px 0 rgba(0, 0, 0, 0.35));
  animation: bob 5s ease-in-out infinite;
}
.logo.sm {
  width: min(210px, 50vw);
}
@keyframes bob {
  50% {
    translate: 0 -7px;
    rotate: -1.5deg;
  }
}
.hero h1 {
  margin: 0;
  font-size: clamp(50px, 9vw, 104px);
  line-height: 1.04;
  color: var(--cream);
  text-shadow: 0 6px 0 rgba(20, 19, 24, 0.75), 0 12px 30px rgba(0, 0, 0, 0.45);
  user-select: none;
}
.hero h1.form-title {
  font-size: clamp(40px, 7vw, 66px);
}
.word {
  display: inline-block;
  white-space: nowrap;
}
.letter {
  display: inline-block;
  will-change: translate, rotate;
  transition: opacity 0.25s;
}
.letter.waiting {
  opacity: 0;
}
.lede {
  max-width: 52ch;
  margin: 0;
  font-size: 21px;
  color: var(--text);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.85);
}
.meta {
  margin: 0;
  font-size: 16px;
  color: var(--text);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

/* ---------- crossing stripes ---------- */
.stripes {
  position: relative;
  z-index: 4;
  height: 130px;
  margin: -46px 0 0;
  pointer-events: none;
  overflow-x: clip;
}
.stripe {
  position: absolute;
  left: -5%;
  right: -5%;
  top: 50%;
  overflow: hidden;
  white-space: nowrap;
  font: 400 clamp(22px, 3vw, 30px) / 1 var(--display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-block: 5px solid var(--frame);
}
.stripe .marquee-track {
  display: flex;
  width: max-content;
}
.stripe .marquee-group {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 14px 10px;
}
.stripe-a {
  translate: 0 -50%;
  rotate: -3deg;
  background: var(--orange);
  color: var(--inset);
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.4);
  z-index: 2;
}
.stripe-b {
  translate: 0 -50%;
  rotate: 2.5deg;
  background: var(--board);
  color: var(--cream);
  z-index: 1;
}
.stripe .dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: currentColor;
  transform: rotate(45deg);
}

/* ---------- sections ---------- */
.section {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto;
  padding: 60px clamp(16px, 4vw, 40px);
}
.section-head {
  max-width: 660px;
  margin: 0 auto 34px;
  text-align: center;
}
.section-title {
  margin: 0;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1;
  color: var(--cream);
}
.section-sub {
  margin: 0;
  font-size: 20px;
  color: var(--text);
}

/* ---------- reveal ---------- */
.reveal {
  opacity: 0;
  translate: 0 28px;
  transition: opacity 0.6s ease, translate 1s var(--spring-soft);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.reveal.in {
  opacity: 1;
  translate: 0 0;
}

/* ---------- program cards ---------- */
.program-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 26px 22px;
  padding-top: 26px;
}
.program-card {
  --gx: 50%;
  --gy: 0%;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px 22px 22px;
  text-decoration: none;
  background: var(--board);
  border: 6px solid var(--frame);
  border-radius: 20px;
  box-shadow: 0 8px 0 #0c0b0f, 0 18px 30px rgba(0, 0, 0, 0.35);
}
.program-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: radial-gradient(420px circle at var(--gx) var(--gy), rgba(255, 251, 185, 0.06), transparent 55%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.program-card:hover::before {
  opacity: 1;
}
.card-sticker {
  position: absolute;
  top: -28px;
  right: -14px;
  width: 116px;
  height: 116px;
  object-fit: contain;
  rotate: 8deg;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.4));
  transition: scale 0.6s var(--spring), rotate 0.6s var(--spring);
  pointer-events: none;
}
.program-card:hover .card-sticker {
  scale: 1.1;
  rotate: -4deg;
}
.card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.card-top.has-sticker {
  min-height: 60px;
  padding-right: 100px;
}
.icon-badge {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--tile);
  border: 3px solid rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25);
  color: var(--accent);
}
.icon-badge.sm {
  width: 40px;
  height: 40px;
}
.card-program {
  margin: 10px 0 4px;
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.card-title {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.05;
  color: var(--cream);
}
.card-tagline {
  margin: 0 0 16px;
  font-size: 18px;
  color: var(--text);
}
.program-card .list {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--panel);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.22);
  font-size: 17px;
}
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding: 12px 12px 12px 16px;
  border-radius: 14px;
  background: var(--inset);
  font-size: 16px;
  color: var(--text);
}
.program-card.closed {
  filter: saturate(0.5) brightness(0.88);
}
.empty {
  padding: 40px;
  text-align: center;
  color: var(--text);
}
.skeleton {
  min-height: 400px;
  border-radius: 20px;
  border: 6px solid var(--frame);
  background: linear-gradient(100deg, var(--board) 30%, var(--panel) 50%, var(--board) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer {
  to {
    background-position: -150% 0;
  }
}

/* ---------- how it works ---------- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 22px;
}
.step-card {
  text-align: center;
}
.step-num {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  padding-top: 4px;
  border-radius: 14px;
  background: var(--orange);
  color: var(--inset);
  font-size: 30px;
  box-shadow: 0 5px 0 var(--orange-deep);
}
.step-card h3 {
  margin: 0 0 8px;
  font-size: 25px;
}
.step-card p {
  margin: 0;
  color: var(--text);
}

/* ---------- FAQ ---------- */
.faq {
  display: grid;
  gap: 14px;
  max-width: 800px;
  margin: 0 auto;
}
.faq details {
  padding: 0 22px;
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 16px;
  font-size: 21px;
  color: var(--cream);
  list-style: none;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary .icon {
  color: var(--orange);
  transition: rotate 0.5s var(--spring);
}
.faq details[open] summary .icon {
  rotate: 45deg;
}
.faq details p {
  margin: 0 0 20px;
  color: var(--text);
}
.faq details[open] p {
  animation: drop 0.6s var(--spring-soft);
}
@keyframes drop {
  from {
    opacity: 0;
    translate: 0 -10px;
  }
}

/* ---------- footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  margin-top: 40px;
  padding: 34px 16px 42px;
  display: grid;
  justify-items: center;
  gap: 14px;
  background: var(--board);
  border-top: 8px solid var(--frame);
  color: var(--text);
  font-size: 17px;
  text-align: center;
}
.footer img {
  width: 130px;
}
.footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.footer a {
  padding: 9px 14px 7px;
  border-radius: 10px;
  background: var(--tile);
  color: var(--cream);
  text-decoration: none;
  box-shadow: 0 4px 0 var(--inset);
}
.footer a:hover {
  background: var(--tile-hi);
}
.footer .staff {
  background: var(--orange);
  color: var(--inset);
  box-shadow: 0 4px 0 var(--orange-deep);
}

/* ---------- admin top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px clamp(16px, 4vw, 40px);
  background: var(--board);
  border-bottom: 6px solid var(--frame);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand img {
  height: 42px;
  width: auto;
}
.brand-tag {
  padding: 8px 12px 6px;
  border-radius: 10px;
  background: var(--orange);
  color: var(--inset);
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.topnav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.topnav a {
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
}
.topnav a:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* ---------- toasts ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 22px;
  translate: -50% 0;
  z-index: 200;
  display: grid;
  gap: 10px;
  width: min(440px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  padding: 14px 18px 12px;
  border-radius: 14px;
  background: var(--board);
  border: 5px solid var(--frame);
  color: var(--cream);
  font-size: 17px;
  box-shadow: 0 6px 0 #0c0b0f, 0 14px 40px rgba(0, 0, 0, 0.4);
  animation: toast-in 0.6s var(--spring);
}
.toast-error {
  border-color: #5a2019;
}
.toast-success {
  border-color: #2c5126;
}
.toast.out {
  animation: toast-out 0.3s ease forwards;
}
@keyframes toast-in {
  from {
    opacity: 0;
    translate: 0 24px;
    scale: 0.9;
  }
}
@keyframes toast-out {
  to {
    opacity: 0;
    translate: 0 12px;
  }
}

@media (max-width: 760px) {
  .floatnav .hide-sm,
  .brand-tag,
  .topnav .hide-sm {
    display: none;
  }
  .stripes {
    height: 100px;
    margin-top: -36px;
  }
  .section {
    padding-block: 46px;
  }
}

@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;
  }
  .reveal {
    opacity: 1;
    translate: none;
  }
}
