/* IRON: Beneath a Shattered Moon -- website styles.
   Colours are the in-game Codex's (client/ui/help/main.lua): backdrop 25, panels 61, tiles 40,
   hover blue 20/138/255, accent 120/190/255. Home, About and Media are black, with the About
   screen's panels crawling down a band on the right, as they crawl in-game. */

@font-face { font-family: "Roboto Condensed"; src: url(/fonts/RobotoCondensed-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Bebas Kai"; src: url(/fonts/BebasKai-Regular.ttf) format("truetype"); font-display: swap; }

:root {
  --bg: #191919;
  --panel: #3d3d3d;
  --tile: #282828;
  --row-hover: #5a5a5a;
  --hover: #148aff;
  --accent: #78beff;
  --text: #ebebeb;
  --dim: #bcbcbc;
  --body: #c8c8c8;
  --gray: #a0a0a0;
  --line: #4e4e4e;
  --red: #b8322f;          /* the logo's red: the call to action on home, about and media */
  --f-body: "Roboto Condensed", "Arial Narrow", sans-serif;
  /* the Codex's own UI face; commercial, so it is used only where it is already installed */
  --f-ui: "Franklin Gothic Demi Cond", "Roboto Condensed", "Arial Narrow", sans-serif;
  --f-display: "Bebas Kai", "Bebas Neue", Impact, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 18px/1.55 var(--f-body); }
body.home { background: #000; }
a { color: var(--accent); }
a:hover { color: #fff; }
img { max-width: 100%; height: auto; }
kbd { font: inherit; font-size: .9em; background: var(--tile); border: 1px solid #5a5a5a; border-bottom-width: 2px; border-radius: 3px; padding: 0 .4em; color: #fff; }
:focus-visible { outline: 2px solid var(--hover); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 20; background: var(--hover); color: #fff; padding: 6px 12px; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; padding: 8px 24px;
       background: rgba(0, 0, 0, .88); backdrop-filter: blur(6px); border-bottom: 1px solid #262626; }
.brand img { display: block; width: 104px; }
.nav { display: flex; gap: 20px; }
.nav a { color: var(--dim); text-decoration: none; font: 22px/1 var(--f-display); letter-spacing: .07em; padding: 6px 0; }
.nav a:hover, .nav a[aria-current] { color: #fff; }
.nav a[aria-current] { box-shadow: inset 0 -2px 0 var(--hover); }
.search { margin: 0 0 0 auto; position: relative; width: min(360px, 40vw); }
.search input { width: 100%; background: var(--tile); border: 1px solid #4a4a4a; color: var(--text);
                font: 16px var(--f-body); padding: 9px 12px; border-radius: 2px; }
.search input::placeholder { color: #8c8c8c; }
.search input:focus { outline: 2px solid var(--hover); outline-offset: -1px; }
.results { position: absolute; right: 0; top: calc(100% + 6px); width: min(460px, calc(100vw - 32px)); max-height: 70vh; overflow: auto;
           margin: 0; padding: 6px; list-style: none; background: #2b2b2b; border: 1px solid #4a4a4a; box-shadow: 0 14px 36px rgba(0, 0, 0, .65); }
.results a { display: flex; gap: 12px; align-items: center; padding: 6px 8px; color: var(--text); text-decoration: none; line-height: 1.25; }
.results a:hover, .results a[aria-selected="true"] { background: var(--hover); color: #fff; }
.results img { width: 40px; height: 40px; object-fit: contain; flex: none; }
.results .c { display: block; font-size: 13px; color: var(--dim); }
.results a[aria-selected="true"] .c, .results a:hover .c { color: #e6f1ff; }
.results .s { display: block; font-size: 13px; color: #9a9a9a; }
.results mark { background: none; color: inherit; font-weight: 700; }
.results .empty { padding: 8px 10px; color: var(--dim); }

/* ---------- codex ---------- */
.codex { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; max-width: 1380px; margin: 24px auto 0; padding: 0 24px; }
.cats { align-self: start; position: sticky; top: 84px; }
.codex-title { margin: 0 0 12px; font: 400 66px/1 var(--f-display); letter-spacing: .05em; text-align: center; text-transform: uppercase; }
.codex-title a { color: var(--text); text-decoration: none; }
.cats nav { background: var(--panel); padding: 8px; }
.cats ul { list-style: none; margin: 0; padding: 0; }
.cats nav a { display: flex; align-items: center; gap: 16px; padding: 10px 14px; color: var(--dim); text-decoration: none; font: 19px/1.2 var(--f-ui); }
.cats nav a:hover { background: var(--row-hover); color: #fff; }
.cats nav a[aria-current] { background: var(--hover); color: #fff; }
.cats nav img { width: 40px; height: 40px; flex: none; }
.panel { background: var(--panel); padding: 18px 28px 28px; min-height: 72vh; min-width: 0; }
.crumbs { margin: 0 0 10px; font-size: 14px; color: var(--dim); }
.crumbs a { color: var(--dim); }
.crumbs a:hover { color: #fff; }
.panel-title { margin: 0 0 18px; color: var(--accent); font: 400 26px/1.2 var(--f-ui); letter-spacing: .02em; }
.count { color: var(--dim); font-size: .62em; margin-left: 6px; vertical-align: middle; }
.intro { color: var(--body); max-width: 70ch; margin: 0 0 22px; }

.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; min-height: 152px; padding: 18px 8px 14px;
        background: url(/img/hud/slot-grey.png) center / 100% 100% no-repeat; color: var(--text); text-decoration: none;
        text-align: center; font: 15px/1.2 var(--f-ui); }
.tile:hover, .tile:focus-visible { background-image: url(/img/hud/slot-hover.png); color: #fff; }
.tile:focus-visible { outline-offset: -2px; }
.tile img { width: 72px; height: 72px; object-fit: contain; }
.tile .sub { display: block; color: var(--dim); font-size: 13px; margin-top: 2px; }

.catcards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.catcards a { display: grid; grid-template-columns: 48px 1fr; column-gap: 14px; align-items: center; padding: 14px 16px;
              background: var(--tile); color: var(--text); text-decoration: none; border: 1px solid #474747; height: 100%; }
.catcards a:hover { background: var(--hover); border-color: var(--hover); color: #fff; }
.catcards img { grid-row: span 2; width: 48px; height: 48px; }
.catcards .t { font: 19px/1.2 var(--f-ui); }
.catcards .n { font-size: 14px; color: var(--dim); }
.catcards a:hover .n { color: #e6f1ff; }

/* entry pages */
.back { display: inline-block; background: var(--tile); color: var(--text); text-decoration: none; font: 16px var(--f-ui); padding: 9px 22px; margin: 0 0 18px; }
.back:hover { background: var(--hover); color: #fff; }
.entry-head { display: flex; align-items: center; gap: 22px; margin: 0 0 20px; }
.entry-head img { width: 112px; height: 112px; padding: 12px; object-fit: contain; flex: none;
                  background: url(/img/hud/slot-grey.png) center / 100% 100% no-repeat; }
.entry-name { margin: 0; font: 400 36px/1.1 var(--f-ui); color: var(--text); }
.subtitle { margin: 4px 0 0; color: var(--dim); font-size: 19px; }
.body { color: var(--body); max-width: 78ch; }
.body p { margin: 0 0 .85em; }
.body strong { color: var(--text); font-weight: 700; }
.body h2.sec { margin: 1.7em 0 .5em; font: 400 16px/1.2 var(--f-ui); letter-spacing: .09em; color: var(--accent); }
.body h2.branch { margin: 1.9em 0 .6em; font: 400 30px/1 var(--f-display); letter-spacing: .07em; color: var(--text);
                  border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.body ul.list { margin: 0 0 1em; padding-left: 1.25em; }
.body ul.list > li { margin: .3em 0; }
.body ul.list > li::marker { color: var(--accent); }
.body ul.sub { margin: .25em 0 .7em; padding-left: 1.1em; list-style: "\2013\00a0 "; color: var(--body); }
.body ul.sub li { margin: .15em 0; }
.req { color: var(--dim); font-size: .85em; white-space: nowrap; margin-left: .3em; }
.body blockquote { margin: 1em 0; padding: .3em 0 .3em 1em; border-left: 3px solid var(--accent); font-style: italic; color: var(--text); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 1.1em 0 0; }
.chips li { background: var(--tile); border: 1px solid #575757; padding: 3px 11px; font: 15px/1.5 var(--f-ui); color: var(--text); }
.usage { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--gray); max-width: 78ch; }
.usage p { margin: 0 0 .45em; }
.usage a { color: #a9cdee; }
.usage a:hover { color: #fff; }
.pn { display: flex; justify-content: space-between; gap: 16px; margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); }
.pn a { color: var(--dim); text-decoration: none; font: 16px var(--f-ui); }
.pn a:hover { color: #fff; }
.pn .next { text-align: right; margin-left: auto; }

/* the Old Gods: card gallery + portrait page */
.gods { list-style: none; margin: 0 0 26px; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.godcard { display: block; background: var(--tile); padding: 6px; }
.godcard:hover, .godcard:focus-visible { background: var(--hover); }
.godcard img { display: block; width: 100%; }
.intro-gods { font-size: 19px; }
.god { display: grid; grid-template-columns: minmax(200px, 320px) minmax(0, 1fr); gap: 36px; align-items: start; }
.god .portrait { width: 100%; }
.god .entry-name { margin-top: 12px; }
.god .body { margin-top: 18px; font-size: 19px; }

/* ---------- home, about, media: the page beside a band of the About screen's panels ---------- */
.with-band { display: grid; grid-template-columns: minmax(0, 1fr) clamp(220px, 21vw, 320px); }
.content { min-width: 0; }
.band { position: sticky; top: 69px; height: calc(100vh - 69px); overflow: hidden; background: #000; border-left: 1px solid #161616;
        -webkit-mask-image: linear-gradient(transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(transparent, #000 5%, #000 95%, transparent); }
.band ul { list-style: none; margin: 0; padding: 0 14px; animation: crawl 160s linear infinite; }
.band li { padding-bottom: 6px; }
.band img { display: block; width: 100%; }
.band:hover ul { animation-play-state: paused; }
@keyframes crawl { to { transform: translateY(-50%); } }

.display { font: 400 50px/1 var(--f-display); letter-spacing: .05em; margin: 0 0 16px; color: #fff; }
.btn { display: inline-block; background: var(--panel); color: #fff; text-decoration: none; font: 24px/1 var(--f-display);
       letter-spacing: .08em; padding: 14px 28px 12px; margin: 4px; border: 1px solid transparent; }
.btn:hover { background: var(--hover); color: #fff; }
.btn.primary { background: var(--red); }
.btn.primary:hover { background: #dd4a46; }
.btn.ghost { background: transparent; border-color: #6a6a6a; }
.btn.ghost:hover { background: var(--hover); border-color: var(--hover); }

.hero { text-align: center; padding: 40px 24px 40px; background: radial-gradient(ellipse at 50% 24%, #1c2330 0%, #07080b 50%, #000 76%); }
.logo-h { margin: 0; line-height: 0; }
.hero .logo { width: min(520px, 90%); }
.tagline { max-width: 720px; margin: 14px auto 0; font-size: 23px; line-height: 1.4; color: var(--text); }
.banner { display: inline-block; margin: 22px 0 0; padding: 9px 22px 7px; background: var(--red); color: #fff;
          font: 30px/1 var(--f-display); letter-spacing: .08em; transform: skewX(-8deg); }
.cta { margin: 26px 0 0; }
.cta-note { margin: 10px 0 0; font-size: 14px; color: #8a8a8a; }

.pitch { max-width: 880px; margin: 0 auto; padding: 0 32px; }
.intro p { margin: 18px 0 0; font-size: 21px; line-height: 1.55; color: var(--text); }
.featured { margin: 36px 0 0; }
.more { margin: 8px 0 0; text-align: right; }
.more a { font: 21px var(--f-display); letter-spacing: .06em; text-decoration: none; }
.feature, .join { margin: 60px 0 0; }
.feats { list-style: none; margin: 0; padding: 0; }
.feats li { position: relative; padding: 12px 0 12px 30px; border-top: 1px solid #1d1d1d; color: var(--body); font-size: 19px; }
.feats li:first-child { border-top: 0; }
.feats li::before { content: ""; position: absolute; left: 6px; top: 1.2em; width: 9px; height: 9px; background: var(--red); transform: rotate(45deg); }
.join { padding: 30px 34px 34px; background: linear-gradient(180deg, #15181e, #0a0b0e); border: 1px solid #2a2f38; }
.join p { margin: 0; font-size: 20px; line-height: 2.3; color: var(--body); }
.connect { text-decoration: none; }
.connect code { font: 600 19px/1.4 ui-monospace, Consolas, monospace; color: #fff; background: #000; padding: 4px 10px; border: 1px solid #3a3f48; }
.connect:hover code { border-color: var(--hover); }
.copy { margin-left: 8px; font: 17px/1 var(--f-display); letter-spacing: .08em; padding: 7px 12px 5px; background: var(--panel); color: #fff;
        border: 0; cursor: pointer; vertical-align: middle; }
.copy:hover { background: var(--hover); }
.copy.done { background: #2e7d32; }
.join p.closing, .closing { font: 400 40px/1.1 var(--f-display); letter-spacing: .05em; color: #fff; margin: 28px 0 0; text-align: center; }

/* a YouTube player that loads on click (site.js) */
.yt { margin: 0; }
.yt-link, .yt-frame { position: relative; display: block; aspect-ratio: 16 / 9; background: #111; overflow: hidden; }
.yt-link img, .yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.yt-play { position: absolute; left: 50%; top: 50%; width: 72px; height: 50px; margin: -25px 0 0 -36px; background: rgba(0, 0, 0, .75);
           border-radius: 12px; transition: background .15s; }
.yt-play::after { content: ""; position: absolute; left: 29px; top: 15px; border-style: solid; border-width: 10px 0 10px 18px;
                  border-color: transparent transparent transparent #fff; }
.yt-link:hover .yt-play, .yt-link:focus-visible .yt-play { background: var(--red); }
.yt figcaption { margin: 8px 0 0; font-size: 17px; line-height: 1.3; color: var(--body); }

/* about + media */
.page-head { max-width: 880px; margin: 0 auto; padding: 44px 32px 0; }
.page-title { font-size: 76px; margin: 0; }
.welcome { max-width: 880px; margin: 0 auto; padding: 14px 32px 0; }
.welcome p { color: var(--body); font-size: 19px; margin: 0 0 1em; }
.welcome p.lede { font-size: 22px; line-height: 1.5; color: var(--text); }
.welcome p.closing { font: 400 40px/1.1 var(--f-display); letter-spacing: .05em; color: #fff; text-align: left; margin-top: 1em; }
.explore { max-width: 880px; margin: 0 auto; padding: 64px 32px 0; }
.explore > p { color: var(--body); max-width: 70ch; margin: 0 0 22px; }
.credits { padding: 80px 24px 0; text-align: center; font-family: var(--f-display); }
.roll { max-width: 640px; margin: 0 auto 64px; }
.roll-title { font: 400 40px/1.1 var(--f-display); letter-spacing: .04em; margin: 0 0 18px; color: #fff; }
.names { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; font-size: 26px; letter-spacing: .03em; color: #fff; }
.names li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.pair { margin: 0 0 18px; }
.cap { display: block; margin: 0; color: #b4b4b4; font-size: 20px; letter-spacing: .04em; }
.who { display: block; margin: 0; font-size: 30px; color: #fff; letter-spacing: .03em; }
.media-sec, .page-head.wide { max-width: 1120px; margin: 0 auto; padding: 36px 32px 0; }
.page-head.wide { padding-top: 44px; }
.videos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 26px 20px; }
.shots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.shot { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #111; }
.shot img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.shot:hover img, .shot:focus-visible img { transform: scale(1.04); }
.lightbox { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 96vh; color: var(--text); overflow: visible; }
.lightbox::backdrop { background: rgba(0, 0, 0, .92); }
.lightbox img { display: block; max-width: 96vw; max-height: 84vh; width: auto; height: auto; margin: 0 auto; }
.lightbox .bar { display: flex; align-items: center; gap: 12px; padding: 12px 0 0; }
.lightbox button { font: 20px/1 var(--f-display); letter-spacing: .06em; background: var(--panel); color: #fff; border: 0; padding: 9px 14px 7px; cursor: pointer; }
.lightbox button:hover { background: var(--hover); }
.lb-cap { flex: 1; text-align: center; font-size: 16px; color: var(--dim); }

.notfound { text-align: center; padding: 96px 24px; }

/* ---------- footer ---------- */
.foot { margin-top: 72px; padding: 28px 24px 40px; border-top: 1px solid #262626; color: #8f8f8f; font-size: 15px; text-align: center; background: #000; }
.foot p { margin: .3em auto; max-width: 900px; }
.foot strong { color: var(--dim); font-weight: 400; }
.foot .links { margin-bottom: 12px; }
.foot .links a { display: inline-block; margin: 0 10px; color: var(--dim); text-decoration: none; font: 20px var(--f-display); letter-spacing: .07em; }
.foot .links a:hover { color: #fff; }
.foot .fine { font-size: 13px; color: #6f6f6f; }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .band ul { animation: none; }
  .band { overflow-y: auto; }
  .shot img { transition: none; }
}

/* ---------- narrow screens ---------- */
@media (max-width: 960px) {
  .top { padding: 8px 16px; gap: 10px 16px; flex-wrap: wrap; }
  .brand img { width: 84px; }
  .search { width: 100%; margin: 0; order: 3; }
  .results { left: 0; right: auto; width: 100%; }
  .codex { grid-template-columns: minmax(0, 1fr); padding: 0 16px; margin-top: 14px; gap: 10px; }
  .cats { position: static; min-width: 0; }
  .codex-title { font-size: 34px; text-align: left; margin-bottom: 6px; }
  .cats nav { padding: 6px; overflow-x: auto; scrollbar-width: thin; }
  .cats ul { display: flex; gap: 4px; width: max-content; }
  .cats nav a { padding: 6px 12px 6px 8px; font-size: 16px; gap: 8px; white-space: nowrap; }
  .cats nav img { width: 28px; height: 28px; }
  .panel { padding: 14px 16px 20px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
  .tile { min-height: 118px; font-size: 13px; padding: 12px 4px 10px; gap: 6px; }
  .tile img { width: 52px; height: 52px; }
  .entry-head { gap: 14px; }
  .entry-head img { width: 80px; height: 80px; padding: 8px; }
  .entry-name { font-size: 28px; }
  .gods { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .god { grid-template-columns: 1fr; gap: 12px; }
  .god .portrait { max-width: 240px; margin: 0 auto; display: block; }
  /* the band turns into a row of panels to swipe through, under the page */
  .with-band { grid-template-columns: minmax(0, 1fr); }
  .band { position: static; height: auto; margin-top: 48px; border: 0; overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .band ul { display: flex; gap: 6px; width: max-content; padding: 0 16px; animation: none; }
  .band li { padding: 0; }
  .band li.dup { display: none; }
  .band img { width: 200px; }
  .hero { padding: 28px 16px 32px; }
  .tagline { font-size: 20px; }
  .banner { font-size: 24px; }
  .pitch, .page-head, .welcome, .explore, .media-sec { padding-left: 16px; padding-right: 16px; }
  .intro p { font-size: 19px; }
  .join { padding: 20px 16px 24px; }
  .join p { line-height: 2; }
  .connect code { font-size: 15px; }
  .display { font-size: 40px; }
  .page-title { font-size: 54px; }
  .closing, .join p.closing { font-size: 32px; }
  .names { font-size: 21px; gap: 6px 14px; }
  .roll-title { font-size: 34px; }
}
@media (max-width: 420px) {
  .nav { gap: 12px; }
  .btn { font-size: 21px; padding: 12px 18px 10px; }
}
