/* Snackpact landing page: the app's colored-pencil look on the web. */
:root {
  --paper: #FCF2DE;
  --card: #FFF8EC;
  --ink: #4A2A1C;
  --ink2: #6E4F3C;
  --ink3: #7E6553;
  --red: #E4553B;
  --red-deep: #A83728;
  --on-red: #FFF6E8;
  --green: #5E9F5B;
  --pink: #F8C9D4;
  --butter: #FBE7A8;
  --mint: #D3EBC9;
  --lilac: #E2D5F3;
  --sky: #CFE4F3;
  --peach: #FAD7BF;
  --shadow: rgba(74, 42, 28, 0.16);
  --display: 'Gaegu', 'Comic Sans MS', cursive;
  --body: 'Mali', ui-rounded, system-ui, sans-serif;
  --r-card: 26px 22px 28px 20px / 22px 28px 20px 26px;
  --r-pill: 999px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper) url('/art/paper.webp') repeat;
  background-size: 640px auto;
  color: var(--ink2);
  font: 16px/1.55 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); color: var(--ink); font-weight: 700; margin: 0; letter-spacing: -0.2px; }
p { margin: 0; }
a { color: var(--ink); }
button, input { font: inherit; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.muted { color: var(--ink3); font-weight: 400; }
:focus-visible { outline: 3px dashed var(--red-deep); outline-offset: 3px; border-radius: 10px; }

.skip { position: absolute; left: 16px; top: -60px; z-index: 10; background: var(--ink); color: var(--on-red); padding: 8px 14px; border-radius: 12px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- crayon boxes ---------- */
.card {
  position: relative;
  background: var(--card);
  border-radius: var(--r-card);
  padding: 26px 24px 24px;
  box-shadow: 0 5px 0 var(--shadow);
  isolation: isolate;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 2.5px solid var(--ink);
  border-radius: inherit;
  filter: url(#rough);
  pointer-events: none;
}
.card-butter { background: #FFF3C9; }
.tape { position: absolute; width: 110px; height: auto; top: -16px; z-index: 2; pointer-events: none; }
.tape-left { left: 22px; transform: rotate(-6deg); }
.tape-right { right: 22px; transform: rotate(5deg); }
.tape-mid { left: 50%; transform: translateX(-50%) rotate(-3deg); }

/* ---------- buttons ---------- */
.btn {
  --lift: 4px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 8px 22px;
  border: 2.5px solid var(--ink);
  border-radius: 18px 16px 19px 15px;
  background: var(--red);
  color: var(--on-red);
  font: 700 24px/1 var(--display);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 var(--lift) 0 var(--red-deep);
  transform: translateY(0);
  transition: transform 90ms ease-out, box-shadow 90ms ease-out;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  white-space: nowrap;
}
.btn:hover { --lift: 5px; transform: translateY(-1px); }
.btn:active { transform: translateY(var(--lift)); box-shadow: 0 0 0 var(--red-deep); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn-small { min-height: 44px; font-size: 20px; padding: 6px 16px; }
.btn-ghost { background: var(--card); color: var(--ink); box-shadow: 0 var(--lift) 0 var(--shadow); font-size: 20px; min-height: 46px; padding: 6px 14px; }
.btn-ghost:active { box-shadow: 0 0 0 var(--shadow); }
.btn-ghost img { width: 22px; height: 22px; }
.textlink { background: none; border: 0; padding: 6px 0; color: var(--ink3); text-decoration: underline; cursor: pointer; font-size: 14px; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 18px 6px; }
.brand img { width: 168px; height: auto; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 32px; align-items: center; padding-block: 28px 56px; }
h1 { font-size: clamp(44px, 5.6vw, 70px); line-height: 0.98; text-wrap: balance; }
.scribble { position: relative; white-space: nowrap; color: var(--red); }
.scribble::after {
  content: ''; position: absolute; left: -4%; right: -4%; bottom: -0.16em; height: 0.36em;
  background: url('/art/underline-squiggle.webp') center / 100% 100% no-repeat;
  z-index: -1;
}
.lede { font-size: 18px; margin-top: 18px; max-width: 34em; color: var(--ink2); }
.invited { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 10px 14px; background: var(--mint); border: 2px dashed var(--green); border-radius: 16px; color: var(--ink); font-weight: 600; max-width: 32em; }
.invited img { width: 28px; height: 28px; flex: none; }
.join { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; max-width: 520px; }
.join input[type="email"] {
  flex: 1 1 220px; min-width: 0; min-height: 54px;
  padding: 10px 16px;
  border: 2.5px solid var(--ink); border-radius: 16px 18px 15px 19px;
  background: #fffdf7; color: var(--ink);
  font-size: 17px;
}
.join input::placeholder { color: #85705D; }
.join .btn { flex: 0 0 auto; }
.join-stack { flex-direction: column; max-width: none; }
.join-stack input[type="email"] { flex: none; width: 100%; }
.form-msg { flex-basis: 100%; min-height: 1.4em; font-size: 15px; font-weight: 600; color: var(--red-deep); }
.form-msg.good { color: #3F7A3C; }
.fine { font-size: 13.5px; color: var(--ink3); margin-top: 2px; }
.joined-link { display: inline-block; margin-top: 24px; font: 700 26px/1.1 var(--display); color: var(--ink); }
.joined-link b { color: var(--red); }

.hero-stage { position: relative; min-height: 380px; display: grid; place-items: center; }
.snack-slot { width: min(320px, 74vw); position: relative; }
.bubble {
  position: absolute; top: 2%; right: 2%; z-index: 3;
  width: 168px; height: 150px;
  background: url('/art/speech-bubble.webp') center / 100% 100% no-repeat;
  display: grid; place-items: center; padding: 18px 20px 40px;
  font: 700 22px/1.05 var(--display); color: var(--ink); text-align: center;
  transform-origin: 20% 90%;
  transition: transform 220ms ease-out, opacity 220ms ease-out;
}
.bubble.swap { transform: scale(0.85); opacity: 0; }
.crumbs { position: absolute; inset: 0; pointer-events: none; }
.crumb { position: absolute; width: 22px; height: 22px; animation: crumb 700ms ease-out forwards; }
@keyframes crumb {
  from { transform: translate(0, 0) rotate(0); opacity: 1; }
  to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}

/* ---------- snacks with faces ---------- */
.snack { position: relative; width: 100%; }
.snack .body { width: 100%; height: auto; position: relative; z-index: 1; }
.snack .shadow { position: absolute; left: 9%; width: 82%; bottom: -12%; z-index: 0; opacity: 0.9; }
.snack .face { position: absolute; z-index: 2; }
.snack .face img { position: absolute; }
.snack .face .eyes { inset: 0; width: 100%; height: 100%; }
.snack .face .blush { left: -27.5%; top: -58.4%; width: 155%; height: 292.8%; }
.snack .face .mouth { left: 31.5%; top: 66.3%; width: 37%; height: 69.9%; }
.snack .wiggle { animation: wiggle 3.6s ease-in-out infinite; transform-origin: 50% 100%; }
.snack.chomp .wiggle { animation: chomp 380ms ease-out; }
@keyframes wiggle { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-1.5%) } }
@keyframes chomp {
  0% { transform: scale(1, 1) }
  30% { transform: scale(1.06, 0.92) translateX(-2%) }
  60% { transform: scale(0.98, 1.03) translateX(1%) }
  100% { transform: scale(1, 1) }
}

/* ---------- the line ---------- */
.line { padding-block: 8px 72px; scroll-margin-top: 16px; }
.line-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.spot h3, .game-card h3 { font-size: 40px; line-height: 1; }
.spot > p { margin-top: 8px; }
.ways { list-style: none; padding: 0; margin: 16px 0 4px; display: grid; gap: 12px; }
.ways li { display: flex; gap: 12px; align-items: center; color: var(--ink); }
.ways img { width: 34px; height: 34px; flex: none; }
.ways b { font-weight: 700; color: var(--red-deep); }
.spot-label { font: 700 24px/1 var(--display); color: var(--ink2); }
.spot-pos { font: 700 clamp(72px, 12vw, 112px)/0.9 var(--display); color: var(--red); margin-top: 6px; letter-spacing: -2px; }
.spot-of { color: var(--ink3); font-size: 15px; margin-top: 4px; }
.tally { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0; }
.tally div { background: var(--card); border: 2px solid var(--ink); border-radius: 14px 16px 13px 17px; padding: 10px 8px; text-align: center; }
.tally dt { font-size: 12.5px; color: var(--ink3); line-height: 1.2; }
.tally dd { margin: 2px 0 0; font: 700 32px/1 var(--display); color: var(--ink); }
.invite label { display: block; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.invite-row { display: flex; gap: 10px; flex-wrap: wrap; }
.invite-row input { flex: 1 1 200px; min-width: 0; min-height: 46px; padding: 8px 12px; border: 2px dashed var(--ink2); border-radius: 12px; background: #fffdf7; color: var(--ink); font-size: 15px; }
.invite-row .btn { flex: 0 0 auto; }
.spot .textlink { margin-top: 6px; }

.game-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.game-meta { font-size: 14px; color: var(--ink3); }
.game-frame { position: relative; margin: 14px auto 0; max-width: 360px; border-radius: 18px; overflow: hidden; border: 2.5px solid var(--ink); background: #FFFCF4; }
#hop { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; touch-action: none; cursor: pointer; border-radius: 0; }
#hop:focus-visible { outline: none; box-shadow: inset 0 0 0 4px var(--red-deep); }
.game-over {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center;
  background: rgba(252, 242, 222, 0.88); padding: 20px;
}
.go-title { font: 700 56px/1 var(--display); color: var(--red); }
.go-score { font: 700 28px/1 var(--display); color: var(--ink); }
.go-note { font-size: 15px; color: var(--ink2); max-width: 20em; min-height: 1.5em; }
.game-over .btn { margin-top: 6px; }
.game-today { margin: 12px auto 0; max-width: 360px; font-size: 14.5px; color: var(--ink2); }

/* ---------- how it works ---------- */
.how, .cast, .faq { padding-block: 40px; }
h2 { font-size: clamp(40px, 5vw, 56px); line-height: 1; text-align: center; text-wrap: balance; }
.section-sub { text-align: center; margin-top: 8px; color: var(--ink2); }
.steps { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.step { text-align: center; padding-top: 30px; }
.step:nth-child(1) { transform: rotate(-1deg); }
.step:nth-child(2) { transform: rotate(0.8deg); background: #FDEFF2; }
.step:nth-child(3) { transform: rotate(-0.6deg); background: #EEF7EA; }
.step-art { height: 150px; width: auto; max-width: 220px; margin: 0 auto 14px; object-fit: contain; }
.step-snack { width: 140px; height: 150px; display: flex; align-items: center; }
.step h3 { font-size: 32px; line-height: 1.05; display: flex; justify-content: center; align-items: center; gap: 10px; }
.num { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 2.5px solid var(--ink); border-radius: 50% 46% 52% 48%; font-size: 22px; background: var(--butter); flex: none; }
.step p { margin-top: 8px; }

/* ---------- cast ---------- */
.cast-row { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; align-items: end; }
.cast-btn { width: 100%; background: none; border: 0; padding: 8px 4px; cursor: pointer; display: grid; justify-items: center; gap: 10px; border-radius: 16px; color: inherit; }
.cast-snack { width: 100%; max-width: 132px; height: 140px; display: flex; align-items: flex-end; justify-content: center; }
.cast-snack .snack { max-width: 100%; }
.cast-name { font: 700 24px/1 var(--display); color: var(--ink); }
.cast-btn:hover .wiggle, .cast-btn:focus-visible .wiggle, .cast-btn.boop .wiggle { animation: hop 520ms ease-out; }
@keyframes hop {
  0% { transform: translateY(0) scale(1, 1) }
  25% { transform: translateY(0) scale(1.05, 0.93) }
  55% { transform: translateY(-14%) scale(0.97, 1.04) }
  100% { transform: translateY(0) scale(1, 1) }
}

/* ---------- faq ---------- */
.faq-list { display: grid; gap: 16px; max-width: 760px; margin: 32px auto 0; }
.faq details { padding: 0; }
.faq summary { list-style: none; cursor: pointer; padding: 18px 56px 18px 22px; font: 700 26px/1.1 var(--display); color: var(--ink); position: relative; border-radius: var(--r-card); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font: 700 34px/1 var(--display); color: var(--red); transition: transform 160ms ease-out; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 22px 20px; }

/* ---------- footer ---------- */
.foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 40px 48px; border-top: 2px dashed rgba(74, 42, 28, 0.25); margin-top: 32px; flex-wrap: wrap; }
.foot img { width: 120px; height: auto; }
.foot p { font-size: 14px; color: var(--ink3); }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-block: 8px 40px; gap: 8px; }
  .hero-stage { order: -1; min-height: 0; padding-top: 8px; }
  .snack-slot { width: min(220px, 56vw); }
  .bubble { width: 132px; height: 118px; font-size: 18px; right: max(0px, calc(50% - 210px)); top: -4px; padding: 14px 14px 32px; }
  .line-grid { grid-template-columns: 1fr; }
  .game-card { max-width: 520px; width: 100%; margin-inline: auto; }
  .steps { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; gap: 34px; }
  .cast-row { grid-template-columns: repeat(3, 1fr); row-gap: 26px; }
}
@media (max-width: 480px) {
  .top .btn-small { font-size: 19px; padding: 6px 12px; }
  .brand img { width: 136px; }
  .join .btn { width: 100%; }
  .card { padding: 24px 18px 20px; }
  .tally dd { font-size: 28px; }
  .cast-snack { height: 110px; }
  .cast-snack .snack { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
