@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("../fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  /* Teal and amber are the game's own room-zone colours: ready and incomplete. */
  --paper: #F4ECDB;
  --ink: #232B5C;
  --ink-soft: #4A527F;
  --sheet: #2C3A78;
  --sheet-line: #B9BFD6;
  --cream: #F4ECDB;
  --teal: #2E8C8A;
  --teal-light: #7FD6CF;
  --amber: #F2B441;
  --amber-deep: #8A4F0F;

  /* Type scale: 1.25 ratio from an 18px base. */
  --step-0: 1.125rem;
  --step-1: 1.406rem;
  --step-small: 0.9rem;

  /* One plan pixel, in CSS pixels. It must land on whole device pixels so the art stays crisp:
     half a pixel on phones, which is exact on a 2x screen, then 1px and up. */
  --px: 0.5px;
  --logo-px: 3px;
  --gutter: 16px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.5 "Barlow", "Trebuchet MS", sans-serif;
}

img { display: block; image-rendering: pixelated; }

/* ---------- Paper column ---------- */

.intro {
  padding: 32px var(--gutter) 40px;
}

h1 { margin: 0; line-height: 1; }

.tagline {
  display: block;
  margin-top: 16px;
  font: 600 var(--step-0)/1.2 "Barlow Condensed", "Arial Narrow", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.logo {
  width: calc(114 * var(--logo-px));
  max-width: 100%;
  height: auto;
}

.lead {
  margin: 32px 0 0;
  max-width: 27em;
  font-size: var(--step-1);
  line-height: 1.35;
  font-weight: 500;
}

.inspection {
  margin-top: 40px;
  max-width: 27rem;
  border-top: 4px solid var(--ink);
  padding-top: 12px;
}

.inspection-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}

.inspection h2 {
  margin: 0;
  font-size: var(--step-0);
  font-weight: 500;
}

.tag {
  font: 600 var(--step-small)/1 "Barlow Condensed", "Arial Narrow", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber-deep);
}

.inspection ul {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.inspection li {
  display: grid;
  grid-template-columns: 12px 1fr;
  column-gap: 12px;
  align-items: baseline;
}

.inspection li::before {
  content: "";
  width: 12px;
  height: 12px;
  background: var(--amber);
  box-shadow: inset 0 0 0 2px var(--ink);
}

.inspection li.done::before { background: var(--teal); }

.inspection p {
  margin: 12px 0 0;
  color: var(--ink-soft);
}

/* ---------- Newsletter signup ---------- */

.signup {
  margin-top: 40px;
  max-width: 27rem;
  border-top: 4px solid var(--ink);
  padding-top: 12px;
}

.signup h2 {
  margin: 0;
  font-size: var(--step-0);
  font-weight: 500;
}

.signup form { margin-top: 8px; }

.signup label {
  display: block;
  margin-bottom: 4px;
  font-size: var(--step-small);
}

.signup-row {
  display: flex;
  gap: 8px;
}

.signup input[type="email"] {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 10px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: #FFFBF2;
  color: var(--ink);
  font: inherit;
}

button {
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--cream);
  font: 500 var(--step-0)/1.2 "Barlow", "Trebuchet MS", sans-serif;
  cursor: pointer;
}

button:hover { background: var(--sheet); }

/* A field only bots fill in. Moved off screen, as hiding it outright fools fewer of them. */
.signup-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.signup p {
  margin: 8px 0 0;
  font-size: var(--step-small);
  line-height: 1.35;
  color: var(--ink-soft);
}

/* ---------- Text pages ---------- */

.page-body { max-width: 34em; }
.page-body p { margin: 16px 0 0; }
.page-body form { margin-top: 24px; }

.page-body h2 {
  margin: 28px 0 0;
  font-size: var(--step-0);
  font-weight: 500;
}

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

.site-foot {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  padding: 16px var(--gutter);
  border-top: 4px solid var(--ink);
  font-size: var(--step-small);
  overflow-wrap: anywhere;
}

/* ---------- Blueprint sheet ---------- */

