/* Pixelify Sans draws its 5 like an S and its 2 like a Z, so every number on the page takes
   its digits from Jersey 10 (SIL OFL, assets/fonts/Jersey10-OFL.txt), cut down to the ten
   digits. Only the digits: the letters stay Pixelify Sans. Scaled to Pixelify's cap height. */
@font-face {
  font-family: "BRS Digits";
  src: url("assets/fonts/jersey10-digits.woff2") format("woff2");
  unicode-range: U+0030-0039;
  font-weight: 100 900;
  font-display: swap;
  size-adjust: 135%;
}

/* Palette sampled from the game: lagoon water, logo outline, logo gold and its shades */
:root {
  color-scheme: light;
  --water: #4ea5fa;
  --ink: #2d2832;
  --ink-soft: #3d3644;
  --gold: #ffcb40;
  --gold-shade: #e87838;
  --peach: #ef9b7a;
  --paper: #fdf6e8;
  --white: #ffffff;
  --grass: #5cc14a;
  --grass-dark: #3c8f3a;
  --text: #2d2832;
  --text-soft: #5b5263;
  --px: 4px; /* one art pixel at the page's chunky scale */
  --heading: "BRS Digits", "Pixelify Sans", ui-monospace, monospace;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* The game's own pointer, handed to the browser like the game hands it to the OS:
     hardware cursor, so it never lags. Tip is (2,2) in the art, doubled. */
  --hand: url("assets/sprites/hand.png") 4 4, auto;
  --hand-bending: url("assets/sprites/hand_bending.png") 4 4, auto;
  --hand-pressed: url("assets/sprites/hand_pressed.png") 4 4, auto;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth; cursor: var(--hand);
  scrollbar-gutter: stable; /* the shop locks the scroll without the page jumping sideways */
  /* fast taps break things; they must never be read as a double-tap zoom */
  touch-action: manipulation;
}
html.bending { cursor: var(--hand-bending); }
html.pressed { cursor: var(--hand-pressed); }
a, button, summary { cursor: inherit; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; height: auto; }
/* The page shakes as one piece when something breaks. Kept on its own layer so a shake only
   moves the layer, rather than repainting the whole page every frame of it. */
main { will-change: transform; }
a { color: inherit; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 24px;
  background: var(--ink);
  color: var(--white);
  border-bottom: var(--px) solid #1d1a21;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 20px var(--heading); }
.brand img { image-rendering: pixelated; }
.purse {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  margin-left: auto;
  padding: 2px 4px 2px 6px;
  background: #1d1a21;
  border: 3px solid #4a4252;
  font: 700 20px var(--heading); color: var(--gold);
  min-width: 84px;
}
.purse:hover, .purse:focus-visible { border-color: var(--gold); }
.shop-tag {
  margin-left: 4px; padding: 0 8px;
  font: 700 15px/26px var(--heading); color: var(--ink);
  background: var(--gold);
  box-shadow: inset 0 -3px 0 var(--gold-shade);
}
.purse.can-buy .shop-tag { animation: tag-nudge 1.4s steps(2, end) infinite; }
/* the red sticker on anything just come within reach */
.new-badge, .new-dot, .card .new {
  position: absolute; z-index: 2;
  padding: 0 5px;
  font: 700 12px/18px var(--heading); color: var(--white); letter-spacing: .04em;
  white-space: nowrap;
  background: #f05a5a;
  border: 2px solid var(--ink);
  box-shadow: 0 2px 0 var(--ink);
  pointer-events: none;
  animation: new-bob 1s steps(2, end) infinite;
}
.new-badge { top: -11px; right: -10px; }
.new-dot { top: -12px; right: -10px; }
.card .new { left: 8px; top: 8px; font-size: 14px; line-height: 20px; }
.new-badge[hidden], .new-dot[hidden], .card .new[hidden] { display: none; }
@keyframes new-bob { 50% { transform: translateY(-3px); } }
@keyframes tag-nudge { 50% { transform: translateY(-3px); } }
.purse img { image-rendering: pixelated; }
.topbar nav { display: flex; gap: 20px; font: 500 18px var(--heading); }
.topbar nav a { text-decoration: none; opacity: .85; }
.topbar nav a:hover { opacity: 1; color: var(--gold); }

/* ---------- hero: the lagoon ---------- */
.hero {
  --tile: url("assets/water.png");
  --sea: var(--water);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--sea);
  color: var(--white);
  padding: 72px 16px 120px;
  text-align: center;
}
/* The water drifts: the tile slides one whole tile and starts over, in steps of one art
   pixel, so it moves without ever blurring. A transform, so it costs the page nothing. */
