@font-face {
  font-family: "Pixelify Sans";
  src: url("../fonts/PixelifySans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "DotGothic16";
  src: url("../fonts/DotGothic16-subset.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #100e1b;
  --panel: #1c182b;
  --raised: #272137;
  --border: #3c334f;
  --text: #f4eff9;
  --muted: #a99fb9;
  --mint: #97e5c2;
  --gold: #eac184;
  --lilac: #b9a3f0;
  --red: #ee8d9d;
  --outline: #0a0712;
  --mint-dark: #3f8f74;
  --gold-dark: #9a6a2c;
  --red-dark: #8a3a4c;
  --ward: #83d2e5;
  --ground: 128px;
  --tile: 512px;
  --slime: 128px;
  --dodge: calc(50vw - 44px);
  --display: "Pixelify Sans", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color-scheme: dark;
}

:lang(ja) {
  --display: "DotGothic16", "Pixelify Sans", system-ui, sans-serif;
  --body: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--body);
  overflow-wrap: anywhere;
}

a {
  color: var(--mint);
  text-underline-offset: 3px;
}

a:hover,
a:focus-visible {
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 10;
  background: var(--panel);
  padding: 8px 12px;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px;
}

header.site {
  background: var(--panel);
  border-bottom: 2px solid var(--border);
}

header.site .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font: 700 24px/1 "Pixelify Sans", system-ui, sans-serif;
  letter-spacing: 0.5px;
}

.brand img {
  width: 40px;
  height: 40px;
  image-rendering: auto;
}

.langs {
  display: flex;
  gap: 6px;
  font-family: var(--display);
}

.langs a,
.langs span {
  padding: 4px 10px;
  border: 2px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
}

.langs [aria-current] {
  background: var(--raised);
  border-color: var(--mint-dark);
  color: var(--mint);
}

nav.pages {
  background: var(--bg);
  border-bottom: 2px solid var(--border);
}

nav.pages ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 auto;
  padding: 10px 16px;
  max-width: 860px;
  list-style: none;
}

nav.pages a {
  display: block;
  padding: 6px 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  font: 15px/1.3 var(--display);
}

nav.pages a[aria-current] {
  border-color: var(--mint);
  color: var(--mint);
}

main {
  padding: 24px 0 48px;
}

h1,
h2,
h3 {
  font-family: var(--display);
  line-height: 1.25;
  font-weight: 700;
}

h1 {
  font-size: 34px;
  margin: 8px 0 16px;
  color: var(--gold);
}

h2 {
  font-size: 24px;
  margin: 36px 0 12px;
  color: var(--mint);
}

h3 {
  font-size: 19px;
  margin: 24px 0 8px;
  color: var(--lilac);
}

p,
ul,
ol,
dl,
table {
  margin: 0 0 14px;
}

.muted {
  color: var(--muted);
}

.box {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin: 0 0 16px;
}

.box > :last-child {
  margin-bottom: 0;
}

.note {
  border-color: var(--red-dark);
  background: #241526;
}

.note strong:first-child {
  color: var(--red);
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: center;
}

.hero img {
  max-width: 320px;
  justify-self: center;
}

@media (min-width: 640px) {
  .hero {
    grid-template-columns: 1.3fr 1fr;
  }
}

.scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent 45%, #1a1530 100%);
}

.scene > div {
  position: absolute;
  image-rendering: pixelated;
}

.meadow {
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--ground);
  overflow: hidden;
}

.meadow::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(-1 * var(--tile));
  right: 0;
  background: url("../img/meadow.png") repeat-x left bottom / var(--tile) var(--ground);
  image-rendering: pixelated;
  animation: meadow-scroll 8s linear infinite;
}

@keyframes meadow-scroll {
  to {
    translate: var(--tile) 0;
  }
}

.slime {
  left: calc(50% - var(--slime) / 2);
  bottom: calc(var(--ground) - 56px);
  width: var(--slime);
  height: var(--slime);
  background: url("../img/slime-walk.png") 0 0 / calc(8 * var(--slime)) var(--slime);
  animation: slime-walk 0.8s steps(8) infinite;
}

