/* Nightjar - the cabinet the games sit in. */

:root {
  --ink:        #12100C;
  --parchment:  #F0E4CC;
  --parchment-2:#C3B294;
  --parchment-3:#8B7C64;
  --brass:      #C79A45;
  --brass-2:    #8A6C31;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  font-family: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  color: var(--parchment);
  background:
    radial-gradient(130% 90% at 50% -20%, #33281D 0%, #1D1710 46%, #0D0A07 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .3;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

.page {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  max-width: 1120px;
  margin-inline: auto;
  padding: clamp(40px, 9vh, 90px) 20px calc(30px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: clamp(30px, 6vh, 56px);
}

/* ----------------------------------------------------------- masthead -- */

.title {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'SOFT' 50, 'opsz' 144, 'wght' 650;
  font-weight: 650;
  font-size: clamp(2.7rem, 11vw, 4.8rem);
  line-height: 1;
  letter-spacing: -.03em;
  margin: 0;
  text-shadow: 0 2px 0 #000, 0 0 60px rgba(199, 154, 69, .16);
}

.stamp {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 0;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--brass);
}
.stamp__rule {
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, var(--brass-2), transparent 85%);
}

.tagline {
  margin: 14px 0 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--brass-2);
}

/* -------------------------------------------------------------- shelf -- */

.shelf {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.entry {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 26px 24px 24px;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(199, 154, 69, .22);
  border-radius: 3px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0) 55%),
    rgba(9, 7, 5, .35);
  box-shadow: 0 20px 40px -30px #000;
  transition: border-color .3s, transform .3s cubic-bezier(.3, 1.1, .5, 1), background .3s;
}

a.entry:hover {
  border-color: var(--brass);
  transform: translateY(-3px);
  background:
    linear-gradient(150deg, rgba(199, 154, 69, .1), rgba(255, 255, 255, 0) 55%),
    rgba(9, 7, 5, .35);
}
a.entry:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

.entry__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.entry__no {
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--brass-2);
}

.entry__name {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'SOFT' 50, 'opsz' 90, 'wght' 600;
  font-weight: 600;
  font-size: 1.7rem;
  line-height: 1.05;
  margin: 6px 0 10px;
  letter-spacing: -.015em;
}

.entry__blurb {
  margin: 0;
  font-size: 12px;
  line-height: 1.75;
  color: var(--parchment-2);
}

.entry__cta {
  display: inline-block;
  margin-top: auto;
  padding-top: 18px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--brass);
}
.entry__cta span {
  display: inline-block;
  transition: transform .3s cubic-bezier(.3, 1.2, .5, 1);
}
a.entry:hover .entry__cta span { transform: translateX(5px); }

.entry--empty {
  border-style: dashed;
  border-color: rgba(199, 154, 69, .14);
  background: none;
  box-shadow: none;
}
.entry--empty .entry__name { color: var(--parchment-3); }
.entry--empty .entry__blurb { color: var(--parchment-3); }

/* Each entry carries a little plate of its own game, above the text. */
.entry__phials,
.entry__plate {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 86px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(199, 154, 69, .14);
}
.entry__phials { align-items: flex-end; }

.phial {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  width: 20px;
  height: 74px;
  padding: 3px;
  border-radius: 3px 3px 10px 10px;
  background: rgba(255, 255, 255, .04);
  box-shadow: inset 0 0 0 1px rgba(240, 228, 204, .16);
}

.phial i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 33% 27%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 45%),
    var(--c);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, .45);
}

a.entry:hover .phial i:last-child {
  animation: hop .7s cubic-bezier(.3, 1.3, .5, 1);
}
@keyframes hop {
  0%   { transform: translateY(0); }
  45%  { transform: translateY(-11px); }
  100% { transform: translateY(0); }
}

/* Four pieces of a plate, one of them not yet home. */
.jig {
  width: 74px;
  height: 74px;
  display: block;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .55));
}

.jig__loose {
  transform: translate(6px, 6px) rotate(4deg);
  transform-origin: 48px 48px;
  transition: transform .45s cubic-bezier(.3, 1.3, .5, 1);
}
a.entry:hover .jig__loose { transform: none; }

/* One box of a grid, part filled. The digits fade up on hover, the way the
   gallows figure does, so every card on the shelf answers a pointer. */
