/* Turn Back! Games and Sojourn. One shared stylesheet. Flat colours, one typeface. */

@font-face {
  font-family: "Libre Franklin";
  src: url(/assets/fonts/libre-franklin-latin-wght.woff2) format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --bg: #1e282d;
  --panel: #27343a;
  --text: #e8eef0;
  --muted: #a9b8bf;
  --accent: #93bba9;
  --steel: #9cbfdd;
  --font: "Libre Franklin", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Side padding: 6% on narrow screens, content kept to a column on wide ones. */
  --pad: max(6%, calc((100% - 1200px) / 2 + 72px));
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.65;
}

a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { color: var(--steel); }

a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--steel);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 10;
  padding: 12px 16px;
  background: var(--text);
  color: var(--bg);
  font-size: 16px;
}
.skip-link:focus { top: 12px; }

/* Header and navigation */

.site-header,
main,
.site-footer { width: 100%; }

main { flex: 1; }

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 32px;
  padding: 26px var(--pad) 0;
}

.wordmark {
  padding: 8px 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
}
.wordmark:hover { color: var(--text); }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 clamp(12px, 3vw, 30px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  display: block;
  padding: 10px 0;
  color: var(--muted);
  font-size: clamp(13px, 3.4vw, 16px);
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover { color: var(--steel); }
.site-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.3em;
}

/* Home page: one statement */

.home {
  padding: clamp(56px, 16vh, 170px) var(--pad) clamp(72px, 14vh, 140px);
}
.home h1 {
  max-width: 11em;
  margin: 0 0 0.4em;
  font-size: clamp(52px, 10.5vw, 132px);
  font-weight: 850;
  line-height: 1;
  text-wrap: balance;
}
.home .sub {
  max-width: 24em;
  margin: 0 0 18px;
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 500;
  line-height: 1.3;
}
.home p { max-width: 30rem; }
.home .follow { margin-top: 0; margin-bottom: 0; color: var(--muted); }

/* Reading pages: about, news, contact, roadmap, release notes, overview, 404 */

.page {
  padding: clamp(40px, 8vh, 88px) var(--pad) 96px;
}
.page > * { max-width: 40rem; }
.page h1 {
  margin: 0 0 0.6em;
  font-size: clamp(38px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.04;
}
.page .overview-title {
  font-size: clamp(56px, 11vw, 128px);
  font-weight: 900;
  line-height: 1;
}
.page h2 {
  margin: 0 0 0.4em;
  font-size: clamp(24px, 2.8vw, 32px);
  font-weight: 700;
  line-height: 1.2;
}
.page p { margin: 0 0 1.1em; }
.page .lead {
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 500;
  line-height: 1.45;
}
.page .muted,
.page .meta,
.page .status { color: var(--muted); }

.entry { margin-top: 48px; }
.entry h2 { margin-bottom: 0.15em; }
.entry .meta { margin-bottom: 0.8em; font-size: 16px; }

.milestones {
  margin: 28px 0 0;
  padding-left: 1.2em;
  list-style: square;
}
.milestones li { margin: 0 0 1.1em; padding-left: 0.3em; }
.milestones li::marker { color: var(--muted); }
.milestones strong { font-weight: 700; }
.milestones .state { color: var(--muted); }

/* Download (Sojourn overview) */

.download { margin-top: clamp(48px, 9vh, 96px); max-width: 44rem; }
.download h2 { margin-bottom: 0.6em; }
.release-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px 28px;
  margin: 0 0 28px;
  padding: 26px 28px;
  background: var(--panel);
  border-radius: 3px;
}
.release-card h3 { margin: 0 0 4px; font-size: 22px; font-weight: 700; line-height: 1.25; }
.release-meta { color: var(--muted); font-size: 16px; overflow-wrap: anywhere; }
.checksum { grid-column: 1 / -1; color: var(--muted); font-size: 16px; }
.checksum summary { cursor: pointer; }
.checksum p { margin: 12px 0 8px; }
.checksum code { display: block; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.download .status { margin: 0 0 28px; }

.button {
  display: inline-block;
  padding: 14px 24px;
  border-radius: 3px;
  background: var(--text);
  color: var(--bg);
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.button:hover { background: var(--steel); color: var(--bg); }

/* Footer */

.site-footer {
  padding: 24px var(--pad) 40px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}
.site-footer p { margin: 0; }

/* Wide screens: body text starts to the right of the headline's left edge */

@media (min-width: 900px) {
  .page > :not(h1) { margin-left: clamp(0px, 9vw, 150px); }
  .home .sub,
  .home .follow { margin-left: clamp(0px, 9vw, 150px); }
}

/* Small screens */

@media (max-width: 650px) {
  body { font-size: 17px; }
  .site-header { padding-top: 14px; }
  .wordmark { font-size: 20px; }
  .site-nav { width: 100%; }
  .site-nav a { font-size: 15px; }
  .site-game .site-nav ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
  .page { padding-bottom: 64px; }
  .release-card { grid-template-columns: 1fr; padding: 22px; }
  .release-card .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
