

@font-face {
  font-family: "Fredoka";
  src: url("../font/Fredoka-Variable.woff2") format("woff2"),
       url("../font/Fredoka-Variable.ttf") format("truetype-variations");
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: "Sour Gummy";
  src: url("../font/SourGummy-Variable.woff2") format("woff2"),
       url("../font/SourGummy-Variable.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --cream: #fbf5e9;
  --paper: #f4e9d4;
  --card: #fffcf4;
  --ink: #3b2a17;
  --ink-soft: #7a6248;
  --wood: #b5793c;
  --wood-deep: #7a4e22;
  --wood-dark: #4a2f14;
  --orange: #e97524;
  --orange-deep: #c85a12;
  --teal: #3fa7a0;
  --teal-deep: #2c7a74;
  --brass: #e5a93f;
  --brick: #d95f43;
  --rose: #c9647a;
  --ink-mid: #5d4930;
  --orange-text: #a1470e;
  --err: #a8261b;
  --radius: 22px;
  --shadow: 0 2px 0 rgba(90, 64, 34, 0.08), 0 14px 34px -18px rgba(74, 47, 20, 0.55);
  --maxw: 1080px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: light; }

a, button, input, select, textarea, [tabindex] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(63, 167, 160, 0.25);
}
:focus-visible {
  outline: 3px solid var(--ink);
  box-shadow: 0 0 0 6px var(--cream);
  outline-offset: 3px;
  border-radius: 6px;
}
:focus:not(:focus-visible) { outline: none; }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: 12px;
  background: var(--ink); color: var(--cream); font-weight: 600;
  text-decoration: none; transition: top 160ms cubic-bezier(0.23, 1, 0.32, 1);
}
.skip:focus-visible { top: 12px; }
h1[id], h2[id], h3[id], [id="main"] { scroll-margin-top: 104px; }

body {
  font-family: "Fredoka", "Segoe UI", system-ui, sans-serif;
  font-weight: 500;
  font-variation-settings: "wght" 500;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
  overflow-x: hidden;
}

h1, h2, h3, .display {
  font-family: "Sour Gummy", "Fredoka", "Segoe UI", system-ui, sans-serif;
  font-weight: 800;
  font-variation-settings: normal;
  letter-spacing: -0.004em;
  line-height: 1.16;
  text-wrap: balance;
}

strong, b { font-weight: 640; font-variation-settings: "wght" 640; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal-deep); }
p { max-width: 62ch; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 245, 233, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(122, 78, 34, 0.14);
}
.topbar-in {
  max-width: var(--maxw); margin: 0 auto; padding: 10px 22px;
  display: flex; align-items: center; gap: 20px;
}

.topbar-logo { display: inline-flex; align-items: center; text-decoration: none; }

.topbar-logo img { height: 66px; width: auto;
  filter: drop-shadow(0 2px 3px rgba(74, 47, 20, 0.25)); }
.topbar nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.topbar nav a {
  text-decoration: none; color: var(--ink); font-size: 15.5px;
}
.topbar nav a:hover { color: var(--orange-text); }
.nav-hide-s { display: none; }
@media (min-width: 640px) { .nav-hide-s { display: inline; } }

.cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, #f68b3a, var(--orange) 55%, var(--orange));
  color: var(--ink); text-decoration: none;
  font-family: "Sour Gummy", "Fredoka", sans-serif;
  font-weight: 800; font-variation-settings: normal;
  letter-spacing: 0.02em;
  padding: 13px 26px; border-radius: 999px;
  border: 2px solid rgba(74, 47, 20, 0.35);
  box-shadow: 0 3px 0 var(--wood-dark), 0 12px 22px -10px rgba(200, 90, 18, 0.7);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--wood-dark), 0 16px 26px -10px rgba(200, 90, 18, 0.75); }
.cta:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--wood-dark); }
.cta .bolt-ic { width: 22px; transition: transform 0.35s ease; }
.cta:hover .bolt-ic { transform: rotate(180deg); }
.cta.small { padding: 9px 18px; font-size: 14px; }
.cta.big { padding: 16px 34px; font-size: 19px; }

