/* Fonts are served from this site (Latin subsets, SIL Open Font Licence). */

@font-face {
  font-family: "Young Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/young-serif-400.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-serif-400.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-serif-400-italic.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-400.woff2") format("woff2");
}

:root {
  /* Palette */
  --sang: #b80c09;   /* accent: presence, position, the current place */
  --prune: #2d232e;  /* contours, quiet dividers */
  --nuit: #141301;   /* ground */
  --pierre: #b5b0aa; /* notation, secondary text */
  --givre: #eae6e1;  /* primary text */

  --font-display: "Young Serif", Georgia, serif;
  --font-body: "IBM Plex Serif", Georgia, serif;
  --font-notation: "IBM Plex Mono", ui-monospace, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --sheet-pad: clamp(20px, 4vw, 48px);
  --measure: 36rem;

  color-scheme: dark;
}

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

body {
  margin: 0;
  padding: calc(var(--gutter) + 1.25rem) var(--gutter) var(--gutter);
  background: var(--nuit) url("/assets/contours.svg") center / 1600px repeat fixed;
  color: var(--givre);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 2px solid var(--sang);
  outline-offset: 4px;
}

/* The sheet, bounded by a neat line */

.sheet {
  position: relative;
  max-width: 68rem;
  min-height: calc(100vh - 2 * var(--gutter) - 1.25rem);
  margin: 0 auto;
  padding: 0 var(--sheet-pad);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--pierre);
}

/* Grid references, ticked against the neat line */

.grid {
  position: absolute;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-notation);
  font-size: 0.6875rem;
  line-height: 1;
  color: var(--pierre);
}

.grid-x {
  left: 8%;
  right: 8%;
  bottom: 100%;
  padding-bottom: 9px;
}

.grid-x span {
  position: relative;
}

.grid-x span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 3px);
  width: 1px;
  height: 6px;
  background: var(--pierre);
}

.grid-y {
  top: 10%;
  bottom: 10%;
  right: 100%;
  flex-direction: column;
  padding-right: 9px;
}

.grid-y span {
  position: relative;
}

.grid-y span::after {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(100% + 3px);
  width: 6px;
  height: 1px;
  background: var(--pierre);
}

@media (max-width: 40rem) {
  .grid-y {
    display: none;
  }
  .grid-x span:nth-child(even) {
    visibility: hidden;
  }
}

.sheet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--pierre);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.125rem;
  letter-spacing: 0.12em;
}

.mark {
  display: block;
  width: 36px;
  height: 36px;
}

nav {
  display: flex;
  gap: 1.5rem;
  font-family: var(--font-notation);
  font-size: 0.875rem;
}

nav a {
  color: var(--pierre);
  text-decoration: none;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--givre);
  text-decoration: underline;
  text-decoration-color: var(--sang);
  text-underline-offset: 0.35em;
  text-decoration-thickness: 1px;
}

main {
  flex: 1;
}

/* Type */

.display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
}

.display-xl {
  font-size: clamp(2.75rem, 9vw, 5.5rem);
  letter-spacing: 0.06em;
}

.voice,
.tagline,
.catalogue-kind {
  font-style: italic;
  color: var(--pierre);
}

.status,
.sheet-foot,
.back {
  font-family: var(--font-notation);
  font-size: 0.8125rem;
  color: var(--pierre);
}

/* Home: the map field, with the title in a cartouche at the lower right */

.map-field {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: clamp(26rem, 68vh, 42rem);
  margin: 0 calc(-1 * var(--sheet-pad));
  padding: var(--sheet-pad);
  background: url("/assets/terrain.svg") left center / cover no-repeat;
  border-bottom: 1px solid var(--pierre);
}

.cartouche {
  max-width: 30rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--nuit);
  border: 1px solid var(--pierre);
  outline: 1px solid var(--pierre);
  outline-offset: 4px;
}

