/* Snack Quests, warm candy shop storefront */
:root {
  --cream: #fff6eb;
  --paper: #fff1dc;
  --peach: #ffd4b8;
  --cookie: #c4783a;
  --cookie-dark: #8b4e1f;
  --jam: #d64545;
  --gold: #f4b942;
  --bread: #e8a838;
  --mint: #7bc47f;
  --sky: #7eb8d4;
  --ink: #3b2a1a;
  --ink-soft: #5c4633;
  --white: #fffcf7;
  --shadow: 0 10px 28px rgba(59, 42, 26, 0.12);
  --radius: 1.25rem;
  --font-display: "Fredoka", "Trebuchet MS", sans-serif;
  --font-body: "Nunito", "Segoe UI", sans-serif;
  --space: clamp(1rem, 4vw, 2.5rem);
  --wrap: 68rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, #ffe4c4 0, transparent 28%),
    radial-gradient(circle at 90% 0%, #ffd6d0 0, transparent 24%),
    linear-gradient(180deg, var(--cream), #ffe8c8 40%, #fff6eb 100%);
  min-height: 100vh;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--cookie-dark);
}

a:hover,
a:focus-visible {
  color: var(--jam);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  background: var(--gold);
  color: var(--ink);
  padding: 0.75rem 1rem;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 246, 235, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 4px solid #f2c48a;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
}

.logo-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.85rem;
  background: #ffe8c0;
  display: grid;
  place-items: center;
  box-shadow: inset 0 -3px 0 rgba(139, 78, 31, 0.12);
}

.nav-toggle {
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 0.9rem;
  background: var(--gold);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1.25rem;
  height: 3px;
  background: var(--ink);
  border-radius: 99px;
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.site-nav a {
  display: block;
  min-height: 2.75rem;
  padding: 0.65rem 0.9rem;
  text-decoration: none;
  font-weight: 800;
  border-radius: 999px;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: #ffe0b0;
  color: var(--ink);
}

.site-nav {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--white);
  padding: 0.75rem 1rem 1rem;
  border-bottom: 4px solid #f2c48a;
}

.site-header.is-open .site-nav {
  display: block;
}

.hero {
  padding: 2.5rem 0 3rem;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.8rem;
  background: #ffd6c8;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
}

.hero h1,
.tracks h2,
.snack-pack h2,
.tip-jar h2,
.why h2,
.workshop h2 {
  font-family: var(--font-display);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.85rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 7vw, 3.6rem);
  max-width: 16ch;
}

.hero-lead,
.hero-welcome {
  font-size: clamp(1.15rem, 2.6vw, 1.4rem);
  max-width: 42rem;
}

.hero-welcome {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--cookie-dark);
  margin-top: 0.25rem;
}

.hero-body {
  max-width: 42rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  border: 3px solid transparent;
}

.btn-primary {
  background: var(--jam);
  color: #fffaf4;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: #b53434;
  color: #fffaf4;
}

.btn-ghost {
  background: var(--white);
  color: var(--ink);
  border-color: #f0c48a;
}

.btn-small {
  min-height: 2.75rem;
  background: var(--cookie);
  color: #fffaf4;
}

.btn-small:hover,
.btn-small:focus-visible {
  background: var(--cookie-dark);
  color: #fffaf4;
}

.section-lede {
  max-width: 40rem;
  margin-top: 0;
}

.tracks,
.snack-pack,
.tip-jar,
.why,
.workshop {
  padding: 2.5rem 0;
}

.track-grid,
.game-grid,
.workshop-grid,
.promise-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}

.track-grid {
  display: grid;
  gap: 1rem;
}