@keyframes slime-walk {
  to {
    background-position-x: calc(-8 * var(--slime));
  }
}

.bat {
  left: 0;
  width: 128px;
  height: 128px;
  translate: -160px 0;
  background: url("../img/bat.png") 0 0 / 1024px 128px;
  animation:
    bat-flap 0.88s steps(8) infinite,
    bat-bob 1.4s ease-in-out infinite alternate,
    bat-fly var(--fly) linear var(--delay) infinite;
}

.bat-1 {
  top: 16%;
  --fly: 17s;
  --delay: 2s;
}

.bat-2 {
  top: 34%;
  scale: -1 1;
  --fly: 23s;
  --delay: 9s;
  animation-direction: normal, alternate, reverse;
}

.bat-3 {
  top: 50%;
  scale: 0.5;
  --fly: 29s;
  --delay: 16s;
}

@keyframes bat-flap {
  to {
    background-position-x: -1024px;
  }
}

@keyframes bat-bob {
  from {
    transform: translateY(-14px);
  }
  to {
    transform: translateY(14px);
  }
}

@keyframes bat-fly {
  0% {
    translate: calc(100vw + 32px) 0;
  }
  40%,
  100% {
    translate: -160px 0;
  }
}

main.home {
  padding-top: 24px;
  padding-bottom: calc(var(--ground) + var(--slime) - 24px);
}

.home .info {
  width: calc(100% - 48px);
  margin: 0 0 32px;
  padding: 4px 20px 6px;
  background: rgb(28 24 43 / 0.94);
  border: 2px solid var(--border);
  border-radius: 12px;
}

.home .info:nth-of-type(even) {
  margin-left: auto;
}

.home .info h2 {
  margin-top: 16px;
}

.home .info > :last-child {
  margin-bottom: 14px;
}

.home .help {
  padding-top: 8px;
}

@media (min-width: 640px) {
  :root {
    --dodge: clamp(180px, 25vw + 40px, 400px);
  }

  .home .info {
    width: 62%;
  }
}

@supports (timeline-scope: --a) and (animation-timeline: view()) {
  body {
    timeline-scope: --info-1, --info-2, --info-3, --info-4, --info-5;
  }

  .home .info {
    view-timeline-inset: calc(100% - var(--ground) - var(--slime) + 56px) 0;
  }

  .home .info:nth-of-type(1) {
    view-timeline-name: --info-1;
  }

  .home .info:nth-of-type(2) {
    view-timeline-name: --info-2;
  }

  .home .info:nth-of-type(3) {
    view-timeline-name: --info-3;
  }

  .home .info:nth-of-type(4) {
    view-timeline-name: --info-4;
  }

  .home .info:nth-of-type(5) {
    view-timeline-name: --info-5;
  }

  .slime {
    animation-name: slime-walk, dodge-first, dodge-left, dodge-right, dodge-left, dodge-last;
    animation-duration: 0.8s, auto, auto, auto, auto, auto;
    animation-timing-function: steps(8), ease-in-out, ease-in-out, ease-in-out, ease-in-out, ease-in-out;
    animation-iteration-count: infinite, 1, 1, 1, 1, 1;
    animation-fill-mode: none;
    animation-timeline: auto, --info-1, --info-2, --info-3, --info-4, --info-5;
  }
}

@keyframes dodge-first {
  entry 0%,
  entry 30% {
    translate: 0 0;
  }
  entry 80%,
  exit 100% {
    translate: var(--dodge) 0;
  }
}

@keyframes dodge-left {
  entry 0%,
  entry 30% {
    translate: var(--dodge) 0;
  }
  entry 80%,
  exit 100% {
    translate: calc(-1 * var(--dodge)) 0;
  }
}

@keyframes dodge-right {
  entry 0%,
  entry 30% {
    translate: calc(-1 * var(--dodge)) 0;
  }
  entry 80%,
  exit 100% {
    translate: var(--dodge) 0;
  }
}

