/* Bible Bored Games: shared stylesheet for the studio website.
   The links page (/links/) was the first page built on it. The rest of the
   site (Home, a page per game, About, Contact, Privacy, 404) adds its own
   rules in the second half of this file.
   The idea: Home and Links are the book's scarlet cover; every other page is
   a linen page inside, with the ribbon marking the page you are on.
   Colors come from the studio color system (HQ social/colour-system.md)
   and the app icons (HQ D-114). Fonts are self-hosted, OFL (see assets/fonts). */

@font-face {
  font-family: "Libre Franklin";
  src: url("fonts/LibreFranklin-500.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Franklin";
  src: url("fonts/LibreFranklin-600.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("fonts/Literata-400.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --scarlet: #86302A;
  --scarlet-deep: #74291F;
  --linen: #F2EADB;
  --paper: #F8F3E9;
  --ink: #2B2623;
  --quiet: #6B5F57;
  --forest: #2D5D30;
  --forest-deep: #244B27;
  --navy: #2E4D7B;
  --navy-deep: #253F66;
  --hairline: rgba(43, 38, 35, 0.12);
  --cover-soft: rgba(242, 234, 219, 0.86);

  --sans: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --serif: "Literata", Georgia, "Times New Roman", serif;

  --ease: cubic-bezier(0.2, 0, 0, 1);
}

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

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

body {
  margin: 0;
  background: var(--linen);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, figure, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; }

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- The cover: the studio's scarlet, with the ribbon hanging in ---------- */

.cover {
  position: relative;
  overflow: hidden;
  background: var(--scarlet);
  color: var(--linen);
  text-align: center;
  padding: 216px 16px 56px;
}

.cover__ribbon {
  position: absolute;
  top: 0;
  left: 50%;
  width: 76px;
  height: 176px;
  transform: translateX(-50%);
  fill: var(--linen);
}

.cover__name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(28px, 8.8vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.cover__tagline {
  margin-top: 12px;
  font-family: var(--serif);
  font-size: clamp(20px, 5.6vw, 24px);
  line-height: 1.3;
}

.cover__line {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--cover-soft);
}

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

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 16px 40px;
}

.game {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 20px 20px 8px;
}

.game + .game { margin-top: 16px; }

.game__head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.game__icon {
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(43, 38, 35, 0.12), 0 4px 12px rgba(43, 38, 35, 0.08);
}

.game__name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.2;
}

.game__subname {
  display: block;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.35;
  color: var(--quiet);
  margin-top: 2px;
}

.game__status {
  margin-top: 4px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 13px;
  line-height: 1.4;
  color: var(--quiet);
}

.game__line {
  margin-top: 16px;
  text-wrap: pretty;
  font-size: 17px;
  line-height: 1.5;
}

.stores {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.button {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 10px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 160ms var(--ease), color 160ms var(--ease), transform 120ms var(--ease);
}

.button:active { transform: scale(0.98); }

.button--theword { background: var(--forest); color: var(--linen); }
.button--theword:hover { background: var(--forest-deep); }

.button--enigma { background: var(--navy); color: var(--linen); }
.button--enigma:hover { background: var(--navy-deep); }

.button--enigma-outline {
  color: var(--navy);
  box-shadow: inset 0 0 0 1.5px var(--navy);
}
.button--enigma-outline:hover { background: rgba(46, 77, 123, 0.08); }

.small-links {
  display: flex;
  gap: 24px;
  margin-top: 4px;
}

.small-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  color: var(--quiet);
  text-decoration: underline;
  text-decoration-color: rgba(107, 95, 87, 0.4);
  text-underline-offset: 3px;
  transition: color 160ms var(--ease), text-decoration-color 160ms var(--ease);
}
.small-links a:hover { color: var(--ink); text-decoration-color: currentColor; }

/* ---------- Follow and contact ---------- */

.block {
  margin-top: 40px;
  padding: 0 4px;
  text-align: center;
}

.block__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 15px;
  color: var(--quiet);
}

.follow[data-enabled="false"] { display: none; }

.follow__links {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.follow__links a,
.contact__mail {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 17px;
  color: var(--scarlet);
  text-decoration: underline;
  text-decoration-color: rgba(134, 48, 42, 0.35);
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  overflow-wrap: anywhere;
  transition: text-decoration-color 160ms var(--ease);
}
.follow__links a:hover,
.contact__mail:hover { text-decoration-color: currentColor; }

.footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  text-align: center;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 13px;
  color: var(--quiet);
}

/* ---------- Narrow phones (320 to 359 px) ---------- */

@media (max-width: 359px) {
  .game { padding: 16px 16px 4px; }
  .game__head { gap: 12px; }
  .game__icon { width: 60px; height: 60px; border-radius: 14px; }
  .game__name { font-size: 19px; }
  .game__status { font-size: 12px; }
  .button { padding: 0 8px; font-size: 15px; white-space: nowrap; }
}

/* ---------- Wide screens: a book laid open, cover on the left, page on the right ---------- */