/* A short Sang rule: the surveyor's mark under a title */
.mark-rule {
  width: 3rem;
  height: 2px;
  margin: 1rem 0 0;
  border: 0;
  background: var(--sang);
}

.tagline {
  margin: 0.75rem 0 0;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

.intro {
  margin: 1.25rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--prune);
}

/* Games */

.catalogue {
  padding: 2.5rem 0 3rem;
  scroll-margin-top: 2rem;
}

.catalogue ol {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--prune);
}

.catalogue a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--prune);
  text-decoration: none;
}

.catalogue-title {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 3.5vw, 2rem);
  line-height: 1.2;
}

.catalogue-kind {
  grid-column: 1;
}

.catalogue .status {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
}

.catalogue a:hover .catalogue-title {
  text-decoration: underline;
  text-decoration-color: var(--sang);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

/* Entries: game and about pages */

.entry {
  max-width: var(--measure);
  padding: clamp(2.5rem, 7vw, 5rem) 0 3rem;
}

.entry-head {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--prune);
}

.entry-head .voice {
  margin: 0.75rem 0 0;
  font-size: 1.25rem;
}

.entry-head .status {
  margin: 0.5rem 0 0;
}

.back {
  margin-top: 3rem;
}

.back a {
  text-decoration: none;
}

.back a:hover {
  color: var(--givre);
}

/* Footer */

.sheet-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--pierre);
}

/* Cookie consent */

.consent {
  position: fixed;
  right: var(--gutter);
  bottom: var(--gutter);
  left: var(--gutter);
  z-index: 10;
  max-width: 26rem;
  margin-left: auto;
  padding: 1.25rem;
  background: var(--nuit);
  border: 1px solid var(--pierre);
  outline: 1px solid var(--pierre);
  outline-offset: 4px;
  font-size: 0.9375rem;
}

.consent[hidden],
.consent-open[hidden] {
  display: none;
}

.consent p {
  margin: 0 0 1rem;
}

.consent-actions {
  display: flex;
  gap: 0.75rem;
}


.consent-open {
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.consent-open:hover {
  color: var(--givre);
  text-decoration: underline;
  text-decoration-color: var(--sang);
}

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

/* Buttons: Allow and Decline carry equal weight, so there is one style */

.button {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: transparent;
  border: 1px solid var(--givre);
  color: var(--givre);
  font: inherit;
  font-family: var(--font-notation);
  font-size: 0.8125rem;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  border-color: var(--sang);
}

.foot-links {
  display: flex;
  gap: 1.25rem;
}

.foot-links a {
  text-decoration: none;
}

.foot-links a:hover {
  color: var(--givre);
  text-decoration: underline;
  text-decoration-color: var(--sang);
}

/* Prose headings, for longer pages such as Privacy */

.prose h2 {
  margin: 2.5rem 0 0.75rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.375rem;
}

.prose code {
  font-family: var(--font-notation);
  font-size: 0.875em;
}

/* Forms */

.form {
  max-width: 26rem;
  margin-top: 2rem;
}

.field {
  margin: 0 0 1.5rem;
  padding: 0;
  border: 0;
}

.field label,
.field legend {
  display: block;
  margin-bottom: 0.375rem;
  padding: 0;
}

.optional {
  color: var(--pierre);
  font-style: italic;
}

.field input[type="text"],
.field input[type="email"] {
  width: 100%;
  padding: 0.625rem 0.75rem;
  background: var(--nuit);
  border: 1px solid var(--pierre);
  border-radius: 0;
  color: var(--givre);
  font: inherit;
}

.field input:focus-visible {
  outline: 2px solid var(--sang);
  outline-offset: 2px;
}

.field .choice {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 1.5rem 0 0;
}

.field input[type="radio"] {
  accent-color: var(--sang);
}

.form-note {
  color: var(--pierre);
  font-size: 0.9375rem;
}

.form-trap {
  position: absolute;
  left: -9999px;
}
