@font-face {
  font-family: DM;
  src: url(assets/dm-sans.woff2);
}
@font-face {
  font-family: Bask;
  src: url(assets/baskervville.woff2);
}
@font-face {
  font-family: Bask;
  src: url(assets/baskervville-italic.woff2);
  font-style: italic;
}
:root {
  --paper: #f7f3e8;
  --ink: #252720;
  --accent: #24509a;
  --line: #c4bdad;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  color: var(--ink);
  background: var(--paper);
  font-family: DM, Arial, sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background-image: url(assets/grain.png);
}
button,
a,
input,
textarea {
  font: inherit;
}
button,
a {
  color: inherit;
}
button {
  cursor: pointer;
}
button {
  border: 0;
  background: none;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #007c8c;
  outline-offset: 3px;
}
button:disabled {
  cursor: wait;
}
a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
[hidden] {
  display: none !important;
}
header,
footer,
.route {
  padding-inline: clamp(20px, 4.8vw, 82px);
}
header {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
  position: relative;
  z-index: 2;
  background: var(--paper) url(assets/grain.png);
}
.brand,
.header-right,
.city {
  display: flex;
  align-items: center;
}
.brand {
  gap: 13px;
  text-decoration: none;
  font-family: Bask, Georgia, serif;
  font-size: 24px;
  letter-spacing: -1px;
}
.monogram {
  font-family: Bask, Georgia, serif;
  font-style: italic;
  font-size: 23px;
  line-height: 36px;
  text-align: center;
  color: var(--paper);
  background: var(--accent);
  border-radius: 46% 51% 47% 48%;
  width: 39px;
  height: 37px;
  transform: rotate(-8deg);
  letter-spacing: -2px;
}
.header-right {
  gap: 32px;
}
.city {
  gap: 8px;
  font: 12px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.city i {
  height: 8px;
  width: 8px;
  background: var(--accent);
  border-radius: 50%;
}
.accent,
.dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 21px;
  border-radius: 3px;
  font-weight: 650;
  transition:
    background 0.18s,
    transform 0.18s;
}
.accent {
  color: #fff9eb;
  background: var(--accent);
}
.accent:hover,
.dark:hover {
  transform: translateY(-2px);
  background: #17376e;
}
.accent span {
  font-size: 19px;
  line-height: 1;
}
.dark {
  background: var(--ink);
  color: var(--paper);
  padding: 15px 23px;
}
.dark span {
  font-family: Arial;
  font-size: 21px;
  line-height: 1;
}
.world {
  height: clamp(520px, calc(100svh - 218px), 1000px);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.world:after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url(assets/grain.png);
  pointer-events: none;
  z-index: 1;
  opacity: 0.65;
}
#street {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: pan-y;
  opacity: 0;
  transition: opacity 0.7s ease-out;
}
#street.ready {
  opacity: 1;
}
@keyframes rise {
  from {
    opacity: 0;
    translate: 0 14px;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
header > *,
.route > * {
  animation: fade 0.6s ease-out both;
}
.intro > *,
.map-corner,
#story {
  animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
#story {
  animation-duration: 0.4s;
}
.intro > :nth-child(2) {
  animation-delay: 0.1s;
}
.intro > :nth-child(3) {
  animation-delay: 0.2s;
}
.intro > :nth-child(4) {
  animation-delay: 0.28s;
}
.map-corner,
.route > * {
  animation-delay: 0.35s;
}
.intro {
  position: absolute;
  z-index: 2;
  top: clamp(38px, 7.8vh, 105px);
  left: clamp(20px, 4.8vw, 82px);
  max-width: min(400px, 36vw);
  transition: opacity 0.25s;
}
.intro:before {
  content: "";
  position: absolute;
  inset: -35px -48px -28px -50px;
  background: radial-gradient(
    closest-side,
    #f7f3e8 58%,
    #f7f3e8ed 81%,
    transparent 155%
  );
  z-index: -1;
  pointer-events: none;
}
.eyebrow,
.map-corner span,
.num,
#count {
  font: 600 12px var(--mono);
  letter-spacing: 0.1em;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
}

