/* Cupsi Studios. One stylesheet, tokens first.
   The look follows the games we ship (Bastion Beasts): bright sky and meadow colours, chunky
   Fredoka type, a thick navy outline and a hard "sticker" shadow on everything you can touch.
   `body.night` is the second direction (the same pages under the Murk's night sky). */

:root {
  /* Colour */
  --ink: #1b1f3b;            /* Bastion Beasts' outline navy: text, outlines, shadows */
  --ink-soft: #3d4165;
  --bg: #fff8ea;             /* warm paper */
  --bg-2: #fff0d2;
  --card: #ffffff;
  --card-2: #fff6e4;
  --line: var(--ink);
  --text: var(--ink);
  --text-muted: #44486b;
  --sky: #8fd6ff;
  --sky-2: #c9ecff;
  --sky-deep: #3a8fe0;
  --grass: #7ccf5a;
  --grass-deep: #4f9e3a;
  --sun: #ffd23f;            /* the game's title yellow */
  --sun-deep: #f2a91f;
  --accent: #ff8a3d;         /* Cupsi amber, warmed */
  --accent-deep: #b9521b;    /* links and eyebrows on cream: AA contrast */
  --on-accent: var(--ink);
  --berry: #ff6b8b;
  --portal: #7b5cff;
  --focus: #3a8fe0;
  --header: rgb(255 248 234 / 0.88);
  --footer: var(--ink);
  --footer-text: #e6e3f5;
  --thumb: radial-gradient(circle at 50% 42%, #ffffff 0%, #fff3dc 60%, #ffe9c4 100%);

  /* Shape: chunky stickers */
  --radius-lg: 28px;
  --radius: 22px;
  --radius-sm: 14px;
  --pill: 999px;
  --stroke: 3px;
  --pop: 0 6px 0 var(--ink);
  --pop-hover: 0 9px 0 var(--ink);
  --pop-sm: 0 4px 0 var(--ink);

  /* Type */
  --font-display: "Fredoka", "Baloo 2", ui-rounded, system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Space */
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1180px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.night {
  --bg: #171a33;
  --bg-2: #1f2347;
  --card: #262b55;
  --card-2: #2d3262;
  --line: #0c0e22;
  --text: #fff6e2;
  --text-muted: #c4c2e4;
  --pop: 0 6px 0 #0c0e22;
  --pop-hover: 0 9px 0 #0c0e22;
  --pop-sm: 0 4px 0 #0c0e22;
  --header: rgb(23 26 51 / 0.86);
  --footer: #0f1126;
  --focus: var(--sun);
  --thumb: radial-gradient(circle at 50% 42%, #3a3f78 0%, #2a2f5c 60%, #222650 100%);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.6;
  overflow-x: hidden;
}

main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }

a { color: var(--sky-deep); text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 600; }
a:hover { color: var(--accent-deep); }
body.night a { color: var(--sky); }
body.night a:hover { color: var(--sun); }
body.night .nav a, body.night .card-link, body.night .art-card { color: var(--text); }
body.night .btn-primary, body.night .btn-primary:hover,
body.night .studio-card a, body.night .nav a[aria-current="page"] { color: var(--ink); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.005em;
  margin: 0 0 0.4em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 5.6vw, 4.2rem); }
h2 { font-size: clamp(2rem, 3.8vw, 2.9rem); }
h3 { font-size: 1.45rem; font-weight: 600; }
p { margin: 0 0 1em; text-wrap: pretty; }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: var(--pill);
  background: var(--sun); color: var(--ink); font-weight: 700;
  border: var(--stroke) solid var(--ink);
}
.skip:focus { top: 12px; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
  margin-bottom: 0.7rem;
}
body.night .eyebrow { color: var(--sun); }

.lede { font-size: clamp(1.1rem, 1.8vw, 1.28rem); color: var(--text-muted); max-width: 34em; }

/* ---------- The game's wordmark, set in type ---------- */