.sheet {
  background: var(--sheet);
  color: var(--cream);
  padding: 24px 0 var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.plan {
  position: relative;
  flex: none;
  width: calc(672 * var(--px));
  height: calc(448 * var(--px));
}

.plan > img { width: 100%; height: 100%; }

/* Live text rather than part of the image, so the labels stay readable at every plan scale.
   Each sits in the bottom-left corner of its room: --room-x is the room's left wall in tiles,
   --room-floor its bottom wall. */
.plan-rooms {
  list-style: none;
  margin: 0;
  padding: 0;
}

.plan-rooms li {
  position: absolute;
  left: calc((var(--room-x) * 32 + 8) * var(--px));
  bottom: calc((14 - var(--room-floor)) * 32 * var(--px) + 4px);
  max-width: calc(184 * var(--px));
  font: 600 10px/1.2 "Barlow Condensed", "Arial Narrow", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream);
}

.room-gp { --room-x: 1; --room-floor: 6; }
.room-ward { --room-x: 7; --room-floor: 6; }
.room-pharmacy { --room-x: 14; --room-floor: 6; }
.room-reception { --room-x: 1; --room-floor: 13; }
.room-waiting { --room-x: 8; --room-floor: 13; }

.plan-rooms .room-east {
  --room-x: 14;
  --room-floor: 13;
  padding: 1px 4px;
  background: var(--sheet);
  color: var(--amber);
}

#nurse {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(16 * var(--px));
  height: calc(32 * var(--px));
  background: url("nurse-idle.png") 0 0 / calc(384 * var(--px)) calc(32 * var(--px)) no-repeat;
  background-position-x: calc(-288 * var(--px));
  image-rendering: pixelated;
  transform: translate(calc(72 * var(--px)), calc(208 * var(--px)));
}

/* Without enough device pixels for the half-size plan, nearest-neighbour would drop its thin lines. */
@media (max-width: 719px) and (max-resolution: 1.99dppx) {
  .plan > img, #nurse { image-rendering: auto; }
}

.titleblock {
  align-self: stretch;
  margin: 24px var(--gutter) 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 2px solid var(--cream);
}

.titleblock div {
  padding: 6px 8px 8px;
  border: 0 solid var(--sheet-line);
  border-width: 0 1px 1px 0;
  min-width: 0;
}

.titleblock div:nth-child(2n) { border-right: 0; }
.titleblock div:nth-last-child(-n+2) { border-bottom: 0; }

.titleblock dt {
  font: 600 11px/1.2 "Barlow Condensed", "Arial Narrow", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sheet-line);
}

.titleblock dd {
  margin: 2px 0 0;
  font-size: var(--step-small);
  font-weight: 500;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

dl { margin: 0; }

/* ---------- Release roadmap ---------- */

/* A second blueprint sheet. Each stage is a room, coloured like the game's zones:
   solid teal is finished, hatched amber is being worked on, dashed is not started. */
.roadmap {
  --wall: 3px;
  --nurse-px: 2px;
  position: relative;
  padding: 40px var(--gutter);
  border-top: 4px solid var(--ink);
  background: var(--sheet);
  color: var(--cream);
}

.roadmap h2 {
  margin: 0;
  font-size: var(--step-1);
  font-weight: 500;
  line-height: 1.2;
}

.roadmap-sub {
  margin: 4px 0 0;
  font-size: var(--step-small);
  color: var(--sheet-line);
}

.stages {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
}

.stage {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
}

.stage-room {
  position: relative;
  margin-top: calc(-1 * var(--wall));
  padding: 8px;
  border: var(--wall) dashed var(--sheet-line);
  color: var(--sheet-line);
}

.stage:first-child .stage-room { margin-top: 0; }

.stage-number {
  font-size: var(--step-1);
  font-weight: 500;
  line-height: 1;
}

.stage-done .stage-room {
  border: var(--wall) solid var(--cream);
  background: var(--teal);
  color: var(--cream);
}

.stage-now .stage-room {
  z-index: 1;
  border: var(--wall) solid var(--amber);
  background: repeating-linear-gradient(135deg, var(--amber) 0 3px, var(--sheet) 3px 10px);
  color: var(--amber);
}

.stage-now .stage-number {
  display: inline-block;
  padding: 3px 7px;
  background: var(--sheet);
}

/* The nurse from the floor plan, standing at the current stage. To move it on, move
   this element to the next stage in app/views/roadmap.php. */
.stage-nurse {
  position: absolute;
  right: 6px;
  bottom: 0;
  width: calc(16 * var(--nurse-px));
  height: calc(32 * var(--nurse-px));
  background: url("nurse-idle.png") calc(-288 * var(--nurse-px)) 0 / calc(384 * var(--nurse-px)) calc(32 * var(--nurse-px)) no-repeat;
  image-rendering: pixelated;
}

.stage-text { padding: 0 0 20px 14px; }
.stage:last-child .stage-text { padding-bottom: 0; }

.stage-text h3 {
  margin: 0;
  font-size: var(--step-0);
  font-weight: 500;
  line-height: 1.2;
}

.stage-status {
  display: block;
  margin-top: 4px;
  font: 600 var(--step-small)/1.2 "Barlow Condensed", "Arial Narrow", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sheet-line);
}

