/* Saint Elmo: the site's one stylesheet.
   The look follows the game: ink engraving on brown paper for the title,
   the lamp room's dark wood around everything, parchment and red-ruled ledgers for the words. */

@font-face {
  font-family: "IM Fell English";
  src: url("../fonts/IMFellEnglish-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IM Fell English";
  src: url("../fonts/IMFellEnglish-Italic.ttf") format("truetype");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IM Fell English SC";
  src: url("../fonts/IMFellEnglishSC-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink: #1d1710;
  --ink-soft: #4a3d2c;
  --kraft: #c9ab82;
  --kraft-deep: #b8986d;
  --parchment: #e3d9c3;
  --parchment-text: #e6dcc4;
  --rule: #a8403a;
  --binding: #5c1411;
  --wood: #3b2a1b;
  --wood-dark: #24180f;
  --wood-line: #1a110a;
  --brass: #b99a5b;
  --lamp: #f2dc8c;
  --abyss: #080c0f;
  --serif: "IM Fell English", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --caps: "IM Fell English SC", "IM Fell English", "Palatino Linotype", Palatino, Georgia, serif;
  --gutter: 16px;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

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

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.55;
  color: var(--parchment-text);
  /* The lamp room's planks. */
  background-color: var(--wood);
  background-image:
    var(--grain),
    repeating-linear-gradient(180deg, transparent 0 138px, rgba(0, 0, 0, .38) 138px 140px, rgba(255, 220, 170, .04) 140px 141px),
    linear-gradient(90deg, rgba(0, 0, 0, .18), transparent 18%, transparent 82%, rgba(0, 0, 0, .18));
  overflow-x: hidden;
}

img, video { max-width: 100%; height: auto; display: block; }

a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--lamp);
  outline-offset: 3px;
}

.visually-hidden {
  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-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: .5rem 1rem;
  background: var(--lamp);
  color: var(--ink);
  font-family: var(--caps);
}
.skip-link:focus { top: var(--gutter); }

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

/* ---------- The engraving: the key art at the top ---------- */

.hero {
  position: relative;
  max-width: 1920px;
  margin: 0 auto;
  background: var(--kraft);
}

.site-nav {
  position: absolute;
  top: 0; right: 0;
  padding: 14px var(--gutter);
  font-family: var(--caps);
  font-size: 1.125rem;
  letter-spacing: .02em;
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding: 2px 0;
}
.site-nav a:hover { color: var(--binding); }

/* ---------- Brown paper bands ---------- */

.paper {
  color: var(--ink);
  background-color: var(--kraft);
  background-image: var(--grain);
  max-width: 1920px;
  margin: 0 auto;
}
.paper a { color: var(--ink); }

.opening {
  text-align: center;
  padding: 1.5rem 0 3.25rem;
  border-bottom: 2px solid var(--wood-line);
}
.tagline {
  margin: 0 auto .75rem;
  font-style: italic;
  font-size: clamp(1.75rem, 1.2rem + 2.6vw, 3rem);
  line-height: 1.15;
}
.lede {
  max-width: 36rem;
  margin: 0 auto 1.75rem;
  font-size: 1.25rem;
}

/* ---------- The call to action ---------- */

.cta {
  display: inline-block;
  min-width: 15rem;
  margin: 0;
  padding: .7rem 1.6rem .6rem;
  font-family: var(--caps);
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: .03em;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: -5px;
  background: transparent;
}
.cta-live {
  background: linear-gradient(180deg, #e8cc7c, #c9a557);
  border-color: #6f5527;
  outline-color: rgba(60, 40, 10, .55);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .35);
  cursor: pointer;
}
.cta-live:hover { background: linear-gradient(180deg, #f2dc8c, #d5b363); }
.on-wood .cta { color: var(--parchment-text); border-color: var(--brass); outline-color: var(--brass); }
.on-wood .cta-live { color: var(--ink); }

/* ---------- The clip, framed like the lamp room's window ---------- */

.clip {
  padding: 3.5rem 0;
}
.window {
  margin: 0 auto;
  max-width: 64rem;
}
.window video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--abyss);
  border: 10px solid var(--wood-line);
  outline: 1px solid rgba(185, 154, 91, .55);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
}
.window figcaption, .shot figcaption {
  margin-top: .7rem;
  font-style: italic;
  color: var(--parchment-text);
  opacity: .9;
}
.window figcaption { text-align: center; }

