/* GalaxyGames Studio. Every value here comes from the game, not from a template:
   - night  #0B0906   the game's launch-screen and scene background
   - stone  rgb(221,200,160)  Unity's sandstone block face, which the walls and floor still use
   - fire   #FFA04A   the lamp colour of the "fire" look (render/look.js)
   - gold   GOLD_RGB 0.90/0.76/0.40 (render/assets.js), the gilding and the coins
   Display type is Rokkitt, a geometric slab serif. Slab serifs were sold as "Egyptian" type in
   the Egyptomania of the 1810s, and the store covers already wear one (Rockwell). The text face
   is Schibsted Grotesk, drawn for a newspaper: an editorial voice rather than an app's. */

:root {
  --night: #0b0906;
  --night-2: #14100b;
  --stone: #ddc8a0;
  --stone-2: #b9a47e;
  --stone-3: #8a7a5d;
  --paper: #efe6d2;
  --ink: #1d160e;
  --ink-2: #5a4a35;
  --fire: #ffa04a;
  --gold: #e6c266;
  --rule: rgba(221, 200, 160, 0.16);
  --rule-ink: rgba(29, 22, 14, 0.16);
  --display: "Rokkitt", Rockwell, "Roboto Slab", Georgia, serif;
  --text: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(20px, 4.2vw, 64px);
  --max: 1440px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { background: var(--night); color: var(--stone); font: 400 17px/1.6 var(--text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--fire); }
:focus-visible { outline: 2px solid var(--fire); outline-offset: 3px; }
::selection { background: var(--fire); color: var(--night); }

/* Film grain over everything, very faint: flat digital black reads cheap next to a painting.
   A small pre-made tile (img/grain.png, 128 px), not an SVG noise filter: a filter is
   re-rendered on every scroll and stalled the page. */
body::before { content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: 0.05;
  background: url("img/grain.png") repeat; }

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

/* Small type: labels, captions, the masthead. Wide tracking, small caps by case. */
.label { font: 600 11.5px/1.4 var(--text); letter-spacing: 0.2em; text-transform: uppercase; }

/* ── Masthead ─────────────────────────────────────────────────────────────── */
.mast { position: relative; z-index: 5; display: flex; align-items: baseline; justify-content: space-between;
  gap: 24px; padding-top: 28px; padding-bottom: 28px; }
.mark { font: 700 19px/1 var(--display); letter-spacing: 0.01em; text-decoration: none; color: var(--stone); }
.mark span { font: 600 10.5px/1 var(--text); letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--stone-3); margin-left: 10px; vertical-align: 2px; }
.mast nav { display: flex; gap: clamp(16px, 2.4vw, 36px); }
.mast nav a { text-decoration: none; color: var(--stone-2); }
.mast nav a:hover { color: var(--fire); }

/* ── Hero: the title on the night, the painting hung off the right edge ──────── */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  min-height: min(86vh, 900px); align-items: end; }
.hero-text { position: relative; z-index: 2; padding-bottom: clamp(32px, 6vh, 72px); }
.hero-text .label { color: var(--fire); display: flex; align-items: center; gap: 14px; }
.hero-text .label::after { content: ""; width: 56px; height: 1px; background: var(--fire); opacity: 0.6; }
h1 { font: 300 clamp(72px, 10.6vw, 176px)/0.86 var(--display); letter-spacing: -0.035em;
  color: var(--stone); margin: 26px 0 0; }
/* The last line steps out over the painting's darkened edge. */
h1 .run { display: block; font-weight: 800; color: var(--gold); margin-right: -0.9em; }
.lede { max-width: 30ch; margin-top: 30px; font-size: clamp(17px, 1.35vw, 20px); line-height: 1.55; color: var(--stone-2); }
.status { margin-top: 34px; display: inline-flex; align-items: center; gap: 14px; color: var(--stone);
  font: 400 16px/1.3 var(--text); }
.status img { width: 48px; height: 48px; border-radius: 11px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); }
.status .label { display: block; color: var(--fire); margin-bottom: 3px; }

.hero-art { position: relative; align-self: stretch; margin-right: calc(-1 * var(--gutter)); }
.hero-art picture, .hero-art img { width: 100%; height: 100%; }
.hero-art img { object-fit: cover; object-position: 58% 40%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 22%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 22%); }
.hero-art figcaption { position: absolute; right: var(--gutter); bottom: 18px; color: rgba(239, 230, 210, 0.78);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9); }