.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: 0.01em;
  color: var(--sun);
  /* The outline is twelve shadows, not -webkit-text-stroke: Fredoka's overlapping contours
     leave a stroke notch inside the B. */
  --o: 0.048em;
  text-shadow:
    var(--o) 0 0 var(--ink), calc(var(--o) * -1) 0 0 var(--ink),
    0 var(--o) 0 var(--ink), 0 calc(var(--o) * -1) 0 var(--ink),
    calc(var(--o) * 0.866) calc(var(--o) * 0.5) 0 var(--ink), calc(var(--o) * -0.866) calc(var(--o) * 0.5) 0 var(--ink),
    calc(var(--o) * 0.866) calc(var(--o) * -0.5) 0 var(--ink), calc(var(--o) * -0.866) calc(var(--o) * -0.5) 0 var(--ink),
    calc(var(--o) * 0.5) calc(var(--o) * 0.866) 0 var(--ink), calc(var(--o) * -0.5) calc(var(--o) * 0.866) 0 var(--ink),
    calc(var(--o) * 0.5) calc(var(--o) * -0.866) 0 var(--ink), calc(var(--o) * -0.5) calc(var(--o) * -0.866) 0 var(--ink),
    0 0.11em 0 var(--ink), var(--o) 0.1em 0 var(--ink), calc(var(--o) * -1) 0.1em 0 var(--ink);
  margin: 0 0 0.25em;
}
.wordmark span { display: block; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: var(--stroke) solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; flex-shrink: 0; border-radius: 12px; }
.brand img { height: 40px; width: auto; }
.brand .on-night { display: none; }
body.night .brand .on-day { display: none; }
body.night .brand .on-night { display: block; }

.nav { display: flex; gap: 6px; }
.nav a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  padding: 7px 16px;
  border-radius: var(--pill);
  border: 2px solid transparent;
  white-space: nowrap;
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s var(--bounce);
}
.nav a:hover { background: var(--card); border-color: var(--line); color: var(--text); transform: translateY(-1px); }
.nav a[aria-current="page"] { background: var(--sun); border-color: var(--ink); color: var(--ink); box-shadow: var(--pop-sm); }

@media (max-width: 560px) {
  .site-header .wrap { flex-wrap: wrap; justify-content: center; gap: 6px; padding-block: 10px; }
  .brand img { height: 34px; }
  .nav { width: 100%; justify-content: center; flex-wrap: wrap; gap: 2px; }
  .nav a { padding: 5px 10px; font-size: 1rem; }
}

/* ---------- Buttons, badges, pills ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  text-decoration: none;
  padding: 12px 26px;
  border-radius: var(--pill);
  border: var(--stroke) solid var(--ink);
  cursor: pointer;
  box-shadow: var(--pop);
  transition: transform 0.2s var(--bounce), box-shadow 0.2s var(--ease), background-color 0.2s;
}
.btn:hover { transform: translateY(-3px); box-shadow: var(--pop-hover); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.btn-primary { background: var(--sun); color: var(--ink); }
.btn-primary:hover { color: var(--ink); background: #ffdc5e; }
.btn-ghost { background: var(--card); color: var(--text); }
.btn-ghost:hover { color: var(--text); }
.btn-big { font-size: 1.3rem; padding: 15px 32px; }
body.night .btn { border-color: #0c0e22; }

/* Store badges: chunky, navy, like a store button, but they say where the game is today */
.badges { display: flex; flex-wrap: wrap; gap: 12px; }
.badge-store {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 18px 8px 12px;
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
  border: var(--stroke) solid var(--ink);
  box-shadow: 0 4px 0 rgb(27 31 59 / 0.35);
  line-height: 1.15;
}
.badge-store svg { width: 26px; height: 26px; fill: currentColor; flex-shrink: 0; }
.badge-store small { display: block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.75; }
.badge-store b { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; }
.badge-store.live { background: var(--grass); color: var(--ink); }
.badge-store.live .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); animation: pulse 2.4s infinite; }
body.night .badge-store { border-color: #0c0e22; box-shadow: 0 4px 0 #0c0e22; }
body.night .badge-store:not(.live) { background: #fff6e2; color: var(--ink); }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: var(--pill);
  background: var(--card);
  color: var(--text);
  border: 2px solid var(--line);
  white-space: nowrap;
}
.pill-accent, .pill-sky { background: var(--grass); color: var(--ink); border-color: var(--ink); }
.pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgb(27 31 59 / 0.45); }
  70% { box-shadow: 0 0 0 8px rgb(27 31 59 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(27 31 59 / 0); }
}
.pills { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Sections ---------- */

.section { padding-block: clamp(48px, 8vw, 96px); }
.section-tight { padding-block: clamp(32px, 5vw, 56px); }
.section-head { margin-bottom: clamp(20px, 3vw, 36px); }
.section-head p { color: var(--text-muted); max-width: 38em; }

.page-hero { padding-block: clamp(44px, 7vw, 80px) clamp(20px, 3vw, 36px); }
.page-hero h1 { margin-bottom: 0.25em; }
.page-hero .byline { font-family: var(--font-display); font-weight: 500; color: var(--text-muted); font-size: 0.42em; letter-spacing: 0; white-space: nowrap; }

/* A sticker: anything framed like a card in the game */
.sticker, .card, .how-item, .game, .facts, .press-item, .asset, .beast, .bb-elements li, .contact, .soon, .bb-cta {
  background: var(--card);
  border: var(--stroke) solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--pop);
}

