/* Biscuit Box Games website. Same look as the games: chunky plum outlines, warm retro colours. */
@font-face { font-family: Fredoka; src: url("/assets/fredoka-latin.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
:root {
  --ink: #3b2340; --cream: #fff8ea; --wall: #fff1d6; --butter: #ffcf5a; --tomato: #ef5b4c;
  --teal: #3fa7a0; --tealDark: #2b857f; --mint: #8fd8c3; --lilac: #b7a1e6;
  --radius: 22px; --shadow: 0 6px 0 var(--ink);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: Fredoka, "Trebuchet MS", system-ui, sans-serif; font-size: 18px; line-height: 1.45;
  color: var(--ink); background: var(--wall);
}
img { max-width: 100%; display: block; }
a { color: var(--tealDark); }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* header */
.top { position: sticky; top: 0; z-index: 5; background: rgba(255, 241, 214, .92); backdrop-filter: blur(6px); border-bottom: 3px solid var(--ink); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 22px; }
.brand img { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--ink); }
.nav { display: flex; gap: 6px; }
.nav a { text-decoration: none; color: var(--ink); font-weight: 600; padding: 8px 12px; border-radius: 12px; }
.nav a:hover { background: var(--butter); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; font: inherit; font-weight: 700; font-size: 22px; text-decoration: none;
  color: var(--cream); background: var(--tomato); border: 4px solid var(--ink); border-radius: 18px; padding: 12px 24px;
  box-shadow: var(--shadow); transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--ink); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.btn.alt { color: var(--ink); background: var(--cream); }
.btn svg { width: 22px; height: 22px; }
.btn:focus-visible, .nav a:focus-visible, .brand:focus-visible { outline: 4px solid var(--teal); outline-offset: 3px; }

/* hero: a live canvas scene (assets/js/home.js) over the still image, which stays as the fallback */
.hero { position: relative; border-bottom: 4px solid var(--ink); background: #fff1d6; overflow: hidden; }
.hero.live { min-height: clamp(460px, 72vh, 640px); display: grid; align-items: start; touch-action: manipulation; cursor: pointer; }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .6s; }
.hero.ready canvas { opacity: 1; }
.hero-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero.ready .hero-still { display: none; }
.hero-copy { position: relative; z-index: 1; width: min(1120px, 100% - 32px); margin: clamp(22px, 5vh, 54px) auto 0; text-align: center; pointer-events: none; }
.hero-copy > * { pointer-events: auto; }
.hero h1 { margin: 0; font-size: clamp(40px, 7.4vw, 92px); line-height: .95; letter-spacing: .01em;
  text-shadow: -3px -3px 0 var(--ink), 3px -3px 0 var(--ink), -3px 3px 0 var(--ink), 3px 3px 0 var(--ink), 0 8px 0 var(--ink); }
.hero h1 span { display: inline-block; }
.hero .h1a { color: var(--butter); transform: rotate(-3deg); animation: popIn .8s cubic-bezier(.2, 1.6, .4, 1) both; }
.hero .h1b { color: var(--tomato); transform: rotate(2deg); animation: popIn .8s .15s cubic-bezier(.2, 1.6, .4, 1) both; }
.hero-copy p { display: inline-block; margin: 16px auto 0; max-width: 40ch; font-size: clamp(17px, 2.2vw, 21px); font-weight: 600; background: rgba(255, 248, 234, .9); border: 3px solid var(--ink); border-radius: 18px; padding: 8px 16px; }
.hero-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 16px; }
.btn.sound[aria-pressed="true"] { background: var(--butter); }
.hero-tip { position: absolute; z-index: 1; left: 50%; bottom: 10px; transform: translateX(-50%); margin: 0; font-size: 14px; font-weight: 700; color: var(--cream); background: rgba(59, 35, 64, .78); border-radius: 999px; padding: 4px 12px; white-space: nowrap; pointer-events: none; }
@keyframes popIn { from { opacity: 0; transform: scale(.5) rotate(-8deg); } }

/* sections */
section { padding: 56px 0; }
h1, h2, h3 { line-height: 1.1; margin: 0 0 12px; }
h2 { font-size: clamp(32px, 4.6vw, 46px); }
.kicker { display: inline-block; font-weight: 700; color: var(--cream); background: var(--ink); border-radius: 999px; padding: 4px 14px; font-size: 15px; margin-bottom: 12px; }
.lead { font-size: 20px; max-width: 62ch; }