.track-card,
.game-card article,
.workshop-grid a {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.track-card {
  padding: 1.35rem 1.35rem 1.5rem;
  border: 3px solid transparent;
}

.track-card.cookie-jar {
  border-color: #f0b27a;
  background: linear-gradient(180deg, #fffaf2, #ffe8cc);
}

.track-card.daily-bread {
  border-color: #f4b942;
  background: linear-gradient(180deg, #fffaf2, #ffe9a8);
}

.track-kicker,
.game-track {
  margin: 0 0 0.35rem;
  font-weight: 800;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cookie-dark);
}

.track-card h3,
.game-meta h3 {
  font-family: var(--font-display);
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
}

.chip {
  min-height: 2.75rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 2px solid #e8c08a;
  background: var(--white);
  font: inherit;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
}

.chip.is-active,
.chip:hover,
.chip:focus-visible {
  background: var(--gold);
  border-color: var(--gold);
}

.game-grid {
  display: grid;
  gap: 1rem;
}

.game-card.is-hidden {
  display: none;
}

.game-card article {
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.game-art {
  position: relative;
}

.game-art svg,
.game-art img {
  width: 100%;
  height: auto;
}

.game-art img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center;
}

/* Square Crumb Trail art keeps Little Brad's face in the card.
   A 16:10 cover crop cut him off at the bottom. */
.game-art--crumb-trail img {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  object-position: center;
  background: #4aa3d6;
}

.game-card.hero-card article {
  border: 3px solid var(--gold);
}

.game-card.hero-card .game-meta h3 {
  font-size: clamp(1.85rem, 3.2vw, 2.35rem);
}

.game-card.hero-card .game-meta > p:not(.game-track):not(:last-child) {
  font-size: 1.12rem;
}

.track-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.track-heading h3 {
  margin: 0 0 0.1rem;
}

.cookie-mark,
.loaf-mark {
  width: 3.35rem;
  height: 3.35rem;
  flex: none;
  border-radius: 0.9rem;
  background: #fff6eb;
  display: grid;
  place-items: center;
  box-shadow: inset 0 -3px 0 rgba(139, 78, 31, 0.12);
}

.cookie-mark svg,
.loaf-mark svg {
  width: 2.55rem;
  height: 2.55rem;
}

.loaf-badge {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.94);
  display: grid;
  place-items: center;
  box-shadow: 0 3px 10px rgba(59, 42, 26, 0.16);
}

.loaf-badge svg {
  width: 1.55rem;
  height: 1.55rem;
}

.game-meta {
  padding: 1rem 1.15rem 1.25rem;
}

.game-meta p {
  margin: 0 0 0.85rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: #ffe0b0;
  font-weight: 800;
}

.tip-card {
  display: grid;
  gap: 1rem;
  align-items: center;
  background: linear-gradient(180deg, #fffaf2, #ffe7b8);
  border: 3px solid #f4b942;
  border-radius: 1.5rem;
  box-shadow: var(--shadow);
  padding: 1.35rem 1.25rem 1.5rem;
}

.tip-art {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 1.2rem;
  background: #fff6eb;
  display: grid;
  place-items: center;
}

.tip-copy p {
  max-width: 40rem;
}

.why-inner {
  background: #fff8ee;
  border: 3px dashed #f0c48a;
  border-radius: 1.5rem;
  padding: 1.5rem 1.25rem;
}

.promise-list {
  display: grid;
  gap: 0.9rem;
}

.promise-list li {
  background: var(--white);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.workshop-grid {
  display: grid;
  gap: 0.75rem;
}

.workshop-grid a {
  display: flex;
  align-items: center;
  min-height: 3.25rem;
  padding: 0.75rem 1.1rem;
  text-decoration: none;
  font-weight: 800;
  color: var(--ink);
}

.workshop-grid a:hover,
.workshop-grid a:focus-visible {
  background: #ffe8c8;
  color: var(--ink);
}

.site-footer {
  margin-top: 2rem;
  background: #3b2a1a;
  color: #fff6eb;
  padding: 2.25rem 0 2.75rem;
}

.site-footer a {
  color: #ffd48a;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0 0 0.4rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.footer-links a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  font-weight: 800;
}

.footer-note {
  opacity: 0.92;
}

@media (min-width: 720px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: block;
    position: static;
    background: transparent;
    padding: 0;
    border: 0;
  }

  .site-nav ul {
    flex-direction: row;
    align-items: center;
  }

  .track-grid,
  .workshop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-card.hero-card {
    grid-column: span 2;
  }

  .game-card.hero-card .game-art img {
    aspect-ratio: 2 / 1;
    min-height: 14rem;
  }

  .tip-card {
    grid-template-columns: auto 1fr;
    padding: 1.75rem 2rem;
    gap: 1.5rem;
  }

  .why-inner {
    padding: 2rem 2.25rem;
  }
}

@media (min-width: 960px) {
  .workshop-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Falling leaves on the home page (leaves.js). Sits over the page, above the
   sticky header but below the skip link, and never takes clicks or taps. */
.leaves-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 15;
  pointer-events: none;
}

/* Leaves on/off button. It sits in the header between the logo and the menu,
   except at widths where that would push the site name onto two lines; there
   the copy under the hero search bar shows instead. */
.leaves-toggle {
  min-height: 1.6rem;
  padding: 0.24rem 0.64rem 0.16rem;
  border: 2px solid;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
}

.leaves-toggle-header {
  flex: none;
  margin-left: auto;
}

.leaves-toggle-hero {
  display: none;
}

.leaves-toggle[hidden] {
  display: none;
}

@media (max-width: 369px), (min-width: 720px) and (max-width: 839px) {
  .leaves-toggle-header {
    display: none;
  }

  /* leaves.js reveals it once the leaves load. Hold its space until then so nothing below jumps. */
  .leaves-toggle-hero,
  .leaves-toggle-hero[hidden] {
    display: block;
  }

  .leaves-toggle-hero[hidden] {
    visibility: hidden;
  }
}

/* Where the header is tight: just "Leaves", struck through while they're off. */
@media (max-width: 419px), (min-width: 720px) and (max-width: 959px) {
  .leaves-toggle-header .leaves-toggle-state {
    display: none;
  }

  .leaves-toggle-header[aria-pressed="false"] {
    text-decoration: line-through;
  }
}

@media (max-width: 419px) {
  .leaves-toggle-header {
    margin-right: -0.5rem;
    padding-inline: 0.45rem;
  }
}

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