/* ── The line from the game ───────────────────────────────────────────────── */
.quote { border-top: 1px solid var(--rule); padding: clamp(72px, 12vw, 168px) 0; }
.quote blockquote { max-width: 18ch; margin-left: calc(100% * 5 / 12);
  font: 300 clamp(34px, 4.4vw, 66px)/1.08 var(--display); letter-spacing: -0.02em; color: var(--stone); }
.quote blockquote em { font-style: normal; color: var(--fire); }
.quote cite { display: block; margin: 28px 0 0 calc(100% * 5 / 12); color: var(--stone-3); font-style: normal; }

/* ── The game: numbered notes beside a slideshow of frames from it ────────── */
.game { border-top: 1px solid var(--rule); padding: clamp(56px, 8vw, 112px) 0 clamp(72px, 10vw, 140px); }
.section-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: baseline;
  margin-bottom: clamp(40px, 6vw, 80px); }
.section-head .label { color: var(--stone-3); }
h2 { font: 300 clamp(40px, 5vw, 76px)/1 var(--display); letter-spacing: -0.025em; color: var(--stone); }

.game-body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0 clamp(24px, 4vw, 64px);
  align-items: start; }
.notes { list-style: none; counter-reset: note; }

/* The frames slideshow: one 16:9 stage, frames crossfading in place, small round arrows on its
   edges, and a counter and caption under it. */
.slides { position: relative; outline: none; }
.slides:focus-visible .slides-stage { outline: 2px solid var(--fire); outline-offset: 4px; }
.slides-stage { position: relative; aspect-ratio: 16 / 9; border-radius: 2px; overflow: hidden;
  background: var(--night-2); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s ease; }
