@font-face {
  font-family: "VT323";
  src: url("./fonts/vt323.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #0c1215;
  --surface: #192326;
  --line: #445346;
  --text: #dfd5bb;
  --muted: #a7b5a0;
  --gold: #e3be79;
  --mono: "VT323", monospace;
  --sans: monospace;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 18px var(--mono);
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}
.shell {
  width: min(1440px, 100%);
  margin: auto;
  padding: 0 32px;
}
.header {
  height: 64px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  color: #b4bdab;
}
.header a:hover,
footer a:hover {
  color: var(--gold);
}
.game-frame {
  background: #111b1c;
  border: 3px solid #354237;
  box-shadow:
    0 0 0 2px #080e10,
    0 8px 0 #080e10;
}
.world-wrap {
  position: relative;
  overflow: hidden;
}
canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
}
.building-access {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.building-access button {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--h);
  background: transparent;
  border: 0;
  pointer-events: auto;
}
.building-access button:hover {
  outline: 2px dashed #dfc18a66;
  outline-offset: 3px;
}
.building-access button:focus-visible {
  outline: 3px dashed var(--gold);
  outline-offset: 3px;
}
.interact {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: #17211ff2;
  border: 2px solid #9c8c60;
  padding: 8px 16px;
  color: var(--gold);
  white-space: nowrap;
  box-shadow: 3px 3px #080f11;
}
.interact[hidden] {
  display: none;
}
kbd {
  display: inline-block;
  background: #27352c;
  border: 1px solid #67725b;
  border-bottom: 3px solid #515b48;
  padding: 1px 5px;
  margin: 0 2px;
  font: 16px var(--mono);
  color: #e4d7b5;
}
.game-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 16px 22px;
  border-top: 3px solid #354237;
  min-height: 70px;
}
.keyboard-hint {
  display: flex;
  align-items: center;
  gap: 24px;
  color: #b1b9a2;
  font-size: 18px;
}
.hint-dot {
  padding: 0 8px;
}
.game-options {
  display: flex;
  gap: 18px;
}
.game-options button {
  border: 0;
  padding: 5px;
  background: none;
  color: #a9b69f;
  white-space: nowrap;
  font-size: 18px;
}
.game-options button[aria-pressed="true"] {
  color: var(--gold);
}
.touch-pad {
  display: none;
}
.touch-pad button {
  width: 44px;
  height: 44px;
  border: 2px solid #65725b;
  box-shadow: 2px 2px #070e0f;
  background: #26352b;
  color: var(--gold);
  touch-action: none;
  user-select: none;
}
.touch-pad button:active {
  background: #596247;
}
footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 24px 0;
  color: #9fad96;
  font-size: 20px;
}
footer > span {
  color: #5f715e;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
dialog {
  padding: 0;
  width: min(850px, calc(100% - 32px));
  max-height: 85dvh;
  background: #172226;
  color: var(--text);
  border: 1px solid #718172;
  box-shadow: 0 25px 100px #0008;
}
dialog::backdrop {
  background: #070f15bb;
  backdrop-filter: blur(5px);
}
.panel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #1f2c2d;
  border-bottom: 1px solid var(--line);
  color: var(--gold);
  font: 11px var(--mono);
  letter-spacing: 1px;
}
.panel-top button {
  border: 0;
  background: none;
  font-size: 20px;
  padding: 6px;
}
.panel-content {
  padding: 30px;
}
.panel-content h2 {
  font-size: 36px;
  font-weight: 500;
  margin: 0 0 10px;
  letter-spacing: -1px;
  color: var(--gold);
}
.panel-content p {
  line-height: 1.75;
  color: #b8c8bf;
  margin: 8px 0 22px;
}
.panel-lead {
  max-width: 620px;
}
.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.project-card {
  border: 1px solid #3b4b43;
  background: #1a2929;
  padding: 22px;
}
.project-card h3 {
  margin: 0 0 10px;
  font-size: 21px;
  font-weight: 500;
}
.project-card p {
  font-size: 15px;
  margin: 10px 0 18px;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font: 10px var(--mono);
  color: #cab785;
}
.tags span {
  padding: 4px 7px;
  background: #30382e;
}
.project-card a,
.text-link {
  font: 12px var(--mono);
  color: var(--gold);
  border-bottom: 1px solid #7c7654;
  padding-bottom: 3px;
  display: inline-block;
}
.project-links {
  display: flex;
  gap: 18px;
}
.panel-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 17px 24px;
  font: 10px var(--mono);
  color: var(--muted);
}
.panel-footer button {
  font: 10px var(--mono);
  background: none;
  border: 0;
  color: var(--gold);
}
.panel-footer kbd {
  margin-left: 10px;
}
.timeline {
  margin: 25px 0;
  padding-left: 23px;
  border-left: 1px solid #536c59;
}
.timeline article {
  position: relative;
  margin-bottom: 25px;
}
.timeline article:before {
  content: "";
  position: absolute;
  left: -28px;
  top: 5px;
  width: 8px;
  height: 8px;
  background: var(--gold);
}
.timeline small {
  font: 11px var(--mono);
  color: var(--gold);
}
.timeline h3 {
  margin: 8px 0;
  font-size: 21px;
}
.timeline p {
  margin: 0;
}
.about-details {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.about-details span {
  padding: 9px 13px;
  border: 1px solid #425349;
  font: 12px var(--mono);
  color: #bbcbbb;
}
.quote {
  border-left: 2px solid var(--gold);
  padding: 10px 20px;
  color: var(--gold) !important;
}
.inline-links {
  display: flex;
  gap: 25px;
  margin: 28px 0 0;
}
.tech-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  margin: 25px 0;
}
.tech-list article {
  padding: 19px;
  border: 1px solid #3b4b43;
}
.tech-list h3 {
  font-size: 17px;
  color: var(--gold);
  margin: 0 0 8px;
}
.tech-list p {
  font-size: 15px;
  margin: 0;
}

