/* Candlewane — "Illuminated codex"
   Self-hosted fonts only. No external requests. */

@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("../fonts/eb-garamond-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("../fonts/eb-garamond-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Silkscreen"; src: url("../fonts/silkscreen-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --ink: #120e0c;
  --ink-2: #19130f;
  --ink-3: #221a15;
  --ink-4: #2e241d;
  --wax: #e8d9b5;
  --wax-2: #cdbd98;
  --wax-3: #9d8f74;
  --ember: #e0702a;
  --glow: #ffb04a;
  --rule: rgba(232, 217, 181, .16);
  --rule-2: rgba(232, 217, 181, .3);
  --accent: var(--ember);
  --accent-2: var(--glow);

  --display: "Cormorant", "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --serif: "EB Garamond", Garamond, Georgia, serif;
  --pixel: "Silkscreen", ui-monospace, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1320px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--wax-2);
  font-family: var(--serif);
  font-size: clamp(1.0625rem, .98rem + .3vw, 1.1875rem);
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Paper grain, everywhere, very quiet */
body { position: relative; }
body::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .9 0 0 0 0 .75 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--wax); text-decoration-color: rgba(224, 112, 42, .55); text-underline-offset: .2em; text-decoration-thickness: 1px; transition: color .25s, text-decoration-color .25s; }
a:hover { color: var(--glow); text-decoration-color: var(--glow); }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 4px; }
::selection { background: var(--ember); color: var(--ink); }

.px { image-rendering: pixelated; image-rendering: crisp-edges; }
@supports (image-rendering: pixelated) { .px { image-rendering: pixelated; } }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 200; background: var(--wax); color: var(--ink); padding: 10px 16px; font-family: var(--pixel); font-size: 11px; }
.skip:focus { top: 16px; }

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

/* --- Type primitives --------------------------------------------- */
.label {
  font-family: var(--serif);
  font-variant-caps: all-small-caps;
  letter-spacing: .16em;
  font-size: 1.05em;
  color: var(--wax-3);
  line-height: 1.3;
}
.meta {
  font-family: var(--pixel);
  font-size: 11px;
  line-height: 1.6;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--wax-3);
}
.tag {
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--pixel); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid currentColor;
  padding: 5px 9px 4px;
  line-height: 1;
}
.tag::before { content: ""; width: 5px; height: 5px; background: currentColor; box-shadow: 0 0 8px currentColor; }
.tag--live::before { animation: pulse 2.4s ease-in-out infinite; }

h1, h2, h3 { font-family: var(--display); font-weight: 500; color: var(--wax); line-height: 1.05; margin: 0; letter-spacing: -.005em; }
p { margin: 0 0 1em; }

.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }
.fleuron { display: flex; align-items: center; gap: 18px; color: var(--accent); }
.fleuron::before, .fleuron::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--rule-2)); }
.fleuron::after { transform: scaleX(-1); }
.fleuron svg { width: 22px; height: 22px; flex: none; }

