/* kharos.io (code/tools/site.py): one page per language, dark as the crypts, warm light for what matters (the art
   bible's colour script: docs/spec/art-bible.md 1).  Every word is the game's own pixel face; --b and --h are CSS
   pixels per face pixel for the body and the headings, and --f the features' headings, set by site.js to whole device pixels (a face pixel never
   falls between two screen pixels), these the values without it. */
:root {
  --ink: #06080a;
  --stone: #0d1114;
  --stone-2: #151b1f;
  --line: #24303a;
  --bone: #ddd6c6;
  --dim: #8d9499;
  --amber: #f0a43c;
  --amber-hi: #ffd08a;
  --amber-lo: #a8611c;
  --soul: #3fd6b4;
  --face: 10;
  --b: 2px;
  --h: 4px;
  --f: 3px;
  --wide: 1120px;
  color-scheme: dark;
}
html.zh { --face: 12; }
@media (max-width: 720px) { :root { --b: 1.5px; --h: 3px; --f: 2.4px; } html.zh { --b: 1.34px; --h: 2.67px; --f: 2px; } }

* { box-sizing: border-box; }
html { background: var(--ink); scroll-behavior: smooth; scroll-padding-top: calc(var(--face) * var(--b) * 3); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  color: var(--bone);
  background: var(--ink);
  font-family: "Kharos Pixel", monospace;
  font-size: calc(var(--face) * var(--b));
  line-height: 1.7;
  -webkit-font-smoothing: none;
  font-smooth: never;
  text-rendering: optimizeSpeed;
  overflow-x: hidden;
}
h1, h2, h3, .tagline, .button, nav a { font-family: "Kharos Pixel Bold", "Kharos Pixel", monospace; font-weight: normal; }
h2 { font-size: calc(var(--face) * var(--h)); line-height: 1.25; margin: 0 0 calc(var(--face) * var(--b)); color: var(--bone); }
h3 { font-size: calc(var(--face) * var(--b) * 1.5); }
a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--amber-hi); }
img { display: block; max-width: 100%; height: auto; }
.pixel { image-rendering: pixelated; }
section { padding: calc(var(--face) * var(--b) * 4) 16px; }
section > * { max-width: var(--wide); margin-left: auto; margin-right: auto; }

/* the bar */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 24px;
  background: linear-gradient(rgba(6, 8, 10, .92), rgba(6, 8, 10, .0));
  transition: background .3s;
}
.bar.solid { background: rgba(6, 8, 10, .94); box-shadow: 0 1px 0 var(--line); }
.bar-logo img { height: calc(var(--face) * var(--b) * 1.6); width: auto; opacity: 0; transition: opacity .3s; }
.bar.solid .bar-logo img { opacity: 1; }
.bar nav { display: flex; gap: calc(var(--face) * var(--b) * 1.2); align-items: center; }
.bar nav a { color: var(--bone); font-size: calc(var(--face) * var(--b)); }
.bar nav a:hover { color: var(--amber-hi); }
.bar nav a.lang { color: var(--dim); }
@media (max-width: 720px) {
  .bar { padding: 8px 16px; }
  .bar nav a:not(.lang) { display: none; }
}

