/* Pixelated Echo: one stylesheet for every page.
   Dark, quiet, editorial. One typeface (Source Serif 4, shared with the game's site),
   one accent (the lamp-green of the lower ward), and one idea: the echo. */

@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/fonts/source-serif-4-italic-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #0b0c0d;
  --ink-2: #111315;
  --ink-3: #181b1e;
  --rule: #2a2f33;
  --paper: #e9e7e2;
  --paper-dim: #a7aaa8;
  --echo: #7fb5a8;
  --echo-bright: #a9d6ca;
  --focus: #ffd98a;
  --stamp: #e2715d;

  --text: "Source Serif 4", Georgia, "Times New Roman", serif;

  /* The echoes: square pixels, fewer and larger with each repeat. */
  --dither-75: conic-gradient(transparent 0 25%, #000 0) 0 0 / 6px 6px;
  --dither-50: repeating-conic-gradient(#000 0 25%, transparent 0 50%) 0 0 / 8px 8px;
  --dither-25: conic-gradient(#000 0 25%, transparent 0) 0 0 / 10px 10px;

  --wrap: 72rem;
  --gutter: 1rem;
  --radius: 2px;
  color-scheme: dark;
}
@media (min-width: 48em) {
  :root { --gutter: 2rem; }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--text);
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  line-height: 1.65;
}
main { flex: 1 0 auto; }

img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }
picture { display: contents; }

a { color: var(--echo-bright); text-underline-offset: 0.2em; text-decoration-thickness: 1px; transition: color 0.2s; }
a:hover { color: var(--paper); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--radius);
}

h1, h2, h3 {
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 1.5rem + 4vw, 4.5rem); }
h2 { font-size: clamp(1.7rem, 1.3rem + 1.8vw, 2.6rem); }
h3 { font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem); }
p { margin: 0 0 1em; }
p, li { text-wrap: pretty; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.narrow { max-width: 46rem; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 200;
  background: var(--paper);
  color: var(--ink);
  padding: 0.6rem 1rem;
}
.skip-link:focus { top: 1rem; }

/* ---------- The echo ----------
   The word, and three copies of it behind, each one step further right, in fewer and
   larger pixels. The copies are aria-hidden spans, so the word is read once.
   They step out once when the page opens; with reduced motion they are simply there. */
.echo {
  position: relative;
  display: inline-block;
  isolation: isolate;
  white-space: nowrap;
}
.echo-copy {
  position: absolute;
  inset: 0;
  z-index: -1;
  color: var(--echo);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.echo-copy:nth-child(2) { --step: 1; -webkit-mask: var(--dither-75); mask: var(--dither-75); }
.echo-copy:nth-child(3) { --step: 2; -webkit-mask: var(--dither-50); mask: var(--dither-50); opacity: 0.7; }
.echo-copy:nth-child(4) { --step: 3; -webkit-mask: var(--dither-25); mask: var(--dither-25); opacity: 0.5; }
.echo-copy { transform: translateX(calc(var(--step) * 0.12em)); }

@media (prefers-reduced-motion: no-preference) {
  .echo-copy { animation: echo-out 0.5s steps(3, end) both; }
  .echo-copy:nth-child(2) { animation-delay: 0.3s; }
  .echo-copy:nth-child(3) { animation-delay: 0.65s; }
  .echo-copy:nth-child(4) { animation-delay: 1s; }
}
@keyframes echo-out {
  from { transform: translateX(0); }
}

/* The small echo in the header: two plain copies, no pixels at this size. */
.echo-small .echo-copy { -webkit-mask: none; mask: none; transform: translateX(calc(var(--step) * 0.08em)); }
.echo-small .echo-copy:nth-child(2) { opacity: 0.55; }
.echo-small .echo-copy:nth-child(3) { opacity: 0.28; }

/* ---------- Labels: a short pixel-stepped rule, then small capitals ---------- */
.label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--echo);
  margin: 0 0 0.9rem;
}
.label::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 4px;
  margin-right: 0.7rem;
  vertical-align: 0.3em;
  background:
    linear-gradient(90deg,
      currentColor 0 4px, transparent 4px 9px,
      color-mix(in srgb, currentColor 60%, transparent) 9px 13px, transparent 13px 18px,
      color-mix(in srgb, currentColor 30%, transparent) 18px 22px);
}

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-block: 0.75rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--paper);
  text-decoration: none;
}
.wordmark:hover { color: var(--paper); }
/* LOGO SLOT: when the logo exists, put <img class="logo" src="/img/logo.svg" alt="" width="28" height="28">
   inside .wordmark, before the name (see README, "The logo"). */
