/* Self-hosted pixel faces (SIL Open Font License 1.1, via Fontsource) */
@font-face {
  font-family: "Pixelify Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/pixelify-sans-latin-wght-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Silkscreen";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/silkscreen-latin-700-normal.woff2") format("woff2");
}

:root {
  --night-0: #0d0f24;
  --night-1: #141733;
  --night-2: #1b1f3b;
  --pavement: #1a1626;
  --curb: #2a2438;
  --ink: #e8e2d0;
  --ink-dim: #bdb7cc;
  --ink-mute: #8d89a8;
  --soot: #14121c;
  --amber: #f2c14e;
  --amber-hi: #ffd977;
  --amber-lo: #b8892a;
  --teal: #53c2b0;
  --coral: #ff7a59;
  --lilac: #b49cf0;
  --u: 4px; /* one art pixel in the HTML layer */
  color-scheme: dark;
}

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

html { background: var(--pavement); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--pavement);
  color: var(--ink);
  font-family: "Pixelify Sans", ui-rounded, system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-ligatures: none;
  scrollbar-color: var(--curb) var(--pavement);
}

::selection { background: var(--amber); color: var(--soot); }

main {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: minmax(52vh, 1fr) auto;
}

@media (max-width: 760px) {
  main { grid-template-rows: minmax(min(64vh, 72vw + 96px), 1fr) auto; }
}

/* ---------- scene ---------- */

.stage {
  position: relative;
  overflow: hidden;
  background: var(--night-0);
}

#scene {
  position: absolute;
  bottom: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.poke {
  position: absolute;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.poke:focus-visible {
  outline: 2px dashed var(--amber);
  outline-offset: 2px;
}

.bubble {
  position: absolute;
  z-index: 2;
  margin: 0;
  max-width: 13.5rem;
  padding: 8px 12px 9px;
  background: var(--ink);
  color: var(--soot);
  border: var(--u) solid var(--soot);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
  pointer-events: none;
  animation: pop 160ms steps(2, end) both;
}

/* notched pixel corners */
.bubble::before {
  content: "";
  position: absolute;
  inset: calc(var(--u) * -1);
  pointer-events: none;
  background:
    linear-gradient(#1b1f3b, #1b1f3b) top left / var(--u) var(--u) no-repeat,
    linear-gradient(#1b1f3b, #1b1f3b) top right / var(--u) var(--u) no-repeat,
    linear-gradient(#1b1f3b, #1b1f3b) bottom left / var(--u) var(--u) no-repeat,
    linear-gradient(#1b1f3b, #1b1f3b) bottom right / var(--u) var(--u) no-repeat;
}

/* stepped tail */
.bubble::after {
  content: "";
  position: absolute;
  left: var(--tail, 50%);
  bottom: calc(var(--u) * -4);
  width: calc(var(--u) * 3);
  height: calc(var(--u) * 3);
  translate: -50% 0;
  background:
    linear-gradient(var(--soot), var(--soot)) 0 0 / 100% var(--u) no-repeat,
    linear-gradient(var(--ink), var(--ink)) var(--u) 0 / var(--u) var(--u) no-repeat,
    linear-gradient(var(--soot), var(--soot)) var(--u) var(--u) / var(--u) calc(var(--u) * 2) no-repeat;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- dialog ---------- */

.dock {
  padding: 26px 16px 16px;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 14px;
  background: var(--pavement);
}

.dialog {
  position: relative;
  width: 100%;
  max-width: 52rem;
  padding: 32px 30px 22px;
  background: var(--night-0);
  border: var(--u) solid var(--ink);
  outline: 2px solid var(--teal);
  outline-offset: -10px;
}

.dialog::before {
  content: "";
  position: absolute;
  inset: calc(var(--u) * -1);
  pointer-events: none;
  background:
    linear-gradient(var(--pavement), var(--pavement)) top left / var(--u) var(--u) no-repeat,
    linear-gradient(var(--pavement), var(--pavement)) top right / var(--u) var(--u) no-repeat,
    linear-gradient(var(--pavement), var(--pavement)) bottom left / var(--u) var(--u) no-repeat,
    linear-gradient(var(--pavement), var(--pavement)) bottom right / var(--u) var(--u) no-repeat;
}

.nameplate {
  position: absolute;
  top: -26px;
  left: 24px;
  margin: 0;
  padding: 6px 14px 5px;
  background: var(--amber);
  color: var(--soot);
  border: var(--u) solid var(--soot);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Silkscreen", "Pixelify Sans", monospace;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.line {
  margin: 0 0 14px;
  max-width: 22ch;
  font-size: clamp(1.625rem, 1rem + 1.8vw, 2.125rem);
  font-weight: 600;
  line-height: 1.15;
  text-wrap: balance;
  color: var(--ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.line .ch { opacity: 0; }
.line .ch.on { opacity: 1; }

.caret {
  display: inline-block;
  width: 0.5em;
  height: 0.35em;
  margin-left: 0.3em;
  vertical-align: 0.05em;
  color: var(--amber);
  animation: nudge 900ms steps(1, end) infinite;
}

@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

.about {
  margin: 0 0 12px;
  max-width: 60ch;
  color: var(--ink-dim);
}

.stations {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  font-weight: 500;
}

.stations li {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.stations li::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--chip);
}

.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
}

.cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px 10px;
  background: var(--amber);
  color: var(--soot);
  border-bottom: var(--u) solid var(--amber-lo);
  font-family: "Silkscreen", "Pixelify Sans", monospace;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 120ms steps(2, end);
}

.cta::before {
  content: "";
  position: absolute;
  inset: 0 0 calc(var(--u) * -1);
  pointer-events: none;
  background:
    linear-gradient(var(--night-0), var(--night-0)) top left / var(--u) var(--u) no-repeat,
    linear-gradient(var(--night-0), var(--night-0)) top right / var(--u) var(--u) no-repeat,
    linear-gradient(var(--night-0), var(--night-0)) bottom left / var(--u) var(--u) no-repeat,
    linear-gradient(var(--night-0), var(--night-0)) bottom right / var(--u) var(--u) no-repeat;
}

.cta:hover { background: var(--amber-hi); }

.cta:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
  margin-bottom: 2px;
}

.cta:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

.envelope { display: block; }

.addr {
  color: var(--ink);
  font-weight: 500;
  user-select: all;
  overflow-wrap: anywhere;
}

.hint {
  margin: 0 0 0 auto;
  font-size: 0.9375rem;
  color: var(--ink-mute);
}

.legal {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-mute);
}

@media (max-width: 560px) {
  .dock { padding-top: 26px; }
  .dialog { padding: 30px 20px 22px; outline-offset: -8px; }
  .nameplate { left: 16px; font-size: 0.875rem; }
  .stations { gap: 6px 18px; margin-bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .bubble, .caret { animation: none; }
  .cta { transition: none; }
}


.portrait { display: block; background: var(--night-2); outline: 2px solid var(--soot); }
