/* Satoshi by Indian Type Foundry, ITF Free Font License 2.0 (fonts/Satoshi-FFL.txt).
   Self-hosted, unmodified, for this site only. */
@font-face { font-family: "Satoshi"; src: url("fonts/Satoshi-Light.otf") format("opentype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("fonts/Satoshi-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("fonts/Satoshi-Medium.otf") format("opentype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("fonts/Satoshi-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("fonts/Satoshi-Black.otf") format("opentype"); font-weight: 900; font-display: swap; }

/* Worlds: the studio is night (from Peg Hexagonal). A game or project page,
   card or banner panel can set its own --night-0/1/2, --ink and --accent
   (build.py writes them from ENTRIES); everything below follows. */
:root {
  --night-0: #05081A;
  --night-1: #0D1433;
  --night-2: #2A2F5C;
  --ink: #ECE6F4;
  --accent: #ECE6F4;
  --radius: 14px;
  --max: 1160px;
}
* { box-sizing: border-box; min-width: 0; }
body, .card, .panel {
  --ink-2: color-mix(in srgb, var(--ink) 78%, var(--night-0));
  --ink-3: color-mix(in srgb, var(--ink) 64%, var(--night-0));
}
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night-0);
  background-image: radial-gradient(1200px 600px at 70% -10%, var(--night-1), transparent 70%);
  background-repeat: no-repeat;
  color: var(--ink);
  font: 400 17px/1.6 "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}
main { flex: 1; }
a { color: var(--ink); text-decoration-color: var(--night-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
img { max-width: 100%; height: auto; display: block; }
img.pixel { image-rendering: pixelated; }
h1, h2, h3 { font-weight: 700; line-height: 1.12; letter-spacing: -0.015em; }
h2 { font-size: 1.6rem; margin: 4rem 0 1.25rem; }
h3 { font-size: 1.15rem; margin: 0.35rem 0 0.4rem; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--ink-3); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--night-0); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* header */
.top {
  max-width: var(--max); margin: 0 auto; padding: 22px 24px;
  display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; font-size: 1.1rem; text-decoration: none; }
.hex { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.top nav a { color: var(--ink-2); text-decoration: none; }
.top nav a:hover { color: var(--ink); }

/* intro + banner */
.intro { padding-top: clamp(16px, 5vh, 56px); }
.intro h1 { font-size: clamp(2.2rem, 5.4vw, 4.1rem); font-weight: 900; letter-spacing: -0.035em; line-height: 1.02; margin: 0; max-width: 16em; }

/* Entrance: the headline's words rise in one after another, then the banner panels. */
.intro h1 .w { display: inline-block; opacity: 0; transform: translateY(0.55em); animation: rise .7s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(80ms + var(--i) * 70ms); }
.banner .panel { opacity: 0; transform: translateY(28px); animation: rise .8s cubic-bezier(.2, .7, .2, 1) forwards; }
.banner .panel:nth-child(1) { animation-delay: 650ms; }
.banner .panel:nth-child(2) { animation-delay: 780ms; }
.banner .panel:nth-child(3) { animation-delay: 910ms; }
.banner .panel:nth-child(n+4) { animation-delay: 1040ms; }
.banner .panel img { transform: scale(1.08); animation: settle 1.6s cubic-bezier(.2, .7, .2, 1) 650ms forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes settle { to { transform: none; } }
.lead { color: var(--ink-2); font-size: 1.2rem; max-width: 36em; font-weight: 300; }
.lead.small { font-size: 1.05rem; }

.banner {
  max-width: 1320px; margin: clamp(24px, 4vw, 44px) auto 0; padding: 0 24px;
  display: flex; gap: 10px; height: clamp(300px, 38vw, 480px);
}
.panel {
  position: relative; flex: 1 1 0; overflow: hidden; border-radius: var(--radius);
  background: var(--night-1); border: 1px solid var(--night-2); text-decoration: none;
  transition: flex-grow .45s ease, border-color .3s ease;
}
.panel:first-child { flex-grow: 1.35; }
.banner:hover .panel { flex-grow: 1; }
.banner .panel:hover { flex-grow: 1.8; border-color: var(--accent); }
.panel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.panel-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 18px 16px;
  background: linear-gradient(transparent, color-mix(in srgb, var(--night-0) 92%, transparent));
  display: flex; flex-direction: column; gap: 2px;
}
.panel-name { font-size: 1.2rem; font-weight: 500; color: var(--ink); }
.panel-status { font-size: 0.9rem; color: var(--accent); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.card {
  background: var(--night-1); border: 1px solid var(--night-2); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; display: flex; flex-direction: column; color: var(--ink);
  transition: transform .2s ease, border-color .2s ease;
}
a.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; background: var(--night-0); }
.card img.pixel { object-fit: cover; object-position: 50% 22%; }
.card-body { padding: 18px 20px 22px; }
.card-body p { margin: 0; color: var(--ink-2); font-size: 0.98rem; }
.tag { font-size: 0.88rem; color: var(--accent); font-weight: 500; }

/* about */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 12px 48px; align-items: start; }
.about h2 { margin-bottom: 0; }
.about-text { margin-top: 4rem; }
.about-text p { color: var(--ink-2); font-size: 1.1rem; margin: 0 0 1em; max-width: 38em; }

/* buttons */
.btn {
  display: inline-block; padding: 11px 22px; border-radius: 999px;
  background: var(--accent); color: var(--night-0); text-decoration: none; font-weight: 500;
  border: 1px solid var(--accent); transition: opacity .2s ease;
}
.btn:hover { opacity: 0.86; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--night-2); margin: 0 8px 8px 0; }
.btn.ghost:hover { border-color: var(--accent); opacity: 1; }

/* game page */
.game-hero { max-width: 1320px; margin: 0 auto; padding: 0 24px; }
.game-hero img, .video { border-radius: var(--radius); border: 1px solid var(--night-2); width: 100%; }
.video { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--night-1); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.game-intro h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 900; letter-spacing: -0.03em; margin: 2.2rem 0 0.4rem; }
.actions { margin-top: 1.6rem; }
.facts { padding-left: 1.1em; color: var(--ink-2); margin-top: 2rem; }
.facts li { margin: 0.3rem 0; }
.facts li::marker { content: "⬡  "; color: var(--accent); }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.shots a { border-radius: 10px; overflow: hidden; border: 1px solid var(--night-2); }
.shots img { transition: transform .3s ease; }
.shots a:hover img { transform: scale(1.03); }
.captioned figure { margin: 0; }
.captioned figure a { display: block; border-radius: 10px; overflow: hidden; border: 1px solid var(--night-2); }
.captioned figcaption { color: var(--ink-3); font-size: 0.9rem; margin-top: 8px; }
.game-intro .tag { display: block; margin-top: 2.2rem; }
.game-intro .tag + h1 { margin-top: 0.3rem; }

