/* Amalga — the game's colours and type, on the web.
   Grenze Gotisch is for names and big headings only; everything read is Fira Sans.
   The site is dark on purpose: it is the game's own colour. */

@font-face {
  font-family: "Grenze Gotisch";
  src: url("fonts/GrenzeGotisch-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Fira Sans";
  src: url("fonts/FiraSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Fira Sans";
  src: url("fonts/FiraSans-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --ink: #0e0f13;          /* the background of the whole game */
  --ink-deep: #08080b;
  --panel: #17191f;
  --panel-light: #20232b;
  --line: #2c3039;
  --line-strong: #3a3e48;
  --bone: #e3e2de;         /* text */
  --text: #c9c8c3;
  --subtle: #8a8f98;
  --gold: #c8a24a;         /* tarnished gold */
  --purple: #8b4fa8;       /* the Guide, and nothing else */
  --purple-light: #c79be0;
  --blood: #b5493e;
  --pink: #d36b9a;         /* spells, as the fight screen draws them */
  --accent: var(--purple); /* a creature's page sets its own */
  --heading: "Grenze Gotisch", Georgia, serif;
  --body: "Fira Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --gutter: clamp(16px, 5vw, 64px);
  --head-h: 68px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 12px); }
body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--bone); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.15; }
p { margin: 0 0 1em; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--gold); color: var(--ink); padding: 8px 14px; border-radius: 4px; font-weight: 600; }
.skip:focus { top: 12px; }

.kicker { font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin: 0 0 10px; font-weight: 600; }
.muted { color: var(--subtle); }
.quiet { font-style: italic; color: var(--subtle); }
.purple { color: var(--purple-light); }

/* ---------------------------------------------------------------- the room behind the page */
.ambience, .vignette { position: fixed; inset: 0; pointer-events: none; }
.ambience { z-index: 1; width: 100%; height: 100%; }
.vignette { z-index: 2; background: radial-gradient(ellipse at center, transparent 50%, rgba(5, 5, 8, 0.7) 100%); }
main, .site-foot { position: relative; z-index: 3; }

