/* Sagelark Studios - site styles. Colours and rules: brand/STYLE.md */

@font-face {
  font-family: "Outfit";
  src: url("/fonts/outfit-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- Colour tokens ---------- */

:root {
  color-scheme: light dark;

  /* Brand palette */
  --pine-night: #1e2a22;
  --fern: #3f5b45;
  --sage: #5f7f5b;
  --sage-light: #a9c2a2;
  --lichen: #c9d8c1;
  --mist: #e6ece1;
  --chalk: #f2f5ee;

  /* Roles: light mode */
  --bg: var(--mist);
  --surface: var(--chalk);
  --text: var(--pine-night);
  --muted: var(--fern);
  --link: var(--fern);
  --heading-accent: var(--sage);
  --border: var(--lichen);
  --button-bg: var(--fern);
  --button-text: var(--chalk);
  --draft-bg: #fbecc8;
  --draft-text: #4a3500;
  --draft-border: #c9971c;

  --radius: 1rem;
  --wrap: 62rem;
  --gutter: 1rem;
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--pine-night);
    --surface: #26352b;
    --text: var(--chalk);
    --muted: var(--sage-light);
    --link: var(--lichen);
    --heading-accent: var(--sage-light);
    --border: #3a4c40;
    --button-bg: var(--lichen);
    --button-text: var(--pine-night);
    --draft-bg: #3a3014;
    --draft-text: #fbe7b0;
    --draft-border: #c9971c;
  }
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

main {
  flex: 1;
}

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

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 1.4rem + 3.2vw, 3.4rem);
}

h2 {
  font-size: clamp(1.5rem, 1.25rem + 1.1vw, 2rem);
  margin-top: 2.5rem;
}

h3 {
  font-size: 1.25rem;
  margin-top: 1.75rem;
}

p,
ul,
ol,
dl {
  margin: 0 0 1em;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

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

@media (min-width: 40rem) {
  :root {
    --gutter: 1.5rem;
  }
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--surface);
  color: var(--text);
  border-radius: 0.5rem;
  font-weight: 500;
}

.skip-link:focus {
  top: 0.5rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Header ---------- */

.site-header {
  padding-block: 1rem;
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.brand {
  display: block;
  border-radius: 6px;
}

.brand img {
  width: 160px;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: inline-block;
  padding-block: 0.4rem;
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  border-bottom-color: var(--border);
}

.site-nav a[aria-current] {
  border-bottom-color: var(--link);
}

/* ---------- Sections ---------- */

.section {
  padding-block: 2rem;
}

.section > .wrap > h2:first-child {
  margin-top: 0;
}

.lead {
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.3rem);
  max-width: 38rem;
}

/* Limit the line length of each block, but keep the blocks aligned with the page. */
.prose > * {
  max-width: 44rem;
}

.prose li + li {
  margin-top: 0.35em;
}

.muted {
  color: var(--muted);
}

/* ---------- Home hero ---------- */

.hero {
  padding-block: 2rem 0.5rem;
}

.hero .wrap {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.hero h1 {
  max-width: 14ch;
}

.hero-bird {
  width: 9rem;
}

@media (min-width: 48rem) {
  .hero {
    padding-block: 3rem 2rem;
  }

  .hero .wrap {
    grid-template-columns: 1.4fr 1fr;
  }

  .hero-bird {
    width: min(100%, 20rem);
    order: 2;
  }
}

/* ---------- Buttons ---------- */

.button {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  background: var(--button-bg);
  color: var(--button-text);
  font-weight: 500;
  text-decoration: none;
}

.button:hover {
  filter: brightness(1.12);
}

.button--quiet {
  background: transparent;
  color: var(--link);
  box-shadow: inset 0 0 0 2px var(--link);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ---------- Game cards ---------- */

.card-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

@media (min-width: 44rem) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.game-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: start;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.game-card:hover,
.game-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.08);
}

.game-card h3 {
  margin: 0 0 0.3rem;
}

/* The whole card is clickable through the heading link. */
.game-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.game-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.game-card h3 a:focus-visible {
  outline: none;
}

.game-card h3 a:focus-visible::after {
  outline: 3px solid var(--link);
  outline-offset: 3px;
}

.game-card p {
  margin: 0 0 0.6rem;
}

.game-icon {
  width: 88px;
  border-radius: 22%;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.15);
}

