/* ============================================================
   ONE BIG SIP — splash → meadow
   paper & ink cartoon: warm paper, marker black, fruit-punch red
   ============================================================ */

:root {
  --paper: #f6efe3;
  --paper-hi: #fdf8ee;
  --ink: #16120d;
  --punch: #ff4724;
  --punch-deep: #d92e10;
  --mango: #ffb30e;
  --leaf: #57a643;
  --display: "Luckiest Guy", "Arial Black", sans-serif;
  --hand: "Gochi Hand", "Comic Sans MS", cursive;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--hand);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}
a, button { cursor: none; }
@media (pointer: coarse), (prefers-reduced-motion: reduce) {
  body { cursor: auto; }
  a, button { cursor: pointer; }
  .cursor { display: none; }
}

/* ---------- stage & atmosphere ---------- */

#stage {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  z-index: 1;
  touch-action: none;
}

.vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, transparent 55%, rgba(22, 18, 13, 0.10) 100%);
}

.grain {
  position: fixed; inset: -50px; z-index: 2; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 300px 300px;
  opacity: 0.075;
  mix-blend-mode: multiply;
}

.ht {
  position: fixed; z-index: 2; pointer-events: none;
  width: 38vmin; height: 38vmin;
  background-image: radial-gradient(var(--ink) 1.2px, transparent 1.45px);
  background-size: 14px 14px;
  opacity: 0.10;
  transition: opacity 0.8s ease;
}
.ht-tr {
  top: -6vmin; right: -6vmin;
  -webkit-mask-image: radial-gradient(circle at 70% 30%, #000 0%, transparent 68%);
          mask-image: radial-gradient(circle at 70% 30%, #000 0%, transparent 68%);
}
.ht-bl {
  bottom: -8vmin; left: -8vmin;
  -webkit-mask-image: radial-gradient(circle at 30% 70%, #000 0%, transparent 68%);
          mask-image: radial-gradient(circle at 30% 70%, #000 0%, transparent 68%);
}
/* dots get out of the way once you're in the meadow */
body[data-state="play"] .ht,
body[data-state="dialogue"] .ht,
body[data-state="win"] .ht,
body[data-state="home"] .ht { opacity: 0.04; }

/* ---------- doodles (pre-sip only) ---------- */

.doodles { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.doodle {
  position: absolute;
  opacity: 0;
  transform: translate3d(calc(var(--px, 0) * var(--depth, 12px)), calc(var(--py, 0) * var(--depth, 12px)), 0) rotate(var(--rot, 0deg));
  transition: opacity 0.8s ease 0.2s;
}
body[data-state="armed"] .doodle { opacity: 1; }

.d-star     { width: clamp(34px, 4.5vw, 60px);  top: 16%; left: 12%; --rot: -14deg; --depth: 18px; animation: bob 5.2s ease-in-out infinite; }
.d-squiggle { width: clamp(80px, 10vw, 150px);  bottom: 22%; right: 9%; --rot: 8deg; --depth: 26px; animation: bob 6.4s ease-in-out -1.8s infinite; }
.d-drop     { width: clamp(20px, 2.6vw, 36px);  top: 24%; right: 17%; --rot: 10deg; --depth: 34px; animation: bob 4.6s ease-in-out -0.9s infinite; }
.d-drop2    { width: clamp(16px, 2vw, 28px);    top: 31%; right: 13.5%; --rot: -8deg; --depth: 22px; animation: bob 5.8s ease-in-out -2.4s infinite; }
.d-spark    { width: clamp(26px, 3.4vw, 48px);  bottom: 30%; left: 10%; --rot: 18deg; --depth: 30px; animation: spin-slow 14s linear infinite; }
.d-cross    { width: clamp(16px, 2vw, 30px);    top: 58%; left: 19%; --rot: 6deg; --depth: 16px; animation: bob 7s ease-in-out -3s infinite; }

@keyframes bob {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  50%      { translate: 0 -14px; rotate: 4deg; }
}
@keyframes spin-slow { to { rotate: 360deg; } }

/* ---------- brand ---------- */

.brand {
  position: fixed; top: 22px; left: 26px; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  opacity: 0;
  animation: fade-drop 0.7s ease 0.5s forwards;
}
.brand img {
  height: 46px; width: auto;
  transform: rotate(-4deg);
  transition: transform 0.3s cubic-bezier(0.34, 2.2, 0.5, 1);
}
.brand:hover img { transform: rotate(6deg) scale(1.12); }

@keyframes fade-drop {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- pre-sip prompt ---------- */

.prompt {
  position: fixed; z-index: 4;
  left: 50%; bottom: clamp(26px, 5vh, 56px);
  transform: translateX(-50%);
  text-align: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
}
body[data-state="armed"] .prompt {
  opacity: 1;
  animation: prompt-in 0.7s cubic-bezier(0.2, 1.6, 0.4, 1);
}
body[data-state="sipping"] .prompt {
  opacity: 0; transform: translateX(-50%) translateY(26px) scale(0.92);
}
@keyframes prompt-in {
  0% { opacity: 0; transform: translateX(-50%) translateY(34px) scale(0.9); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.prompt-arrow {
  width: 46px;
  position: absolute; top: -72px; left: 50%;
  transform: translateX(-210%) rotate(14deg);
  animation: arrow-nudge 1.6s ease-in-out infinite;
}
@keyframes arrow-nudge {
  0%, 100% { translate: 0 0; } 50% { translate: 0 -9px; }
}

.prompt-hand { font-size: clamp(19px, 2.2vw, 26px); transform: rotate(-1.5deg); }
.prompt-big {
  font-family: var(--display);
  font-size: clamp(34px, 4.6vw, 56px);
  letter-spacing: 0.04em;
  margin-top: 2px;
  color: var(--punch);
  text-shadow: 0.05em 0.06em 0 var(--ink);
  animation: prompt-pulse 1.6s ease-in-out infinite;
}
@keyframes prompt-pulse {
  0%, 100% { transform: scale(1) rotate(-1deg); }
  50%      { transform: scale(1.055) rotate(0.6deg); }
}
.prompt-sub { font-size: clamp(14px, 1.5vw, 17px); opacity: 0.62; margin-top: 7px; }

/* ---------- quest card ---------- */

.quest {
  position: fixed; z-index: 5;
  top: 24px; left: 50%;
  transform: translateX(-50%) translateY(-90px) rotate(-1deg);
  display: flex; align-items: center; gap: 10px;
  font-size: clamp(16px, 1.9vw, 21px);
  background: var(--paper-hi);
  border: 3px solid var(--ink);
  border-radius: 14px 18px 12px 16px;
  box-shadow: 4px 5px 0 var(--ink);
  padding: 9px 18px 7px;
  transition: transform 0.6s cubic-bezier(0.2, 1.6, 0.4, 1), background 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}
.quest.on { transform: translateX(-50%) translateY(0) rotate(-1deg); }
.quest-box {
  width: 17px; height: 17px;
  border: 3px solid var(--ink);
  border-radius: 5px 6px 4px 6px;
  flex: none;
  position: relative;
  background: var(--paper-hi);
}
.quest.done { background: var(--mango); }
.quest.done .quest-box::after {
  content: "";
  position: absolute; inset: -6px -4px 0 1px;
  border-left: 4px solid var(--punch-deep);
  border-bottom: 4px solid var(--punch-deep);
  transform: rotate(-50deg);
  border-radius: 2px;
}

/* ---------- controls hint ---------- */

.hint {
  position: fixed; z-index: 5;
  left: 26px; bottom: 22px;
  font-size: clamp(14px, 1.6vw, 18px);
  background: var(--paper-hi);
  border: 2.5px solid var(--ink);
  border-radius: 12px 15px 11px 14px;
  box-shadow: 3px 4px 0 var(--ink);
  padding: 8px 15px 6px;
  transform: rotate(-1.2deg);
  opacity: 0; pointer-events: none;
  transition: opacity 0.5s ease 0.4s;
}
.hint.on { opacity: 1; }
.hint-keys {
  font-family: var(--display);
  font-size: 0.82em;
  letter-spacing: 0.06em;
  color: var(--punch-deep);
}
body.touch .hint { bottom: calc(22px + env(safe-area-inset-bottom)); }

/* ---------- floating interact prompt ---------- */

.act {
  position: fixed; z-index: 5; left: 0; top: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.act.on { opacity: 1; }
.act > span { display: inline-block; }
.act-key {
  font-family: var(--display);
  font-size: 15px;
  background: var(--ink);
  color: var(--paper-hi);
  border-radius: 8px;
  padding: 5px 8px 2px;
  margin-right: 7px;
  animation: act-bounce 0.9s ease-in-out infinite;
}
body.touch .act-key { display: none; }
.act-label {
  font-family: var(--display);
  font-size: clamp(16px, 1.8vw, 20px);
  letter-spacing: 0.04em;
  color: var(--paper-hi);
  background: var(--punch);
  border: 2.5px solid var(--ink);
  border-radius: 11px 13px 10px 12px;
  box-shadow: 2.5px 3px 0 var(--ink);
  padding: 5px 12px 2px;
  transform: rotate(-2deg);
}
@keyframes act-bounce {
  0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; }
}

/* ---------- dialogue bubble ---------- */

.dlg {
  position: fixed; z-index: 6;
  left: 50%; bottom: calc(clamp(22px, 5vh, 52px) + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(30px) scale(0.92);
  width: min(92vw, 640px);
  background: var(--paper-hi);
  border: 3.5px solid var(--ink);
  border-radius: 22px 26px 20px 24px;
  box-shadow: 6px 8px 0 var(--ink);
  padding: 26px 30px 22px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease, transform 0.25s cubic-bezier(0.2, 1.7, 0.4, 1);
}
.dlg.on { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }

.dlg-name {
  position: absolute; top: -17px; left: 24px;
  font-family: var(--display);
  font-size: clamp(15px, 1.7vw, 19px);
  letter-spacing: 0.06em;
  color: var(--paper-hi);
  background: var(--punch);
  border: 3px solid var(--ink);
  border-radius: 12px 14px 10px 12px;
  padding: 6px 14px 3px;
  transform: rotate(-2.5deg);
}
.dlg-text {
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.4;
  min-height: 2.8em;
}
.dlg-next {
  position: absolute; right: 20px; bottom: 12px;
  color: var(--punch);
  font-size: 18px;
  opacity: 0;
}
.dlg.idle .dlg-next { opacity: 1; animation: next-nudge 0.8s ease-in-out infinite; }
@keyframes next-nudge {
  0%, 100% { translate: 0 0; } 50% { translate: 0 4px; }
}

/* ---------- touch controls ---------- */

.stick {
  position: fixed; z-index: 7; left: 0; top: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.stick.on { opacity: 1; }
.stick-base {
  position: absolute;
  width: 108px; height: 108px;
  margin: -54px 0 0 -54px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: rgba(253, 248, 238, 0.5);
}
.stick-nub {
  position: absolute;
  width: 52px; height: 52px;
  margin: -26px 0 0 -26px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--punch);
  box-shadow: 2px 3px 0 var(--ink);
}

.actbtn {
  position: fixed; z-index: 7;
  right: calc(22px + env(safe-area-inset-right));
  bottom: calc(30px + env(safe-area-inset-bottom));
  width: 72px; height: 72px;
  font-family: var(--display);
  font-size: 34px;
  color: var(--paper-hi);
  background: var(--punch);
  border: 3.5px solid var(--ink);
  border-radius: 50%;
  box-shadow: 4px 5px 0 var(--ink);
  display: none;
  touch-action: manipulation;
}
.actbtn:active { transform: translate(2px, 3px); box-shadow: 1px 1px 0 var(--ink); }
body.touch[data-state="play"] .actbtn { display: block; }

/* ---------- home-sweet-carton finale ---------- */

/* paper wash so the brand + buttons never fight the grass */
.homescrim {
  position: fixed; inset: 0; z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s ease 0.2s;
  background: linear-gradient(
    180deg,
    transparent 32%,
    rgba(246, 239, 227, 0.45) 52%,
    rgba(246, 239, 227, 0.88) 72%,
    var(--paper) 96%
  );
}
body[data-state="home"] .homescrim { opacity: 1; }

.homeui { opacity: 0; pointer-events: none; }
body[data-state="home"] .homeui {
  opacity: 1; pointer-events: auto;
  transition: opacity 0.6s ease 0.15s;
}

.hero {
  position: fixed; z-index: 4;
  left: 50%; bottom: calc(clamp(26px, 6.5vh, 72px) + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  text-align: center;
  width: min(94vw, 1100px);
}

.title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(48px, 10.5vw, 124px);
  line-height: 0.86;
  letter-spacing: 0.015em;
  user-select: none;
}
.title .word { display: inline-block; white-space: nowrap; margin: 0 0.09em; }
.title .ltr {
  display: inline-block;
  opacity: 0;
  transform: scale(0) rotate(-18deg) translateY(0.2em);
  text-shadow: 0.048em 0.058em 0 var(--punch);
  paint-order: stroke fill;
}
.title .big .ltr {
  color: var(--punch);
  -webkit-text-stroke: 0.022em var(--ink);
  text-shadow: 0.048em 0.058em 0 var(--ink);
}
body.revealed .title .ltr {
  animation: slam 0.55s cubic-bezier(0.18, 2.0, 0.32, 1) forwards;
  animation-delay: calc(var(--i) * 0.046s);
}
.title .ltr:nth-child(odd)  { --tilt: -2.6deg; }
.title .ltr:nth-child(even) { --tilt: 2.1deg; }
@keyframes slam {
  0%   { opacity: 0; transform: scale(0) rotate(-18deg) translateY(0.2em); }
  100% { opacity: 1; transform: scale(1) rotate(var(--tilt, 0deg)) translateY(0); }
}

.tagline {
  font-size: clamp(18px, 2.1vw, 25px);
  margin-top: clamp(12px, 1.8vh, 20px);
  transform: rotate(-0.8deg);
}
.tagline strong { color: var(--punch-deep); }
.homenote {
  font-size: clamp(14px, 1.6vw, 18px);
  opacity: 0.66;
  margin-top: 6px;
  transform: rotate(-0.4deg);
}

.ctas {
  display: flex; gap: 18px; justify-content: center; align-items: center;
  margin-top: clamp(14px, 2.4vh, 26px);
  flex-wrap: wrap;
}

.btn {
  font-family: var(--display);
  font-size: clamp(16px, 1.7vw, 21px);
  letter-spacing: 0.05em;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper-hi);
  border: 3px solid var(--ink);
  border-radius: 16px 20px 14px 18px;
  padding: 13px 26px 10px;
  box-shadow: 5px 6px 0 var(--ink);
  cursor: none;
  transition: transform 0.16s cubic-bezier(0.34, 1.8, 0.5, 1), box-shadow 0.16s ease, background 0.16s ease;
  display: inline-flex; align-items: center; gap: 9px;
}
@media (pointer: coarse), (prefers-reduced-motion: reduce) { .btn { cursor: pointer; } }
.btn:hover, .btn:focus-visible { transform: translate(-2px, -3px) rotate(-0.6deg); box-shadow: 8px 10px 0 var(--ink); }
.btn:active { transform: translate(3px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--punch); color: var(--paper-hi); }
.btn.primary:hover { background: var(--punch-deep); }
.btn .btn-arrow { display: inline-block; transition: transform 0.2s ease; }
.btn:hover .btn-arrow { transform: translateX(5px); }
.btn .re { display: inline-block; font-size: 1.2em; line-height: 0; transition: transform 0.45s cubic-bezier(0.34, 1.6, 0.5, 1); }
.btn:hover .re { transform: rotate(-360deg); }

/* ---------- comic FX ---------- */

.fx-slurp, .fx-ahh {
  position: fixed; z-index: 6; left: 0; top: 0;
  font-family: var(--display);
  color: var(--punch);
  -webkit-text-stroke: 1.5px var(--ink);
  text-shadow: 0.05em 0.07em 0 var(--ink);
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
}
.fx-slurp { font-size: clamp(30px, 4.2vw, 54px); }
.fx-slurp.on {
  opacity: 1;
  animation: slurp-shake 0.09s linear infinite;
}
@keyframes slurp-shake {
  0%   { margin-left: -2px; margin-top: 1px; }
  25%  { margin-left: 2px;  margin-top: -2px; }
  50%  { margin-left: -1px; margin-top: 2px; }
  75%  { margin-left: 2px;  margin-top: 1px; }
  100% { margin-left: -2px; margin-top: -1px; }
}
.fx-ahh {
  font-family: var(--hand);
  font-size: clamp(24px, 2.8vw, 38px);
  color: var(--ink);
  -webkit-text-stroke: 0;
  text-shadow: none;
}
.fx-ahh.on { animation: ahh-float 1.5s ease-out forwards; }
@keyframes ahh-float {
  0%   { opacity: 0; translate: 0 10px; scale: 0.6; }
  18%  { opacity: 1; scale: 1.08; }
  30%  { scale: 1; }
  100% { opacity: 0; translate: 0 -46px; scale: 1; }
}

#burst {
  position: fixed; z-index: 3; left: 0; top: 0;
  width: 46vmin; height: 46vmin;
  margin: -23vmin 0 0 -23vmin;
  pointer-events: none;
  opacity: 0;
}
#burst.go { animation: burst-pop 0.34s cubic-bezier(0.2, 0.9, 0.3, 1) forwards; }
@keyframes burst-pop {
  0%   { opacity: 0; scale: 0.35; }
  22%  { opacity: 1; }
  100% { opacity: 0; scale: 1.18; }
}

.flash {
  position: fixed; inset: 0; z-index: 7;
  background: var(--paper-hi);
  opacity: 0; pointer-events: none;
}
.flash.go { animation: flash-bang 0.22s ease-out forwards; }
@keyframes flash-bang {
  0% { opacity: 0.95; } 100% { opacity: 0; }
}

/* ---------- footer ---------- */

.foot {
  position: fixed; z-index: 5;
  left: 50%; bottom: 12px; transform: translateX(-50%);
  font-size: clamp(13px, 1.4vw, 16px);
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.6s ease 0.4s;
}
body[data-state="home"] .foot { opacity: 0.66; }

/* ---------- cursor ---------- */

.cursor {
  position: fixed; z-index: 99; left: 0; top: 0;
  width: 22px; height: 22px;
  margin: -11px 0 0 -11px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: rgba(255, 71, 36, 0.22);
  pointer-events: none;
  transition: width 0.18s ease, height 0.18s ease, margin 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.cursor.hot {
  width: 40px; height: 40px; margin: -20px 0 0 -20px;
  background: rgba(255, 71, 36, 0.4);
}
.cursor.down { width: 14px; height: 14px; margin: -7px 0 0 -7px; background: var(--punch); }

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  .brand { top: 14px; left: 14px; }
  .brand img { height: 36px; }
  .quest { top: 14px; font-size: 14px; padding: 8px 13px 6px; }
  .dlg { padding: 20px 20px 18px; }
  .foot { display: none; }
  .hero { bottom: 56px; }
  .ctas { gap: 12px; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .doodle, .prompt-big, .prompt-arrow, .fx-slurp.on, .act-key { animation: none !important; }
  body.revealed .title .ltr { animation: none; opacity: 1; transform: scale(1) rotate(var(--tilt, 0deg)); }
  .brand { animation: none; opacity: 1; }
}