.story { margin-top: 1.4rem; max-width: 44em; }
.story summary {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer; list-style: none;
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--night-2); color: var(--ink); font-weight: 500;
}
.story summary::-webkit-details-marker { display: none; }
.story summary::after { content: "+"; font-size: 1.2em; line-height: 1; color: var(--accent); transition: transform .25s ease; }
.story[open] summary::after { transform: rotate(45deg); }
.story summary:hover { border-color: var(--accent); }
.story-body {
  margin-top: 14px; padding: 20px 24px; border-radius: var(--radius);
  background: var(--night-1); border: 1px solid var(--night-2); animation: open .35s ease;
}
.story-body p { color: var(--ink-2); margin: 0 0 0.9em; }
.story-body p:last-child { margin-bottom: 0; }
.story-body h2 { font-size: 1.2rem; margin: 1.8rem 0 0.5rem; }
.story-body h2:first-child { margin-top: 0; }
.story-body strong { color: var(--ink); }
@keyframes open { from { opacity: 0; transform: translateY(-6px); } }

.table-scroll { overflow-x: auto; }
.specs { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 520px; }
.specs th, .specs td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--night-2); }
.specs thead th { color: var(--ink); font-weight: 500; }
.specs tbody th { color: var(--ink-3); font-weight: 400; white-space: nowrap; }
.specs td { color: var(--ink-2); }
.small-print { font-size: 0.9rem; margin-top: 0.8rem; }