/* ---------- Home: the lead game ---------- */

.home-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(260px 90px at 12% 18%, rgb(255 255 255 / 0.9), transparent 70%),
    radial-gradient(320px 100px at 78% 10%, rgb(255 255 255 / 0.8), transparent 70%),
    linear-gradient(180deg, var(--sky) 0%, var(--sky-2) 62%, #e9f7d8 100%);
  border-bottom: var(--stroke) solid var(--ink);
}
.home-hero::after {
  /* the meadow the castle stands on */
  content: "";
  position: absolute; z-index: -1;
  left: -10%; right: -10%; bottom: -1px; height: 120px;
  background: var(--grass);
  border-top: var(--stroke) solid var(--ink);
  border-radius: 50% 50% 0 0 / 70% 70% 0 0;
}
.home-hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding-block: clamp(36px, 6vw, 72px) 0;
}
.home-hero .copy { padding-bottom: clamp(48px, 9vw, 140px); }
.home-hero .wordmark { font-size: clamp(3.4rem, 8.4vw, 6.6rem); }
.home-hero .tagline { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: 0 0 0.5em; }
.home-hero .lede { color: var(--ink-soft); }
.home-hero .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 26px; }
.home-hero .badges { margin-top: 22px; }

.hero-stage { position: relative; align-self: end; justify-self: center; width: min(100%, 430px); padding-bottom: 44px; }
.hero-phone {
  /* the whole phone, standing on the meadow */
  position: relative;
  margin: 0 auto;
  width: 74%;
  padding: 10px;
  border: 5px solid var(--ink);
  border-radius: 44px;
  background: var(--ink);
  box-shadow: 0 8px 0 rgb(27 31 59 / 0.35);
}
.hero-phone img { width: 100%; aspect-ratio: 540 / 906; object-fit: cover; border-radius: 30px; }
.pop-beast {
  /* beasts as stickers: a white disc, the navy outline, a hard shadow */
  position: absolute;
  width: 27%;
  aspect-ratio: 1;
  padding: 2%;
  border-radius: 50%;
  background: #fff;
  border: var(--stroke) solid var(--ink);
  box-shadow: var(--pop-sm);
  animation: bob 4s ease-in-out infinite;
}
/* the art leaves a wide margin round each beast: scaled up, it fills the disc and a tail may break out */
.pop-beast img { width: 100%; height: 100%; object-fit: contain; scale: 1.42; }
.pop-beast.a { left: -4%; top: 12%; rotate: -8deg; }
.pop-beast.b { right: -4%; top: 52%; rotate: 7deg; animation-delay: -1.8s; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }

@media (max-width: 860px) {
  .home-hero .wrap { grid-template-columns: 1fr; }
  .home-hero .copy { padding-bottom: 0; }
  .hero-stage { width: min(100%, 360px); padding-bottom: 36px; }
  .pop-beast.a { left: 0; }
  .pop-beast.b { right: 0; }
}