/* --- Buttons ------------------------------------------------------ */
.btn {
  --b: var(--wax);
  position: relative;
  display: inline-flex; align-items: center; gap: 14px;
  min-height: 52px;
  padding: 0 24px;
  font-family: var(--display); font-weight: 600; font-size: 1.2rem; letter-spacing: .02em;
  color: var(--ink); background: var(--b);
  text-decoration: none;
  border: 1px solid var(--b);
  transition: background .3s var(--ease), color .3s, box-shadow .3s, transform .3s var(--ease);
  cursor: pointer;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { color: var(--ink); background: var(--glow); border-color: var(--glow); box-shadow: 0 0 0 1px rgba(255,176,74,.2), 0 10px 40px -10px rgba(255,176,74,.55); }
.btn--ghost { background: transparent; color: var(--wax); border-color: var(--rule-2); }
.btn--ghost:hover { background: rgba(232,217,181,.06); color: var(--wax); border-color: var(--wax-3); box-shadow: none; }
.btn--ghost .arrow { transition: transform .3s var(--ease); }
.btn--ghost:hover .arrow { transform: translateX(4px); }

/* Steam button: inert until a URL exists */
.btn--steam { background: linear-gradient(180deg, #ef8236, var(--ember)); border-color: #f08a3e; color: #1a0f08; box-shadow: 0 0 0 1px rgba(255,176,74,.12), 0 14px 44px -14px rgba(224,112,42,.75); }
.btn--steam[aria-disabled="true"] { cursor: default; }
.btn--steam[aria-disabled="true"]:hover { background: linear-gradient(180deg, #ef8236, var(--ember)); color: #1a0f08; border-color: #f08a3e; box-shadow: 0 0 0 1px rgba(255,176,74,.12), 0 14px 44px -14px rgba(224,112,42,.75); }
[data-discord][aria-disabled="true"] { cursor: default; }
.btn--steam svg { stroke-width: 1.8; }
.btn .soon {
  font-family: var(--pixel); font-weight: 400; font-size: 9px; letter-spacing: .12em; text-transform: uppercase;
  padding: 5px 7px 4px; line-height: 1;
  color: var(--glow); background: #1a0f08;
}
.btn--steam:not([aria-disabled="true"]) .soon { display: none; }

/* --- Header ------------------------------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  transition: background .4s, border-color .4s, backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.site-header.is-solid { background: rgba(18, 14, 12, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom-color: var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; max-width: none; }
.brand { display: block; line-height: 0; margin-left: -10px; position: relative; }
.brand img { position: relative; }
.brand__glow { position: absolute; left: 2px; top: 50%; width: 46px; height: 46px; margin-top: -30px; border-radius: 50%; background: radial-gradient(circle, rgba(255,176,74,.42), rgba(224,112,42,.12) 45%, transparent 70%); animation: flicker 4.6s ease-in-out infinite; pointer-events: none; }
.brand img { width: 157px; height: 34px; }
.nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 36px); }
.nav a { text-decoration: none; color: var(--wax-2); font-variant-caps: all-small-caps; letter-spacing: .16em; font-size: 1.05rem; }
.nav a:hover { color: var(--glow); }
.nav a .n { font-family: var(--display); font-style: italic; font-variant-caps: normal; letter-spacing: 0; color: var(--ember); margin-right: .35em; }
.menu { display: none; position: relative; }
.menu summary { list-style: none; cursor: pointer; font-family: var(--pixel); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--wax); padding: 12px 0 12px 12px; display: flex; gap: 10px; align-items: center; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary i { display: block; width: 18px; height: 1px; background: var(--wax); box-shadow: 0 5px 0 var(--wax), 0 -5px 0 var(--wax); }
.menu[open] summary i { box-shadow: none; transform: rotate(45deg); }
.menu nav { position: absolute; right: 0; top: 56px; width: min(78vw, 300px); background: var(--ink-2); border: 1px solid var(--rule-2); padding: 12px 22px; box-shadow: 0 30px 60px -20px #000; }
.menu nav a { display: flex; gap: 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--rule); text-decoration: none; font-family: var(--display); font-size: 1.45rem; color: var(--wax); }
.menu nav a:last-child { border-bottom: 0; }
.menu nav a .n { font-style: italic; color: var(--ember); min-width: 1.6em; }

/* --- Hero (Marrowmoon) ------------------------------------------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; background: var(--ink); }
.hero__art { display: block; position: absolute; inset: 0 0 auto 0; height: clamp(460px, 76vh, 840px); z-index: -2; overflow: hidden; }
.hero__art img { width: 100%; height: 100%; object-fit: cover; object-position: 38% 62%; transform-origin: 62% 40%; animation: settle 2.8s var(--ease) both, breathe 26s 2.8s ease-in-out infinite alternate; }
.hero__art::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(110% 95% at 60% 42%, transparent 40%, rgba(10,4,4,.6) 85%),
    linear-gradient(180deg, rgba(18,14,12,.7) 0%, transparent 16%, transparent 55%, rgba(18,14,12,.7) 80%, var(--ink) 100%),
    linear-gradient(90deg, rgba(18,10,9,.75) 0%, rgba(18,10,9,.25) 34%, transparent 52%); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -3; background: radial-gradient(60% 40% at 70% 30%, rgba(210,72,58,.12), transparent 70%), var(--ink); }
.hero__inner { position: relative; width: 100%; padding-top: 140px; padding-bottom: clamp(40px, 7vh, 88px); display: grid; grid-template-columns: minmax(0, 580px) 1fr; align-items: end; gap: 40px; }
.hero__kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 26px; }
.hero__kicker .meta { color: var(--wax-2); }
.hero__logo { width: 100%; max-width: 516px; height: auto; margin: 0 0 18px -6px; filter: drop-shadow(0 8px 30px rgba(0,0,0,.6)); }
.hero__tagline { font-family: var(--display); font-style: italic; font-weight: 500; font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.6rem); line-height: 1.12; color: var(--wax); margin: 0 0 14px; }
.hero__lede { max-width: 34em; color: var(--wax-2); margin-bottom: 30px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 28px; }
.hero__platforms { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.hero__platforms span + span::before { content: "·"; margin-right: 18px; color: var(--ember); }
.hero__aside { justify-self: end; display: flex; flex-direction: column; align-items: flex-end; gap: 22px; padding-bottom: 6px; }
.hero__aside .meta { writing-mode: vertical-rl; transform: rotate(180deg); color: var(--wax-3); letter-spacing: .2em; }
.scrollcue { width: 1px; height: 64px; background: linear-gradient(var(--rule-2), transparent); position: relative; overflow: hidden; }
.scrollcue::after { content: ""; position: absolute; left: 0; top: -20px; width: 1px; height: 20px; background: var(--glow); animation: drip 2.6s var(--ease) infinite; }

/* --- Proem + Contents -------------------------------------------- */
.proem { padding: clamp(72px, 10vw, 140px) 0 clamp(16px, 3vw, 40px); position: relative; }
.proem__grid { display: grid; grid-template-columns: 1fr minmax(0, 7fr) 1fr; gap: 24px; }
.proem__grid > * { grid-column: 2; }
.proem__text { font-family: var(--display); font-weight: 500; font-size: clamp(1.7rem, 1.1rem + 2.2vw, 3rem); line-height: 1.18; color: var(--wax); text-align: center; text-wrap: balance; margin: 34px 0 0; }
.proem__text em { color: var(--glow); }
.proem__sign { text-align: center; margin-top: 26px; }

.contents { grid-column: 1 / -1 !important; margin-top: clamp(64px, 8vw, 112px); }
.contents__head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--rule-2); padding-bottom: 14px; margin-bottom: clamp(20px, 2.4vw, 32px); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.6vw, 26px); }
.card--mm { --accent: #d2483a; --accent-2: #ff8a5c; }
.card--bi { --accent: #e23b4a; --accent-2: #74dcd6; }
.card--as { --accent: #b8432f; --accent-2: #ecd283; }
.card a { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; isolation: isolate; text-decoration: none; color: var(--wax); background: var(--ink-3); }
.card a::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, rgba(10,7,6,.96) 0%, rgba(10,7,6,.62) 30%, rgba(10,7,6,0) 58%), linear-gradient(to bottom, rgba(10,7,6,.55), transparent 22%); }
.card a::after { content: ""; position: absolute; inset: 10px; z-index: 2; pointer-events: none; border: 1px solid rgba(232,217,181,.14); transition: border-color .5s, inset .6s var(--ease); }
.card a:hover::after, .card a:focus-visible::after { border-color: color-mix(in srgb, var(--accent-2) 60%, transparent); inset: 14px; }
.card__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.6s var(--ease), filter .8s; filter: saturate(.9) brightness(.86); }
.card--mm .card__img { object-position: 50% 100%; }
.card--bi .card__img { object-position: 50% 50%; }
.card--as .card__img { object-position: 62% 50%; }
.card a:hover .card__img, .card a:focus-visible .card__img { transform: scale(1.05); filter: saturate(1.05) brightness(1); }
.card__top { position: absolute; z-index: 3; top: 26px; left: 28px; right: 28px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card__num { font-family: var(--display); font-style: italic; font-size: 2.6rem; line-height: .8; color: var(--accent-2); text-shadow: 0 2px 20px rgba(0,0,0,.7); }
.card .tag { color: var(--accent-2); background: rgba(12,9,8,.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.card__body { position: absolute; z-index: 3; left: 28px; right: 28px; bottom: 28px; display: flex; flex-direction: column; gap: 18px; }
.card__logo { height: 50px; width: auto; max-width: 100%; object-fit: contain; object-position: left bottom; filter: drop-shadow(0 4px 18px rgba(0,0,0,.8)); }
.card--bi .card__logo { height: 54px; margin-left: -8px; }
.card--as .card__logo { height: 58px; }
.card__genre { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--rule-2); font-style: italic; color: var(--wax-2); font-size: 1.02rem; }
.card__go { font-style: normal; color: var(--accent-2); transition: transform .4s var(--ease); }
.card a:hover .card__go { transform: translateX(5px); }
.js .cards .reveal:nth-child(2) { transition-delay: .12s; }
.js .cards .reveal:nth-child(3) { transition-delay: .24s; }

/* --- Chapters ----------------------------------------------------- */
.chapter { position: relative; padding: clamp(80px, 11vw, 150px) 0; }
.chapter--mm { --accent: #d2483a; --accent-2: #ff8a5c; }
.chapter--bi { padding-top: 0; }
.chapter--bi { --accent: #e23b4a; --accent-2: #74dcd6; }
.chapter--as { --accent: #b8432f; --accent-2: #ecd283; }

.chap-head { display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 0 clamp(20px, 3vw, 40px); margin-bottom: clamp(40px, 6vw, 80px); }
.chap-head__num {
  font-family: var(--display); font-weight: 500; font-size: clamp(6rem, 4rem + 9vw, 13rem); line-height: .72;
  color: transparent; -webkit-text-stroke: 1px var(--accent-2);
  text-shadow: 0 0 60px color-mix(in srgb, var(--accent-2) 22%, transparent);
  margin-bottom: -.04em;
}
.chap-head__body { padding-bottom: 8px; }
.chap-head__body .label { display: block; margin-bottom: 12px; }
.chap-head__line { display: flex; align-items: center; gap: 18px; }
.chap-head__line .rule { flex: 1; background: linear-gradient(90deg, var(--rule-2), transparent); }

.folio { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(24px, 3vw, 48px); align-items: start; }
.folio__text { grid-column: 1 / span 6; }
.folio__plate { grid-column: 8 / span 5; }
.folio--flip .folio__text { grid-column: 7 / span 6; grid-row: 1; }
.folio--flip .folio__plate { grid-column: 1 / span 5; grid-row: 1; }

.game-logo { margin: 0 0 22px -4px; height: auto; }
.tagline { font-family: var(--display); font-style: italic; font-size: clamp(1.6rem, 1.2rem + 1.3vw, 2.3rem); line-height: 1.15; color: var(--wax); margin: 0 0 28px; text-wrap: balance; }
.pitch { color: var(--wax-2); max-width: 36em; }
.pitch::first-letter {
  float: left;
  font-family: var(--display); font-weight: 600; font-size: 4.1em; line-height: .78;
  color: var(--accent-2);
  padding: 14px 14px 10px; margin: 4px 16px 0 0;
  border: 1px solid color-mix(in srgb, var(--accent-2) 45%, transparent);
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%), var(--ink-2);
  text-shadow: 0 0 24px color-mix(in srgb, var(--accent-2) 45%, transparent);
}
.folio__cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 34px 0 0; }

/* Plates: images framed like plates in a book */
.plate { margin: 0; position: relative; }
.plate__frame { position: relative; padding: 10px; border: 1px solid var(--rule-2); background: var(--ink-2); box-shadow: 0 40px 80px -40px rgba(0,0,0,.9); }
.plate__frame::before, .plate__frame::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-color: var(--accent-2); border-style: solid; opacity: .9;
}
.plate__frame::before { top: -5px; left: -5px; border-width: 1px 0 0 1px; }
.plate__frame::after { bottom: -5px; right: -5px; border-width: 0 1px 1px 0; }
.plate__frame img { width: 100%; outline: 1px solid rgba(0,0,0,.6); }
.plate figcaption { display: flex; gap: 14px; align-items: baseline; margin-top: 14px; font-style: italic; color: var(--wax-3); font-size: .95em; line-height: 1.4; }
.plate figcaption .meta { font-style: normal; color: var(--accent-2); white-space: nowrap; }

/* Facts — marginalia */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin: 28px 0 0; padding: 0; }
.facts div { border-top: 1px solid var(--rule); padding: 12px 0; }
.facts dt { margin-bottom: 4px; }
.facts dd { margin: 0; color: var(--wax); font-size: .98em; line-height: 1.4; }

/* Features — articles of the codex */
.articles-wrap { margin-top: clamp(64px, 8vw, 110px); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(24px, 3vw, 48px); }
.articles-wrap > header { grid-column: 1 / span 3; }
.articles-wrap > header h3 { font-size: clamp(1.8rem, 1.4rem + 1vw, 2.4rem); margin-top: 10px; }
.articles { grid-column: 4 / -1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(28px, 3.5vw, 56px); counter-reset: art; }
.articles li { counter-increment: art; position: relative; padding: 22px 0 24px 52px; border-top: 1px solid var(--rule); color: #b4a586; line-height: 1.55; }
.articles li::before {
  content: counter(art, lower-roman) ".";
  position: absolute; left: 0; top: 18px;
  font-family: var(--display); font-style: italic; font-size: 1.6rem; color: var(--accent-2);
}
.articles strong { display: block; font-weight: 400; font-family: var(--display); font-size: 1.45rem; line-height: 1.15; color: var(--wax); margin-bottom: 6px; }
.articles li:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* Galleries */
.gallery-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: clamp(64px, 8vw, 110px) 0 22px; padding-bottom: 14px; border-bottom: 1px solid var(--rule-2); }
.gallery { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: clamp(150px, 14.5vw, 214px); gap: clamp(10px, 1.2vw, 18px); grid-auto-flow: dense; }
.gallery figure { margin: 0; position: relative; grid-column: span 4; }
.gallery a { display: block; position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--ink-3); outline-offset: 3px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease), filter .6s; filter: saturate(.92) brightness(.92); }
.gallery a::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(232,217,181,.14); transition: box-shadow .4s; pointer-events: none; }
.gallery a:hover img, .gallery a:focus-visible img { transform: scale(1.035); filter: none; }
.gallery a:hover::after { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-2) 70%, transparent); }
.gallery figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 12px;
  background: linear-gradient(transparent, rgba(10,7,6,.88));
  font-style: italic; color: var(--wax); font-size: .95rem; line-height: 1.35;
  opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .5s var(--ease);
  pointer-events: none;
}
.gallery .fig { position: absolute; top: 10px; left: 10px; z-index: 1; font-family: var(--pixel); font-size: 9px; letter-spacing: .1em; color: var(--wax); background: rgba(18,14,12,.72); padding: 4px 6px 3px; pointer-events: none; }
.gallery figure:hover figcaption, .gallery figure:focus-within figcaption { opacity: 1; transform: none; }
/* Touch screens have no hover: show the captions of the larger plates outright. */
@media (hover: none) {
  .gallery figcaption { font-size: .85rem; padding: 28px 12px 10px; }
  .gallery .g-big figcaption, .gallery .g-half figcaption { opacity: 1; transform: none; }
}
@media (hover: none) and (max-width: 900px) {
  .gallery .g-half figcaption { opacity: 0; }
  .gallery figure:first-child figcaption, .gallery figure:last-child figcaption { opacity: 1; transform: none; }
}
.g-big { grid-column: span 8 !important; grid-row: span 2; }
.g-half { grid-column: span 6 !important; grid-row: span 2; }
.g-third { grid-column: span 3 !important; }
.g-right { grid-column: 5 / span 8 !important; }