h1,
h2,
p {
  margin: 0;
}
h1 {
  font-family: Bask, Georgia, serif;
  letter-spacing: -0.072em;
  font-weight: 400;
  font-size: clamp(70px, 7.05vw, 123px);
  line-height: 0.92;
  margin: 0 0 22px;
}
h1 em {
  color: var(--accent);
}
.intro p,
#story p {
  font-size: clamp(16px, 1.2vw, 19px);
  line-height: 1.52;
  max-width: 355px;
}
.intro p {
  margin-bottom: 25px;
}
.map-corner {
  position: absolute;
  z-index: 2;
  right: 4.8%;
  top: 25px;
  width: 117px;
  transform: rotate(3deg);
  border: 1px solid #777364;
  background: #f8f4e9;
  box-shadow: 2px 3px 0 #5e594838;
  text-align: center;
  padding: 3px 3px 4px;
}
.map-corner canvas {
  width: 100%;
  display: block;
}
.map-corner span {
  font-size: 10px;
}

.game-tools {
  position: absolute;
  z-index: 3;
  left: 4.8%;
  top: 20px;
  display: flex;
  gap: 7px;
}
.game-tools button,
#pad button {
  width: 44px;
  height: 44px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 3px;
  font: 22px var(--mono);
}
#pad {
  position: absolute;
  right: 4.8%;
  bottom: 20px;
  display: grid;
  grid-template-columns: repeat(3, 44px);
  gap: 4px;
  z-index: 4;
  touch-action: none;
}
#pad button {
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  font-size: 16px;
}
#pad button:first-child {
  grid-column: 2;
}
#pad button:nth-child(2) {
  grid-column: 1;
}
#pad button:active {
  background: #d9c5ab;
}
#story {
  position: absolute;
  z-index: 3;
  left: 4.8%;
  bottom: 25px;
  width: min(380px, 40%);
  background: var(--paper) url(assets/grain.png);
  padding: 22px 25px;
  border: 1px solid var(--ink);
  border-left: 4px solid var(--accent);
  box-shadow: 3px 4px 0 #39332d25;
}
h2 {
  font:
    400 clamp(27px, 3.1vw, 46px)/1.06 Bask,
    Georgia,
    serif;
  letter-spacing: -0.05em;
}
#story h2 {
  margin: 9px 0;
}
#story p {
  font-size: 16px;
}
#story-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}
#story-actions button {
  font-size: 14px;
  font-weight: bold;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 4px 0;
}
#story-actions a {
  font-size: 14px;
}
.route {
  border-block: 1px solid var(--ink);
  padding-top: 15px;
  padding-bottom: 15px;
}
.route-head,
.stops,
footer,
footer div {
  display: flex;
  align-items: center;
}
.route-head {
  justify-content: space-between;
  margin-bottom: 10px;
}
.route-head .eyebrow {
  color: var(--ink);
}
#count {
  font-weight: 400;
  letter-spacing: 0;
  color: #57564c;
}
.stops {
  gap: 0;
}
.stops button {
  flex: 1;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  border-right: 1px solid var(--line);
  padding: 6px clamp(8px, 2.6vw, 46px);
  font:
    400 clamp(19px, 1.9vw, 30px) Bask,
    Georgia,
    serif;
  white-space: nowrap;
}
.stops button:first-child {
  padding-left: 0;
}
.stops button:last-child {
  border: 0;
}
.num {
  font-size: 12px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  letter-spacing: 0;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 50%;
}
.stops button:hover,
.stops button[aria-current] {
  color: var(--accent);
}
.stops .visited .num {
  color: var(--paper);
  background: var(--accent);
}
footer {
  justify-content: space-between;
  min-height: 42px;
  font: 12px var(--mono);
  color: #59594e;
}
footer div {
  gap: 18px;
}
footer a,
footer button {
  font: inherit;
  text-decoration: none;
  padding: 6px 0;
}
footer a:hover,
footer button:hover {
  text-decoration: underline;
}
dialog {
  border: 1px solid var(--ink);
  border-radius: 3px;
  padding: 0;
  width: min(500px, calc(100% - 28px));
  max-height: 90svh;
  background: var(--paper) url(assets/grain.png);
  color: var(--ink);
}
dialog::backdrop {
  background: #25251ec2;
}
dialog[open] {
  animation: panel-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
dialog[open]::backdrop {
  animation: backdrop-in 0.2s ease-out;
}
@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
}
@keyframes backdrop-in {
  from {
    opacity: 0;
  }
}
.panel-inner {
  position: relative;
  padding: 35px;
}
.close {
  position: absolute;
  right: 12px;
  top: 9px;
  font-size: 28px;
  width: 38px;
  height: 38px;
}
.panel-inner h2 {
  padding-right: 18px;
}
.panel-inner p {
  margin: 15px 0;
  line-height: 1.5;
}
.panel-inner label {
  display: block;
  font-weight: 600;
  margin: 14px 0;
}
.panel-inner label span {
  font-weight: 400;
  font-size: 14px;
}
.panel-inner input,
.panel-inner textarea {
  width: 100%;
  border: 1px solid #958d7b;
  border-radius: 2px;
  background: #fffdf4;
  padding: 10px;
  display: block;
  margin-top: 5px;
  resize: vertical;
}
.trap {
  position: absolute;
  left: -9999px;
}
.profile {
  font-size: 14px;
}
.form-status {
  color: var(--accent);
}
.playing .intro {
  display: none;
}
@media (max-width: 700px) {
  header {
    height: 58px;
  }
  .brand {
    font-size: 19px;
    gap: 7px;
  }
  .monogram {
    width: 32px;
    height: 31px;
    line-height: 31px;
    font-size: 20px;
  }
  .city {
    display: none;
  }
  .accent {
    padding: 9px 13px;
  }
  .world {
    height: clamp(540px, calc(100svh - 195px), 820px);
  }
  .intro {
    top: 24px;
    max-width: 74%;
    left: 20px;
  }
  .intro:before {
    inset: -20px -22px -8px -25px;
  }

  h1 {
    font-size: clamp(52px, 10.6vw, 68px);
    margin: 0 0 12px;
  }
  .intro p {
    font-size: 15px;
    line-height: 1.4;
    width: min(250px, 100%);
    margin-bottom: 13px;
  }
  .dark {
    font-size: 14px;
    padding: 10px 14px;
  }
  .map-corner {
    top: 18px;
    right: 14px;
    width: 62px;
  }
  .map-corner span {
    font-size: 7px;
  }

  .route {
    padding-block: 10px;
  }
  .route-head {
    margin-bottom: 5px;
  }
  .stops {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .stops button,
  .stops button:first-child {
    font-size: 17px;
    padding: 4px 0;
    gap: 7px;
    border: 0;
  }
  .num {
    width: 22px;
    height: 22px;
    font-size: 10px;
  }
  .route-head .eyebrow,
  #count {
    font-size: 10px;
  }
  footer {
    font-size: 10px;
    gap: 8px;
  }
  footer div {
    gap: 10px;
  }
  .playing .map-corner {
    width: 68px;
  }
  .game-tools {
    top: 16px;
  }
  #story {
    left: 14px;
    top: 73px;
    bottom: auto;
    width: calc(100% - 28px);
    padding: 13px 17px;
  }
  #story p {
    font-size: 15px;
  }
  #story h2 {
    font-size: 25px;
    margin: 4px 0;
  }
  #story-actions {
    margin-top: 7px;
  }
  .panel-inner {
    padding: 28px 21px;
  }
  #pad {
    bottom: 12px;
    right: 12px;
  }
}
@media (max-height: 550px) and (min-width: 701px) {
  .world {
    min-height: 430px;
  }
  .intro {
    top: 22px;
  }
  h1 {
    font-size: 64px;
  }
  .intro p {
    font-size: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
  dialog[open],
  dialog[open]::backdrop {
    animation: none;
  }
}
h1 {
  white-space: nowrap;
}
header {
  position: sticky;
  top: 0;
  z-index: 6;
}
.direct {
  display: block;
  margin-bottom: 10px;
}
.entry-help {
  margin-top: 11px;
  font: 12px var(--mono);
  color: #5c584c;
}
.touch-tip {
  display: none;
}
@media (pointer: coarse) {
  .keyboard-tip {
    display: none;
  }
  .touch-tip {
    display: inline;
  }
}
#info p {
  white-space: pre-line;
}