@media (min-width: 900px) {
  body.book {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    min-height: 100vh;
  }

  .cover {
    min-height: 100vh;
    padding: calc(42vh + 64px) 48px 64px;
  }

  .cover__ribbon { width: 112px; height: 42vh; min-height: 260px; }

  .cover__name { font-size: 48px; }
  .cover__tagline { margin-top: 16px; font-size: 28px; }
  .cover__line { margin-top: 12px; font-size: 18px; }

  .page {
    width: 100%;
    max-width: 512px;
    padding: 96px 32px 48px;
    align-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button, .small-links a, .contact__mail { transition: none; }
  .button:active { transform: none; }
}

/* ======================================================================
   The rest of the site
   ====================================================================== */

:root {
  --gold: #CFA64C;
  --stone: #D4C9B5;
  --tile-edge: #D5C5A7;
  --mark: var(--scarlet);          /* the ribbon color of the current page */
  --measure: 36rem;
}

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 10;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--linen);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border-radius: 8px;
}
.skip:focus { top: 12px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Masthead: the scarlet edge of the cover, and the ribbon marking the page ---------- */

.masthead { border-top: 4px solid var(--scarlet); }
.masthead--home { border-top: 0; }
.masthead--home .masthead__inner { justify-content: center; }

.masthead__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 12px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand {
  padding-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  text-decoration: none;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.2;
  color: var(--ink);
}
.brand img { width: 32px; height: 32px; flex: none; }
.brand__name { display: none; }

.nav ul { display: flex; }

.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 56px;
  padding: 4px 8px 0;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 15px;
  color: var(--quiet);
  text-decoration: none;
  transition: color 160ms var(--ease);
}
.nav a:hover { color: var(--ink); }

.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 10px;
  height: 15px;
  margin-left: -5px;
  background: var(--mark);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 70%, 0 100%);
}

@media (min-width: 600px) {
  .brand__name { display: inline; }
  .masthead__inner { padding: 0 24px 0 32px; }
  .nav a { padding: 4px 12px 0; }
}

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

.site-foot {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-foot__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 24px;
  padding: 12px 0 24px;
  border-top: 1px solid var(--hairline);
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  color: var(--quiet);
}

.site-foot ul { display: flex; gap: 24px; }

.site-foot a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  color: var(--quiet);
  text-decoration: underline;
  text-decoration-color: rgba(107, 95, 87, 0.4);
  text-underline-offset: 3px;
  transition: color 160ms var(--ease), text-decoration-color 160ms var(--ease);
}
.site-foot a:hover { color: var(--ink); text-decoration-color: currentColor; }

@media (min-width: 600px) {
  .site-foot { padding: 0 32px; }
}

/* The links page keeps its own centered footer, with two small links added */
.footer__links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 4px;
}
.footer__links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  color: var(--quiet);
  text-decoration: underline;
  text-decoration-color: rgba(107, 95, 87, 0.4);
  text-underline-offset: 3px;
}
.footer__links a:hover { color: var(--ink); text-decoration-color: currentColor; }

/* ---------- A linen page ---------- */

.sheet {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 16px 64px;
}

.column { max-width: var(--measure); }

.sheet--text .column { margin: 0 auto; }

.title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.lede {
  margin-top: 16px;
  font-size: 19px;
  line-height: 1.5;
  text-wrap: pretty;
}

.prose > * + * { margin-top: 16px; }
.lede + .prose { margin-top: 16px; }
.prose p, .prose li { text-wrap: pretty; line-height: 1.6; }

.prose h2,
.section-title {
  margin-top: 40px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.3;
}
.prose h2 + p, .prose h2 + ul { margin-top: 8px; }

.prose ul li {
  position: relative;
  padding-left: 20px;
}
.prose ul li + li { margin-top: 8px; }
.prose ul li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mark);
}

.prose a,
.text-link {
  color: var(--scarlet);
  text-decoration: underline;
  text-decoration-color: rgba(134, 48, 42, 0.35);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  overflow-wrap: anywhere;
  transition: text-decoration-color 160ms var(--ease);
}
.prose a:hover,
.text-link:hover { text-decoration-color: currentColor; }

.note {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.5;
  color: var(--quiet);
}

.signature {
  margin-top: 24px;
  font-family: var(--serif);
  font-size: 19px;
}

@media (min-width: 600px) {
  .sheet { padding: 64px 32px 96px; }
  .title { font-size: 44px; }
  .lede { font-size: 20px; }
}

/* ---------- Game pages ---------- */

.page-theword { --mark: var(--forest); }
.page-enigma { --mark: var(--navy); }

.game-head {
  display: flex;
  align-items: center;
  gap: 20px;
}

.game-head__icon {
  flex: none;
  width: 80px;
  height: 80px;
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(43, 38, 35, 0.12), 0 4px 12px rgba(43, 38, 35, 0.08);
}

.game-head__sub {
  margin-top: 4px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 15px;
  line-height: 1.35;
  color: var(--quiet);
}

.game-head + .lede { margin-top: 24px; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  max-width: 400px;
}
.actions .button { flex: 1 1 120px; }

.small-links--page { margin-top: 8px; }

.split__aside { margin-top: 40px; }
.split__more { margin-top: 8px; }

