@font-face {
  font-family: "Kenney Pixel";
  src: url("fonts/kenney-pixel.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #120d1c;
  --panel: #1f1630;
  --panel-edge: #7f613d;
  --gold: #ebbd61;
  --gold-bright: #ffd98a;
  --text: #f5ebd6;
  --muted: #b9a990;
  --danger: #e0654f;
  --link: #8fe0ff;
  --pixel: "Kenney Pixel", "Courier New", monospace;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--bg); color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
}

img { max-width: 100%; display: block; image-rendering: auto; }

a { color: var(--link); }
a:hover { color: var(--gold-bright); }

/* The bar along the top. */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  background: rgba(18, 13, 28, 0.92);
  border-bottom: 2px solid var(--panel-edge);
  position: sticky;
  top: 0;
  z-index: 10;
}
.top .brand { font-family: var(--pixel); font-size: 28px; color: var(--gold); text-decoration: none; letter-spacing: 1px; }
.top nav { display: flex; gap: 18px; flex-wrap: wrap; }
.top nav a { font-family: var(--pixel); font-size: 22px; color: var(--text); text-decoration: none; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--gold-bright); }

/* The front page's banner: the art, the logo over it, and the wishlist button. */
.hero {
  position: relative;
  min-height: 62vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 40px 16px 48px;
  background: url("img/hero.jpg") center / cover no-repeat;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(18, 13, 28, 0.1) 30%, rgba(18, 13, 28, 0.85) 92%, var(--bg));
}
.hero > * { position: relative; z-index: 1; }
.hero .logo { width: min(680px, 92vw); filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.7)); }
.hero .pitch { font-family: var(--pixel); font-size: 30px; text-align: center; max-width: 820px; margin: 8px 0 20px; text-shadow: 0 2px 6px #000; }

.button {
  display: inline-block;
  font-family: var(--pixel);
  font-size: 30px;
  padding: 10px 28px;
  color: #1a1206;
  background: var(--gold);
  border: 3px solid var(--gold-bright);
  text-decoration: none;
  box-shadow: 0 4px 0 #7a5a24;
}
.button:hover { background: var(--gold-bright); color: #1a1206; }
.button.secondary { background: transparent; color: var(--text); border-color: var(--panel-edge); box-shadow: none; }

main { max-width: 1060px; margin: 0 auto; padding: 32px 24px 64px; }

h1, h2, h3 { font-family: var(--pixel); color: var(--gold); font-weight: normal; line-height: 1.1; }
h1 { font-size: 52px; margin: 8px 0 16px; }
h2 { font-size: 40px; margin: 40px 0 12px; }
h3 { font-size: 30px; margin: 24px 0 6px; }

.panel {
  background: var(--panel);
  border: 2px solid var(--panel-edge);
  padding: 20px 24px;
  margin: 16px 0;
}

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.features .panel { margin: 0; }
.features h3 { margin-top: 0; }

.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.shots a { border: 2px solid var(--panel-edge); }
.shots a:hover { border-color: var(--gold); }
.shots a { cursor: zoom-in; }

/* The image viewer (viewer.js) */
.viewer {
  position: fixed; inset: 0;
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; outline: none;
  background: rgba(8, 5, 14, 0.97);
  color: var(--text);
  overflow: hidden;
}
.viewer::backdrop { background: transparent; }
.viewer figure {
  position: absolute; inset: 0; margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 72px 16px; box-sizing: border-box;
}
.viewer img {
  display: block; max-width: 100%; max-height: calc(100% - 56px); min-height: 0;
  object-fit: contain; border: 2px solid var(--panel-edge); background: var(--bg);
}
.viewer figcaption {
  display: flex; gap: 6px 16px; align-items: baseline; flex-wrap: wrap; justify-content: center;
  max-width: 100%; margin-top: 12px; font-size: 16px; text-align: center;
}
.viewer-count { color: var(--muted); }
.viewer-full { color: var(--link); }
.viewer button {
  position: absolute; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; padding: 0;
  background: rgba(31, 22, 48, 0.85); border: 2px solid var(--panel-edge);
  color: var(--gold); cursor: pointer;
}
.viewer button svg { width: 28px; height: 28px; }
.viewer button:hover, .viewer button:focus-visible { color: var(--gold-bright); border-color: var(--gold); }
.viewer .viewer-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.viewer .viewer-next { right: 10px; top: 50%; transform: translateY(-50%); }
.viewer .viewer-close { top: 10px; right: 10px; width: 44px; height: 44px; }
.viewer .viewer-close svg { width: 20px; height: 20px; }
.viewer.single .viewer-prev, .viewer.single .viewer-next { display: none; }

.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 20px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.note { color: var(--muted); font-size: 15px; }

form.delete { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
form.delete input {
  font: 20px var(--pixel);
  padding: 8px 12px;
  background: #0c0814;
  color: var(--text);
  border: 2px solid var(--panel-edge);
  min-width: 0;
  flex: 1 1 220px;
}
form.delete button { font-size: 24px; cursor: pointer; }
#result { min-height: 1.6em; }

footer {
  border-top: 2px solid var(--panel-edge);
  padding: 20px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}
footer a { color: var(--muted); margin: 0 8px; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .top { padding: 8px 16px; }
  .top .brand { font-size: 24px; }
  .top nav a { font-size: 20px; }
  main { padding: 24px 16px 48px; }
  h1 { font-size: 40px; }
  h2 { font-size: 32px; }
  .hero .pitch { font-size: 24px; }
  .button { font-size: 26px; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 8px; }
  .panel { padding: 16px; }
  .viewer figure { padding: 60px 8px 16px; }
  .viewer .viewer-prev, .viewer .viewer-next { top: auto; bottom: 12px; transform: none; width: 48px; height: 48px; }
  .viewer figcaption { padding: 0 56px; box-sizing: border-box; min-height: 48px; }
}
