/* The game's own UI theme (src/ui/theme.zig), carried onto the page: one gold accent, bronze
   frames, bone text on near-black, boxes with their corner pixel left out. */
:root {
  --bone: #e8dfcf;
  --ash: #b3a898;
  --dust: #9a8e7e;
  --gold: #e6aa46;
  --prize: #ffecaa;
  --bronze: #a05a28;
  --ink: #ba885c;
  --dark: #0b0908;
  --panel: #16110e;
  --hover: #3d2817;
  --danger: #e5604f;

  --px: 2px; /* a game pixel at the page's scale: borders, notches, the rule */
  --measure: 34rem;
  --gutter: clamp(1rem, 5vw, 3rem);
}

* { box-sizing: border-box; }

html {
  background: var(--dark);
  color: var(--bone);
  font: 400 1.1875rem/1.62 Alegreya, Georgia, serif;
  -webkit-font-smoothing: antialiased;
}

body { margin: 0; }

img { display: block; max-width: 100%; }

/* Every shot is the game's 320x180, scaled up without smoothing: the pixel pass, as played. */
.hero-shot, .shot img, h1 img, .home img { image-rendering: pixelated; }

p { margin: 0 0 1em; }

a { color: var(--gold); }
a:focus-visible, .play:focus-visible { outline: var(--px) solid var(--prize); outline-offset: 4px; }

/* The hero: the pit filling the screen, the title standing on its dark floor. */
.hero {
  position: relative;
  min-height: min(92vh, 56.25vw + 16rem);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgb(11 9 8 / 0) 30%, rgb(11 9 8 / 0.75) 62%, var(--dark) 94%);
}

/* On the same column as the reading below, so the title and the text share a left edge. */
.hero-text {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(2rem, 5vh, 3.5rem);
}

h1 { margin: 0; line-height: 0; }
h1 img { width: min(100%, 684px); height: auto; } /* the art is at the title screen's size; twice that here */

/* title.zig's rule: bronze either side of a gold diamond. */
.rule {
  --diamond: 7px;
  position: relative;
  height: var(--px);
  margin: 1.1rem 0 1.4rem;
  width: min(100%, 684px);
  background: linear-gradient(to right, var(--bronze) calc(50% - 1.2rem), transparent 0 calc(50% + 1.2rem), var(--bronze) 0);
}
.rule::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--diamond) * 2);
  height: calc(var(--diamond) * 2);
  background: var(--gold);
  transform: translate(-50%, -50%) rotate(45deg) scale(0.72);
}

.tagline {
  font-size: 1.375rem;
  line-height: 1.4;
  color: var(--bone);
  max-width: 28rem;
  margin-bottom: 1.75rem;
}

/* A button as the game draws one: a panel with its corner pixels out, gold when it's the way on. */
.play {
  --notch: var(--px);
  display: inline-block;
  padding: 0.7rem 1.6rem 0.75rem;
  font: 500 1.125rem/1.2 Alegreya, Georgia, serif;
  color: var(--bone);
  text-decoration: none;
  background: var(--panel);
  border: var(--px) solid var(--gold);
  clip-path: polygon(
    var(--notch) 0, calc(100% - var(--notch)) 0, calc(100% - var(--notch)) var(--notch), 100% var(--notch),
    100% calc(100% - var(--notch)), calc(100% - var(--notch)) calc(100% - var(--notch)), calc(100% - var(--notch)) 100%,
    var(--notch) 100%, var(--notch) calc(100% - var(--notch)), 0 calc(100% - var(--notch)), 0 var(--notch), var(--notch) var(--notch));
  transition: background-color 120ms linear;
}
.play:hover { background: var(--hover); }

/* The page below: one reading column, the shots breaking out of it. */
main {
  padding: clamp(1.5rem, 4vh, 3rem) var(--gutter) 2rem;
}

main > section {
  max-width: var(--measure);
  margin: 0 auto;
}

.story p:first-child {
  font-size: 1.375rem;
  line-height: 1.5;
}

.shot {
  margin: clamp(3rem, 9vh, 5.5rem) auto;
  max-width: 60rem;
}
.shot img {
  width: 100%;
  height: auto;
  border: var(--px) solid var(--bronze);
}
.shot figcaption {
  margin-top: 0.7rem;
  font-style: italic;
  color: var(--ash);
}

h2 {
  margin: 0 0 0.6rem;
  font: 500 1.625rem/1.25 Alegreya, Georgia, serif;
  color: var(--gold);
}

section > p { color: var(--ash); }
.story > p { color: var(--bone); }

/* The ledger: numbers in the Warden's dried ink, the names not there. */
.ledger ol {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
  border-top: var(--px) solid rgb(160 90 40 / 0.45);
}
.ledger li {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.55rem 0 0.6rem;
  border-bottom: var(--px) solid rgb(160 90 40 / 0.45);
}
.ledger .number {
  min-width: 3ch;
  font-size: 1.25rem;
  font-variant-numeric: oldstyle-nums;
  color: var(--ink);
}
.ledger .name {
  color: var(--dust);
  letter-spacing: 0.1em;
}

.keys {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.3rem 2rem;
  margin: 1.4rem 0 1.8rem;
}
.keys div { display: flex; gap: 1rem; align-items: baseline; }
.keys dt {
  min-width: 6.5rem;
  color: var(--bone);
  font-weight: 500;
}
.keys dd { margin: 0; color: var(--ash); }

/* The playtest's door: the title, one field, and what a playtester needs to know. */
.door main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: clamp(2.5rem, 8vh, 5rem);
  padding-bottom: clamp(2.5rem, 8vh, 5rem);
}
.door section { width: 100%; }
.door section > p { color: var(--ash); }

.home { display: inline-block; line-height: 0; }
.home img { width: min(100%, 513px); height: auto; } /* one and a half times the art: smaller than the home page's */

.password { margin: 0 0 2.2rem; }
.password label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--ash);
}
.field { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.field input {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.65rem 0.9rem;
  font: 400 1.125rem/1.3 Alegreya, Georgia, serif;
  color: var(--bone);
  background: var(--dark);
  border: var(--px) solid var(--bronze);
  border-radius: 0;
}
.field input:focus-visible { outline: none; border-color: var(--gold); }
.field .play { cursor: pointer; }
.wrong { margin: 0.7rem 0 0; color: var(--danger); }

footer {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 3rem auto 0;
  padding: 1.5rem var(--gutter) 3rem;
  font-size: 0.95rem;
  color: var(--dust);
}

/* Narrow: the shot as a band on top, the title stepping onto its dark foot, not covering it. */
@media (max-width: 40rem) {
  .hero { display: block; min-height: 0; }
  .hero-shot { position: relative; height: auto; aspect-ratio: 16 / 9; }
  .hero::after { bottom: auto; height: calc(56.25vw + 1px); background: linear-gradient(to bottom, rgb(11 9 8 / 0) 55%, var(--dark)); }
  .hero-text { margin-top: -2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .play { transition: none; }
}