dialog {
  border: 4px solid #899075;
  box-shadow:
    0 0 0 3px #303f34,
    8px 8px #050c0e;
}
dialog::backdrop {
  backdrop-filter: none;
}
.panel-top,
.panel-footer {
  background: #243229;
}
.panel-content {
  font-family: monospace;
  font-size: 16px;
}
.panel-content h2 {
  font-family: var(--mono);
  letter-spacing: 0;
  font-size: 40px;
}
.panel-top,
.panel-footer {
  font-size: 16px;
}
.panel-footer button,
.project-card a,
.text-link {
  font-size: 17px;
}
@media (max-width: 1000px) {
  .shell {
    padding: 0 20px;
  }
  .keyboard-hint {
    gap: 14px;
    font-size: 16px;
  }
  .game-options {
    gap: 8px;
  }
}
@media (max-width: 700px) {
  .shell {
    padding: 0 10px;
  }
  .header {
    height: 54px;
    font-size: 19px;
  }
  .game-frame {
    border-width: 2px;
  }
  .game-bottom {
    flex-wrap: wrap;
    justify-content: center;
    padding: 12px;
    gap: 16px;
  }
  .keyboard-hint {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  .keyboard-hint > span:last-child {
    font-size: 16px;
  }
  .touch-pad {
    display: grid;
    grid-template-columns: repeat(3, 44px);
    gap: 4px;
  }
  .touch-pad [data-move="up"] {
    grid-column: 2;
  }
  .touch-pad [data-move="left"] {
    grid-row: 2;
    grid-column: 1;
  }
  .touch-pad [data-move="down"] {
    grid-row: 2;
    grid-column: 2;
  }
  .touch-pad [data-move="right"] {
    grid-row: 2;
    grid-column: 3;
  }
  .game-options {
    flex-direction: column;
    gap: 12px;
  }
  .interact {
    bottom: 8px;
    font-size: 16px;
    padding: 5px 9px;
  }
  .project-grid,
  .tech-list {
    grid-template-columns: 1fr;
  }
  .panel-content {
    padding: 20px;
  }
  .panel-footer > span {
    display: none;
  }
  .panel-footer button {
    margin-left: auto;
  }
  .inline-links {
    flex-wrap: wrap;
  }
  footer {
    padding: 20px;
  }
}
@media (pointer: coarse) and (min-width: 701px) {
  .touch-pad {
    display: flex;
    gap: 5px;
  }
  .keyboard-hint {
    flex-direction: column;
    gap: 7px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* Keep the keyboard focus ring inside the clipped game viewport. */
canvas:focus-visible {
  outline-offset: -3px;
}