/* Interlude — full-bleed quote */
.interlude { position: relative; min-height: clamp(380px, 62vh, 640px); display: grid; place-items: center; overflow: hidden; isolation: isolate; text-align: center; }
.interlude img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.interlude::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 60% at 50% 50%, rgba(18,14,12,.45), transparent 75%), linear-gradient(var(--ink), transparent 20%, transparent 80%, var(--ink)); }
.interlude img { filter: brightness(1.5) saturate(1.1); }
.interlude blockquote { margin: 0; padding: 0 var(--gutter); max-width: 980px; }
.interlude p { font-family: var(--display); font-style: italic; font-size: clamp(2rem, 1.2rem + 3.4vw, 4.4rem); line-height: 1.08; color: var(--wax); text-wrap: balance; text-shadow: 0 4px 40px rgba(0,0,0,.8); }
.interlude cite { font-style: normal; }

/* Chapter II band */
.band { position: relative; margin: 0 0 clamp(48px, 6vw, 80px); overflow: hidden; isolation: isolate; }
.band img { width: 100%; height: auto; aspect-ratio: 1920 / 823; object-fit: cover; min-height: 300px; }
.band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(var(--ink), transparent 18%, transparent 70%, var(--ink)), radial-gradient(130% 100% at 50% 40%, transparent 55%, rgba(18,14,12,.7)); pointer-events: none; }
.band .chap-head { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; margin: 0; }