/* ---------------------------------------------------------------- the bar on top */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--head-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 var(--gutter);
  background: linear-gradient(180deg, rgba(14, 15, 19, 0.85), rgba(14, 15, 19, 0.35));
  backdrop-filter: blur(6px);
  border-bottom: 1px solid transparent;
  transition: background 0.4s, border-color 0.4s;
}
.site-head.scrolled { background: rgba(10, 11, 14, 0.94); border-bottom-color: #22252d; }
.brand { flex: 0 0 auto; margin-right: auto; }
.brand img { height: 40px; width: auto; filter: drop-shadow(0 0 12px rgba(139, 79, 168, 0.35)); }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  padding: 8px 14px;
  border-radius: 4px;
  position: relative;
}
.site-nav a:hover { color: var(--bone); background: rgba(255, 255, 255, 0.04); }
.site-nav a[aria-current="page"] { color: var(--bone); }
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 2px;
  background: var(--purple);
  box-shadow: 0 0 10px var(--purple);
}
.site-nav .nav-cta {
  margin-left: 10px;
  color: var(--ink);
  background: var(--gold);
}
.site-nav .nav-cta:hover { background: #d8b45c; color: var(--ink); }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--bone);
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
  }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 18px; height: 2px; background: currentColor; position: relative; transition: transform 0.3s;
  }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -6px; }
  .nav-toggle-bars::after { top: 6px; }
  .nav-open .nav-toggle-bars { background: transparent; }
  .nav-open .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
  .nav-open .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }
  .js .site-nav {
    position: fixed;
    top: var(--head-h); left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px var(--gutter) 24px;
    background: rgba(10, 11, 14, 0.98);
    border-bottom: 1px solid var(--line);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  }
  .js .nav-open .site-nav { opacity: 1; transform: none; visibility: visible; }
  .site-nav a { padding: 14px 4px; font-size: 18px; border-bottom: 1px solid #1d2027; border-radius: 0; }
  .site-nav a[aria-current="page"]::after { left: 0; right: auto; width: 3px; top: 14px; bottom: 14px; height: auto; }
  .site-nav a[aria-current="page"] { padding-left: 14px; }
  .site-nav .nav-cta { margin: 16px 0 0; text-align: center; border-radius: 4px; border: 0; }
  /* without the script the links simply sit under the bar */
  html:not(.js) .site-head { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  html:not(.js) .site-nav { flex-wrap: wrap; width: 100%; }
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-block;
  font-weight: 600;
  text-decoration: none;
  padding: 11px 24px;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  margin: 4px 8px 4px 0;
  transition: background 0.3s, box-shadow 0.3s, color 0.3s, border-color 0.3s;
}
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: #d8b45c; color: var(--ink); }
.btn-purple { background: rgba(139, 79, 168, 0.2); color: var(--bone); border-color: var(--purple); animation: pulse 3.2s ease-in-out infinite; }
.btn-purple:hover { background: rgba(139, 79, 168, 0.4); color: var(--bone); }
.btn-quiet { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-quiet:hover { color: var(--gold); border-color: var(--gold); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 6px rgba(139, 79, 168, 0.15); }
  50%      { box-shadow: 0 0 26px rgba(139, 79, 168, 0.5); }
}

/* ---------------------------------------------------------------- sections */
.section { max-width: 1180px; margin: 0 auto; padding: clamp(56px, 8vw, 96px) var(--gutter); }
.section-title { font-family: var(--heading); font-size: clamp(32px, 4.2vw, 48px); margin-bottom: 16px; }
.section-lede { color: var(--text); max-width: 46em; margin-bottom: 32px; }
.section-foot { color: var(--subtle); max-width: 46em; margin-top: 28px; }
.prose p { color: var(--text); }
.prose h2 { font-family: var(--heading); font-size: clamp(30px, 3.4vw, 40px); margin: 0 0 14px; }
.prose em { color: var(--bone); }
.prose strong { color: var(--bone); }

/* ---------------------------------------------------------------- home: the first screen */
.hero {
  position: relative;
  min-height: clamp(600px, calc(100vh - var(--head-h)), 940px);
  margin-top: calc(var(--head-h) * -1);
  padding: calc(var(--head-h) + 48px) var(--gutter) 64px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-art, .hero-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-art img { object-fit: cover; object-position: 72% center; animation: drift 40s ease-in-out infinite alternate; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(14,15,19,0.96) 0%, rgba(14,15,19,0.82) 34%, rgba(14,15,19,0.1) 70%, rgba(14,15,19,0) 100%),
    linear-gradient(0deg, var(--ink) 0%, rgba(14,15,19,0) 22%);
}
@keyframes drift {
  from { transform: scale(1.04) translateX(0); }
  to   { transform: scale(1.1) translateX(-1.5%); }
}
.hero-inner { position: relative; z-index: 2; max-width: 600px; }
.hero-logo img { width: min(500px, 100%); margin-bottom: 18px; filter: drop-shadow(0 0 30px rgba(139, 79, 168, 0.4)); }
.hook { font-weight: 600; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.25; margin: 0 0 14px; }
.pitch { color: var(--text); margin: 0 0 30px; max-width: 34em; }
.platform { margin: 22px 0 0; color: var(--subtle); letter-spacing: 0.04em; }
.platform strong { color: var(--bone); }
.steam-button { display: inline-block; background: #1b2838; color: #c7d5e0; border: 1px solid #66c0f4; padding: 10px 22px; border-radius: 4px; font-weight: 600; text-decoration: none; }

@media (max-width: 720px) {
  .hero { align-items: flex-end; min-height: 100svh; }
  .hero-art img { object-position: center top; }
  .hero::after { background: linear-gradient(180deg, rgba(14,15,19,0.2) 0%, rgba(14,15,19,0.6) 35%, rgba(14,15,19,0.94) 62%, var(--ink) 100%); }
}

/* the sign-up */
.signup {
  background: rgba(23, 25, 31, 0.9);
  border: 1px solid rgba(200, 162, 74, 0.35);
  border-radius: 6px;
  padding: 20px 22px;
  max-width: 520px;
}
.signup-label { display: block; font-weight: 600; margin-bottom: 10px; }
.signup-row { display: flex; gap: 10px; flex-wrap: wrap; }
.signup-row .btn { margin: 0; }
.signup-note { font-size: 14px; color: var(--subtle); margin: 12px 0 0; }

/* home: what it is */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 36px; }
.pillar h2 { font-family: var(--heading); font-size: 32px; color: var(--gold); margin-bottom: 10px; }
.pillar p { color: var(--text); margin: 0; }

/* home: a look */
.showcase { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
.showcase-text p { color: var(--text); }
.showcase-shot { margin: 0; }
@media (max-width: 860px) { .showcase { grid-template-columns: 1fr; } }

/* home: where to go */
.explore-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.explore-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 300px;
  padding: 20px;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--bone);
  border: 1px solid var(--line);
  isolation: isolate;
}
.explore-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1.2s ease, filter 0.6s; filter: brightness(0.6) saturate(0.85); }
.explore-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(10,10,13,0.95) 0%, rgba(10,10,13,0.3) 60%, rgba(10,10,13,0.1) 100%); }
.explore-card:hover img { transform: scale(1.06); filter: brightness(0.75) saturate(1); }
.explore-card:hover { color: var(--bone); border-color: var(--purple); box-shadow: 0 0 30px rgba(139, 79, 168, 0.25); }
.explore-name { font-family: var(--heading); font-size: 32px; line-height: 1.1; }
.explore-sub { color: var(--text); font-size: 15px; margin-top: 6px; }
.explore-spoiler .explore-name::after { content: "Spoilers"; font-family: var(--body); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #e0564a; border: 1px solid currentColor; border-radius: 3px; padding: 2px 6px; margin-left: 10px; vertical-align: middle; }

/* home: follow */
.follow { text-align: center; }
.follow p { color: var(--subtle); }
.socials { display: flex; gap: 10px; flex-wrap: wrap; }
.socials a { text-decoration: none; color: var(--text); border: 1px solid var(--line-strong); border-radius: 4px; padding: 7px 16px; font-weight: 600; font-size: 15px; }
.socials a:hover { border-color: var(--gold); color: var(--gold); }
.socials-big { justify-content: center; margin-top: 22px; }
.socials-big a { padding: 10px 22px; font-size: 17px; color: var(--bone); }

/* ---------------------------------------------------------------- inner pages: the top */
.page-hero {
  position: relative;
  margin-top: calc(var(--head-h) * -1);
  padding: calc(var(--head-h) + clamp(64px, 10vw, 140px)) var(--gutter) clamp(48px, 7vw, 88px);
  overflow: hidden;
  isolation: isolate;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--hero, none) center / cover no-repeat;
  filter: brightness(0.5) saturate(0.85);
  animation: drift 40s ease-in-out infinite alternate;
}
.page-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, var(--ink) 0%, rgba(14,15,19,0.4) 50%, rgba(14,15,19,0.7) 100%); }
.page-hero-inner, .page-hero > .kicker, .page-hero > h1 { max-width: 1180px; margin-left: auto; margin-right: auto; }
.page-hero h1 { font-family: var(--heading); font-size: clamp(48px, 7.5vw, 88px); line-height: 1; text-shadow: 0 0 30px rgba(139, 79, 168, 0.35); margin-bottom: 18px; }
.page-lede { max-width: 38em; color: var(--text); font-size: clamp(18px, 1.8vw, 21px); }
.page-hero-short { padding-bottom: 24px; }