.hero { position: relative; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0; z-index: -2; overflow: hidden;
  container-type: size;
}
/* The game's title-screen house. The image always covers the hero, and its
   door lands at (--tx, --ty): right of the phone, near the phone's bottom.
   --dx and --dy are the door centre and doorstep in the image (0 to 1).
   --h keeps every edge covered for these targets. */
.hero-bg .scene {
  --ar: 2.3571; --dx: 0.5018; --dy: 0.6733; --tx: 44cqw; --ty: 68cqh;
  --h: max(101cqh, 48cqw);
  position: absolute; height: var(--h); aspect-ratio: 3168 / 1344;
  left: calc(var(--tx) - var(--dx) * var(--ar) * var(--h));
  top: calc(var(--ty) - var(--dy) * var(--h));
}
.hero-bg .scene img { display: block; width: 100%; height: 100%; }
/* Boltie's wave from the game's door video, laid exactly over the door:
   80 frames (30 fps) in a 10 x 8 sprite, played by CSS. A sprite instead of
   a video because the host does not answer byte-range requests, which
   Safari needs for video. Frame 0 is the raised hand. */
.scene-door {
  position: absolute; left: 46.893%; top: 51.484%; width: 6.417%; height: 18.186%;
  background: url("../img/door-sprite-20261009.webp") 0 0 / 1000% 800% no-repeat;
  animation: door-x 0.3333s steps(10, jump-none) infinite, door-y 2.6667s steps(8, jump-none) infinite;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent), linear-gradient(to bottom, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent), linear-gradient(to bottom, transparent, #000 8%, #000 92%, transparent);
  mask-composite: intersect;
}
@keyframes door-x { from { background-position-x: 0%; } to { background-position-x: 100%; } }
@keyframes door-y { from { background-position-y: 0%; } to { background-position-y: 100%; } }
html[data-motion-paused="true"] .scene-door { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .scene-door { animation: none; background-position: 0 0; } }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg,
    rgba(59, 42, 23, 0.18) 0%,
    rgba(59, 42, 23, 0.05) 30%,
    rgba(251, 245, 233, 0.42) 88%,
    var(--cream) 100%);
}
.hero-in {
  max-width: var(--maxw); margin: 0 auto; padding: 46px 22px 30px;
  display: grid; gap: 18px; justify-items: center; text-align: center;
}

.hero-logo { width: min(420px, 82vw); }
.hero h1 {
  font-size: clamp(26px, 4.6vw, 42px);
  color: #fff8ec;
  text-shadow: 0 2px 0 rgba(59, 42, 23, 0.65), 0 8px 24px rgba(40, 24, 8, 0.5);
  max-width: 17ch;
}
.hero-sub {
  font-size: clamp(15px, 2.2vw, 19px);
  color: #fdf3df;
  text-shadow: 0 1px 0 rgba(59, 42, 23, 0.6), 0 4px 14px rgba(40, 24, 8, 0.45);
}
.hero-stage {
  display: flex; align-items: flex-end; justify-content: center;
  gap: clamp(6px, 4vw, 44px); margin-top: 6px;
}
@media (min-width: 701px) {

  .hero h1 { max-width: 30ch; }
}
@media (min-width: 1020px) {
  .hero-in {
    max-width: 1560px;
    grid-template-columns: 1.05fr 1fr;
    grid-template-areas:
      "stage logo"
      "stage h1"
      "stage sub"
      "stage cta"
      "stage pills";
    grid-template-rows: repeat(4, auto) 1fr;
    column-gap: 28px;
    align-content: center;
  }
  .hero-in > picture     { grid-area: logo; align-self: end; }
  .hero-in > h1          { grid-area: h1; max-width: 34ch; font-size: clamp(28px, 2.6vw, 40px); }
  .hero-in > .hero-sub   { grid-area: sub; }
  .hero-in > .cta.big    { grid-area: cta; }
  .hero-in > .follow     { grid-area: pills; align-self: start; }
  .hero-in > .hero-stage { grid-area: stage; align-self: end; }
}

