@font-face {
  font-family: Fredoka;
  src: url("/fonts/fredoka.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --banana: #f7be7a;
  --ink: #2c2226;
  --ink-soft: #5a4038;
  --cream: #fff4e3;
  --orange: #c44b0a;
  --orange-hover: #a33d08;
  --shadow: 0 6px 0 #2c2226;
  --radius-pill: 999px;
  --page: 68rem;
  --focus: 3px solid #2c2226;
}

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

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: Fredoka, "Segoe UI", "Trebuchet MS", "Avenir Next", system-ui, sans-serif;
  font-weight: 450;
  font-size: 1.0625rem;
  line-height: 1.55;
  background: var(--banana);
  color: var(--ink);
  display: flex;
  flex-direction: column;
}

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

a { color: var(--orange); }
a:hover { color: var(--orange-hover); }

:focus { outline: none; }
:focus-visible {
  outline: var(--focus);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -100%;
  z-index: 100;
  background: var(--cream);
  color: var(--ink);
  padding: 0.6rem 1rem;
  border: 3px solid var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus {
  top: 0.75rem;
  outline: var(--focus);
  outline-offset: 3px;
}

.wrap {
  width: min(var(--page), calc(100% - 2rem));
  margin-inline: auto;
}

/* Header + tab nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--banana);
  border-bottom: 3px solid var(--ink);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: 0.7rem 0 0.8rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 650;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.brand-mark {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--ink);
  background: var(--banana);
  flex: 0 0 auto;
  box-shadow: 0 3px 0 var(--ink);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
  margin-left: auto;
}

.tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.45rem;
  padding: 0.3rem 0.85rem;
  border: 3px solid var(--ink);
  border-radius: 0.7rem 0.7rem 0.15rem 0.15rem;
  background: var(--banana);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.tabs a:hover {
  background: var(--cream);
  transform: translateY(1px);
  box-shadow: 0 2px 0 var(--ink);
  color: var(--ink);
}

.tabs a[aria-current="page"] {
  background: var(--cream);
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}

.tabs a:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--ink);
}

/* Main */
main {
  flex: 1;
  padding: 1.75rem 0 3.5rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(10rem, 17rem) minmax(0, 1fr);
  gap: 2rem 2.75rem;
  align-items: center;
  padding: 1.5rem 0 2.5rem;
}

.portrait {
  justify-self: center;
  width: min(17rem, 70vw);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
  background: #f3d3a4;
  transform: rotate(-2deg);
  animation: sticker-pop 0.7s cubic-bezier(0.2, 1.4, 0.3, 1) both;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes sticker-pop {
  0% { transform: rotate(-10deg) scale(0.84); opacity: 0; }
  62% { transform: rotate(1.6deg) scale(1.045); opacity: 1; }
  100% { transform: rotate(-2deg) scale(1); }
}

.hero-copy h1 {
  font-size: clamp(1.85rem, 5.2vw, 3.15rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin: 0 0 0.9rem;
  max-width: 18ch;
  text-wrap: balance;
}

.lede {
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  font-weight: 500;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
  max-width: 32rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.05rem;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-pill);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.25;
  color: var(--ink);
  background: var(--cream);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn:hover {
  transform: translateY(2px);
  box-shadow: 0 4px 0 var(--ink);
  color: var(--ink);
  background: #ffe8c6;
}

.btn:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 var(--ink);
}

.btn-primary {
  background: var(--orange);
  color: #fff;
}

.btn-primary:hover {
  background: var(--orange-hover);
  color: #fff;
}

.btn svg {
  width: 1.3rem;
  height: 1.3rem;
  flex: 0 0 auto;
}

/* Sections */
.section {
  padding: 0.5rem 0 1.5rem;
}

.section h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 1rem;
}

.prose {
  max-width: 40rem;
}

.prose p { margin: 0 0 1rem; }
.prose p:last-child { margin-bottom: 0; }

.page-title {
  font-size: clamp(1.85rem, 4.5vw, 2.6rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin: 0 0 0.75rem;
}

/* Episode comic grid */
.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 1.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.episode {
  display: flex;
  flex-direction: column;
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  min-height: 100%;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.episode:hover {
  transform: translateY(2px);
  box-shadow: 0 4px 0 var(--ink);
  color: inherit;
}

.episode:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 var(--ink);
}

.episode-art {
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #1a1210;
  border-bottom: 3px solid var(--ink);
}

.episode-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.episode-body {
  padding: 0.8rem 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.episode-kicker {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.episode-body h3,
.episode h3 {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
  color: var(--ink);
}

.episode-body p {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.episode-soon {
  box-shadow: var(--shadow);
  background: var(--cream);
  border: 3px dashed var(--ink);
}

.episode-soon .episode-art {
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(
    -45deg,
    #fff4e3,
    #fff4e3 12px,
    #f7be7a 12px,
    #f7be7a 24px
  );
  color: var(--ink-soft);
  font-weight: 600;
  text-align: center;
  padding: 1rem;
}

.episode-soon:hover { color: inherit; }

/* Poster blocks for games / books */
.poster {
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.35rem 1.5rem;
  max-width: 40rem;
}

.poster h2 {
  margin-top: 0;
}

.poster p:last-of-type { margin-bottom: 1.1rem; }

/* Contact list */
.social {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 28rem;
}

.social a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--cream);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  border-radius: var(--radius-pill);
  padding: 0.7rem 1.05rem;
  min-height: 3rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.social a:hover {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink);
  color: var(--ink);
  background: #ffe8c6;
}

.social a.is-first {
  background: var(--orange);
  color: #fff;
}

.social a.is-first:hover {
  background: var(--orange-hover);
  color: #fff;
}

.social svg {
  width: 1.3rem;
  height: 1.3rem;
  flex: 0 0 auto;
}

.mail {
  font-weight: 600;
  word-break: break-word;
}

/* Footer */
.site-footer {
  border-top: 3px solid var(--ink);
  padding: 1.15rem 0 1.5rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: center;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.footer-links a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.footer-links a:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: left;
    gap: 1.35rem;
    padding-top: 0.6rem;
  }
  .portrait { width: min(12.5rem, 62vw); justify-self: start; }
  .tabs { margin-left: 0; }
  .header-inner { padding-top: 0.6rem; }
  .hero-copy h1 { max-width: 16ch; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .portrait { animation: none; }
  .btn, .tabs a, .episode, .social a { transition: none; }
}

.nowrap { white-space: nowrap; }
.after-grid { margin-top: 1.5rem; }

/* Easter egg portrait */
button.portrait {
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
button.portrait:focus-visible {
  outline: var(--focus);
  outline-offset: 4px;
}
.portrait.is-tipping {
  animation: hat-tip 0.55s cubic-bezier(0.2, 1.2, 0.3, 1);
}
@keyframes hat-tip {
  0% { transform: rotate(-2deg); }
  35% { transform: rotate(-14deg) translateY(-4px); }
  70% { transform: rotate(6deg); }
  100% { transform: rotate(-2deg); }
}
.egg-status {
  margin: 0.7rem 0 0;
  min-height: 1.4em;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
}

/* Play tab */
.play-block {
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.2rem 1.4rem;
  margin: 0 0 1.5rem;
  max-width: 40rem;
}
.play-block h2 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
}
.play-lead {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  max-width: 38rem;
}
.quiz-progress {
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 0.55rem;
}
.quiz-question {
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0 0 0.85rem;
}
.quiz-choices {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.quiz-choices button {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  background: var(--banana);
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  border-radius: 0.9rem;
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.quiz-choices button:hover {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--ink);
  background: #ffe8c6;
}
.quiz-choices button:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--ink);
}
.quiz-result h3 {
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
}
.quiz-result p { margin: 0 0 0.8rem; }
.quiz-result .actions { margin-top: 0.4rem; }

.game-frame {
  position: relative;
  height: min(22rem, 62vw);
  min-height: 16rem;
  border: 3px solid var(--ink);
  background: #7ec8e3;
  overflow: hidden;
  touch-action: none;
  margin: 0 0 0.85rem;
}
.game-catcher {
  position: absolute;
  bottom: 0.45rem;
  width: 4.4rem;
  height: 4.4rem;
  margin-left: -2.2rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  background: #f3d3a4;
  pointer-events: none;
}
.game-catcher img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.game-banana {
  position: absolute;
  font-size: 1.7rem;
  line-height: 1;
  width: 2rem;
  height: 2rem;
  margin-left: -1rem;
  pointer-events: none;
  user-select: none;
}
.game-hud {
  position: absolute;
  top: 0.5rem;
  left: 0.6rem;
  right: 0.6rem;
  display: flex;
  justify-content: space-between;
  font-weight: 650;
  color: var(--ink);
  text-shadow: 0 1px 0 #fff4e3;
  pointer-events: none;
}
.game-overlay[hidden] { display: none !important; }
.game-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 244, 227, 0.92);
  padding: 1rem;
  text-align: center;
}
.game-overlay p {
  margin: 0 0 0.85rem;
  font-weight: 600;
  max-width: 16rem;
}
.game-still {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin: 0 0 0.85rem;
}
.game-still button {
  font-size: 2rem;
  line-height: 1;
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  background: var(--cream);
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
  border-radius: 0.8rem;
}
.game-still button:hover { background: #ffe8c6; }
.game-still button.is-gone {
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .portrait.is-tipping { animation: none; }
  .quiz-choices button { transition: none; }
}

.btn-kofi[hidden] { display: none !important; }
.btn-kofi {
  background: var(--banana);
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 0 6px 0 var(--ink);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.35rem 0.95rem;
}
.btn-kofi:hover { background: var(--cream); color: var(--ink); }
.footer-links .btn-kofi {
  min-height: 2.2rem;
  padding: 0.15rem 0.7rem;
  font-size: 0.9rem;
  box-shadow: 0 3px 0 var(--ink);
}
.kofi-row { margin: 1rem 0 0; }