.sud {
  width: 74px;
  height: 74px;
  display: block;
}

.sud text {
  opacity: .45;
  transition: opacity .3s ease;
}
a.entry:hover .sud text { opacity: 1; }
a.entry:hover .sud text:nth-of-type(2) { transition-delay: .06s; }
a.entry:hover .sud text:nth-of-type(3) { transition-delay: .12s; }
a.entry:hover .sud text:nth-of-type(4) { transition-delay: .18s; }
a.entry:hover .sud text:nth-of-type(5) { transition-delay: .24s; }

/* Six letters, three of them ringed. The lozenge draws itself on hover, which
   is exactly what the card is offering to let you do. */
.ws {
  width: 74px;
  height: 74px;
  display: block;
}

.ws rect {
  stroke-dasharray: 152;
  stroke-dashoffset: 152;
  transition: stroke-dashoffset .55s ease;
}
a.entry:hover .ws rect { stroke-dashoffset: 0; }

/* A gallows, and the figure that arrives one wrong letter at a time. */
.noose {
  width: 74px;
  height: 74px;
  display: block;
}

.noose__figure > * {
  opacity: .28;
  transition: opacity .3s ease;
}
a.entry:hover .noose__figure > * { opacity: 1; }
a.entry:hover .noose__figure > :nth-child(2) { transition-delay: .08s; }
a.entry:hover .noose__figure > :nth-child(3) { transition-delay: .16s; }
a.entry:hover .noose__figure > :nth-child(4) { transition-delay: .24s; }

/* The empty shelf still gets a plate, so a row of cards keeps its rhythm. */
.waiting {
  width: 74px;
  height: 74px;
  border: 1px dashed rgba(199, 154, 69, .18);
  border-radius: 3px;
}
.entry--empty .entry__plate { border-bottom-color: rgba(199, 154, 69, .08); }

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

.ledger {
  display: grid;
  gap: 30px;
  padding-top: 10px;
  font-size: 13px;
  line-height: 1.85;
  color: var(--parchment-2);
}
.ledger h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'SOFT' 50, 'opsz' 90, 'wght' 600;
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--parchment);
  letter-spacing: -.01em;
}
.ledger p { margin: 0 0 12px; }
.ledger p:last-child { margin-bottom: 0; }

@media (min-width: 760px) {
  .ledger { grid-template-columns: 1.6fr 1fr; gap: 44px; }
}

/* ---------------------------------------------------------- colophon -- */

.colophon {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid rgba(199, 154, 69, .16);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--parchment-3);
}
.colophon p { margin: 0; }
.colophon abbr { text-decoration: none; border-bottom: 1px dotted currentColor; }
.colophon__clock { color: var(--brass-2); font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .shelf { grid-template-columns: repeat(2, 1fr); }
}

/* One column: the plate goes back beside the text, so three games do not
   cost three screens of scrolling. */
@media (max-width: 600px) {
  .shelf { grid-template-columns: 1fr; }
  .entry { flex-direction: row; align-items: stretch; gap: 18px; padding: 20px; }
  .entry__phials, .entry__plate {
    min-height: 0;
    padding-bottom: 0;
    padding-right: 18px;
    border-bottom: none;
    border-right: 1px solid rgba(199, 154, 69, .14);
  }
  .entry__cta { padding-top: 14px; }
  .phial { width: 17px; height: 62px; }
  .phial i { width: 11px; height: 11px; }
  .jig, .noose, .sud, .ws, .waiting { width: 62px; height: 62px; }
}

@media (max-width: 400px) {
  .entry__phials, .entry__plate { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* A little stack of days, for the archive card. */
.stack { display: flex; flex-direction: column; gap: 5px; width: 74px; }
.stack i {
  height: 20px;
  border: 1px solid rgba(199, 154, 69, .35);
  border-radius: 2px;
  background: linear-gradient(120deg, rgba(199, 154, 69, .14), rgba(255, 255, 255, 0) 70%);
  transition: transform .3s cubic-bezier(.3, 1.2, .5, 1);
}
.stack i:nth-child(2) { transform: translateX(5px); }
.stack i:nth-child(3) { transform: translateX(10px); opacity: .6; }
a.entry:hover .stack i { transform: none; opacity: 1; }