.gallery { width: clamp(150px, 22vw, 226px); }
.phone {
  width: 100%;
  border-radius: 34px;
  padding: 10px;
  background: linear-gradient(160deg, #4c3a28, #241708);
  box-shadow: 0 24px 44px -18px rgba(30, 18, 6, 0.65), inset 0 1px 2px rgba(255, 240, 214, 0.25);
  position: relative;
}
.phone::before {
  content: ""; position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  width: 38%; height: 16px; background: #241708; border-radius: 0 0 12px 12px; z-index: 2;
}
.phone img { border-radius: 24px; }

section { padding: 64px 0; }
.hero { padding: 0; }

.final-cta {
  background: url("../img/section-bg.webp") center / cover no-repeat,
              linear-gradient(180deg, #eeddba, var(--paper));
  text-align: center;
}
.final-cta h2 { font-size: clamp(26px, 4vw, 38px); margin-bottom: 8px; }
.final-cta p { margin: 0 auto 22px; color: var(--ink-mid); }

footer {
  background: var(--wood-dark);
  color: #efe0c8;
  padding: 40px 0 30px;
  font-size: 14.5px;
}
.foot-in {
  max-width: var(--maxw); margin: 0 auto; padding: 0 22px;
  display: grid; gap: 18px;
}
.foot-links { display: flex; flex-wrap: wrap; gap: 0 10px; margin: 0 -6px; }
.foot-links a { color: #f6e8cd; text-decoration: none; display: inline-block; padding: 8px 6px; }
.foot-links a:hover { color: var(--brass); }
.foot-social { display: flex; gap: 4px; margin: 0 -12px; }
.foot-social a {
  color: #f6e8cd; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 12px;
}
.foot-social svg { width: 20px; height: 20px; fill: currentColor; }
.foot-note { color: #c9b08a; font-size: 13px; }

.page { padding: 46px 0 70px; }
.page .wrap { max-width: 760px; }
.page h1 { font-size: clamp(26px, 4vw, 36px); margin-bottom: 6px; }
.page h2 { font-size: 21px; margin: 30px 0 8px; }
.page p, .page li { color: var(--ink); font-size: 16px; }
.page p + p, .page p + ul, .page p + ol, .page ul + p, .page ol + p { margin-top: 12px; }
.page ul, .page ol { padding-left: 22px; }
.page li + li { margin-top: 4px; }
.page .meta { color: var(--ink-soft); font-size: 14.5px; margin-bottom: 22px; }
.press-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); margin: 14px 0 6px; }
@media (min-width: 640px) { .press-grid { grid-template-columns: repeat(3, 1fr); } }
.press-grid a { display: grid; gap: 6px; text-decoration: none; color: var(--ink-soft); font-size: 13.5px; text-align: center; }
.press-grid img { background: var(--card); border: 1.5px solid rgba(181, 121, 60, 0.4); border-radius: 12px; padding: 10px; }
.err { text-align: center; padding: 70px 0; }
.err picture img { width: 260px; margin: 0 auto 18px; }

.rv { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  .cta, .cta .bolt-ic { transition: none; }
}

.follow { margin-top: 26px; }
.follow-lead { color: var(--ink-mid); font-size: 15.5px; margin-bottom: 12px; }
.follow-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.soc-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px;
  background: var(--card); color: var(--wood-deep);
  border: 2px solid rgba(181, 121, 60, 0.45);
  box-shadow: var(--shadow);
  text-decoration: none; font-weight: 600; font-size: 15.5px;
  font-variation-settings: "wght" 620;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.soc-pill svg { width: 20px; height: 20px; fill: currentColor; }
.soc-pill:hover { transform: translateY(-2px); border-color: var(--brass); }

.follow-hero { margin-top: 2px; }
/* Below the two-column hero the launch section follows right after; one set of follow buttons is enough there. */
@media (max-width: 1019px) { .follow-hero { display: none; } }
.follow-hero .follow-lead {
  color: #fdf3df; font-size: 15px; margin-bottom: 10px;
  text-shadow: 0 1px 0 rgba(59, 42, 23, 0.6), 0 4px 14px rgba(40, 24, 8, 0.45);
}
.follow-hero .follow-lead { width: fit-content; margin-inline: auto; }
.follow-hero .soc-pill { padding: 11px 16px; font-size: 14.5px; }
.follow-hero .soc-pill svg { width: 18px; height: 18px; }

.notify { margin-top: 18px; color: var(--ink-mid); font-size: 15px; }
.notify a { color: var(--teal-deep); font-weight: 600; }

section[id] { scroll-margin-top: 88px; }

.hero-in { position: relative; z-index: 1; }

.ph-frames { position: relative; }
.ph-shot { display: block; opacity: 0; transition: opacity 0.9s ease; }
.ph-shot.cur { opacity: 1; }
.ph-shot + .ph-shot { position: absolute; inset: 0; }

.hero-bolts { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hb { position: absolute; opacity: 0.9; }
.hb1 { left: 5%;  top: 16%; }
.hb2 { left: 11%; top: 58%; }
.hb3 { right: 6%; top: 22%; }
.hb4 { right: 12%; top: 64%; }
.hb5 { left: 47%; top: 7%; }

.progress { display: none; }

@media (prefers-reduced-motion: no-preference) {

  @keyframes h-drop {
    0%   { opacity: 0; transform: translateY(-36px) scale(0.92); }
    65%  { opacity: 1; transform: translateY(5px) scale(1.02); }
    100% { opacity: 1; transform: none; }
  }
  @keyframes h-rise  { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
  @keyframes h-pop   {
    0%   { opacity: 0; transform: scale(0.7); }
    70%  { opacity: 1; transform: scale(1.06); }
    100% { opacity: 1; transform: none; }
  }
  @keyframes h-phone { from { opacity: 0; transform: translateY(56px) rotate(2deg); } to { opacity: 1; transform: none; } }

  .hero-logo            { animation: h-drop 0.65s ease-out both; }
  .hero h1              { animation: h-rise 0.6s 0.18s ease-out both; }
  .hero-sub             { animation: h-rise 0.6s 0.3s ease-out both; }
  .hero-in > .cta.big   { animation: h-pop 0.5s 0.45s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
  .hero-in > .follow    { animation: h-rise 0.6s 0.58s ease-out both; }
  .phone                { animation: h-phone 0.7s 0.7s ease-out both; }

  @keyframes floaty  { from { transform: translateY(0) rotate(0deg); }  to { transform: translateY(-16px) rotate(14deg); } }
  @keyframes floaty2 { from { transform: translateY(0) rotate(0deg); }  to { transform: translateY(13px) rotate(-12deg); } }
  html[data-motion-ready="true"] .hb  { animation: floaty 8s ease-in-out infinite alternate; }
  html[data-motion-ready="true"] .hb2 { animation: floaty2 9.5s 0.8s ease-in-out infinite alternate; }
  html[data-motion-ready="true"] .hb3 { animation: floaty 7s 1.6s ease-in-out infinite alternate; }
  html[data-motion-ready="true"] .hb4 { animation: floaty2 10.5s 0.4s ease-in-out infinite alternate; }
  html[data-motion-ready="true"] .hb5 { animation: floaty 11s 2.2s ease-in-out infinite alternate; }

  @supports (animation-timeline: scroll()) {
    .progress {
      display: block; position: absolute; left: 0; right: 0; bottom: -3px;
      height: 6px; pointer-events: none;
    }
    .progress-fill {
      position: relative; height: 100%; width: 100%;
      background: linear-gradient(90deg, var(--brass), var(--orange));
      border-radius: 0 3px 3px 0;
      box-shadow: 0 1px 3px rgba(74, 47, 20, 0.3);
      transform: translateX(-100%);
      animation: fill-x linear both;
      animation-timeline: scroll(root);
    }
    .progress-fill img {
      position: absolute; right: -7px; top: -4px; width: 14px; height: 14px;
      animation: bolt-spin linear both;
      animation-timeline: scroll(root);
    }
  }
  @keyframes fill-x    { from { transform: translateX(-100%); } to { transform: translateX(0); } }
  @keyframes bolt-spin { from { transform: rotate(0deg); }      to { transform: rotate(900deg); } }

  .cta { position: relative; overflow: hidden; }
  html[data-motion-ready="true"] .cta.big::after {
    content: ""; position: absolute; top: -20%; bottom: -20%; left: -30%; width: 36%;
    background: linear-gradient(105deg, transparent, rgba(255, 248, 230, 0.55), transparent);
    transform: translateX(-140%) skewX(-18deg);
    animation: shine 5.6s ease-in-out 2.4s infinite;
    pointer-events: none;
  }
  @keyframes shine {
    0%   { transform: translateX(-140%) skewX(-18deg); }
    14%  { transform: translateX(480%) skewX(-18deg); }
    100% { transform: translateX(480%) skewX(-18deg); }
  }
  .cta:active { transform: translateY(1px) scale(0.96, 0.93); }
}
[hidden] { display: none !important; }
.topbar nav a.cta:hover { color: var(--ink); }
.cta:focus-visible, .soc-pill:focus-visible { box-shadow: 0 0 0 6px var(--cream); }
.hero h1, .hero-sub, .follow-hero .follow-lead {
  background: rgba(59, 42, 23, 0.88);
  border-radius: 12px;
  padding: 8px 12px;
}
.gallery { flex-shrink: 0; }
.gallery-controls {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 14px;
}
.gallery-controls button {
  min-height: 44px; padding: 8px 6px;
  border: 2px solid var(--wood-deep); border-radius: 12px;
  background: var(--cream); color: var(--ink);
  font: 500 14px "Fredoka", sans-serif; cursor: pointer;
}
#motion-toggle { grid-column: 1 / -1; }
.gallery-controls button:disabled { cursor: default; }
.gallery-caption {
  margin-top: 8px; padding: 6px; border-radius: 12px;
  background: var(--cream); color: var(--ink); font-size: 13px;
}
.final-cta .notify { background: var(--cream); border-radius: 12px; padding: 12px; }
.page a { overflow-wrap: anywhere; }
html[data-motion-paused="true"] { scroll-behavior: auto; }
html[data-motion-paused="true"] .hb,
html[data-motion-paused="true"] .cta.big::after,
html[data-motion-paused="true"] .progress-fill,
html[data-motion-paused="true"] .progress-fill img {
  animation-play-state: paused !important;
}
html[data-motion-paused="true"] *, html[data-motion-paused="true"] *::after {
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .ph-shot, .soc-pill { transition: none; }
}

.gallery { width: clamp(220px, 24vw, 270px); }
.phone::before { content: none; }
.gallery-caption { min-height: 70px; }
.gallery-caption strong { display: block; font-weight: 600; }
.gallery-open { display: inline-block; margin-top: 6px; padding: 8px 12px; min-height: 44px; border-radius: 10px; background: var(--cream); font-size: 14px; }
@media (min-width: 1020px) {
  .gallery { width: clamp(250px, 21vw, 290px); }
}
@media (max-width: 700px) {
  .hero-stage { width: 100%; }
  .gallery { width: min(280px, 100%); }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

/* Game-house hero scene: layout tweaks (kept last so they win over the base hero rules). */
@media (min-width: 1020px) {
  /* Narrow text boxes so the roof, chimney and workbench stay in view. */
  .hero-in > h1 { max-width: 12.5em; text-wrap: balance; }
  .hero-in > .hero-sub { max-width: 27em; text-wrap: balance; }
  .hero h1, .hero-sub { background: rgba(59, 42, 23, 0.8); }
}
@media (min-width: 1020px) and (max-width: 1279px) {
  .hero-in { grid-template-columns: minmax(0, 1fr) 420px; }
  .hero-in > .hero-stage { justify-self: start; margin-left: 8px; }
  .hero-bg .scene { --tx: 37cqw; }
}
@media (min-width: 701px) and (max-width: 1019px) {
  .hero-bg .scene { --tx: 76cqw; --ty: 78cqh; --h: max(116cqh, 64cqw); }
}
@media (max-width: 700px) {
  /* Phones: the whole house stands between the button and the phone, with
     Boltie at the door, like the game's title screen. Sky colour above it,
     the path fades out below. main-v5.js sets --phone-top. */
  .hero-bg { background: linear-gradient(180deg, #86bcee 0%, #86bcee 40%, #d9b98a 72%, var(--cream) 100%); }
  .hero-bg .scene {
    --ar: 0.8185; --dx: 0.4997; --h: 154cqw; aspect-ratio: 1100 / 1344;
    left: calc(50cqw - var(--dx) * var(--ar) * var(--h));
    top: calc(var(--phone-top, 600px) + 8px - var(--dy) * var(--h));
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 84%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 84%, transparent 100%);
  }
  .scene-door { left: 40.506%; width: 18.48%; }
  .hero-logo { width: min(230px, 62vw); }
  .hero-in > .hero-stage { margin-top: calc(60vw - 4px); }
}
@media (max-width: 1019px) { .hero-bolts { display: none; } }
.hb4 { display: none; }