.wordmark .logo { width: 28px; height: 28px; }
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.4rem;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--paper-dim);
  text-decoration: none;
  font-size: 0.98rem;
}
.site-nav a:hover { color: var(--paper); }
.site-nav a[aria-current="page"] { color: var(--paper); text-decoration: underline; text-decoration-color: var(--echo); text-underline-offset: 0.45em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.6rem 1.25rem;
  border: 1px solid var(--echo);
  border-radius: var(--radius);
  color: var(--paper);
  background: transparent;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}
.btn:hover { background: var(--ink-3); color: var(--paper); }
.btn-primary { background: var(--echo); color: var(--ink); }
.btn-primary:hover { background: var(--echo-bright); color: var(--ink); }
.btn svg { width: 1em; height: 1em; flex: none; }
/* Not a link yet: shown so visitors know it is coming, but it goes nowhere. */
.btn-soon { border-color: var(--paper-dim); border-style: dashed; color: var(--paper-dim); font-weight: 400; cursor: default; }
.btn-soon:hover { background: transparent; color: var(--paper-dim); }
.btn-note { display: block; font-size: 0.85rem; color: var(--paper-dim); margin-top: 0.4rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 1rem 1.25rem; align-items: flex-start; margin-top: 1.75rem; }

/* ---------- Home: the studio in one line ---------- */
.intro { padding-block: clamp(4rem, 2rem + 9vw, 9rem) clamp(3rem, 2rem + 4vw, 5.5rem); }
.intro h1 {
  font-size: clamp(2.7rem, 0.6rem + 9.6vw, 8.5rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.45em;
  max-width: 100%;
}
.intro .lede {
  font-size: clamp(1.25rem, 1rem + 1.1vw, 1.9rem);
  font-style: italic;
  line-height: 1.35;
  color: var(--paper-dim);
  max-width: 34rem;
  margin: 0;
}

/* ---------- The featured game ---------- */
.feature {
  display: grid;
  background: var(--ink-2);
  border: 1px solid var(--rule);
}
.feature-shot { position: relative; overflow: hidden; background: var(--ink-3); }
.feature-shot img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 9; }
.feature-body { padding: clamp(1.5rem, 1rem + 2.5vw, 3rem); align-self: center; }
.feature-body h2 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.4rem); margin-bottom: 0.4em; }
.feature .hook {
  font-style: italic;
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
  line-height: 1.4;
  margin: 0 0 1rem;
}
.feature-body > p:not(.label):not(.hook) { color: var(--paper-dim); }
.feature-body .cta-row { margin-top: 1.5rem; }
@media (min-width: 60em) {
  .feature { grid-template-columns: 7fr 5fr; }
  .feature-shot img { aspect-ratio: auto; min-height: 100%; }
}
.section { padding-bottom: clamp(4rem, 3rem + 4vw, 7rem); }

/* ---------- Inner pages ---------- */
.page-head { padding-block: clamp(3rem, 2rem + 5vw, 6rem) 1.5rem; }
.page-head h1 { margin-bottom: 0.4em; }
.page-head p:last-child { color: var(--paper-dim); font-size: 1.15em; font-style: italic; max-width: 40rem; }
.prose { padding-bottom: clamp(4rem, 3rem + 4vw, 7rem); }
.prose h2 { font-size: clamp(1.4rem, 1.2rem + 1vw, 1.9rem); margin-top: 2.75rem; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }

/* Factsheet (Press) and the contact list: label, then value, on a hairline. */
.facts { margin: 0 0 2rem; border-top: 1px solid var(--rule); }
.facts div {
  display: grid;
  gap: 0.1rem 2rem;
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 40em) {
  .facts div { grid-template-columns: 11rem 1fr; }
}
.facts dt { color: var(--paper-dim); font-size: 0.9rem; letter-spacing: 0.04em; padding-top: 0.15rem; }
.facts dd { margin: 0; }

/* ---------- Placeholders the author must replace (same as the game's site) ---------- */
.placeholder {
  border: 2px dashed var(--stamp);
  background: rgba(226, 113, 93, 0.08);
  padding: 1rem 1.2rem;
  color: var(--paper);
}
.placeholder::before {
  content: "To write";
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stamp);
  margin-bottom: 0.35rem;
}
span.placeholder { display: inline; padding: 0 0.3rem; border-width: 1px; }
span.placeholder::before { content: none; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 2.5rem;
  font-size: 0.95rem;
  color: var(--paper-dim);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; justify-content: space-between; align-items: center; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.4rem; }
.site-footer a { color: var(--paper); display: inline-block; padding-block: 0.6rem; text-decoration: none; }
.site-footer a:hover { color: var(--echo-bright); text-decoration: underline; }
.site-footer p { margin: 0; }