.hero::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; z-index: -1;
  width: calc(100% + 256px);
  background: var(--tile) 0 0 / 256px 160px repeat; /* 4x the 64x40 tile */
  image-rendering: pixelated;
  animation: tide 16s steps(64) infinite;
  will-change: transform;
}
@keyframes tide { to { transform: translate3d(-256px, 0, 0); } }
.hero[data-lagoon="turquoise"] { --tile: url("assets/water_turquoise.png"); --sea: #20b2a6; }
.hero[data-lagoon="sunset"] { --tile: url("assets/water_sunset.png"); --sea: #ec7a68; }
.hero[data-lagoon="night"] { --tile: url("assets/water_night.png"); --sea: #1e2a5c; }

/* gulls and glints, moved by the page's one loop */
.lagoon { position: absolute; inset: 0; pointer-events: none; }
.lagoon > * { position: absolute; left: 0; top: 0; will-change: transform; }
.gull {
  width: 28px; height: 12px;
  background: url("assets/sprites/gull.png") 0 0 / 56px 12px no-repeat;
  image-rendering: pixelated;
  opacity: .9;
}
.glint { height: 4px; background: #fff; opacity: .7; }
.hero[data-lagoon="night"] .glint { background: #dfe8ff; opacity: .9; box-shadow: 0 0 0 2px rgba(150, 180, 255, .25); }
.hero[data-lagoon="sunset"] .glint { background: #fff3c4; }

.hero-inner { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; }

/* The title as the game's own title screen shows it: the name, and the game's hand pressing
   it from below, every 1.7 seconds. Three sheets on one grid, scaled up whole: --lp is one
   art pixel. The hand hangs 13 art pixels under the name, so the space under it is kept. */
.logo-wrap {
  --lp: 5px;
  width: calc(123 * var(--lp));
  margin: 0 auto 16px;
}
.logo-wrap img {
  width: calc(123 * var(--lp)); max-width: none; height: auto;
}
.logo { animation: bob 2.4s step-end infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  25%, 75% { transform: translateY(calc(-1 * var(--lp))); }
  50% { transform: translateY(calc(-2 * var(--lp))); }
}
.tagline {
  max-width: 640px; margin: 0 auto 32px;
  font-size: 19px; line-height: 1.55; font-weight: 500;
  text-shadow: 0 2px 0 rgba(29, 26, 33, .55);
}
.cta { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.release {
  width: fit-content; margin: 22px auto 0;
  font: 500 18px var(--heading); letter-spacing: .02em;
  text-shadow: 0 2px 0 rgba(29, 26, 33, .35);
}
.hint {
  position: relative;
  width: fit-content; margin: 26px auto 0;
  padding: 8px 14px;
  background: var(--white); color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  font: 500 16px var(--heading);
  animation: hint-bob 1.2s steps(2, end) infinite;
}
.hint::before {
  content: ""; position: absolute; left: 50%; top: -11px; margin-left: -6px;
  width: 12px; height: 8px; background: var(--ink);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
@keyframes hint-bob { 50% { transform: translateY(-3px); } }
.hint.done { animation: none; opacity: .0; transition: opacity .4s; }

/* sandy shore with a stepped pixel edge, like the island borders in-game */
.shore {
  position: absolute; left: 0; right: 0; bottom: 0; height: 48px;
  background:
    linear-gradient(var(--paper), var(--paper)) 0 100% / 100% 24px no-repeat,
    repeating-linear-gradient(90deg, var(--paper) 0 32px, transparent 32px 64px) 0 100% / 100% 36px no-repeat,
    repeating-linear-gradient(90deg, transparent 0 16px, var(--paper) 16px 24px, transparent 24px 64px) 0 100% / 100% 44px no-repeat;
}

/* ---------- buttons ---------- */
.btn {
  --face: var(--white);
  --edge: #c9c2d1;
  display: inline-block;
  padding: 14px 26px 12px;
  font: 700 21px var(--heading);
  color: var(--ink);
  text-decoration: none;
  background: var(--face);
  border: var(--px) solid var(--ink);
  box-shadow: inset 0 calc(-1 * var(--px)) 0 var(--edge), 0 var(--px) 0 var(--ink);
  transition: transform .08s steps(2), box-shadow .08s steps(2);
}
.btn-gold { --face: var(--gold); --edge: var(--gold-shade); }
.btn:hover { transform: translateY(-4px); box-shadow: inset 0 calc(-1 * var(--px)) 0 var(--edge), 0 8px 0 var(--ink); }
.btn:active { transform: translateY(4px); box-shadow: inset 0 calc(-1 * var(--px)) 0 var(--edge), 0 0 0 var(--ink); }
.btn-gold { animation: breathe 1.6s steps(2, end) infinite; }
@keyframes breathe {
  0%, 100% { outline: 0 solid transparent; }
  50% { outline: var(--px) solid rgba(255, 255, 255, .55); }
}

/* ---------- features ---------- */
.features { max-width: 1120px; margin: 0 auto; padding: 56px 24px 24px; }
.feature {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 40px; align-items: center;
  margin-bottom: 64px;
}
.feature.flip .frame { order: 2; }
.frame {
  background: var(--ink);
  padding: var(--px);
  box-shadow: 8px 8px 0 rgba(45, 40, 50, .18);
}
.frame video { width: 100%; image-rendering: pixelated; background: var(--water); }
.copy h2 { width: fit-content; margin: 0 0 12px; font: 700 34px/1.1 var(--heading); color: var(--ink); }
.copy p { margin: 0; color: var(--text-soft); font-size: 18px; }

.perks {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.perks li {
  padding: 16px 18px 16px 52px;
  background: var(--white);
  border: var(--px) solid var(--ink);
  box-shadow: 0 var(--px) 0 var(--ink);
  font: 500 19px/1.35 var(--heading);
}
.perks li::before {
  content: ""; position: absolute; left: 18px; top: 50%;
  width: 16px; height: 16px; margin-top: -8px;
  background: var(--gold);
  box-shadow: inset -4px -4px 0 var(--gold-shade);
}

/* ---------- gallery ---------- */
.gallery { max-width: 1120px; margin: 0 auto; padding: 40px 24px 64px; }
.gallery h2, .studio h2 { width: fit-content; margin: 0 0 20px; font: 700 34px var(--heading); color: var(--ink); }
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.shot {
  border: var(--px) solid var(--ink); background: var(--ink);
  box-shadow: 0 var(--px) 0 var(--ink);
}
.shot img { width: 100%; }

.shot { position: relative; }
.zoom {
  position: absolute; right: 8px; bottom: 8px; z-index: 4;
  width: 40px; height: 40px;
  background: var(--white);
  border: 3px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  opacity: .85;
  transition: transform .08s steps(2), opacity .08s;
}
/* a pixel magnifier drawn with two boxes: the lens and the handle */
.zoom::before {
  content: ""; position: absolute; left: 7px; top: 7px;
  width: 14px; height: 14px;
  border: 4px solid var(--ink);
}
.zoom::after {
  content: ""; position: absolute; left: 23px; top: 23px;
  width: 8px; height: 8px; background: var(--ink);
}
.zoom:hover { opacity: 1; transform: translateY(-3px); }

.lightbox {
  max-width: min(1600px, 94vw); padding: 0; border: var(--px) solid var(--ink);
  background: var(--ink); overflow: visible;
}
.lightbox::backdrop { background: rgba(29, 26, 33, .85); }
.lightbox img { width: 100%; image-rendering: pixelated; }
.lightbox .close {
  position: absolute; top: -20px; right: -20px;
  width: 44px; height: 44px;
  font: 700 28px/1 var(--heading); color: var(--ink);
  background: var(--gold); border: var(--px) solid var(--ink);
  box-shadow: 0 var(--px) 0 var(--ink);
}

/* ---------- questions ---------- */
.faq { max-width: 860px; margin: 0 auto; padding: 8px 24px 64px; }
.faq h2, .press h2 { width: fit-content; margin: 0 0 20px; font: 700 34px var(--heading); color: var(--ink); }
.faq details {
  margin-bottom: 12px;
  background: var(--white);
  border: var(--px) solid var(--ink);
  box-shadow: 0 var(--px) 0 var(--ink);
}
.faq summary {
  list-style: none;
  padding: 14px 18px 14px 48px;
  position: relative;
  font: 700 20px var(--heading); color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: ""; position: absolute; left: 18px; top: 50%; margin-top: -8px;
  width: 16px; height: 16px; background: var(--gold);
  box-shadow: inset -4px -4px 0 var(--gold-shade);
  transition: transform .1s steps(2);
}
.faq details[open] summary::before { transform: rotate(45deg); }
.faq summary:hover { color: var(--gold-shade); }
.faq details p { width: fit-content; margin: 0; padding: 0 18px 16px 48px; color: var(--text-soft); overflow-wrap: anywhere; }

/* ---------- press kit ---------- */
.press { max-width: 1120px; margin: 0 auto; padding: 8px 24px 64px; }
.press-inner { display: flex; gap: 24px; align-items: stretch; flex-wrap: wrap; }
.press-inner > * { min-width: 0; }
.facts {
  flex: 1 1 420px;
  display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px;
  margin: 0; padding: 20px 24px;
  background: var(--white);
  border: var(--px) solid var(--ink);
  box-shadow: 0 var(--px) 0 var(--ink);
}
.facts dt { font: 700 17px var(--heading); color: var(--text-soft); }
.facts dd { margin: 0; font: 500 18px var(--heading); color: var(--ink); overflow-wrap: anywhere; }
.press-side { flex: 1 1 260px; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.press-side p { width: fit-content; margin: 0; color: var(--text-soft); }
.press-side .btn { align-self: flex-start; }

/* ---------- achievements, in the corner like Steam's ---------- */
.toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 1100;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  width: 300px; max-width: calc(100vw - 32px);
  padding: 10px 14px;
  background: var(--ink); color: var(--white);
  border: 3px solid #4a4252;
  box-shadow: 0 4px 0 #1d1a21;
  animation: toast-in .24s steps(4) both;
}
.toast.out { animation: toast-out .2s steps(3) both; }
.toast img { flex: none; width: 54px; height: 54px; /* 32px coin + padding + border: whole pixels */ image-rendering: pixelated; background: #1d1a21; padding: 8px; border: 3px solid var(--gold); }
.toast b { display: block; font: 700 17px var(--heading); color: var(--gold); }
.toast span { display: block; font: 500 15px/1.3 var(--heading); color: #cfc8d6; }
.toast small { display: block; font: 500 12px var(--heading); color: #8d8496; text-transform: uppercase; letter-spacing: .06em; }
@keyframes toast-in { from { transform: translateX(120%); } to { transform: translateX(0); } }
@keyframes toast-out { to { transform: translateX(120%); } }

/* ---------- studio / contact ---------- */
.studio {
  background: var(--grass);
  border-top: var(--px) solid var(--grass-dark);
  padding: 56px 24px;
}
.studio-inner {
  max-width: 1120px; margin: 0 auto;
  display: flex; gap: 32px; align-items: flex-start;
  background: var(--paper);
  border: var(--px) solid var(--ink);
  box-shadow: 0 8px 0 var(--ink);
  padding: 32px;
}
.studio-icon { flex: none; border: var(--px) solid var(--ink); }
.studio-icon img { width: 128px; height: 128px; image-rendering: pixelated; }
.studio p { margin: 0 0 20px; color: var(--text-soft); font-size: 18px; }
.mail { display: flex; flex-wrap: wrap; gap: 16px; }
.mail-card {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 18px;
  text-decoration: none;
  background: var(--white);
  border: var(--px) solid var(--ink);
  box-shadow: 0 var(--px) 0 var(--ink);
  transition: transform .08s steps(2);
}
.mail-card:hover { transform: translateY(-4px); }
.mail-label { font: 500 15px var(--heading); color: var(--text-soft); }
.mail-addr { font: 700 19px var(--heading); color: var(--ink); word-break: break-all; }

/* ---------- footer ---------- */
.footer {
  display: flex; flex-wrap: wrap; gap: 24px; justify-content: center;
  padding: 22px 16px;
  background: var(--ink); color: #cfc8d6;
  font: 500 16px var(--heading);
}
.footer a { text-decoration: none; }
.footer a:hover { color: var(--gold); }

/* ---------- breaking things ---------- */
[data-break] {
  position: relative;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  transform-origin: 50% 100%;
}
@media (pointer: fine) {
  /* the drawn pickaxe takes over from the hand, as it does over a node in-game */
  [data-break] { cursor: none; }
}
[data-break].broken { visibility: hidden; }
[data-break].flash { filter: brightness(1.9) saturate(.6); }
[data-break].flash-text {
  color: #fff !important;
  text-shadow: 2px 0 var(--ink), -2px 0 var(--ink), 0 2px var(--ink), 0 -2px var(--ink) !important;
}

.cracks {
  position: absolute; left: 0; top: 0;
  pointer-events: none;
  image-rendering: pixelated;
  z-index: 2;
}
.hp {
  position: absolute; left: 50%; bottom: -20px; z-index: 3;
  width: 120px; max-width: 80%; height: 14px;
  transform: translateX(-50%);
  background: #1d1a21;
  border: 3px solid var(--ink);
  box-shadow: 0 2px 0 rgba(29, 26, 33, .35);
  pointer-events: none;
}
.hp b, .hp i { position: absolute; left: 0; top: 0; bottom: 0; }
.hp b { background: #fff3b0; }          /* the pale chunk that drains after a blow */
.hp i { background: var(--grass); box-shadow: inset 0 -3px 0 var(--grass-dark); }

.tool {
  position: fixed; left: 0; top: 0; z-index: 1000;
  width: 132px; height: 72px;
  background: url("assets/sprites/pickaxe_gold.png") 0 0 / 1056px 72px no-repeat;
  image-rendering: pixelated;
  pointer-events: none;
  display: none;
  will-change: transform;
}
/* every chip, piece, coin and number flying about is drawn on this one canvas */
.fx {
  position: fixed; left: 0; top: 0; z-index: 900;
  width: 100%; height: 100%;
  pointer-events: none;
}

/* ---------- friends walking the bottom edge of the screen ---------- */
.walkers { position: fixed; left: 0; right: 0; bottom: 2px; height: 0; z-index: 700; pointer-events: none; }
.pet {
  position: absolute; left: 0; bottom: 0;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  will-change: transform;
  pointer-events: auto;
  cursor: inherit;
}

/* ---------- shop ---------- */
.shop {
  position: fixed; inset: 0; z-index: 800;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(29, 26, 33, .82);
}
.shop[hidden] { display: none; }
html.shop-open { overflow: hidden; }
.shop-panel {
  display: flex; flex-direction: column;
  width: min(940px, 100%);
  /* one height for every tab, so switching tabs never makes the panel jump */
  height: min(800px, calc(100vh - 32px));
  height: min(800px, calc(100dvh - 32px));
  background: var(--paper);
  border: var(--px) solid var(--ink);
  box-shadow: 0 8px 0 #1d1a21;
  animation: shop-in .24s steps(4) both;
}
.shop-panel.shake { animation: shop-shake .2s steps(4) 1; }
@keyframes shop-in { from { transform: translateY(48px) scale(.94); opacity: 0; } }
@keyframes shop-shake {
  25% { transform: translate(-6px, 3px); }
  50% { transform: translate(5px, -3px); }
  75% { transform: translate(-3px, 2px); }
}
.shop-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px 12px 20px;
  background: var(--ink); color: var(--white);
}
.shop-head h2 { margin: 0; font: 700 30px/1 var(--heading); color: var(--gold); }
.shop-balance {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto;
  padding: 2px 14px 2px 6px;
  background: #1d1a21; border: 3px solid #4a4252;
  font: 700 22px var(--heading); color: var(--gold);
}
.shop-balance img { image-rendering: pixelated; }
.shop-close {
  flex: none; width: 44px; height: 44px; padding: 0;
  font: 700 28px/1 var(--heading); color: var(--ink);
  background: var(--gold); border: 3px solid #1d1a21;
  box-shadow: inset 0 -4px 0 var(--gold-shade);
}
.shop-close:hover { transform: translateY(-2px); }
.shop-blurb { margin: 14px 20px 0; color: var(--text-soft); font-size: 15px; }
.shop-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px 0; }
.shop-tab {
  position: relative;
  padding: 8px 14px 6px;
  font: 700 18px var(--heading); color: var(--ink);
  background: var(--white);
  border: 3px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
}
.shop-tab:hover { transform: translateY(-2px); }
.shop-tab[aria-selected="true"] { background: var(--gold); box-shadow: inset 0 -3px 0 var(--gold-shade), 0 3px 0 var(--ink); }
.shop-tab small { margin-left: 6px; font-size: 14px; color: var(--text-soft); }
.shop-grid {
  flex: 1; align-content: start;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 16px;
  padding: 18px 20px 22px;
  overflow-y: auto; overscroll-behavior: contain;
}
.card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--white);
  border: var(--px) solid var(--ink);
  box-shadow: 0 var(--px) 0 var(--ink);
}
.card.equipped { box-shadow: 0 0 0 var(--px) var(--gold), 0 8px 0 var(--ink); }
.card.flash { animation: card-flash .3s steps(3) 1; }
@keyframes card-flash { 0%, 66% { filter: brightness(1.6); transform: translateY(-6px); } }
.pv {
  position: relative; height: 112px;
  display: grid; place-items: center;
  overflow: hidden;
  background: #dcecff;
  border-bottom: 3px solid var(--ink);
}
.pv > i { display: block; image-rendering: pixelated; background-repeat: no-repeat; }
.pv-tool { width: 132px; height: 72px; background-size: 1056px 72px; }
.card:hover .pv-tool { animation: pv-swing .25s steps(8) infinite; }
@keyframes pv-swing { to { background-position: -1056px 0; } }
.pv > .pv-lagoon { position: absolute; inset: 0; background: 0 0 / 256px 160px repeat; }
.pv > .gull { position: relative; }
.pv-sand { position: absolute; left: 0; right: 0; bottom: 0; height: 18px; background: var(--paper); border-top: 3px solid #eadfc8; }
.pv > .pet-pv { position: absolute; bottom: 12px; left: 50%; }
.pv-rainbow { display: flex; gap: 6px; }
.pv-rainbow b { width: 14px; height: 14px; animation: hop .6s steps(2, end) infinite; }
.pv-rainbow b:nth-child(2n) { animation-delay: -.3s; }
@keyframes hop { 50% { transform: translateY(-10px); } }
.pv > .pv-trail { display: block; }
.pv.dark { background: #2d2832; }
.pv-flock { display: flex; gap: 14px; align-items: center; }
.pv-flock .gull:nth-child(2) { margin-top: -26px; }
.card h3 { margin: 12px 14px 2px; font: 700 20px/1.15 var(--heading); color: var(--ink); }
.card p { flex: 1; margin: 0 14px 12px; font-size: 14px; line-height: 1.4; color: var(--text-soft); }
.buy {
  --face: var(--gold); --edge: var(--gold-shade);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 0 14px 14px; padding: 8px 10px 6px;
  font: 700 18px var(--heading); color: var(--ink);
  background: var(--face);
  border: 3px solid var(--ink);
  box-shadow: inset 0 -4px 0 var(--edge), 0 3px 0 var(--ink);
}
.buy img { width: 24px; height: 24px; image-rendering: pixelated; }
.buy:hover { transform: translateY(-2px); }
.buy:active { transform: translateY(2px); box-shadow: inset 0 -4px 0 var(--edge), 0 1px 0 var(--ink); }
.buy.affordable { animation: breathe 1.6s steps(2, end) infinite; }
.buy.short { --face: #e9e4ee; --edge: #c9c2d1; color: var(--text-soft); }
.buy.owned { --face: var(--white); --edge: #c9c2d1; }
.buy.on { --face: var(--grass); --edge: var(--grass-dark); color: var(--white); text-shadow: 0 2px 0 var(--grass-dark); }
.buy[disabled] { --face: #f1ecf4; --edge: #d8d1de; color: var(--text-soft); transform: none; }
.buy.nope { animation: nope .3s steps(6) 1; --face: #f05a5a; --edge: #b33a3a; color: var(--white); }
@keyframes nope {
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.tag {
  position: absolute; right: 8px; top: 8px; z-index: 1;
  padding: 0 6px;
  font: 700 13px/22px var(--heading); color: var(--white);
  background: var(--ink);
}

/* ---------- smaller screens ---------- */
@media (max-width: 900px) {
  .feature, .feature.flip { grid-template-columns: 1fr; gap: 20px; margin-bottom: 48px; }
  .feature.flip .frame { order: 0; }
  .shots { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .logo-wrap { --lp: 3px; }
  .perks { grid-template-columns: 1fr; }
  .studio-inner { flex-direction: column; padding: 24px; }
  .studio-icon img { width: 96px; height: 96px; }
  .copy h2, .gallery h2, .studio h2 { font-size: 28px; }
}
@media (max-width: 520px) {
  .topbar nav { display: none; }
  .facts { grid-template-columns: 1fr; gap: 0; padding: 16px 18px; }
  .facts dd { margin-bottom: 10px; }
  .facts dd:last-child { margin-bottom: 0; }
  .shop { padding: 8px; }
  .shop-panel { height: calc(100vh - 16px); height: calc(100dvh - 16px); }
  .shop-head { padding: 10px 10px 10px 14px; gap: 8px; }
  .shop-head h2 { font-size: 24px; }
  .shop-blurb { margin: 10px 14px 0; }
  .shop-tabs { padding: 10px 14px 0; gap: 6px; }
  .shop-tab { padding: 6px 10px 4px; font-size: 16px; }
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px 14px 16px; }
  .card h3 { margin: 10px 10px 2px; font-size: 17px; }
  .card p { margin: 0 10px 10px; font-size: 13px; }
  .buy { margin: 0 10px 10px; font-size: 16px; }
  .pv { height: 96px; }
}
@media (max-width: 420px) {
  .logo-wrap { --lp: 2px; }
  .topbar { padding: 10px 16px; }
  .brand span { display: none; }
  .hero { padding: 48px 16px 104px; }
  .tagline { font-size: 17px; }
  .features, .gallery { padding-left: 16px; padding-right: 16px; }
  .shots { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .logo, .btn-gold, .hint, .hero::before,
  .buy.affordable, .purse.can-buy .shop-tag, .pv-rainbow b, .new-badge, .new-dot, .card .new { animation: none; }
  html { scroll-behavior: auto; }
}
