/* Rooklite palette: the game's black, candle text, wax gold. */
@font-face {
  font-family: "Rooklite Title";
  src: url("/fonts/rhombus_title.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #07060a;
  --bg-2: #110f16;
  --line: #2a2530;
  --text: #d9cdb4;
  --muted: #9a8f7c;
  --head: #f2dfbd;
  --accent: #e8b04a;
  --accent-ink: #1a1206;
  --max: 980px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; height: auto; display: block; }

/* Pixel art: sharp only when drawn at least twice its size (site.js); shrunk, smoothed. */
.pixel.sharp { image-rendering: pixelated; }

main { flex: 1; }

a { color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
a:hover { color: var(--head); }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

/* Top bar */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}
.brand {
  font-family: "Rooklite Title", Georgia, serif;
  font-size: 26px;
  color: var(--head);
  text-decoration: none;
  letter-spacing: .02em;
}
.top nav { display: flex; gap: 20px; flex-wrap: wrap; }
.top nav a { color: var(--muted); text-decoration: none; font-size: 16px; }
.top nav a:hover, .top nav a[aria-current] { color: var(--head); }
/* External links carry a diagonal arrow; internal ones a plain one or none. */
.ext { display: inline-block; margin-left: .2em; font-size: .85em; }
.brand { white-space: nowrap; }
@media (max-width: 520px) {
  .brand { font-size: 21px; }
  .top { gap: 12px; }
  .top nav { gap: 12px; flex-wrap: nowrap; }
  .top nav a { font-size: 14px; white-space: nowrap; }
}
@media (max-width: 420px) {
  .top { flex-wrap: wrap; row-gap: 6px; }
}

/* Buttons */
.buttons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.btn {
  display: inline-block;
  padding: 12px 22px;
  border: 2px solid var(--accent);
  border-radius: 4px;
  font-weight: 700;
  text-decoration: none;
  color: var(--accent);
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn:hover { background: var(--head); border-color: var(--head); color: var(--accent-ink); }
.btn.disabled {
  border-color: var(--line);
  color: var(--muted);
  pointer-events: none;
}

/* Sections */
section { padding: 56px 0; }
section + section { border-top: 1px solid var(--line); }

.lead { font-size: 21px; color: var(--head); text-align: center; max-width: 720px; margin: 0 auto 28px; }
.note { color: var(--muted); font-size: 15px; text-align: center; }

.heading { margin: 0 auto 24px; max-height: 44px; width: auto; }
h2.text-heading {
  font-family: "Rooklite Title", Georgia, serif;
  font-weight: normal;
  font-size: 34px;
  color: var(--head);
  text-align: center;
  margin: 0 0 24px;
}

.feature {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;
}
.feature p { margin: 0; }
.feature video { width: 100%; border-radius: 4px; background: var(--bg-2); }
@media (min-width: 820px) {
  .feature { grid-template-columns: 3fr 2fr; }
  .feature.flip { grid-template-columns: 2fr 3fr; }
  .feature.flip video { order: 2; }
}

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.shots a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  cursor: zoom-in;
  transition: border-color .15s;
}
.shots img { transition: transform .25s ease; }
.shots a:hover, .shots a:focus-visible { border-color: var(--accent); }
.shots a:hover img { transform: scale(1.03); }

/* Lightbox (built by site.js) */
.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 56px 16px;
  border: 0;
  background: transparent;
  color: var(--text);
  overflow: hidden;
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(7, 6, 10, .96); backdrop-filter: blur(6px); }
.lightbox img {
  max-width: min(100%, 1600px);
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 0 0 1px var(--line);
}
.lb-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--head);
  font: 32px/1 system-ui, sans-serif;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.lb-btn:hover { border-color: var(--accent); color: var(--accent); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; translate: 0 -50%; }
.lb-next { right: 12px; top: 50%; translate: 0 -50%; }
.lb-count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 14px; }
@media (max-width: 600px) {
  .lb-prev, .lb-next { top: auto; bottom: 8px; translate: none; }
}

ul.list { max-width: 720px; margin: 0 auto; padding-left: 1.2em; }
ul.list li { margin: 6px 0; }

footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 48px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
footer a { color: var(--muted); }

html:has(.lightbox[open]) { overflow: hidden; }

/* Footer contact: email + copy button + social icons */
footer .contact { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 18px; margin-bottom: 8px; }
.social { display: inline-flex; align-items: center; gap: 14px; }
.social a { display: inline-flex; color: var(--muted); transition: color .15s; }
.social a:hover { color: var(--accent); }
.email { display: inline-flex; align-items: center; gap: 4px; line-height: 1; }
.copy-email {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s;
}
.copy-email:hover, .copy-email.copied { color: var(--accent); }
.copy-email svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.copy-email .i-done, .copy-email.copied .i-copy { display: none; }
.copy-email.copied .i-done { display: block; }

/* Newsletter signup (posts to /api/subscribe; site.js shows the result inline) */
.signup { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 520px; margin: 0 auto; }
.signup input[type="email"] {
  flex: 1 1 240px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.signup input[type="email"]:focus { outline: none; border-color: var(--accent); }
.signup .btn { cursor: pointer; font: inherit; font-weight: 700; }
.signup .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.signup-status { min-height: 1.6em; margin: 10px 0 0; text-align: center; color: var(--accent); }
.signup-status.error { color: #e07a5f; }
.signup-note { max-width: 30em; margin: 6px auto 0; line-height: 1.6; text-wrap: balance; }
.signup-note strong { color: var(--text); font-weight: 600; }
.signup-fine { margin: 8px auto 0; font-size: 13px; }

/* About */
.about { max-width: 640px; margin: 0 auto; text-align: center; text-wrap: pretty; }
.about + .about { margin-top: 1.6em; }

/* Devlog */
.devlog { padding: 32px 0 56px; }
.devlog h1, .post h1 { font-family: "Rooklite Title", Georgia, serif; font-weight: normal; color: var(--head); line-height: 1.15; }
.devlog h1 { font-size: clamp(36px, 7vw, 56px); margin: 8px 0 4px; }
.post-item { padding: 22px 0; border-top: 1px solid var(--line); }
.post-item:first-of-type { margin-top: 20px; }
.post-item h2 { margin: 2px 0 6px; font-size: 22px; }
.post-item h2 a { color: var(--head); text-decoration: none; }
.post-item h2 a:hover { color: var(--accent); }
.post-item p { margin: 0; color: var(--text); }
.devlog time { color: var(--muted); font-size: 14px; }
.post { max-width: 680px; }
.post h1 { font-size: clamp(30px, 6vw, 44px); margin: 4px 0 18px; }
.post p, .post ul { margin: 0 0 14px; }
.post-back { margin-top: 28px; }

/* The title's rook (site.js): a canvas on Rooklite's lattice */
.intro { overflow-x: clip; }
.rook-box { position: relative; display: inline-block; vertical-align: top; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.rook-box canvas { position: absolute; pointer-events: none; }
.rook-box:focus { outline: none; }
.rook-box:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 4px; }

/* A card's screenshots over its picture (site.js) */
.shots { position: relative; display: block; overflow: hidden; border-radius: 4px; align-self: center; }
.shots img { display: block; width: 100%; height: auto; }
.shots img + img { position: absolute; inset: 0; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s ease; }
.shots img.on { opacity: 1; }

/* Burnogue embers (site.js) */
.logo-title.burns { position: relative; display: inline-block; }
.logo-title .embers { position: absolute; left: 0; pointer-events: none; image-rendering: pixelated; }