/* devlog */
.posts { display: flex; flex-direction: column; border-top: 1px solid var(--night-2); }
.post-item { display: grid; gap: 4px; padding: 20px 0; border-bottom: 1px solid var(--night-2); text-decoration: none; color: var(--ink); }
.post-item.has-thumb { grid-template-columns: minmax(0, 240px) minmax(0, 1fr); gap: 24px; align-items: center; }
.post-thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; border: 1px solid var(--night-2); background: var(--night-1); transition: border-color .2s ease; }
.post-item:hover .post-thumb { border-color: var(--accent); }
.post-text { display: grid; gap: 4px; }
.post-item:hover .post-title { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--ink-3); font-size: 0.92rem; }
.post-game { color: var(--accent); font-weight: 500; }
.post-draft { border: 1px dashed var(--night-2); border-radius: 999px; padding: 0 10px; }
.post-title { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.015em; }
.post-summary { color: var(--ink-2); max-width: 44em; }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag-chip { font-size: 0.82rem; color: var(--ink-2); border: 1px solid var(--night-2); border-radius: 999px; padding: 1px 10px; text-decoration: none; }
a.tag-chip:hover { color: var(--ink); border-color: var(--accent); }
.post > .post-tags { margin: -0.8rem 0 1.6rem; }
.devlog-latest .btn { margin-top: 18px; }
.post { max-width: 760px; }
.post h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 900; letter-spacing: -0.03em; line-height: 1.05; margin: 1rem 0 0.5rem; }
.post > .post-meta { margin: 0 0 1.6rem; }
.post-cover { border-radius: var(--radius); border: 1px solid var(--night-2); margin-bottom: 1.6rem; }
.post-body { font-size: 1.08rem; }
.post-body p, .post-body li { color: var(--ink-2); }
.post-body h2 { font-size: 1.45rem; margin: 2.4rem 0 0.7rem; }
.post-body h3 { font-size: 1.15rem; margin: 1.8rem 0 0.5rem; }
.post-body figure { margin: 1.6rem 0; }
.post-body figure img { border-radius: 10px; border: 1px solid var(--night-2); max-height: min(80vh, 760px); width: auto; margin: 0 auto; }
.post-body figcaption { text-align: center; }
.post-body figure video { display: block; max-height: min(80vh, 760px); max-width: 100%; margin: 0 auto; border-radius: 10px; border: 1px solid var(--night-2); background: var(--night-1); }
.post-body figcaption { color: var(--ink-3); font-size: 0.9rem; margin-top: 8px; }
.post-body blockquote { margin: 1.4rem 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent); }
.post-body pre { background: var(--night-1); border: 1px solid var(--night-2); border-radius: 10px; padding: 14px 16px; overflow-x: auto; font-size: 0.9rem; }
.post-body code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.92em; }

/* legal pages */
.legal { max-width: 760px; }
.legal h1 { font-size: 2.2rem; font-weight: 700; letter-spacing: -0.02em; margin: 1rem 0 1.5rem; }
.legal h2 { font-size: 1.25rem; margin: 2.4rem 0 0.6rem; }
.legal p, .legal li { color: var(--ink-2); }
.legal strong { color: var(--ink); font-weight: 500; }
.legal ul { padding-left: 1.2em; }
.legal li { margin: 0.35rem 0; }
.crumb { margin: 1.5rem 0 0; }
.crumb a { color: var(--ink-3); text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.draft {
  border: 1px dashed var(--night-2); border-radius: 10px; padding: 10px 14px;
  color: var(--ink-3); font-size: 0.92rem; margin-top: 1.2rem;
}

/* footer */
.foot {
  max-width: var(--max); margin: 6rem auto 0; padding: 36px 24px 40px; width: 100%;
  border-top: 1px solid var(--night-2); color: var(--ink-3); font-size: 0.92rem;
}
.foot p { margin: 0; }
.foot-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 28px; }
.foot-cols > div { display: flex; flex-direction: column; gap: 6px; }
.foot-cols a { color: var(--ink-2); text-decoration: none; overflow-wrap: anywhere; }
.foot-cols a:hover { color: var(--ink); }
.foot-brand { color: var(--ink); font-weight: 500; font-size: 1.05rem; }
.foot-h { color: var(--ink); font-weight: 500; }
.foot-c { margin-top: 28px !important; }

@media (max-width: 820px) {
  .banner { height: auto; flex-direction: column; }
  .panel, .panel:first-child, .banner .panel:hover { flex: none; height: clamp(170px, 42vw, 260px); }
  .about { grid-template-columns: minmax(0, 1fr); }
  .about-text { margin-top: 0; }
  .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-cols > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .post-item.has-thumb { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  body { font-size: 16px; }
  .top { flex-wrap: wrap; }
  .top nav { gap: 4px 16px; }
  h2 { margin-top: 3rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .intro h1 .w, .banner .panel, .banner .panel img, .story-body { animation: none; opacity: 1; transform: none; }
}

/* feedback form */
.feedback { max-width: 640px; display: grid; gap: 8px; margin-top: 1rem; }
.feedback label, .feedback legend { font-weight: 500; margin-top: 0.8rem; }
.feedback fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.feedback .choice { font-weight: 400; margin: 0; color: var(--ink-2); display: flex; align-items: center; gap: 10px; }
.feedback input[type=radio] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.feedback select, .feedback textarea, .feedback input[type=email] {
  font: inherit; color: var(--ink); background: var(--night-1); width: 100%;
  border: 1px solid var(--night-2); border-radius: 10px; padding: 11px 14px;
}
.feedback textarea { resize: vertical; min-height: 9rem; }
.feedback select:focus, .feedback textarea:focus, .feedback input:focus { outline: none; border-color: var(--accent); }
.feedback button { font: inherit; cursor: pointer; margin-top: 0.4rem; }
.feedback .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