.stage-done .stage-status { color: var(--teal-light); }
.stage-now .stage-status { color: var(--amber); }

.stage-text p {
  margin: 6px 0 0;
  font-size: var(--step-small);
  line-height: 1.35;
  color: var(--cream);
}

.roadmap-note {
  margin: 24px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--sheet-line);
  font-size: var(--step-small);
}

.roadmap a:hover { color: var(--amber); }
.roadmap :focus-visible { outline-color: var(--cream); }

/* ---------- About the game ---------- */

.about {
  padding: 48px var(--gutter);
  border-top: 4px solid var(--ink);
}

.about h2 {
  margin: 0;
  max-width: 16em;
  font-size: var(--step-1);
  line-height: 1.2;
  font-weight: 500;
}

.about-intro p { margin: 16px 0 0; max-width: 34em; }
.about-intro .about-note { color: var(--ink-soft); }
.about-intro ul { margin: 8px 0 0; padding-left: 1.2em; list-style: square; }

/* ---------- Links ---------- */

a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--teal); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.logo-link { display: inline-block; }

.tag.missing { color: #A3262A; }

.intro h1.page-title {
  margin: 32px 0 0;
  font-size: 2.2rem;
  line-height: 1.1;
  font-weight: 500;
}

/* ---------- Wider screens ---------- */

@media (min-width: 720px) {
  :root { --px: 1px; --logo-px: 4px; --gutter: 32px; }
  .plan-rooms li { font-size: 11px; }
  .intro { padding-top: 48px; padding-bottom: 48px; }
  .sheet { padding-top: 32px; }
  .titleblock {
    align-self: flex-end;
    width: calc(672 * var(--px));
    margin-right: auto;
    margin-left: auto;
  }

  /* The rooms line up along a corridor, with the nurse standing in it. */
  .roadmap { padding-top: 48px; padding-bottom: 48px; }
  .stages {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-top: 32px;
    padding-top: calc(32 * var(--nurse-px) + 12px);
    border-top: var(--wall) solid var(--sheet-line);
  }
  .stage { display: block; }
  .stage-room {
    height: 88px;
    margin-top: 0;
    margin-left: calc(-1 * var(--wall));
  }
  .stage:first-child .stage-room { margin-left: 0; }
  .stage-nurse { right: auto; left: 12px; bottom: calc(100% + var(--wall)); }
  .stage-text { padding: 14px 16px 0 0; }
}

@media (min-width: 1160px) {
  body {
    grid-template-rows: none;
    grid-template-columns: minmax(420px, 38%) 1fr;
  }
  .intro, .sheet { min-height: 100vh; min-height: 100dvh; }
  .site-foot { padding-left: 48px; padding-right: 48px; }
  .roadmap {
    grid-column: 1 / -1;
    padding: 64px 48px;
  }
  .stage-text { padding-right: 24px; }
  .about {
    grid-column: 1 / -1;
    padding: 64px 48px;
  }
  .intro {
    padding: 56px 40px 40px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .sheet {
    justify-content: center;
    padding: 40px;
    position: relative;
  }
  /* The drawing frame every printed sheet has. */
  .sheet::before {
    content: "";
    position: absolute;
    inset: 16px;
    border: 1px solid var(--sheet-line);
    pointer-events: none;
  }
}

@media (min-width: 1160px) and (min-height: 700px) {
  .titleblock { grid-template-columns: repeat(4, 1fr); }
  .titleblock div { border-bottom: 0; }
  .titleblock div:nth-child(2n) { border-right: 1px solid var(--sheet-line); }
  .titleblock div:last-child { border-right: 0; }
}

@media (min-width: 1760px) and (min-height: 960px) {
  :root { --logo-px: 5px; }
  .roadmap { --nurse-px: 3px; }
  .stage-room { height: 120px; }
}

/* Larger plans, only where they still land on whole device pixels. */
@media (min-width: 1760px) and (min-height: 960px) and (resolution: 2dppx) {
  :root { --px: 1.5px; }
}

@media (min-width: 2400px) and (min-height: 1100px) {
  :root { --px: 2px; }
}
  