/* ---------- The ledger ---------- */

.ledger {
  position: relative;
  max-width: 48rem;
  margin: 0 auto;
  padding: 2.75rem 2.5rem 2.5rem 4.25rem;
  color: var(--ink);
  background-color: var(--parchment);
  background-image: var(--grain), radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, .25), transparent 60%);
  border-left: 12px solid var(--binding);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55), inset 10px 0 18px -10px rgba(0, 0, 0, .45);
}
/* The double red rule down the margin, as in the game's ledgers. */
.ledger::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 2.5rem;
  width: 5px;
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  opacity: .8;
}
.ledger p { margin: 0 0 1.1rem; }
.ledger h2 {
  margin: 2.25rem 0 1rem;
  padding-bottom: .35rem;
  font-family: var(--caps);
  font-weight: 400;
  font-size: 1.75rem;
  line-height: 1.2;
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 3px 0 -2px var(--rule);
}
.ledger h2:first-child { margin-top: 0; }
.ledger ul { margin: 0 0 1.25rem; padding: 0; list-style: none; }
.ledger li {
  position: relative;
  margin: 0 0 .7rem;
  padding-left: 1.4rem;
}
.ledger li::before {
  content: "";
  position: absolute;
  left: .2rem; top: .62em;
  width: .42rem; height: .42rem;
  background: var(--rule);
  transform: rotate(45deg);
}
.ledger strong { font-weight: 400; font-family: var(--caps); font-size: 1.08em; }
.ledger em { font-style: italic; }

.section-ledger { padding: 0 0 3.5rem; }

/* ---------- Screenshots ---------- */

.shots { padding: 1rem 0 3.5rem; }
.shots .wrap { max-width: 84rem; }
.wood-heading {
  margin: 0 0 1.5rem;
  font-family: var(--caps);
  font-weight: 400;
  font-size: 2rem;
  text-align: center;
  color: var(--parchment-text);
}
.wood-heading::after {
  content: "";
  display: block;
  width: 7rem;
  height: 5px;
  margin: .5rem auto 0;
  border-top: 1px solid var(--brass);
  border-bottom: 1px solid var(--brass);
}
.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 2rem 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.shot { margin: 0; }
.shot a { display: block; }
.shot img {
  width: 100%;
  border: 6px solid var(--wood-line);
  outline: 1px solid rgba(185, 154, 91, .5);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .5);
  transition: transform .2s ease;
}
.shot a:hover img { transform: translateY(-2px); }
.shot figcaption { font-size: 1.05rem; line-height: 1.4; }

/* ---------- The facts and the last call ---------- */

.closing {
  text-align: center;
  padding: 2.75rem 0 3rem;
  border-top: 2px solid var(--wood-line);
}
.facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem 0;
  margin: 0 auto 1.75rem;
  padding: 0;
  list-style: none;
  font-size: 1.25rem;
}
.facts li { padding: 0 .9rem; }
.facts li + li { border-left: 1px solid var(--ink-soft); }

.signup { margin: 2.25rem auto 0; max-width: 30rem; }
.signup form { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; align-items: flex-end; }
.signup label { display: block; width: 100%; font-family: var(--caps); font-size: 1.15rem; }
.signup input {
  flex: 1 1 14rem;
  min-width: 0;
  padding: .6rem .75rem;
  font: inherit;
  font-size: 1.1rem;
  color: var(--ink);
  background: var(--parchment);
  border: 1px solid var(--ink);
}
.signup button {
  flex: 0 0 auto;
  padding: .6rem 1.2rem;
  font-family: var(--caps);
  font-size: 1.15rem;
  color: var(--ink);
  background: linear-gradient(180deg, #e8cc7c, #c9a557);
  border: 1px solid #6f5527;
  cursor: pointer;
}

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

.site-footer {
  padding: 1.75rem 0 2.25rem;
  font-size: 1.05rem;
  color: var(--parchment-text);
  background: rgba(8, 12, 15, .55);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
  align-items: baseline;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--parchment-text); }
.site-footer a:hover { color: var(--lamp); }

/* ---------- The lightbox ---------- */