/* Chapter III split opening */
.opening { position: relative; min-height: clamp(560px, 92vh, 960px); display: flex; align-items: center; overflow: hidden; isolation: isolate; margin-bottom: clamp(48px, 6vw, 90px); }
.opening > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 45%; z-index: -2; }
.opening::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(18,14,12,.94) 0%, rgba(18,14,12,.78) 30%, rgba(18,14,12,.1) 62%, transparent 80%), linear-gradient(var(--ink), transparent 16%, transparent 80%, var(--ink)); }
.opening__text { max-width: 560px; }
.opening .chap-head { margin-bottom: 36px; }

/* Studio / colophon */
.studio { position: relative; padding: clamp(96px, 12vw, 170px) 0 clamp(80px, 10vw, 140px); background: radial-gradient(60% 50% at 22% 40%, rgba(224,112,42,.10), transparent 70%), var(--ink); border-top: 1px solid var(--rule); }
.studio__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(24px, 3vw, 48px); align-items: center; }
.candle { grid-column: 1 / span 5; position: relative; display: grid; place-items: center; aspect-ratio: 1; max-width: 460px; }
.candle::before { content: ""; position: absolute; inset: 6%; border-radius: 50%; background: radial-gradient(circle at 50% 30%, rgba(255,176,74,.30), rgba(224,112,42,.10) 38%, transparent 68%); animation: flicker 5s ease-in-out infinite; }
.candle::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--rule); border-radius: 50%; }
.candle img { position: relative; width: 64%; height: auto; }
.candle .ring { position: absolute; inset: 7%; border: 1px dashed rgba(232,217,181,.1); border-radius: 50%; }
.studio__text { grid-column: 7 / span 6; }
.studio__text h2 { font-size: clamp(2.4rem, 1.6rem + 3vw, 4.4rem); line-height: 1; margin: 14px 0 28px; }
.studio__text h2 em { color: var(--glow); }
.studio__text p { max-width: 34em; }
.links { list-style: none; margin: 36px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--rule-2); }
.links li { border-bottom: 1px solid var(--rule); }
.links li:nth-child(odd) { border-right: 1px solid var(--rule); }
.links a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px 16px 0; text-decoration: none; color: var(--wax); font-family: var(--display); font-size: 1.4rem; line-height: 1.2; }
.links li:nth-child(even) a { padding-left: 18px; }
.links a .meta { font-size: 10px; }
.links a:hover { color: var(--glow); }
.links a:hover .meta { color: var(--wax-2); }
.mail { margin-top: 40px; }
.mail a { display: inline-block; font-family: var(--display); font-style: italic; font-size: clamp(1.8rem, 1.2rem + 2.2vw, 3rem); line-height: 1.1; text-decoration: none; color: var(--wax); border-bottom: 1px solid var(--ember); padding-bottom: 4px; word-break: break-word; }
.mail a:hover { color: var(--glow); border-color: var(--glow); }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: 56px 0 44px; }
.site-footer .wrap { display: grid; grid-template-columns: auto 1fr auto; gap: 24px 40px; align-items: center; }
.site-footer .brand img { width: 157px; height: 34px; }
.site-footer nav { display: flex; gap: 28px; justify-self: end; }
.site-footer nav a { text-decoration: none; font-variant-caps: all-small-caps; letter-spacing: .14em; color: var(--wax-2); font-size: 1.05rem; }
.site-footer nav a:hover { color: var(--glow); }
.site-footer .colophon { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; border-top: 1px solid var(--rule); padding-top: 22px; }