.tag {
  display: inline-block;
  padding: 0.15rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

/* ---------- Game pages ---------- */

.game-hero {
  color: var(--game-text);
  background: linear-gradient(180deg, var(--game-top), var(--game-bottom));
  padding-block: 3rem;
}

.game-hero .wrap {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

@media (min-width: 44rem) {
  .game-hero {
    padding-block: 4rem;
  }

  .game-hero .wrap {
    grid-template-columns: auto 1fr;
    gap: 2.5rem;
  }
}

.game-hero .game-icon {
  width: 140px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.35);
}

@media (min-width: 44rem) {
  .game-hero .game-icon {
    width: 180px;
  }
}

.game-hero h1 {
  margin-bottom: 0.2rem;
}

.game-hero .subtitle {
  margin: 0 0 1rem;
  color: var(--game-soft);
  font-size: 1.3rem;
  font-weight: 500;
}

.game-hero .lead {
  margin-bottom: 0;
}

.game-hero a {
  color: var(--game-text);
}

.game-title-art {
  width: min(100%, 26rem);
  margin-bottom: 0.75rem;
}

/* Fixed game colours: the same in light and dark mode. */
.game--constellations {
  --game-top: #26285a;
  --game-bottom: #090b19;
  --game-text: #fff3d4;
  --game-soft: #dfeaff;
}

.game--stepping-stones {
  --game-top: #1f5162;
  --game-bottom: #13343f;
  --game-text: #ecf3f2;
  --game-soft: #ece2d0;
}

/* ---------- Store buttons ---------- */

.store-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 0;
  list-style: none;
}

.store-soon {
  display: flex;
  flex-direction: column;
  min-width: 11.5rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid currentColor;
  border-radius: 0.75rem;
  line-height: 1.25;
}

.store-soon small {
  font-size: 0.78rem;
  opacity: 0.9;
}

.store-soon span {
  font-size: 1.15rem;
  font-weight: 600;
}

/* Official badges, for launch (see README). */
.store-badge img {
  height: 54px;
  width: auto;
}

/* ---------- Feature list ---------- */

.feature-list {
  display: grid;
  gap: 1rem;
  padding: 0;
  list-style: none;
}

@media (min-width: 44rem) {
  .feature-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Four items: two by two on tablets, one row on wide screens. */
@media (min-width: 44rem) {
  .feature-list--four {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 60rem) {
  .feature-list--four {
    grid-template-columns: repeat(4, 1fr);
  }
}

.feature-list li {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.feature-list h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.feature-list p {
  margin: 0;
}

/* ---------- Screenshots ---------- */

/* Phones: a row that scrolls sideways and snaps to each shot.
   Wider screens: all shots fit in one row. */
.shots-scroll {
  margin-top: 1.5rem;
  padding-bottom: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  border-radius: 1rem;
}

.shots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(62%, 15rem);
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 44rem) {
  .shots-scroll {
    overflow-x: visible;
    padding-bottom: 0;
  }

  .shots {
    grid-auto-columns: minmax(0, 1fr);
  }
}

.shots li {
  scroll-snap-align: start;
}

.shots figure {
  margin: 0;
}

.shots img {
  width: 100%;
  border-radius: 1rem;
  border: 1px solid var(--border);
}

.shots figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.coming-soon {
  margin-top: 1.5rem;
  padding: 2rem 1.25rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
}

/* ---------- FAQ ---------- */

.faq details {
  max-width: 44rem;
  border-bottom: 1px solid var(--border);
}

.faq details:first-of-type {
  border-top: 1px solid var(--border);
}

.faq summary {
  cursor: pointer;
  padding: 1rem 0;
  font-weight: 600;
  font-size: 1.1rem;
}

.faq details > div {
  padding-bottom: 0.5rem;
}

/* ---------- Contact box ---------- */

.contact-box {
  max-width: 44rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.contact-box .email {
  font-size: 1.25rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ---------- Press ---------- */

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.5rem;
  max-width: 44rem;
}

.facts dt {
  font-weight: 600;
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 30rem) {
  .facts {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .facts dd {
    margin-bottom: 0.75rem;
  }
}

.logo-grid {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}

@media (min-width: 40rem) {
  .logo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.logo-grid figure {
  margin: 0;
}

.logo-tile {
  display: grid;
  place-items: center;
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.logo-tile img {
  width: min(100%, 300px);
}

.logo-tile--light {
  background: #e6ece1;
}

.logo-tile--dark {
  background: #1e2a22;
}

.logo-grid figcaption {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- Privacy / legal text ---------- */

.draft-banner {
  margin: 1.5rem 0 2rem;
  padding: 1rem 1.25rem;
  background: var(--draft-bg);
  color: var(--draft-text);
  border: 2px solid var(--draft-border);
  border-radius: var(--radius);
}

.draft-banner p:last-child {
  margin-bottom: 0;
}

.draft-banner a {
  color: inherit;
}

.draft-banner strong {
  letter-spacing: 0.08em;
}

.toc {
  max-width: 44rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.toc h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.25rem;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

table {
  border-collapse: collapse;
  min-width: 34rem;
  font-size: 0.97rem;
}

th,
td {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface);
  font-weight: 600;
}

/* ---------- 404 ---------- */

.not-found {
  padding-block: 4rem;
  text-align: center;
}

.not-found img {
  width: 9rem;
  margin: 0 auto 1.5rem;
}

.not-found .lead {
  margin-inline: auto;
}

.not-found .button-row {
  justify-content: center;
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 3rem;
  padding-block: 2rem 2.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.footer-nav a {
  display: inline-block;
  padding-block: 0.25rem;
}

.site-footer p {
  margin: 0 0 0.4rem;
}

.site-footer .legal {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.875rem;
  max-width: 44rem;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .game-card:hover,
  .game-card:focus-within {
    transform: none;
  }
}