@keyframes dodge-last {
  entry 0%,
  entry 30% {
    translate: calc(-1 * var(--dodge)) 0;
  }
  entry 80%,
  exit 0% {
    translate: var(--dodge) 0;
  }
  exit 100% {
    translate: 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene *,
  .scene *::before {
    animation: none !important;
  }

  .bat {
    display: none;
  }
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  padding: 0;
  list-style: none;
}

.cards a {
  display: block;
  height: 100%;
  padding: 14px 16px;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
}

.cards a:hover,
.cards a:focus-visible {
  border-color: var(--mint);
}

.cards strong {
  display: block;
  font: 700 19px/1.3 var(--display);
  color: var(--mint);
  margin-bottom: 4px;
}

.cards span {
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 1px 8px;
  margin: 0 4px 0 0;
  border: 2px solid currentColor;
  border-radius: 8px;
  font: 13px/1.5 var(--display);
  vertical-align: 2px;
  white-space: nowrap;
}

.badge.active {
  color: var(--mint);
}

.badge.planned {
  color: var(--gold);
}

.badge.optional {
  color: var(--lilac);
}

.ph {
  background: transparent;
  color: var(--red);
  border-bottom: 2px dashed var(--red);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

details {
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 12px;
  margin: 0 0 10px;
}

details[open] {
  border-color: var(--mint-dark);
}

summary {
  cursor: pointer;
  padding: 12px 16px;
  font: 700 17px/1.4 var(--display);
  color: var(--text);
}

details > :not(summary) {
  margin-left: 16px;
  margin-right: 16px;
}

details > :last-child {
  margin-bottom: 16px;
}

.table-scroll {
  overflow-x: auto;
  margin: 0 0 14px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 420px;
}

th,
td {
  border: 2px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--raised);
  font-family: var(--display);
  font-weight: 400;
  color: var(--gold);
}

dl.facts {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 6px 16px;
}

dl.facts dt {
  color: var(--muted);
}

dl.facts dd {
  margin: 0;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  padding: 0;
  list-style: none;
}

.gallery figure {
  margin: 0;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 8px;
}

.gallery img {
  display: block;
  border-radius: 6px;
  image-rendering: auto;
}

.gallery figcaption {
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
}

.result {
  display: none;
}

.result:target {
  display: block;
}

.result.done {
  border-color: var(--mint-dark);
}

.result.done strong:first-child {
  color: var(--mint);
}

form.delete label {
  display: block;
  margin: 0 0 12px;
}

form.delete input[type="text"] {
  display: block;
  width: 100%;
  max-width: 22em;
  margin-top: 6px;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--raised);
  color: var(--text);
  font: 1.1rem/1.2 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

form.delete input[type="checkbox"] {
  width: 1.2em;
  height: 1.2em;
  margin-right: 8px;
  vertical-align: -0.2em;
  accent-color: var(--red);
}

form.delete button {
  min-height: 44px;
  padding: 10px 18px;
  border: 2px solid var(--red-dark);
  border-radius: 10px;
  background: var(--red);
  color: var(--outline);
  font: inherit;
  font-family: var(--display);
  cursor: pointer;
}

form.contact label {
  display: block;
  margin: 0 0 12px;
}

form.contact input[type="text"],
form.contact input[type="email"],
form.contact select,
form.contact textarea {
  display: block;
  width: 100%;
  max-width: 36em;
  margin-top: 6px;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--raised);
  color: var(--text);
  font: inherit;
}

form.contact textarea {
  resize: vertical;
}

form.contact button {
  min-height: 44px;
  padding: 10px 18px;
  border: 2px solid var(--mint-dark);
  border-radius: 10px;
  background: var(--mint);
  color: var(--outline);
  font: inherit;
  font-family: var(--display);
  cursor: pointer;
}

/* Honeypot field: off screen for people, naive bots still fill it in. */
form .hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

footer.site {
  border-top: 2px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 14px;
}

footer.site .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}

footer.site ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