.slide.is-active { opacity: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slides-arrow { position: absolute; top: 50%; z-index: 2; width: 42px; height: 42px; margin-top: -21px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  border-radius: 50%; border: 1px solid rgba(221, 200, 160, 0.35); background: rgba(11, 9, 6, 0.55);
  color: var(--stone); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease; }
.slides-arrow:hover { background: rgba(11, 9, 6, 0.8); border-color: var(--fire); color: var(--fire); }
.slides-arrow.prev { left: 14px; }
.slides-arrow.next { right: 14px; }
.slides-arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.slides-bar { display: flex; gap: 18px; align-items: baseline; margin-top: 16px; }
.slides-count { color: var(--stone-3); flex: none; font-variant-numeric: tabular-nums; }
.slides-count b { color: var(--fire); font-weight: 600; }
.slides-caption { color: var(--stone-2); }
@media (prefers-reduced-motion: reduce) { .slide { transition: none; } }
.notes li { counter-increment: note; display: grid; grid-template-columns: 56px minmax(0, 1fr);
  padding: 26px 0 30px; border-top: 1px solid var(--rule); }
.notes li:last-child { border-bottom: 1px solid var(--rule); }
.notes li::before { content: counter(note, upper-roman); font: 400 22px/1.2 var(--display); color: var(--fire); }
.notes h3 { font: 600 22px/1.2 var(--display); color: var(--stone); letter-spacing: 0; }
.notes p { margin-top: 10px; color: var(--stone-2); max-width: 44ch; }


/* ── How to play: a plate, not a set of cards ─────────────────────────────── */
.controls { border-top: 1px solid var(--rule); padding: clamp(56px, 7vw, 96px) 0; }
.controls dl { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
.controls dl div { padding: 22px 22px 0 0; }
.controls dl div + div { padding-left: 22px; border-left: 1px solid var(--rule); }
.controls dt { font: 600 21px/1.2 var(--display); color: var(--stone); }
.controls dd { margin-top: 6px; color: var(--stone-2); }

/* ── The studio: the one light section, sandstone paper ───────────────────── */
.studio { background: var(--paper); color: var(--ink); padding: clamp(72px, 10vw, 150px) 0; }
.studio .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0 clamp(24px, 4vw, 64px); }
.studio .label { color: var(--ink-2); }
.studio h2 { color: var(--ink); margin-top: 18px; }
.studio p { font-size: clamp(18px, 1.45vw, 21px); line-height: 1.6; color: var(--ink); max-width: 42ch; }
.studio p + p { margin-top: 1em; }
.studio a { color: var(--ink); }
.studio a:hover { color: #b4561a; }
.studio .mail { display: inline-block; margin-top: 34px; font: 300 clamp(26px, 3vw, 42px)/1.1 var(--display);
  letter-spacing: -0.01em; text-decoration: none; border-bottom: 1px solid var(--ink); padding-bottom: 6px; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 32px;
  padding-top: 34px; padding-bottom: 40px; color: var(--stone-3); }
.foot nav { display: flex; gap: 28px; }
.foot a { text-decoration: none; }

/* ── Document pages (the privacy policy): paper, one readable column ──────── */
.doc-page { background: var(--paper); color: var(--ink); }
.doc-page .mast { border-bottom: 1px solid var(--rule-ink); }
.doc-page .mark { color: var(--ink); }
.doc-page .mark span, .doc-page .mast nav a { color: var(--ink-2); }
.doc-page .mast nav a:hover, .doc-page a:hover { color: #b4561a; }
.doc-page ::selection { background: var(--ink); color: var(--paper); }
body.doc-page::before { opacity: 0.05; }
.doc { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 0 clamp(24px, 4vw, 64px);
  padding-top: clamp(48px, 7vw, 104px); padding-bottom: clamp(64px, 8vw, 120px); }
.doc-side { position: sticky; top: 32px; align-self: start; }
.doc-side h1 { font-size: clamp(48px, 6vw, 92px); color: var(--ink); margin: 18px 0 0; }
.doc-side .label { color: var(--ink-2); }
.doc-side p { margin-top: 18px; color: var(--ink-2); font-size: 15px; }
.doc-main { max-width: 66ch; }
.doc-main .summary { font: 300 clamp(22px, 2vw, 28px)/1.4 var(--display); color: var(--ink); padding-bottom: 34px;
  border-bottom: 1px solid var(--rule-ink); }
.doc-main section { counter-increment: sec; padding: 34px 0 6px; border-bottom: 1px solid var(--rule-ink); }
.doc-main { counter-reset: sec; }
.doc-main h2 { font: 600 24px/1.25 var(--display); color: var(--ink); letter-spacing: 0; display: flex; gap: 16px; }
.doc-main h2::before { content: counter(sec, decimal-leading-zero); color: #b4561a; font-weight: 400; }
.doc-main p, .doc-main li { color: #2e2418; margin: 14px 0; }
.doc-main ul { padding-left: 1.1em; }
.doc-main li { margin: 8px 0; padding-left: 4px; }
.doc-main li::marker { color: #b4561a; }
.doc-main strong { color: var(--ink); }
.doc-page .foot { color: var(--ink-2); border-top: 1px solid var(--rule-ink); }

/* A label is a label wherever it sits: section paragraph rules (.studio p, .doc-side p) would
   otherwise outrank .label and set it at body size. */
.studio p.label, .doc-side p.label { font: 600 11.5px/1.4 var(--text); letter-spacing: 0.2em; margin-top: 0; }

/* ── Small screens ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .mast nav a.opt { display: none; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-art { order: -1; margin: 0 calc(-1 * var(--gutter)); aspect-ratio: 4 / 5; max-height: 74vh; }
  .hero-art img { -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
                          mask-image: linear-gradient(180deg, #000 70%, transparent 100%); object-position: 50% 30%; }
  .hero-art figcaption { display: none; }
  .hero-text { margin-top: -8vw; }
  h1 .run { margin-right: 0; }
  .quote blockquote, .quote cite { margin-left: 0; }
  .section-head, .game-body, .studio .wrap, .doc { grid-template-columns: 1fr; }
  .section-head .label { margin-bottom: 14px; }
  .slides { margin-top: 44px; }
  .slides-arrow { width: 36px; height: 36px; margin-top: -18px; }
  .slides-arrow.prev { left: 10px; }
  .slides-arrow.next { right: 10px; }
  .slides-bar { flex-direction: column; gap: 6px; }
  .controls dl { grid-template-columns: 1fr 1fr; }
  .controls dl div, .controls dl div + div { padding: 18px 0 18px; border-left: 0; border-bottom: 1px solid var(--rule); }
  .controls dl div:nth-child(odd) { padding-right: 16px; }
  .studio h2 { margin-bottom: 28px; }
  .doc-side { position: static; margin-bottom: 36px; }
}
@media (prefers-reduced-motion: no-preference) {
  .hero-art img { animation: settle 1.6s cubic-bezier(.2, .7, .2, 1) both; }
  @keyframes settle { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
}