@media (min-width: 960px) {
  .split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    grid-template-areas:
      "main  board"
      "more  board"
      "more  shot";
    grid-template-rows: auto auto 1fr;
    column-gap: 80px;
    align-items: start;
  }
  .split__main { grid-area: main; }
  .split__aside { grid-area: board; margin-top: 0; }
  .split__more { grid-area: more; }
  .split__shot { grid-area: shot; }
}

/* The board: a game of theWord drawn in its colors */

.board {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: 28px 20px 24px;
  text-align: center;
}

.board__grid {
  display: grid;
  grid-template-columns: repeat(5, 48px);
  gap: 6px;
  justify-content: center;
}

.tile {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 24px;
  line-height: 1;
  color: var(--ink);
  background: var(--linen);
  box-shadow: inset 0 0 0 1.5px var(--tile-edge);
}
.tile--right { background: var(--forest); color: var(--linen); box-shadow: none; }
.tile--near { background: var(--gold); box-shadow: none; }
.tile--out { background: var(--stone); box-shadow: none; }

.board__verse {
  display: block;
  margin-top: 24px;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.4;
  text-wrap: balance;
}

.board__ref {
  display: block;
  margin-top: 4px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 14px;
  color: var(--quiet);
}

.legend {
  margin-top: 16px;
}
.prose .legend li { padding-left: 0; }
.prose .legend li::before { content: none; }
.legend li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 32px;
}
.legend .tile {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  font-size: 13px;
  flex: none;
}

.shot {
  margin-top: 40px;
  text-align: center;
}
.shot img { margin: 0 auto; }
.shot img {
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: 20px;
  border: 1px solid var(--hairline);
  box-shadow: 0 1px 2px rgba(43, 38, 35, 0.10), 0 8px 24px rgba(43, 38, 35, 0.08);
}
.shot figcaption { margin-top: 12px; }

.kjv { margin-top: 48px; max-width: var(--measure); }

@media (min-width: 400px) {
  .board__grid { grid-template-columns: repeat(5, 52px); }
  .board .board__grid .tile { width: 52px; height: 52px; font-size: 26px; }
}

/* ---------- Home: the cover on the left, the first page on the right ---------- */

.home-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 16px 48px;
}

.intro {
  font-size: 20px;
  line-height: 1.5;
  text-wrap: pretty;
}

.home-page .section-title { margin: 48px 0 16px; }

.game__more {
  display: flex;
  margin-top: 4px;
}

.contents { border-top: 1px solid var(--hairline); }
.contents li { border-bottom: 1px solid var(--hairline); }
.contents a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 16px 4px;
  text-decoration: none;
  transition: background-color 160ms var(--ease);
}
.contents a:hover { background: rgba(43, 38, 35, 0.03); }
.contents a:hover .contents__name { text-decoration-color: currentColor; }
.contents__name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 17px;
  color: var(--scarlet);
  text-decoration: underline;
  text-decoration-color: rgba(134, 48, 42, 0.35);
  text-underline-offset: 3px;
}
.contents__what {
  font-size: 16px;
  color: var(--quiet);
  text-align: right;
}

.home-page .site-foot { padding: 0; margin-top: 48px; }

@media (min-width: 900px) {
  .book__side {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }
  .book__side .masthead__inner { justify-content: flex-end; width: 100%; max-width: 576px; padding: 0 20px; }
  .home-page {
    width: 100%;
    max-width: 576px;
    padding: 56px 32px 32px;
  }
}

/* ---------- 404 ---------- */

.lost { text-align: center; padding-top: 72px; }
.lost .actions { margin: 32px auto 0; }

@media (prefers-reduced-motion: reduce) {
  .nav a, .site-foot a, .prose a, .text-link, .contents a { transition: none; }
}

/* ---------- Small pieces ---------- */

.games-list { margin-top: 40px; max-width: 480px; }

.contact-big { margin-top: 4px; }
.contact-big .contact__mail { font-size: clamp(18px, 5.6vw, 22px); }

.button--home { background: var(--scarlet); color: var(--linen); }
.button--home:hover { background: var(--scarlet-deep); }
.button--quiet { color: var(--scarlet); box-shadow: inset 0 0 0 1.5px var(--scarlet); }
.button--quiet:hover { background: rgba(134, 48, 42, 0.06); }

/* ---------- Footer at the foot of short pages ---------- */

body:not(.book) {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
body:not(.book) > main { flex: 1 0 auto; width: 100%; }
body:not(.book) > .masthead,
body:not(.book) > .site-foot { width: 100%; }

/* ---------- The games page: both games side by side on wide screens ---------- */

.column--games { max-width: 1000px; margin: 0 auto; }
.column--games .lede { max-width: var(--measure); }

@media (min-width: 840px) {
  .games-list {
    max-width: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: stretch;
  }
  .games-list .game + .game { margin-top: 0; }
  .games-list .game { display: flex; flex-direction: column; }
  .games-list .game__line { flex: 1 0 auto; }
}

/* ---------- Narrow phones ---------- */

@media (max-width: 359px) {
  .title { font-size: 30px; }
  .game-head { gap: 16px; }
  .game-head__icon { width: 64px; height: 64px; border-radius: 14px; }
}