/* the first screen: the Endless Hall, the Exile in the brazier ring, the dead closing in */
.hero { position: relative; min-height: 100svh; padding: 0 16px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.hero-art {
  position: absolute; inset: 0; max-width: none;
  background: var(--ink) url("/media/hero.webp") center 46% / cover no-repeat;
  animation: dawn 2.4s ease-out both;
}
.hero-art::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 46%, transparent 40%, rgba(6, 8, 10, .55) 75%, var(--ink) 100%),
    linear-gradient(transparent 55%, rgba(6, 8, 10, .85) 82%, var(--ink));
}
@keyframes dawn { from { opacity: 0; filter: brightness(.3); } to { opacity: 1; filter: none; } }
.hero-words { position: relative; text-align: center; padding-bottom: calc(var(--face) * var(--b) * 4); max-width: var(--wide); }
.hero-words h1 { margin: 0; }
.logo { width: min(640px, 84vw); margin: 0 auto; filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .9)); animation: rise 1.2s .6s ease-out both; }
.tagline { margin: calc(var(--face) * var(--b)) 0 calc(var(--face) * var(--b) * 1.8); color: var(--bone); text-shadow: 0 2px 8px #000; animation: rise 1.2s .9s ease-out both; }
.buttons { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; animation: rise 1.2s 1.1s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hero-art, .logo, .tagline, .buttons { animation: none; } }

/* buttons as the game's interface draws them: a pixel border, a lit top, a dark bottom, pressed one pixel down */
.button {
  --c: var(--stone-2); --hi: #2b363f; --lo: #000; --fg: var(--bone);
  display: inline-block; padding: calc(var(--face) * var(--b) * .55) calc(var(--face) * var(--b) * 1.3);
  color: var(--fg); background: var(--c);
  font-size: calc(var(--face) * var(--b));
  line-height: 1.4;
  box-shadow: inset 0 calc(var(--b)) 0 var(--hi), inset 0 calc(var(--b) * -2) 0 var(--lo),
              0 0 0 var(--b) #000, 0 0 0 calc(var(--b) * 2) var(--line);
  cursor: pointer; border: 0;
}
.button:hover { color: var(--fg); filter: brightness(1.12); }
.button:active { transform: translateY(var(--b)); }
.button.lit { --c: var(--amber); --hi: var(--amber-hi); --lo: var(--amber-lo); --fg: #1a0e02; }
.button.still { cursor: default; }
.button.still:hover { filter: none; }
.button.still:active { transform: none; }

/* the line that opens the page */
.intro { padding-top: calc(var(--face) * var(--b) * 3); }
.intro p { max-width: 34em; text-align: center; font-size: calc(var(--face) * var(--b)); color: var(--bone); margin: 0 auto; }
html.zh .intro p { max-width: 28em; }

/* the trailer */
.trailer h2, .shots h2 { text-align: center; }
.frame { position: relative; background: #000; box-shadow: 0 0 0 var(--b) #000, 0 0 0 calc(var(--b) * 2) var(--line), 0 20px 60px rgba(0, 0, 0, .6); }
.frame video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; }

/* the features: a picture and its words, side by side, sides taking turns */
.features { display: grid; gap: calc(var(--face) * var(--b) * 5); }
.feature { display: grid; grid-template-columns: 3fr 2fr; gap: calc(var(--face) * var(--b) * 2.5); align-items: center; width: 100%; }
.feature:nth-child(even) .shot { order: 2; }
.feature .shot { box-shadow: 0 0 0 var(--b) #000, 0 0 0 calc(var(--b) * 2) var(--line); background: #000; }
.feature .shot img { width: 100%; }
.feature h2 { color: var(--amber); font-size: calc(var(--face) * var(--f)); }
.feature p { margin: 0; color: var(--bone); }
.feature.soul h2 { color: var(--soul); }
@media (max-width: 720px) {
  .feature { grid-template-columns: 1fr; gap: calc(var(--face) * var(--b) * 1.2); }
  .feature:nth-child(even) .shot { order: 0; }
}
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s ease-out, transform .9s ease-out; }
.reveal.seen { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* the screenshots */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid a { display: block; padding: 0; border: 0; background: #000; cursor: zoom-in; box-shadow: 0 0 0 var(--b) #000, 0 0 0 calc(var(--b) * 2) var(--line); }
.grid a:hover { box-shadow: 0 0 0 var(--b) #000, 0 0 0 calc(var(--b) * 2) var(--amber-lo); }
.grid img { width: 100%; }
@media (max-width: 720px) { .grid { grid-template-columns: 1fr; } }
.viewer { max-width: min(96vw, 1920px); padding: 0; border: 0; background: transparent; color: var(--bone); }
.viewer::backdrop { background: rgba(0, 0, 0, .88); }
.viewer img { width: 100%; max-height: 82vh; object-fit: contain; }
.viewer .caption { text-align: center; margin: 12px auto 0; max-width: 46em; }
.viewer .close { position: fixed; top: 12px; right: 18px; font-size: calc(var(--face) * var(--h)); line-height: 1; color: var(--bone); background: none; border: 0; cursor: pointer; font-family: inherit; }

/* Steam */
.steam { display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--face) * var(--b) * 2.5); align-items: center; max-width: var(--wide); margin: 0 auto; }
.steam > * { margin: 0; }
.steam-art img { width: 100%; box-shadow: 0 0 0 var(--b) #000, 0 0 0 calc(var(--b) * 2) var(--line); }
.steam ul { margin: 0 0 calc(var(--face) * var(--b)); padding: 0; list-style: none; }
.steam li { padding-left: 1.2em; position: relative; color: var(--bone); }
.steam li::before { content: "◆"; position: absolute; left: 0; color: var(--soul); font-size: .7em; top: .35em; }
.platforms { color: var(--dim); margin: 0 0 calc(var(--face) * var(--b) * 1.5); }
@media (max-width: 720px) { .steam { grid-template-columns: 1fr; } }

footer { text-align: center; padding: calc(var(--face) * var(--b) * 4) 16px calc(var(--face) * var(--b) * 3); color: var(--dim); border-top: 1px solid var(--line); margin-top: calc(var(--face) * var(--b) * 3); }
footer img { margin: 0 auto calc(var(--face) * var(--b)); height: calc(var(--face) * var(--b) * 2.4); width: auto; opacity: .8; }
footer p { margin: .3em 0; }

/* the 404 page */
.lost { min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--face) * var(--b) * 1.5); text-align: center; padding: 16px; }
.lost .logo { animation: none; }