/* night: the Murk's sky over the same field */
body.night .home-hero {
  background:
    radial-gradient(420px 260px at 80% 20%, rgb(123 92 255 / 0.45), transparent 70%),
    radial-gradient(300px 200px at 10% 80%, rgb(58 143 224 / 0.25), transparent 70%),
    radial-gradient(1.5px 1.5px at 20% 30%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 60% 12%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 40% 60%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 85% 55%, #fff 50%, transparent 51%),
    linear-gradient(180deg, #120f2a 0%, #1f1a45 70%, #2a2360 100%);
  border-bottom-color: #0c0e22;
}
body.night .home-hero::after { background: #2f6b3a; border-top-color: #0c0e22; }
body.night .home-hero .lede, body.night .home-hero .tagline { color: #e6e3f5; }
body.night .hero-phone { border-color: #0c0e22; box-shadow: 0 0 80px rgb(123 92 255 / 0.5); }

/* Phones in a row: the store screenshots */
.phone-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 2vw, 24px); margin: 0; padding: 0; list-style: none; }
.phone-row li { text-align: center; }
.phone-row li:nth-child(odd) { transform: rotate(-1.5deg); }
.phone-row li:nth-child(even) { transform: rotate(1.5deg) translateY(14px); }
.phone-row img {
  width: 100%;
  aspect-ratio: 480 / 1043;
  object-fit: cover;
  border: var(--stroke) solid var(--line);
  border-radius: 26px;
  box-shadow: var(--pop);
  background: var(--ink);
}
@media (max-width: 760px) {
  .phone-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phone-row li:nth-child(even) { transform: rotate(1.5deg); }
}

/* Element chips */
.element-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.element-row li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 16px 5px 6px;
  border-radius: var(--pill);
  border: var(--stroke) solid var(--line);
  background: var(--card);
  box-shadow: var(--pop-sm);
  font-family: var(--font-display);
  font-weight: 600;
}
.element-row img { width: 34px; height: 34px; }

/* The beasts as stickers on the paper */
.beast-parade { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.beast-parade li { text-align: center; font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
.beast-parade img {
  width: 100%; aspect-ratio: 1; object-fit: contain;
  /* one soft disc behind every beast, so the art's own glows (some have one, some don't) read the same */
  background: radial-gradient(circle at 50% 52%, #fff1c9 0 44%, rgb(255 241 201 / 0) 62%);
  transition: transform 0.3s var(--bounce);
}
.beast-parade li:hover img { transform: translateY(-8px) rotate(-4deg); }
@media (max-width: 760px) { .beast-parade { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.lead-game .beast-parade { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 10px; }

/* The game panel on the home page: copy + the castle */
.lead-game {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  padding: clamp(24px, 4vw, 44px);
  background: var(--card);
  border: var(--stroke) solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--pop);
}
@media (max-width: 860px) { .lead-game { grid-template-columns: 1fr; } }
.lead-game p { color: var(--text-muted); }

/* Studio band */
.studio-band {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: stretch;
}
@media (max-width: 860px) { .studio-band { grid-template-columns: 1fr; } }
.studio-card {
  padding: clamp(24px, 4vw, 40px);
  background: var(--sun);
  color: var(--ink);
  border: var(--stroke) solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--pop);
}
.studio-card .about-mark { width: 72px; height: 72px; margin-bottom: 14px; }
.studio-card p { color: var(--ink-soft); font-size: 1.12rem; }
.studio-card a { color: var(--ink); }
.art-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 22px;
  color: inherit;
  text-decoration: none;
  font-weight: 400;
}
.art-card img { width: 120px; height: 120px; object-fit: cover; object-position: 50% 55%; border-radius: var(--radius-sm); border: 2px solid var(--line); background: var(--sky-2); }
.art-card h3 { margin-bottom: 0.2em; }
.art-card p { color: var(--text-muted); margin: 0 0 8px; font-size: 0.98rem; }
.art-card:hover { color: inherit; transform: translateY(-3px); box-shadow: var(--pop-hover); }
.art-card { transition: transform 0.2s var(--bounce), box-shadow 0.2s; }
.side-stack { display: grid; gap: clamp(16px, 2.5vw, 24px); }
@media (max-width: 520px) {
  .art-card { grid-template-columns: 76px minmax(0, 1fr); gap: 14px; padding: 16px; }
  .art-card img { width: 76px; height: 76px; }
}

.more {
  margin-top: auto;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--accent-deep);
  display: inline-flex; gap: 8px; align-items: center;
}
.more::after { content: "→"; transition: transform 0.2s var(--ease); }
a:hover .more::after { transform: translateX(4px); }
body.night .more { color: var(--sun); }

/* The castle, standing on a meadow hill as wide as the page; its cut-off walls fade out at the sides */
.castle-scene { position: relative; isolation: isolate; margin-top: clamp(28px, 4vw, 44px); padding-bottom: 26px; }
.castle-scene::after {
  content: "";
  position: absolute; z-index: -1;
  left: 50%; width: 100vw; translate: -50% 0;
  bottom: 0; height: 52px;
  background: var(--grass);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.castle-strip {
  display: block; width: min(100%, 760px); height: auto; margin: 0 auto;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}

/* ---------- Old home blocks still used elsewhere ---------- */

.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 3vw, 32px); }
@media (max-width: 760px) { .duo { grid-template-columns: 1fr; } }
.card { position: relative; display: flex; flex-direction: column; overflow: hidden; transition: transform 0.25s var(--bounce), box-shadow 0.25s; }
.card-link { color: inherit; text-decoration: none; font-weight: 400; }
.card-link:hover { color: inherit; transform: translateY(-4px); box-shadow: var(--pop-hover); }
.card-media { aspect-ratio: 16 / 10; overflow: hidden; background: #1c1a1d; border-bottom: var(--stroke) solid var(--line); }
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.card-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { font-size: 1.8rem; margin-bottom: 0.2em; }
.card-body h3 small { font-size: 0.55em; font-weight: 500; color: var(--text-muted); margin-left: 6px; }
.card-body p { color: var(--text-muted); }

.frame { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--card); border: var(--stroke) solid var(--line); box-shadow: var(--pop); }
.frame img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* ---------- Asset library (C-Board, "how we make our art") ---------- */

.stats { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 24px 0 20px; }
.stat { display: flex; align-items: baseline; gap: 8px; }
.stat b { font-family: var(--font-display); font-weight: 700; font-size: 2rem; color: var(--accent-deep); line-height: 1; }
.stat span { color: var(--text-muted); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.chip {
  font: 600 1rem var(--font-display);
  color: var(--text);
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--pill);
  padding: 7px 16px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: var(--pop-sm);
  transition: transform 0.15s var(--bounce), background-color 0.2s;
}
.chip:hover { background: var(--card-2); transform: translateY(-1px); }
.chip:active { transform: translateY(2px); }
.chip .n { font-family: var(--font-body); font-size: 0.8rem; font-weight: 700; background: var(--bg-2); color: var(--text-muted); border-radius: var(--pill); padding: 1px 8px; }
.chip[aria-pressed="true"] { background: var(--sun); color: var(--ink); }
.chip[aria-pressed="true"] .n { background: rgb(27 31 59 / 0.12); color: var(--ink); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
@media (max-width: 520px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

.asset {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  text-align: left; font: inherit; color: inherit; cursor: pointer; padding: 0;
  overflow: hidden;
  transition: transform 0.2s var(--bounce), box-shadow 0.2s;
}
.asset:hover { transform: translateY(-4px); box-shadow: var(--pop-hover); }
.asset:active { transform: translateY(0); }
.asset-thumb { aspect-ratio: 1; background: var(--thumb); display: grid; place-items: center; border-bottom: 2px solid var(--line); }
.asset-thumb img { width: 92%; height: 92%; object-fit: contain; transition: transform 0.4s var(--bounce); }
.asset:hover .asset-thumb img { transform: scale(1.06) rotate(-2deg); }
.asset-info { padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 2px; }
.asset-name { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; line-height: 1.2; }
.asset-meta { font-size: 0.85rem; color: var(--text-muted); display: flex; flex-wrap: wrap; column-gap: 10px; }
.asset-meta span { white-space: nowrap; }
@media (max-width: 520px) {
  .asset-info { padding: 10px 12px 12px; }
  .asset-name { font-size: 1rem; }
  .asset-meta { font-size: 0.78rem; }
}
.empty { color: var(--text-muted); padding: 24px 0; }

.viewer {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: var(--stroke) solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--text);
  box-shadow: 0 10px 0 var(--ink), 0 40px 80px rgb(0 0 0 / 0.35);
  overflow: hidden;
}
.viewer::backdrop { background: rgb(27 31 59 / 0.6); backdrop-filter: blur(4px); }
.viewer[open] { animation: pop 0.28s var(--bounce); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(0.97); } }
.viewer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.viewer-stage { position: relative; min-height: 420px; aspect-ratio: 4 / 3; background: radial-gradient(circle at 50% 40%, #ffffff 0%, #e9f6ff 55%, #cdeaff 100%); }
body.night .viewer-stage { background: radial-gradient(circle at 50% 40%, #3a3f78 0%, #262b55 60%, #1d2147 100%); }
.viewer-stage model-viewer, .viewer-stage .fallback { position: absolute; inset: 0; width: 100%; height: 100%; }
model-viewer { --poster-color: transparent; background: transparent; }
.fallback { display: grid; place-items: center; text-align: center; padding: 24px; }
.fallback img { max-width: 60%; max-height: 65%; margin: 0 auto 12px; }
.fallback p { color: var(--text-muted); font-size: 0.92rem; margin: 0; }
.viewer-hint { position: absolute; left: 14px; top: 14px; font-size: 0.85rem; pointer-events: none; }
.viewer-side { padding: 28px 24px 24px; display: flex; flex-direction: column; gap: 14px; border-left: var(--stroke) solid var(--line); }
.viewer-side h2 { font-size: 1.9rem; margin: 0; padding-right: 40px; }
.viewer-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%;
  border: var(--stroke) solid var(--ink);
  background: var(--sun); color: var(--ink);
  font-size: 1.6rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
  box-shadow: var(--pop-sm);
}
.specs { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 0.95rem; }
.specs dt { color: var(--text-muted); }
.specs dd { margin: 0; font-weight: 600; }
.specs dd:nth-of-type(3) { white-space: nowrap; }
.viewer-side .note { margin-top: auto; font-size: 0.9rem; color: var(--text-muted); }
@media (max-width: 760px) {
  .viewer-grid { grid-template-columns: 1fr; }
  .viewer-stage { min-height: 0; aspect-ratio: 1; }
  .viewer-side { border-left: 0; border-top: var(--stroke) solid var(--line); padding: 20px; }
  .viewer-side .note { margin-top: 0; }
}

.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 3vw, 28px); }
@media (max-width: 860px) { .how { grid-template-columns: 1fr; } }
.how-item { padding: 24px; }
.how-item h3 { margin: 14px 0 8px; font-size: 1.4rem; }
.how-item p { color: var(--text-muted); margin: 0; }
.how-item code { font-size: 0.88em; background: var(--bg-2); padding: 1px 6px; border-radius: 6px; }
.how-item .how-art { width: 84px; height: 84px; margin: -8px 0 -10px -8px; }
.glyph { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--sun); color: var(--ink); border: 2px solid var(--ink); }
.glyph svg { width: 32px; height: 32px; fill: currentColor; }
.palette-strip { margin-top: 18px; border-radius: 12px; overflow: hidden; height: 76px; background-size: 100% 100%; border: 2px solid var(--line); }

.soon { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: 26px 30px; background: var(--card-2); border-style: dashed; box-shadow: none; }
.soon h2 { font-size: 1.7rem; margin: 0 0 4px; }
.soon p { margin: 0; color: var(--text-muted); }
.soon .glyph { width: 64px; height: 64px; }
@media (max-width: 700px) { .soon { grid-template-columns: 1fr; gap: 14px; padding: 22px 20px; } }

/* ---------- Games ---------- */

.game { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 48px); padding: clamp(20px, 3vw, 36px); }
@media (max-width: 900px) { .game { grid-template-columns: 1fr; } }
.game-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.game-icon { width: 88px; height: 88px; border-radius: 22px; flex-shrink: 0; border: var(--stroke) solid var(--ink); box-shadow: var(--pop-sm); }
.game-head h2 { margin: 0 0 6px; font-size: clamp(2.2rem, 4vw, 2.8rem); }
.game-info p { color: var(--text-muted); }
.game-info blockquote { margin: 20px 0; padding: 4px 0 4px 18px; border-left: 5px solid var(--sun); font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; }

.shots-tall { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-content: start; }
.shots-tall a { display: block; border-radius: var(--radius); overflow: hidden; background: var(--ink); border: var(--stroke) solid var(--line); box-shadow: var(--pop-sm); }
.shots-tall img { width: 100%; aspect-ratio: 480 / 1043; object-fit: cover; transition: transform 0.5s var(--ease); }
.shots-tall a:hover img { transform: scale(1.03); }

.teaser {
  position: relative;
  margin-top: clamp(20px, 3vw, 32px);
  padding: clamp(24px, 4vw, 40px);
  border-radius: var(--radius-lg);
  border: var(--stroke) solid var(--line);
  box-shadow: var(--pop);
  background: var(--card-2);
  padding-right: calc(clamp(24px, 4vw, 40px) + clamp(84px, 12vw, 120px));
}
.teaser::after {
  /* the next game, still under its cover */
  content: "?";
  position: absolute;
  right: clamp(20px, 4vw, 44px); top: 50%;
  width: clamp(64px, 9vw, 96px); aspect-ratio: 3 / 4;
  translate: 0 -50%; rotate: 6deg;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(2.2rem, 4vw, 3.2rem);
  color: var(--sun);
  background: repeating-linear-gradient(135deg, var(--ink) 0 10px, #2a2f55 10px 20px);
  border: var(--stroke) solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--pop-sm);
}
.teaser h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0; }
.teaser p { color: var(--text-muted); margin: 6px 0 0; }