/* Lightbox */
.lightbox { padding: 0; border: 0; background: transparent; width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; color: var(--wax); overflow: hidden; }
.lightbox::backdrop { background: rgba(8, 6, 5, .94); backdrop-filter: blur(4px); }
.lightbox[open] { display: grid; grid-template-rows: 1fr auto; }
.lightbox__stage { display: grid; place-items: center; padding: 64px clamp(16px, 6vw, 96px) 12px; min-height: 0; }
.lightbox__stage img { max-width: 100%; max-height: calc(100vh - 170px); width: auto; height: auto; border: 1px solid var(--rule-2); box-shadow: 0 30px 100px rgba(0,0,0,.8); background: var(--ink-2); }
.lightbox__bar { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 14px clamp(16px, 4vw, 48px) 22px; max-width: 1200px; width: 100%; margin: 0 auto; }
.lightbox__cap { font-style: italic; color: var(--wax-2); text-align: center; line-height: 1.4; }
.lightbox__cap .meta { display: block; font-style: normal; margin-bottom: 4px; }
.lb-btn { width: 48px; height: 48px; display: grid; place-items: center; background: transparent; color: var(--wax); border: 1px solid var(--rule-2); cursor: pointer; transition: border-color .25s, color .25s, background .25s; }
.lb-btn:hover { border-color: var(--glow); color: var(--glow); background: rgba(255,176,74,.06); }
.lb-btn svg { width: 18px; height: 18px; }
.lb-close { position: absolute; top: 14px; right: 14px; }