/* game cards */
.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 26px; margin-top: 24px; }
.card { background: var(--cream); border: 4px solid var(--ink); border-radius: var(--radius); box-shadow: 0 8px 0 var(--ink); overflow: hidden; display: flex; flex-direction: column; }
.card .art { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; height: auto; border-bottom: 4px solid var(--ink); }
.card .body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { font-size: 30px; margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 14px; font-weight: 600; background: var(--mint); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px; }
.card .btn { align-self: flex-start; margin-top: auto; }
.soon-art { display: grid; place-items: center; background: repeating-linear-gradient(45deg, var(--butter) 0 22px, #ffd979 22px 44px); }
.soon-art img { width: 38%; border-radius: 50%; border: 4px solid var(--ink); box-shadow: var(--shadow); }
.ribbon { font-weight: 700; color: var(--ink); background: var(--butter); border: 3px solid var(--ink); border-radius: 12px; padding: 6px 12px; align-self: flex-start; margin-top: auto; }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-top: 20px; }
.gallery figure { margin: 0; background: #fff; border: 3px solid var(--ink); border-radius: 16px; overflow: hidden; box-shadow: 0 5px 0 var(--ink); }
.gallery img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; height: auto; }
.gallery figcaption { padding: 8px 12px; font-weight: 600; font-size: 16px; }

/* promises */
.promises { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.promise { background: #fff; border: 3px solid var(--ink); border-radius: 18px; padding: 16px 18px; }
.promise b { display: block; font-size: 21px; margin-bottom: 4px; }

.band { background: var(--cream); border-block: 4px solid var(--ink); }
.split { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; }
.split img { width: 180px; border-radius: 50%; border: 4px solid var(--ink); box-shadow: var(--shadow); }

/* footer */
footer { padding: 32px 0 44px; font-size: 16px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; align-items: center; }
footer nav { display: flex; flex-wrap: wrap; gap: 16px; }

/* plain text pages */
.doc { max-width: 760px; }
.doc h1 { font-size: 44px; margin-top: 8px; }
.doc h2 { font-size: 26px; margin-top: 28px; }

@media (max-width: 640px) {
  body { font-size: 17px; }
  .nav a.hide-sm { display: none; }
  .split { grid-template-columns: 1fr; }
  .split img { width: 130px; }
  .promises { grid-template-columns: 1fr; }
  section { padding: 40px 0; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn { transition: none; } }

/* game cards: lift and tilt on hover, a NEW badge, the mission line */
.card { position: relative; transition: transform .25s cubic-bezier(.2, 1.6, .4, 1), box-shadow .25s; }
.card:hover { transform: translateY(-6px) rotate(var(--tilt, 0deg)); box-shadow: 0 14px 0 var(--ink); }
.card .art { transition: transform .4s; }
.card:hover .art { transform: scale(1.04); }
.art-link { display: block; overflow: hidden; border-bottom: 4px solid var(--ink); }
.art-link .art { border-bottom: 0; }
.badge { position: absolute; z-index: 1; top: 12px; right: 12px; font-weight: 700; font-size: 15px; color: var(--cream); background: var(--tomato); border: 3px solid var(--ink); border-radius: 999px; padding: 3px 12px; transform: rotate(6deg); box-shadow: 0 3px 0 var(--ink); animation: wiggle 2.6s ease-in-out infinite; }
.mission { margin: 0; padding: 8px 12px; background: #fff; border: 2.5px dashed rgba(59, 35, 64, .35); border-radius: 14px; font-size: 16px; }
.mission b { color: var(--tomato); }

/* the cast */
.cast { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-top: 22px; }
.who { margin: 0; background: #fff; border: 3px solid var(--ink); border-radius: 20px; box-shadow: 0 6px 0 var(--ink); overflow: hidden; text-align: center; }
.who canvas { display: block; width: 100%; height: auto; aspect-ratio: 6 / 5; background: radial-gradient(circle at 50% 70%, #fff3cf, #ffe7b8); border-bottom: 3px solid var(--ink); }
.who figcaption { padding: 10px 12px 14px; font-size: 15px; }
.who b { display: block; font-size: 22px; }

/* playtest */
.faces { white-space: nowrap; }
.faces-big { display: flex; gap: 10px; font-size: clamp(44px, 7vw, 72px); }
.faces-big span { display: inline-block; animation: bounce 2.4s ease-in-out infinite; }
.faces-big span:nth-child(2) { animation-delay: .25s; } .faces-big span:nth-child(3) { animation-delay: .5s; }

/* scroll reveals and little motions */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .6s ease, transform .7s cubic-bezier(.2, 1.3, .4, 1); }
.reveal.in { opacity: 1; transform: none; }
.card.reveal.in:hover { transform: translateY(-6px) rotate(var(--tilt, 0deg)); }
.bob { animation: bounce 3s ease-in-out infinite; }
@keyframes wiggle { 0%, 100% { transform: rotate(6deg); } 50% { transform: rotate(-4deg) scale(1.06); } }
@keyframes bounce { 0%, 100% { transform: none; } 50% { transform: translateY(-10px); } }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 640px) { .hero-tip { font-size: 12px; } .faces-big { justify-content: center; } .hero h1 { line-height: 1.04; } .brand { font-size: 18px; white-space: nowrap; } .brand img { width: 36px; height: 36px; } .nav a { padding: 8px 8px; } }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero .h1a, .hero .h1b, .badge, .faces-big span, .bob { animation: none; }
  .card, .card .art { transition: none; }
}