/* text beside a picture */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.split-flip .split-text { order: 2; }
.split-art { margin: 0; }
.split-art img, .showcase-shot img { border-radius: 6px; border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55); }
figcaption { color: var(--subtle); font-size: 14px; margin-top: 10px; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split-flip .split-text { order: 0; }
}

/* the five kinds of card */
.kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.kind { margin: 0; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--kind, var(--gold)); border-radius: 6px; overflow: hidden; }
.kind img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.kind figcaption { padding: 12px 14px 16px; margin: 0; color: var(--text); font-size: 15px; }
.kind figcaption b { display: block; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--kind); }
.kind figcaption span { display: block; font-family: var(--heading); font-size: 24px; color: var(--bone); margin: 2px 0 4px; }
.kind-attack { --kind: #d0614f; }
.kind-block { --kind: #6f9fc7; }
.kind-buff { --kind: var(--gold); }
.kind-spell { --kind: var(--pink); }
.kind-equip { --kind: #b98a5a; }

/* the four choices over a body */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.choice { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 22px 22px 18px; }
.choice h3 { font-family: var(--heading); font-size: 28px; color: var(--gold); margin-bottom: 8px; }
.choice p { color: var(--text); margin: 0; font-size: 16px; }
.choice-spare h3 { color: #a8c3a0; }

/* a closing call */
.cta-band { text-align: center; }
.cta-band p { color: var(--text); }

/* the world: the voice */
.voice-band { max-width: none; background: radial-gradient(ellipse at center, rgba(139, 79, 168, 0.14), transparent 70%); }
.voice-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.voice-inner > p { color: var(--text); font-size: 20px; }
.voice-inner .wall { text-align: left; }

/* the world: places */
.places { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.place { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.place img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; filter: brightness(0.85); transition: filter 0.6s; }
.place:hover img { filter: brightness(1); }
/* the title screens keep their picture on the right and leave the left black for the menu */
.place img[src*="title-"], .explore-card img[src*="title-"], .gallery img[src*="title-"] { object-position: 80% 50%; }
.place figcaption { padding: 14px 16px 18px; margin: 0; color: var(--text); font-size: 15px; }
.place figcaption b { display: block; font-family: var(--heading); font-size: 26px; color: var(--bone); font-weight: 600; margin-bottom: 4px; }

/* the world: the living */
.people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.person { display: flex; gap: 16px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 14px 18px 14px 14px; }
.person img { width: 96px; height: 96px; object-fit: contain; flex: 0 0 auto; background: radial-gradient(circle, #2a2530, #15161b 70%); border-radius: 50%; border: 1px solid var(--line-strong); }
.person h3 { font-family: var(--heading); font-size: 26px; margin-bottom: 2px; }
.person p { margin: 0; color: var(--text); font-size: 15px; }

/* words cut into the stone */
.walls { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.wall {
  margin: 0;
  padding: 20px 22px;
  border-left: 3px solid var(--blood);
  background: rgba(8, 8, 11, 0.7);
  font-family: var(--serif);
  letter-spacing: 0.06em;
}
.wall p { margin: 0; color: var(--bone); font-size: clamp(16px, 2vw, 19px); }
.wall .wall-small { font-size: 14px; color: var(--subtle); margin-top: 8px; }
.wall cite { display: block; margin-top: 12px; font-family: var(--body); font-size: 13px; color: var(--subtle); letter-spacing: 0; font-style: italic; }

/* media */
.key-art { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.media-item { margin: 0; }
.media-item img { border-radius: 6px; border: 1px solid var(--line); width: 100%; }
.media-wide { grid-column: 1 / -1; }
.media-logo img { background: #000; padding: 24px; }
@media (max-width: 720px) { .key-art { grid-template-columns: 1fr; } }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.gallery a { display: block; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.gallery img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; transition: transform 0.8s ease, filter 0.6s; filter: brightness(0.9); }
.gallery a:hover img { transform: scale(1.04); filter: brightness(1.05); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 32px; margin: 0; }
.facts div { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid #22252d; }
.facts dt { flex: 0 0 110px; color: var(--subtle); font-size: 15px; }
.facts dd { margin: 0; color: var(--bone); }
.fine { color: var(--subtle); font-size: 14px; max-width: 52em; margin-top: 28px; }

/* pictures, opened large */
.lightbox { max-width: min(1400px, 94vw); max-height: 94vh; padding: 0; border: 0; background: transparent; color: var(--bone); overflow: visible; }
.lightbox::backdrop { background: rgba(5, 5, 8, 0.92); backdrop-filter: blur(3px); }
.lightbox figure { margin: 0; }
.lightbox img { max-height: 84vh; width: auto; margin: 0 auto; border-radius: 4px; box-shadow: 0 30px 80px rgba(0,0,0,0.7); }
.lightbox figcaption { text-align: center; }
.lightbox button { position: fixed; background: rgba(23, 25, 31, 0.8); color: var(--bone); border: 1px solid var(--line-strong); border-radius: 50%; width: 44px; height: 44px; font-size: 26px; line-height: 1; cursor: pointer; }
.lightbox button:hover { border-color: var(--gold); color: var(--gold); }
.lightbox-close { top: 16px; right: 16px; }
.lightbox-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-single .lightbox-prev, .lightbox-single .lightbox-next { display: none; }

/* privacy, and any page that is mostly words */
.text-page { max-width: 760px; margin: 0 auto; padding: 56px var(--gutter) 88px; }
.text-page h1 { font-family: var(--heading); font-size: 48px; margin-bottom: 8px; }
.text-page h2 { font-size: 20px; margin: 32px 0 8px; color: var(--gold); }
.text-page p, .text-page li { color: var(--text); }

/* lost */
.lost { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 64px var(--gutter); }
.lost h1 { font-family: var(--heading); font-size: clamp(40px, 7vw, 72px); margin-bottom: 14px; }
.lost p { color: var(--text); }

/* ---------------------------------------------------------------- the foot of every page */
.site-foot { border-top: 1px solid #1d2027; background: linear-gradient(180deg, rgba(14,15,19,0.6), var(--ink-deep)); }
.foot-inner { max-width: 1180px; margin: 0 auto; padding: 44px var(--gutter) 52px; display: grid; gap: 18px; justify-items: center; text-align: center; }
.foot-brand img { height: 46px; width: auto; opacity: 0.85; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: center; }
.foot-links a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
.foot-links a:hover { color: var(--gold); }
.site-foot .socials { justify-content: center; }
.foot-small { font-size: 14px; color: var(--subtle); margin: 0; }

/* ================================================================ the Beastpedia */

/* the warning, and which of it and the book shows: without the script both do, warning first */
.gate { min-height: calc(100vh - var(--head-h)); display: flex; align-items: center; justify-content: center; padding: 48px 16px; text-align: center; }
.gate-inner { max-width: 600px; animation: rise 1.6s ease-out both; }
.gate h1 { font-family: var(--heading); font-size: clamp(46px, 9vw, 84px); line-height: 1; margin: 6px 0 22px; text-shadow: 0 0 30px rgba(139, 79, 168, 0.45); }
.gate .kicker { color: var(--subtle); font-style: italic; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 16px; }
.gate-warning { margin: 0 auto 14px; padding: 18px 20px; border: 1px solid rgba(181, 73, 62, 0.55); border-radius: 6px; background: rgba(23, 25, 31, 0.85); color: #d6d4cf; }
.gate-warning strong { color: var(--blood); letter-spacing: 0.04em; text-transform: uppercase; font-size: 15px; display: block; margin-bottom: 4px; }
.gate-quiet { color: var(--subtle); margin: 0 0 28px; }
.gate-actions { display: none; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; }
.js .gate-actions { display: flex; }
.gate-back { color: var(--subtle); }
.gate-eye { width: 120px; margin: 0 auto 18px; overflow: visible; transform-origin: center; animation: blink 7s infinite; filter: drop-shadow(0 0 12px rgba(139, 79, 168, 0.6)); }
.gate-eye-lid { fill: rgba(14, 15, 19, 0.9); stroke: var(--purple); stroke-width: 2; }
.gate-eye-iris { fill: rgba(139, 79, 168, 0.55); }
.gate-eye-pupil { fill: #0b0a0f; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.05); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes sink { to { opacity: 0; transform: scale(0.96); filter: blur(10px); } }
.gate-leaving .gate-inner { animation: sink 0.85s ease-in forwards; }
.js .gated .book { display: none; }
.js.bp-open .gated .book { display: block; }
.js.just-opened .gated .book { animation: rise 1.1s ease-out both; }
.js.bp-open .gate { display: none; }

/* the threat stamp */
.threat { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; padding: 3px 9px; border-radius: 3px; border: 1px solid currentColor; white-space: nowrap; line-height: 1.4; }
.threat-low    { color: #8fa58a; }
.threat-medium { color: var(--gold); }
.threat-high   { color: #d0743f; }
.threat-deadly { color: #e0564a; background: rgba(181, 73, 62, 0.14); animation: flicker 4s infinite; }
@keyframes flicker { 0%, 41%, 43%, 77%, 80%, 100% { opacity: 1; } 42% { opacity: 0.45; } 78% { opacity: 0.6; } }
.rank { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--subtle); border: 1px solid var(--line-strong); border-radius: 3px; padding: 3px 9px; }

/* the contents */
.contents { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter) 40px; }
.contents .page-hero { margin: 0; padding: calc(clamp(40px, 7vw, 80px)) 0 24px; text-align: center; overflow: visible; }
.contents .page-hero h1 { margin-bottom: 14px; }
.floor-pick { display: inline-flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.floor-current { color: #e0564a; font-family: var(--serif); font-style: italic; font-size: 19px; border-bottom: 1px solid rgba(224, 86, 74, 0.4); }
.floor-locked { color: #5b606a; font-family: var(--serif); font-style: italic; font-size: 17px; }
.floor-locked::before { content: "\00b7\00a0"; }
.intro-panel, .legend { background: rgba(23, 25, 31, 0.82); border: 1px solid var(--line); border-radius: 8px; padding: 28px clamp(18px, 4vw, 40px); margin-bottom: 22px; }
.intro-panel { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: center; }
@media (max-width: 860px) { .intro-panel { grid-template-columns: 1fr; } }
.legend h2 { font-family: var(--heading); font-size: clamp(28px, 3.4vw, 36px); color: var(--gold); margin-bottom: 8px; }
.legend h3 { font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); margin: 28px 0 6px; }
.threat-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 24px; margin: 16px 0 0; }
.threat-list div { display: flex; gap: 12px; align-items: baseline; }
.threat-list dt { flex: 0 0 78px; }
.threat-list dd { margin: 0; color: var(--text); font-size: 15px; }
.people-row { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 14px 18px; }
.people-row li { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; color: var(--text); width: 74px; text-align: center; }
.people-row img { width: 64px; height: 64px; object-fit: contain; border-radius: 50%; background: radial-gradient(circle, #2a2530, #15161b 70%); border: 1px solid var(--line-strong); }

.filter { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 40px 0 6px; }
.filter button { font-size: 15px; font-weight: 600; padding: 8px 18px; border-radius: 4px; border: 1px solid var(--line-strong); background: rgba(14, 15, 19, 0.7); color: var(--subtle); cursor: pointer; }
.filter button:hover { color: var(--bone); border-color: #5a5f6a; }
.filter button[aria-pressed="true"] { color: var(--bone); border-color: var(--purple); background: rgba(139, 79, 168, 0.2); }

.contents-section { margin-top: 44px; }
.contents-section[hidden] { display: none; }
.rule-title { font-family: var(--heading); font-size: clamp(32px, 4vw, 44px); margin-bottom: 22px; display: flex; align-items: center; gap: 18px; }
.rule-title small { font-family: var(--body); font-size: 14px; color: var(--subtle); font-weight: 400; }
.rule-title::before, .rule-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.tile {
  --glow: color-mix(in srgb, var(--accent) 45%, transparent);
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 6px;
  padding: 14px 14px 16px;
  text-decoration: none;
  color: var(--bone);
  background: linear-gradient(180deg, rgba(32, 35, 43, 0.92), rgba(18, 19, 24, 0.94));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.4s, box-shadow 0.4s, transform 0.4s;
}
.tile::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, var(--glow), transparent 65%); opacity: 0.25; transition: opacity 0.5s; pointer-events: none; }
.tile:hover { border-color: var(--accent); box-shadow: 0 0 34px var(--glow); transform: translateY(-3px); color: var(--bone); }
.tile:hover::before { opacity: 0.6; }
.tile-art { display: flex; align-items: center; justify-content: center; height: 180px; }
.tile-art img { max-height: 180px; width: auto; object-fit: contain; filter: drop-shadow(0 6px 18px rgba(0,0,0,0.6)); transition: transform 0.6s ease; }
.tile:hover .tile-art img { transform: scale(1.05); }
.tile-name { font-family: var(--heading); font-size: 26px; line-height: 1.1; position: relative; }
.tile-meta { position: relative; }
.tile-sub { font-size: 14px; color: var(--subtle); font-style: italic; position: relative; }
.book-end { text-align: center; margin: 56px 0 24px; color: var(--subtle); }
.book-end p { font-style: italic; }

/* one creature: the top of its page is the room it stands in */
.creature-hero { position: relative; overflow: hidden; isolation: isolate; border-bottom: 1px solid var(--line); }
.creature-room { position: absolute; inset: 0; z-index: -2; background: center / cover no-repeat; filter: brightness(0.42) saturate(0.8); animation: drift 50s ease-in-out infinite alternate; }
.creature-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 70% 60%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    linear-gradient(90deg, rgba(14,15,19,0.92) 0%, rgba(14,15,19,0.55) 45%, rgba(14,15,19,0.2) 100%),
    linear-gradient(0deg, var(--ink) 0%, transparent 30%);
}
.creature-hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px var(--gutter) 0;
  min-height: clamp(460px, 64vh, 640px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-items: end;
}
.crumbs { grid-column: 1 / -1; font-size: 14px; color: var(--subtle); align-self: start; }
.crumbs a { color: var(--text); }
.creature-title { padding-bottom: clamp(32px, 6vw, 72px); }
.creature-title h1 { font-family: var(--heading); font-size: clamp(50px, 7.5vw, 96px); line-height: 0.98; margin: 4px 0 16px; text-shadow: 0 0 34px color-mix(in srgb, var(--accent) 55%, transparent); }
.creature-lede { font-family: var(--serif); font-style: italic; color: color-mix(in srgb, var(--accent) 70%, #fff); font-size: 19px; margin: 0; }
.creature-tags { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; }
.creature-where { color: var(--text); margin: 0; max-width: 28em; }
.creature-where::before { content: "\2316\00a0"; color: var(--accent); }
.creature-art {
  justify-self: center;
  align-self: end;
  max-height: min(560px, 60vh);
  width: auto;
  filter: drop-shadow(0 0 40px color-mix(in srgb, var(--accent) 45%, transparent)) drop-shadow(0 20px 30px rgba(0,0,0,0.7));
  animation: breathe 6s ease-in-out infinite;
  transform-origin: 50% 100%;
}
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.015) translateY(-3px); } }
@media (max-width: 760px) {
  .creature-hero-inner { grid-template-columns: 1fr; grid-template-rows: auto auto auto; min-height: 0; }
  .creature-art { grid-row: 2; max-height: 340px; margin-top: 12px; }
  .creature-title { grid-row: 3; padding-bottom: 32px; }
}

.creature-body { max-width: 1180px; margin: 0 auto; padding: clamp(36px, 5vw, 64px) var(--gutter) 40px; display: grid; gap: 28px; }
.creature-words { max-width: 46em; }
.creature-words h2 { color: var(--bone); margin-top: 28px; }
.creature-words h2:first-of-type { margin-top: 0; }
.sighted, .approach { font-family: var(--serif); font-style: italic; color: var(--bone); border-left: 2px solid var(--accent); padding: 4px 0 4px 18px; margin: 0 0 28px; }
.sighted p { color: var(--bone); margin-bottom: 0.6em; }

.panel { background: rgba(23, 25, 31, 0.86); border: 1px solid var(--line); border-radius: 8px; padding: 22px clamp(16px, 3vw, 28px); }
.panel h3, .sub-title { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin: 0 0 14px; }
.sub-title { margin-top: 8px; }

/* who told you */
.tab-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tab-list [role="tab"] {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(14, 15, 19, 0.7);
  color: var(--subtle);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.tab-list [role="tab"] img { width: 36px; height: 36px; border-radius: 50%; object-fit: contain; background: #1d1c22; }
.tab-list [role="tab"]:hover { color: var(--bone); }
.tab-list [role="tab"][aria-selected="true"] { color: var(--bone); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
html:not(.js) .tab-list { display: none; }
.tell-panel { animation: rise 0.6s ease-out both; }
.tell-panel + .tell-panel { margin-top: 18px; }
.tabs-ready .tell-panel + .tell-panel { margin-top: 0; }
.tell-who { font-size: 13px; color: var(--subtle); margin: 0 0 4px; }
.tabs-ready .tell-who { display: none; }
.tell-heading { color: #e0564a; font-family: var(--serif); font-style: italic; font-size: 19px; margin: 0 0 8px; }
.tell-note { margin: 0; font-family: var(--serif); font-size: 18px; line-height: 1.6; color: var(--bone); }
.tell-note p { margin: 0; }
.tell-cards { margin: 10px 0 0; font-size: 14px; color: var(--gold); }

/* Barry, or a patient */
.variant-switch [role="tab"] { padding: 8px 18px; }
.variant + .variant { margin-top: 28px; }
.tabs-ready .variant + .variant { margin-top: 0; }
.variant-art { max-height: 280px; width: auto; margin: 0 auto 12px; filter: drop-shadow(0 0 30px color-mix(in srgb, var(--accent) 40%, transparent)); }
.variant-words { margin-bottom: 20px; max-width: 46em; }

/* numbers, and what its body gives */
.body-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; margin-bottom: 28px; }
.threat-line { display: flex; gap: 12px; align-items: baseline; color: var(--text); font-size: 15px; font-style: italic; margin-bottom: 14px; }
.stats { margin: 0; display: grid; gap: 8px; }
.stat { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 12px; }
.stat dt { color: var(--subtle); font-size: 15px; }
.stat dd { margin: 0; display: flex; align-items: center; gap: 10px; }
.stat dd b { min-width: 36px; text-align: right; font-weight: 600; }
.stat-bar { flex: 1; height: 6px; background: #22252d; border-radius: 3px; overflow: hidden; }
.stat-bar span { display: block; height: 100%; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 50%, #000), var(--accent)); border-radius: 3px; transform-origin: left; animation: grow 1.4s cubic-bezier(.2,.7,.2,1) both; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.stat-wide dd { color: var(--text); font-size: 15px; }
.drops { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 6px; }
.drops li { display: flex; align-items: center; gap: 12px; border-bottom: 1px dashed #2a2d35; padding-bottom: 6px; color: var(--text); font-size: 15px; }
.drops li img { width: 48px; height: 32px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line-strong); flex: 0 0 auto; }
.drops li span { flex: 1; }
.drops li b { color: var(--gold); font-weight: 600; }
.voice { margin: 0; padding: 2px 0 2px 16px; border-left: 2px solid var(--purple); color: var(--purple-light); font-style: italic; animation: whisper 5s ease-in-out infinite; }
.voice::before { content: "The voice"; font-style: normal; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--purple); display: block; }
.voice p { margin: 0; }
@keyframes whisper { 0%, 100% { text-shadow: none; } 50% { text-shadow: 0 0 10px rgba(139, 79, 168, 0.6); } }

/* what it carries: its cards */
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.ct { --kind: var(--gold); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--kind); border-radius: 6px; overflow: hidden; transition: transform 0.4s, box-shadow 0.4s; }
.ct:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,0.5), 0 0 0 1px var(--kind); }
.ct-attack { --kind: #d0614f; }
.ct-block { --kind: #6f9fc7; }
.ct-buff { --kind: var(--gold); }
.ct-spell { --kind: var(--pink); }
.ct-equip { --kind: #b98a5a; }
.ct-art img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.ct-body { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.ct-body header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ct-body h4 { font-family: var(--heading); font-size: 23px; line-height: 1.1; }
.ct-cost { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; background: #2a2d35; color: var(--bone); border: 1px solid var(--line-strong); }
.ct-type { margin: 0; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--kind); font-weight: 600; }
.ct-fx { margin: 4px 0 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--text); line-height: 1.45; }
.ct-fx li + li { margin-top: 3px; }
.ct-flavor { margin: 6px 0 0; font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--subtle); }
.ct-note { margin: auto 0 0; padding-top: 8px; font-size: 13px; color: var(--gold); }

/* pictures from the game */
.scene-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.scene { margin: 0; }
.scene img { border-radius: 6px; border: 1px solid var(--line); aspect-ratio: 3 / 2; object-fit: cover; width: 100%; transition: filter 0.6s; filter: brightness(0.9); }
.scene a:hover img { filter: brightness(1.05); }

/* turning the page */
.pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; margin-top: 20px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager a { text-decoration: none; color: var(--bone); }
.pager-prev, .pager-next { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: rgba(23, 25, 31, 0.7); transition: border-color 0.4s, box-shadow 0.4s; }
.pager-prev:hover, .pager-next:hover { border-color: var(--accent); box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 35%, transparent); color: var(--bone); }
.pager-next { flex-direction: row-reverse; text-align: right; }
.pager img { width: 54px; height: 54px; object-fit: contain; }
.pager span { font-family: var(--heading); font-size: 22px; line-height: 1.1; }
.pager small { display: block; font-family: var(--body); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--subtle); }
.pager-contents { font-weight: 600; color: var(--gold) !important; padding: 10px 16px; border: 1px solid var(--line-strong); border-radius: 4px; }
@media (max-width: 640px) {
  .pager { grid-template-columns: 1fr 1fr; }
  .pager-contents { grid-column: 1 / -1; grid-row: 2; text-align: center; }
  .pager span { font-size: 18px; }
  .pager img { width: 40px; height: 40px; }
}

/* ---------------------------------------------------------------- coming out of the dark */
.reveals .reveal, .reveals .tile, .reveals .ct, .reveals .person, .reveals .place {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1s ease, transform 1s ease, filter 1.2s ease, border-color 0.4s, box-shadow 0.4s;
  filter: blur(3px) brightness(0.5);
}
.reveals .seen { opacity: 1 !important; transform: none; filter: none; }
.reveals .tile.seen:hover, .reveals .ct.seen:hover { transform: translateY(-3px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .ambience { display: none; }
}