/* Reveal motion */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@keyframes settle { from { transform: scale(1.06); filter: brightness(.6); } to { transform: none; filter: none; } }
@keyframes breathe { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes drip { 0% { top: -20px; } 60%, 100% { top: 70px; } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes flicker { 0%, 100% { opacity: 1; transform: scale(1); } 22% { opacity: .86; transform: scale(.985); } 41% { opacity: .97; } 63% { opacity: .82; transform: scale(1.01); } 80% { opacity: .95; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

.chapter.chapter--as { padding-top: 0; }

/* --- Responsive --------------------------------------------------- */
@media (max-width: 1100px) {
  .articles-wrap > header { grid-column: 1 / -1; }
  .articles { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .nav { display: none; }
  .menu { display: block; }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__aside { display: none; }
  .folio__text, .folio__plate, .folio--flip .folio__text, .folio--flip .folio__plate { grid-column: 1 / -1; grid-row: auto; }
  .folio__plate { max-width: 560px; }
  .studio__grid > * { grid-column: 1 / -1 !important; }
  .candle { max-width: 300px; margin-inline: auto; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: clamp(110px, 26vw, 200px); }
  .gallery figure, .g-big, .g-half, .g-third, .g-right { grid-column: span 1 !important; grid-row: span 1; }
  .gallery figure:first-child, .gallery figure:last-child { grid-column: 1 / -1 !important; grid-row: span 2; }
  .site-footer .wrap { grid-template-columns: 1fr; }
  .site-footer nav { justify-self: start; }
}
@media (max-width: 600px) {
  .site-header .wrap { height: 60px; }
  .hero { min-height: 0; display: block; background: var(--ink); }
  .hero__art { position: relative; inset: auto; height: min(128vw, 66svh); min-height: 400px; }
  .hero__art img { object-position: 50% 100%; }
  .hero__art::after { background: linear-gradient(180deg, rgba(18,14,12,.6) 0%, transparent 18%, transparent 55%, var(--ink) 100%); }
  .hero__inner { padding-top: 0; margin-top: -160px; padding-bottom: 56px; }
  .hero__logo { max-width: 100%; }
  .btn { width: 100%; justify-content: center; }
  .facts { grid-template-columns: 1fr; }
  .articles { grid-template-columns: 1fr; }
  .articles li { padding-left: 44px; }
  .chap-head__num { font-size: 6.5rem; }
  .gallery-head { flex-direction: column; gap: 4px; }
  .links { grid-template-columns: 1fr; }
  .links li:nth-child(odd) { border-right: 0; }
  .links li:nth-child(even) a { padding-left: 0; }
  .band img { min-height: 260px; }
  .band .chap-head { position: relative; margin-top: -70px; }
  .opening { min-height: 0; display: block; }
  .opening > img { position: relative; height: 56svh; min-height: 340px; object-position: 30% 50%; }
  .opening::before { background: linear-gradient(var(--ink), transparent 14%, transparent 34%, var(--ink) 56svh); }
  .opening__text { margin-top: -110px; position: relative; }
  .hero__platforms span + span::before { content: none; }
  .hero__platforms { gap: 6px 16px; }
  .chap-head__line .meta { display: none; }
  .hero__inner { margin-top: -120px; }
}
.folio-title { font-size: clamp(3rem, 2rem + 4vw, 5.6rem); line-height: .95; letter-spacing: -.01em; margin-bottom: 18px; }
.chapter--mm .tagline { color: var(--accent-2); }
@media (max-width: 600px) { .chapter--mm .folio__plate { display: none; } }

/* --- Final pass ------------------------------------------------------ */
/* Big screens: let the folio breathe instead of floating in a narrow column */
@media (min-width: 1600px) {
  :root { --max: 1480px; }
  body { font-size: 1.25rem; }
  .hero__inner { grid-template-columns: minmax(0, 680px) 1fr; }
  .hero__logo { max-width: 620px; }
  .hero__tagline { font-size: 3rem; }
  .card__logo { height: 58px; }
  .card--as .card__logo { height: 66px; }
}
/* Chapter III: keep the text side quiet over the busy village */
.opening::before { background: linear-gradient(90deg, rgba(18,14,12,.96) 0%, rgba(18,14,12,.86) 30%, rgba(18,14,12,.35) 56%, transparent 76%), linear-gradient(var(--ink), transparent 16%, transparent 80%, var(--ink)); }
.opening .tagline { text-shadow: 0 2px 24px rgba(0,0,0,.9); }
.opening .chap-head__body .label { color: var(--wax-2); text-shadow: 0 1px 12px #000, 0 0 2px #000; }

@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .cards li:first-child { grid-column: 1 / -1; }
  .cards li:first-child a { aspect-ratio: 16 / 10; }
  .card--mm .card__img { object-position: 50% 78%; }
}
@media (max-width: 600px) {
  .proem__grid { grid-template-columns: minmax(0, 1fr); }
  .proem__grid > * { grid-column: 1; }
  .proem__text { font-size: 1.85rem; }
  .card--mm .card__img { object-position: 30% 50%; }
  .opening .chap-head__body .label { color: var(--wax-2); text-shadow: 0 1px 12px #000, 0 0 2px #000; }
  .cards { grid-template-columns: 1fr; gap: 14px; }
  .card a, .cards li:first-child a { aspect-ratio: 5 / 4; }
  .card__top { top: 20px; left: 22px; right: 22px; }
  .card__body { left: 22px; right: 22px; bottom: 22px; gap: 14px; }
  .card__num { font-size: 2.1rem; }
  .card__logo { height: 40px; }
  .card--bi .card__logo { height: 44px; }
  .card--as .card__logo { height: 48px; }
  .brand__glow { margin-top: -27px; }
}

/* Section titles that link to a game's own page */
.title-link { color: inherit; text-decoration: none; display: inline-block; transition: color .25s, filter .4s; }
.title-link:hover { color: var(--glow); filter: drop-shadow(0 0 18px color-mix(in srgb, var(--accent-2) 35%, transparent)); }

/* --- Hero art: the gallows-field backdrop (native 5px pixel grid) ---- */
.hero__art--backdrop { height: 100%; }
.hero__art--backdrop img { object-position: 34% 38%; filter: brightness(1.55) saturate(1.2) contrast(1.04); animation: settle-bd 2.8s var(--ease) both, breathe 26s 2.8s ease-in-out infinite alternate; transform-origin: 36% 26%; }
.hero__art--backdrop::after {
  background:
    radial-gradient(120% 90% at 50% 30%, transparent 45%, rgba(8,5,6,.55) 100%),
    linear-gradient(180deg, rgba(18,14,12,.55) 0%, transparent 14%, transparent 52%, rgba(18,14,12,.72) 78%, var(--ink) 100%),
    linear-gradient(90deg, rgba(18,10,9,.55) 0%, rgba(18,10,9,.12) 38%, transparent 56%); }
/* the moon's red haze and a low candle glow behind the title */
.hero__glow { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(22% 30% at 35.5% 26%, rgba(210,72,58,.22), transparent 70%),
    radial-gradient(38% 34% at 18% 78%, rgba(255,176,74,.10), rgba(224,112,42,.05) 45%, transparent 72%);
  animation: flicker 6s ease-in-out infinite; }
@keyframes settle-bd { from { transform: scale(1.05); filter: brightness(.9) saturate(1.1); } to { transform: none; filter: brightness(1.55) saturate(1.2) contrast(1.04); } }
@media (max-width: 600px) {
  .hero__art--backdrop { height: min(128vw, 66svh); }
  .hero__art--backdrop img { object-position: 36% 30%; }
  .hero__art--backdrop::after { background: radial-gradient(130% 80% at 40% 30%, transparent 45%, rgba(8,5,6,.5) 100%), linear-gradient(180deg, rgba(18,14,12,.5) 0%, transparent 16%, transparent 50%, var(--ink) 100%); }
  .hero__glow { background: radial-gradient(34% 26% at 38% 27%, rgba(210,72,58,.24), transparent 70%); }
}
@media (prefers-reduced-motion: reduce) { .hero__art--backdrop img { filter: brightness(1.55) saturate(1.2) contrast(1.04); } }