.lightbox {
  width: min(96vw, 1920px);
  max-width: none;
  max-height: 96vh;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--parchment-text);
  overflow: visible;
}
.lightbox::backdrop { background: rgba(8, 12, 15, .97); }
.lightbox figure { margin: 0; }
.lightbox img {
  width: auto;
  max-width: 100%;
  max-height: calc(96vh - 5rem);
  margin: 0 auto;
  border: 6px solid var(--wood-line);
}
.lightbox figcaption {
  margin: .6rem auto 0;
  max-width: 60rem;
  font-style: italic;
  text-align: center;
}
.lightbox form { text-align: right; margin: 0 0 .5rem; }
.lightbox button {
  padding: .35rem 1rem;
  font-family: var(--caps);
  font-size: 1.1rem;
  color: var(--ink);
  background: linear-gradient(180deg, #e8cc7c, #c9a557);
  border: 1px solid #6f5527;
  cursor: pointer;
}

/* ---------- Press page ---------- */

.press-head {
  padding: 1.75rem 0 2rem;
  color: var(--ink);
}
.press-head .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.press-title {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .5rem 1.25rem;
  margin: 0;
  font-family: var(--caps);
  font-weight: 400;
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem);
  line-height: 1;
}
.press-title img { width: min(26rem, 70vw); }
.press-head nav { font-family: var(--caps); font-size: 1.125rem; }

.press-main { padding: 2.5rem 0 1rem; }
.press-main .ledger { max-width: 56rem; margin-bottom: 2.5rem; }

.ledger h3 {
  margin: 1.5rem 0 .5rem;
  font-family: var(--caps);
  font-weight: 400;
  font-size: 1.3rem;
}
.ledger a { color: var(--binding); }
.ledger a:hover { color: var(--rule); }

.fact-sheet { margin: 0; }
.fact-sheet div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0 1.25rem;
  padding: .45rem 0;
  border-bottom: 1px solid rgba(168, 64, 58, .45);
}
.fact-sheet dt { font-family: var(--caps); }
.fact-sheet dd { margin: 0; }
.fact-sheet div[hidden] { display: none; }

.downloads {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 1.75rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ledger .downloads li { margin: 0; padding: 0; }
.ledger .downloads li::before { display: none; }
.download figure { margin: 0; }
.download img {
  width: 100%;
  border: 1px solid rgba(29, 23, 16, .55);
}
.download .on-dark { background: var(--wood-dark); padding: 1rem; }
.download .on-light { background: var(--kraft); padding: 1rem; }
.download .on-dark img, .download .on-light img { border: 0; }
.download .files a { white-space: nowrap; }
.press-main .ledger-wide { max-width: 72rem; }
@media (min-width: 48rem) {
  .download-wide { grid-column: span 2; }
}
.download figcaption { margin-top: .45rem; font-size: 1rem; line-height: 1.4; }
.download figcaption em { display: block; }
.download .files { margin: .35rem 0 0; font-size: 1rem; }
.download .files a { margin-right: .75rem; }

.zip {
  margin: 0;
  font-size: 1.2rem;
}

/* ---------- The 404 page ---------- */

.lost { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem var(--gutter); }
.lost .ledger { max-width: 34rem; width: 100%; text-align: left; }
.lost img { width: min(20rem, 70vw); margin: 0 0 1.5rem; }

/* ---------- Narrow screens ---------- */

@media (max-width: 640px) {
  body { font-size: 1.125rem; }
  .ledger { padding: 2rem 1.1rem 1.75rem 2.6rem; border-left-width: 8px; }
  .ledger::before { left: 1.25rem; }
  .ledger h2 { font-size: 1.5rem; }
  .facts { flex-direction: column; }
  .facts li + li { border-left: 0; }
  .cta { min-width: 0; width: 100%; max-width: 22rem; }
  .fact-sheet div { grid-template-columns: 1fr; }
  .clip { padding: 2.5rem 0; }
  /* On a phone the tall card's title fills the top, so the link sits in a bar above it. */
  .site-nav { position: static; text-align: right; padding: 8px var(--gutter); background: var(--wood-dark); }
  .site-nav a { color: var(--parchment-text); }
  .site-nav a:hover { color: var(--lamp); }
  .tagline { font-size: 1.65rem; }
  .window video { border-width: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