/* ---------- Bastion Beasts pages ---------- */

.bb-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: clamp(24px, 4vw, 48px) clamp(20px, 4vw, 48px) 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background:
    radial-gradient(260px 80px at 20% 12%, rgb(255 255 255 / 0.85), transparent 70%),
    linear-gradient(180deg, var(--sky) 0%, var(--sky-2) 75%, #e9f7d8 100%);
  border: var(--stroke) solid var(--ink);
  box-shadow: var(--pop);
  color: var(--ink);
}
.bb-hero .copy { padding-bottom: clamp(24px, 4vw, 48px); }
.bb-hero h1 { margin-bottom: 0.15em; }
.bb-hero .wordmark { font-size: clamp(3rem, 6vw, 4.8rem); }
.bb-hero .tagline { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.3rem, 2.4vw, 1.7rem); color: var(--ink); margin-bottom: 0.6em; }
.bb-hero .lede { color: var(--ink-soft); }
.bb-hero .pills, .bb-hero .badges { margin: 18px 0 0; }
.bb-icon { width: 104px; height: 104px; border-radius: 26px; margin-bottom: 18px; border: var(--stroke) solid var(--ink); box-shadow: var(--pop-sm); }
.bb-hero .phones { align-self: end; }
.phones { display: flex; justify-content: center; align-items: flex-end; gap: clamp(8px, 1.6vw, 18px); }
.phones img { width: 31%; max-width: 220px; aspect-ratio: 480 / 1043; object-fit: cover; border-radius: 22px 22px 0 0; border: var(--stroke) solid var(--ink); border-bottom: 0; }
.phones img:nth-child(2) { width: 34%; max-width: 240px; }
@media (max-width: 860px) { .bb-hero { grid-template-columns: 1fr; } }
body.night .bb-hero { background: linear-gradient(180deg, #1f1a45 0%, #2a2360 100%); color: var(--text); border-color: #0c0e22; }
body.night .bb-hero .tagline { color: var(--sun); }
body.night .bb-hero .lede { color: #e6e3f5; }

.bb-castle { display: block; width: 100%; max-width: 760px; height: auto; margin: clamp(24px, 4vw, 40px) auto 0; }
.link-row-gap { margin-top: 24px; }

.bb-elements { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
@media (max-width: 860px) { .bb-elements { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.bb-elements li { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px 12px; font-family: var(--font-display); font-weight: 600; box-shadow: var(--pop-sm); }
.bb-elements img { width: 56px; height: 56px; }

.beasts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
@media (max-width: 640px) { .beasts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.beast { overflow: hidden; }
.beast-art { aspect-ratio: 1; display: grid; place-items: center; background: linear-gradient(180deg, var(--sky-2), #e9f7d8); border-bottom: 2px solid var(--line); }
body.night .beast-art { background: radial-gradient(circle at 50% 45%, #3a3f78 0%, #2a2f5c 60%, #222650 100%); }
.beast-art img { width: 86%; height: 86%; object-fit: contain; }
.beast-info { padding: 10px 14px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.beast-name { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; line-height: 1.2; }
.beast-info img { width: 28px; height: 28px; flex-shrink: 0; }
.bosses .beast-art { background: linear-gradient(180deg, #d9cfff, #f3eaff); }
body.night .bosses .beast-art { background: radial-gradient(circle at 50% 45%, #4a2a5c 0%, #2c1d44 60%, #1d1430 100%); }
.bosses { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 520px) { .bosses { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } .bosses .beast-name { font-size: 0.9rem; } }

.bb-cta { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 20px 28px; padding: 26px 30px; background: var(--sun); color: var(--ink); }
.bb-cta h2 { font-size: 1.8rem; margin: 0 0 4px; }
.bb-cta p { margin: 0; color: var(--ink-soft); }
.bb-cta .bb-icon { width: 84px; height: 84px; border-radius: 22px; margin: 0; }
@media (max-width: 600px) { .bb-cta { grid-template-columns: 1fr; padding: 22px 20px; } }

/* Legal and help pages */
.legal { max-width: 46em; }
.legal h2 { font-size: 1.55rem; margin-top: 1.6em; }
.legal p, .legal li { color: var(--text-muted); font-size: 1.08rem; }
.legal .lede { color: var(--text-muted); }
.legal strong { color: var(--text); }
.legal .updated { font-size: 0.95rem; }
.legal .pill { white-space: normal; }
.legal dl { margin: 0; }
.legal dt { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; margin-top: 1.1em; }
.legal dd { margin: 4px 0 0; color: var(--text-muted); font-size: 1.05rem; }
.crumbs { font-family: var(--font-display); font-weight: 600; margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; color: var(--text-muted); }
.crumbs a { text-decoration: none; }

/* ---------- About, press ---------- */

.prose { max-width: 40em; }
.prose p { font-size: 1.18rem; }
.contact { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 12px 0 20px; padding: 16px 20px; box-shadow: var(--pop-sm); }
.contact strong { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.credits { font-size: 0.95rem; color: var(--text-muted); max-width: 44em; }
.credits h2 { font-size: 1.5rem; color: var(--text); }
.credits ul { padding-left: 1.2em; margin: 0; }
.credits li { margin-bottom: 6px; }
.about-mark { width: 96px; height: 96px; margin-bottom: 20px; animation: wobble 5s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes wobble { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }

.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 28px; margin: 0; padding: 26px; max-width: 46em; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; font-weight: 600; }
@media (max-width: 520px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 10px; } }
.press-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: clamp(16px, 3vw, 28px); margin: 0; padding: 0; list-style: none; }
.press-item { overflow: hidden; display: flex; flex-direction: column; }
.press-item .press-media { aspect-ratio: 16 / 9; display: grid; place-items: center; background: var(--bg-2); border-bottom: 2px solid var(--line); }
.press-item .press-media img { width: 100%; height: 100%; object-fit: cover; }
.press-item .press-media.logo { background: var(--ink); }
.press-item .press-media.light img { width: auto; height: auto; max-width: 70%; max-height: 50%; object-fit: contain; }
.press-item .press-media.logo img { width: auto; height: auto; max-width: 70%; max-height: 50%; object-fit: contain; }
.press-item .press-body { padding: 16px 20px 20px; }
.press-item h3 { font-size: 1.25rem; margin-bottom: 6px; }
.press-item p { color: var(--text-muted); font-size: 0.95rem; margin: 0 0 8px; }

.studio-note { max-width: 46em; }
.studio-note p { color: var(--text-muted); font-size: 1.12rem; }
.link-row { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0; padding: 0; list-style: none; }
.link-row a { font-family: var(--font-display); font-weight: 600; text-decoration: none; }
.link-row a::after { content: " →"; }

.not-found { text-align: left; }
.not-found .link-row { margin-top: 20px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: clamp(48px, 8vw, 96px);
  background: var(--footer);
  color: var(--footer-text);
  padding-block: 30px 38px;
  font-size: 0.92rem;
  border-top: var(--stroke) solid var(--ink);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.site-footer img { height: 28px; width: auto; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--footer-text); font-weight: 500; }
.site-footer a:hover { color: var(--sun); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; width: 100%; order: -1; padding-bottom: 8px; }
.footer-nav a { text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; }

/* ---------- Motion ---------- */

.rise { animation: rise 0.7s var(--ease) both; }
.rise-2 { animation-delay: 0.08s; }
.rise-3 { animation-delay: 0.16s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Utilities ---------- */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
@media (max-width: 520px) {
  .chips { gap: 8px; }
  .chip { padding: 6px 12px; font-size: 0.95rem; }
}
