:root {
  --cream: #FBF4E6;
  --paper: #FFFBF3;
  --ink: #221913;
  --muted: #6F635A;
  --red: #E2463A;
  --gold: #F4C232;
  --gap: clamp(10px, 1.6vw, 22px);
  --pad: clamp(16px, 3.4vw, 48px);
}

/* The page reset lives in the lowest cascade layer: unlayered rules would beat
   the Prompt Bond component's layered styles. */
@layer site {
  * { box-sizing: border-box; margin: 0; padding: 0; }
  a { color: inherit; }
  svg { display: block; }
}

/* ---------- one screen, no scrolling ---------- */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  height: 100vh;
  height: 100svh;
  padding: var(--gap);
  background: var(--cream);  /* same as inside the frame */
  color: var(--ink);
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* the framed card: thick ink border, plain cream inside */
.frame {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  /* no overflow clip here: clipping a rounded box stops Chromium painting the blended cat video */
  border: 3px solid var(--ink);
  border-radius: clamp(20px, 2.6vw, 34px);
  /* no background of its own: the body's cream shows through, so the paw trail can sit behind everything */
}

/* ---------- nav ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: clamp(14px, 2vw, 22px) var(--pad) 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: clamp(10px, .9vw, 14px);
  font-weight: 800;
  font-size: clamp(19px, 1.75vw, 27px);   /* sized to sit with the headline, not under it */
  letter-spacing: -0.01em;
  white-space: nowrap;   /* the name stays on one line */
  text-decoration: none;
}
.brand-mark {
  width: clamp(36px, 3.1vw, 46px); height: clamp(36px, 3.1vw, 46px);
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: grid; place-items: center;
  border: 2px solid var(--ink);
}
.brand-mark svg { width: 78%; height: 78%; translate: 0 1px; }   /* the lucky-cat head */
.nav-links { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  font: inherit;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .2s, color .2s;
}
.icon-btn svg { width: 17px; height: 17px; fill: currentColor; }
.icon-line svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); background: var(--ink); color: var(--cream); }
.icon-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }
.icon-btn.done, .icon-btn.done:hover { background: var(--gold); color: var(--ink); }

/* ---------- hero: the cat is the star; the headline and the wallet box sit beside it as one group ---------- */
.hero {
  min-height: 0;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 var(--pad) clamp(14px, 2vw, 24px);
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto auto minmax(0, 1fr);
  grid-template-areas:
    "cat ."
    "cat head"
    "cat box"
    "cat .";
  column-gap: clamp(16px, 3vw, 56px);
}

.headline {
  grid-area: head;
  text-align: center;
  text-wrap: balance;
  font: 400 clamp(32px, min(3.6vw, 7svh), 60px)/1.1 "Potta One", "Bricolage Grotesque", system-ui, sans-serif;
  color: var(--ink);
}
.headline em { font-style: normal; color: var(--red); }

.copy { grid-area: box; position: relative; z-index: 1; min-width: 0; height: 420px; display: flex; }
.bond-host { width: calc(100% + 48px); margin-inline: -24px; flex: none; height: 100%; }  /* bleeds a little into the side gaps so the bonded box has room */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---------- stage / cat video ---------- */
.stage {
  grid-area: cat;
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: min(720px, calc((100svh - 150px) * 0.8));
  aspect-ratio: 4 / 5;
}
.cat-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 50%;
  /* grows past its box a little (the faded rim is see-through). Scaled on the video itself, not .stage:
     a transformed .stage would get its own layer and the multiply blend below would show the video's pale rectangle */
  scale: 1.16;
  translate: -6% 0;   /* keeps the raised paw clear of the souls around the wallet box */
  /* blend into the page: lift the video's light-grey backdrop to white,
     multiply so white becomes the page colour, and fade the edges out */
  filter: brightness(1.07);
  mix-blend-mode: multiply;
  -webkit-mask-image: radial-gradient(ellipse 72% 74% at 50% 50%, #000 62%, transparent 100%);
  mask-image: radial-gradient(ellipse 72% 74% at 50% 50%, #000 62%, transparent 100%);
}

/* ---------- golden paw stamps on the background (main.js) ----------
   Each stamp lands where the cursor is, stays put and fades. The layer sits inside the frame
   at z-index -1: under the border, nav, headline, cat and wallet box, over the page colour. */
.paw-trail { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; border-radius: inherit; }
.paw {
  --s: 32px; --o: .65; --d: 2s;   /* size, opacity and lifetime are varied per stamp */
  position: absolute;
  left: 0; top: 0;
  width: var(--s); height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='%23D6AA64'%3E%3Cpath d='M20 18c5.6 0 11 6.4 11 11.4 0 3.6-3 5.6-6.2 5.6-2 0-3.2-1-4.8-1s-2.8 1-4.8 1C12 35 9 33 9 29.4 9 24.4 14.4 18 20 18z'/%3E%3Cellipse cx='8.5' cy='17' rx='3.6' ry='4.6' transform='rotate(-24 8.5 17)'/%3E%3Cellipse cx='15' cy='9.5' rx='3.8' ry='5' transform='rotate(-8 15 9.5)'/%3E%3Cellipse cx='25' cy='9.5' rx='3.8' ry='5' transform='rotate(8 25 9.5)'/%3E%3Cellipse cx='31.5' cy='17' rx='3.6' ry='4.6' transform='rotate(24 31.5 17)'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 1px 2px rgba(110, 72, 20, .28));
  opacity: 0;
  animation: paw-stamp var(--d) ease-out forwards;
}
@keyframes paw-stamp {
  0%   { opacity: 0; scale: .7; }
  8%   { opacity: var(--o); }
  18%  { scale: 1; }
  50%  { opacity: var(--o); }
  100% { opacity: 0; scale: 1; }
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 40px;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-weight: 700;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- small screens: headline, cat, wallet flow stacked, still one screen ---------- */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "head" "cat" "box";
    column-gap: 0;
  }
  .headline { margin-top: 10px; font-size: clamp(26px, 5.6vw, 44px); }
  .copy { height: auto; }
  /* the cat takes whatever height the wallet flow leaves */
  .cat-video { scale: none; translate: none; }
  .stage { width: auto; height: clamp(84px, calc(100svh - 510px), 260px); max-width: none; transition: height .6s cubic-bezier(.3,.7,.2,1); }
  .bond-host { width: calc(100% + 2 * var(--pad)); margin-inline: calc(-1 * var(--pad)); }
  /* when the appreciation card arrives the cat shrinks to make room for it (on short phones it steps
     aside completely; the card has its own cat) */
  .hero:has(.prompt-story[data-step="4"]) .stage { height: clamp(0px, calc(100svh - 760px), 110px); }
}
@media (max-width: 640px) {
  .headline { font-size: clamp(26px, 7.6vw, 34px); }
  .brand { font-size: 18px; gap: 9px; }
  .brand-mark { width: 34px; height: 34px; }
  .icon-btn { width: 38px; height: 38px; }
  .nav-links { gap: 8px; }
}
/* small phones: "Just A Lucky Cat" and the three buttons share one row */
@media (max-width: 400px) {
  .brand { font-size: 16px; gap: 7px; }
  .brand-mark { width: 31px; height: 31px; }
  .icon-btn { width: 36px; height: 36px; }
  .nav-links { gap: 6px; }
}
@media (max-width: 350px) {
  .brand { font-size: 14px; gap: 6px; }
  .brand-mark { width: 28px; height: 28px; }
  .icon-btn { width: 32px; height: 32px; }
  .icon-btn svg { width: 15px; height: 15px; }
  .nav-links { gap: 4px; }
}
