/* Snakables: games collection page */

:root {
  --page: #faf6ef;
  --ink: #1f1a14;
  --muted: #6b6258;
  --card: #ffffff;
  --line: #e9e1d4;
  --link: #18772f;
  --gutter: 16px;
  --display: "Fredoka", "Avenir Next Rounded", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #14110e;
    --ink: #f3ede4;
    --muted: #a99f92;
    --card: #1e1a16;
    --line: #2e2822;
    --link: #6fdc84;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #14110e;
  --ink: #f3ede4;
  --muted: #a99f92;
  --card: #1e1a16;
  --line: #2e2822;
  --link: #6fdc84;
  color-scheme: dark;
}

@media (min-width: 640px) {
  :root { --gutter: 32px; }
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

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

/* ---------- Top bar ---------- */

.topbar { padding: 14px 0; }
.topbar .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 44px;
}
.topbar .brand { display: block; line-height: 0; }
.topbar .brand img { width: clamp(112px, 30vw, 156px); height: auto; }
.topnav { display: flex; gap: 2px; margin-left: auto; }
.topnav a {
  padding: 9px 12px;
  border-radius: 999px;
  font: 600 16px/1 var(--display);
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
@media (min-width: 480px) {
  .topnav { gap: 4px; }
  .topnav a { padding: 9px 15px; }
}
.topnav a:hover,
.topnav a:focus-visible { background: var(--line); outline: none; }
.topnav a[aria-current] { background: var(--ink); color: var(--page); }
.topbar + .hero { padding-top: clamp(16px, 5vw, 56px); }

/* ---------- Hero ---------- */

.hero {
  padding: clamp(56px, 10vw, 112px) 0 clamp(48px, 7vw, 80px);
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  font: 600 14px/1.2 var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.logo {
  margin: 0;
  font: 700 clamp(56px, 13vw, 128px)/0.95 var(--display);
  letter-spacing: -0.02em;
}

/* The logo image: a transparent SVG wordmark (brand/snakables-logo.svg). */
.wordmark {
  margin: 0;
  line-height: 0;
}
.wordmark img {
  width: min(100%, 620px);
  height: auto;
  margin: 0 auto;
}

.lede {
  max-width: 34ch;
  margin: 18px auto 0;
  font-size: clamp(18px, 2.4vw, 22px);
  color: var(--muted);
}

.picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 1040px;
  margin: clamp(40px, 6vw, 64px) auto 0;
}
/* An odd card count on two columns: the last card sits centred on its own row. */
.picker a:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  justify-self: center;
  width: calc(50% - 6px);
}
@media (min-width: 760px) {
  .picker { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 760px; }
  .picker a:last-child:nth-child(odd) { grid-column: auto; justify-self: stretch; width: auto; }
}
@media (min-width: 1080px) {
  .picker { grid-template-columns: repeat(6, minmax(0, 1fr)); max-width: 1100px; }
}

.picker a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px 12px 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.picker a:hover,
.picker a:focus-visible {
  transform: translateY(-4px);
  border-color: var(--tint);
  box-shadow: 0 12px 28px -14px var(--tint);
}
.picker img {
  width: 80px;
  height: 80px;
  margin-bottom: 8px;
  border-radius: 22%;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.45);
}
.picker .name { font: 600 18px/1.2 var(--display); }
.picker .kind { font-size: 14px; color: var(--muted); }
.picker .kind.soon {
  margin-top: 2px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--tint);
  color: #14110e;
  font: 600 13px/1.4 var(--display);
}

/* ---------- Upcoming games ---------- */

.upcoming-head {
  padding: clamp(44px, 7vw, 72px) var(--gutter);
  text-align: center;
}
.upcoming-head h2 {
  margin: 0;
  font: 700 clamp(30px, 5vw, 46px)/1.05 var(--display);
  letter-spacing: -0.01em;
}

/* ---------- Game sections ---------- */

.game {
  --text: #fbf6ec;
  --soft: rgba(251, 246, 236, 0.78);
  position: relative;
  padding: clamp(56px, 8vw, 96px) 0;
  background:
    radial-gradient(120% 80% at 100% 0%, var(--bg2), transparent 60%),
    var(--bg);
  color: var(--text);
  scroll-margin-top: 0;
  overflow: hidden;
}

.game-top {
  display: grid;
  gap: 28px;
}
@media (min-width: 900px) {
  .game-top {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 56px;
    align-items: end;
  }
}

.title-row {
  display: flex;
  align-items: center;
  gap: 18px;
}
.icon {
  flex: none;
  width: clamp(72px, 12vw, 104px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 22%;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.game h2 {
  margin: 0;
  font: 700 clamp(30px, 5vw, 46px)/1.05 var(--display);
  letter-spacing: -0.01em;
}
.subtitle {
  margin: 6px 0 0;
  font: 600 clamp(16px, 2vw, 19px)/1.3 var(--display);
  color: var(--accent);
}

.blurb {
  max-width: 58ch;
  margin: 22px 0 0;
  color: var(--soft);
}

.features {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.features li {
  position: relative;
  padding-left: 26px;
  line-height: 1.45;
}
.features li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.45em;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
  transform: rotate(45deg);
}

.meta {
  margin: 18px 0 0;
  font-size: 15px;
  color: var(--soft);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  margin-top: 18px;
}
.store img {
  width: 150px;
  height: auto;
  transition: transform 0.2s ease;
}
.store:hover img,
.store:focus-visible img { transform: scale(1.04); }

.coming-soon {
  margin: 0;
  padding: 14px 24px;
  border-radius: 12px;
  background: var(--accent);
  color: #14110e;
  font: 600 18px/1 var(--display);
}

.site {
  font: 600 16px/1.2 var(--display);
  color: var(--accent);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}
.site:hover,
.site:focus-visible { border-bottom-color: currentColor; }

/* Screenshot rail: scrolls sideways inside itself, never the page. */
.shots {
  --h: clamp(340px, 62vw, 460px);
  display: flex;
  gap: 16px;
  margin: 44px calc(-1 * var(--gutter)) 0;
  padding: 6px var(--gutter) 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}
@media (min-width: 900px) {
  .shots { gap: 20px; }
}

.shots > *,
.shots figure { flex: none; scroll-snap-align: start; margin: 0; }

.shot {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: transform 0.25s ease;
}
.shot:hover { transform: translateY(-4px); }
.shot:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.shot img {
  height: var(--h);
  width: auto;
  max-width: none;
  aspect-ratio: 552 / 1200;
}
.shots.tablet .shot img { aspect-ratio: 3 / 4; }
.shots.tablet { --h: clamp(300px, 56vw, 400px); }

.shots figcaption {
  max-width: calc(var(--h) * 0.75);
  margin-top: 12px;
  font-size: 14px;
  color: var(--soft);
}

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

.footer {
  padding: 56px 0 64px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}
.footer .wordmark.small { margin: 0 0 14px; }
.footer .wordmark.small img { width: 200px; }
.footer p { margin: 6px 0; }
.footer a { color: var(--ink); text-underline-offset: 3px; }
.footer .fine { margin-top: 18px; font-size: 13px; }

/* ---------- Blog ---------- */

.page-head {
  padding: clamp(28px, 6vw, 64px) 0 clamp(28px, 5vw, 48px);
  text-align: center;
}
.page-head h1 {
  margin: 0;
  font: 700 clamp(44px, 9vw, 76px)/1 var(--display);
  letter-spacing: -0.02em;
}
.page-head .lede { margin-top: 12px; }

.post-meta {
  margin: 0;
  font: 600 14px/1.3 var(--display);
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* Post cards: the blog index and the home page teaser. */
.posts {
  display: grid;
  gap: 20px;
  max-width: 920px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.post-card a {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.post-card a:hover,
.post-card a:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.45);
}
@media (min-width: 760px) {
  .post-card a { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
}
.post-card img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1600 / 840;
  object-fit: cover;
}
.post-card .body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 24px 26px 28px;
}
.post-card h2,
.post-card h3 {
  margin: 0;
  font: 700 clamp(24px, 3.2vw, 30px)/1.15 var(--display);
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.post-card .excerpt { margin: 0; color: var(--muted); }
.post-card .more {
  margin-top: 4px;
  font: 600 16px/1.2 var(--display);
  color: var(--link);
}

.blog-list { padding-bottom: clamp(56px, 8vw, 96px); }

/* Home page teaser */
.from-blog { padding: clamp(56px, 8vw, 96px) 0 clamp(24px, 4vw, 40px); }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
  max-width: 920px;
  margin: 0 auto 24px;
}
.section-head h2 {
  margin: 0;
  font: 700 clamp(30px, 5vw, 46px)/1.05 var(--display);
  letter-spacing: -0.01em;
}
.section-head a {
  font: 600 17px/1.2 var(--display);
  color: var(--link);
  text-decoration: none;
}
.section-head a:hover,
.section-head a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

/* A post */
.article {
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 48px) var(--gutter) clamp(56px, 8vw, 96px);
}
.article-head {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}
.article-head h1 {
  margin: 14px 0 0;
  font: 700 clamp(34px, 6.4vw, 58px)/1.06 var(--display);
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.cover { margin: clamp(28px, 5vw, 48px) 0; }
.cover img {
  width: 100%;
  border-radius: clamp(18px, 3vw, 28px);
  box-shadow: 0 24px 50px -30px rgba(0, 0, 0, 0.6);
}

.prose {
  max-width: 680px;
  margin: 0 auto;
  font-size: 18px;
  line-height: 1.7;
}
@media (min-width: 640px) {
  .prose { font-size: 19px; }
}
.prose p { margin: 0 0 1.1em; }
.prose .intro {
  font-size: 1.2em;
  line-height: 1.55;
}
.prose h2 {
  margin: 1.9em 0 0.55em;
  font: 700 clamp(25px, 3.6vw, 31px)/1.2 var(--display);
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.prose p a {
  color: var(--link);
  font-weight: 600;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent);
}
.prose p a:hover { text-decoration-color: currentColor; }

/* A game mentioned in a post, in its own colours, with a screenshot peeking up. */
.game-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(96px, 26vw, 136px);
  gap: 12px;
  margin: 1.8em 0 2.2em;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 100% 0%, var(--bg2), transparent 60%),
    var(--bg);
  color: #fbf6ec;
  font-size: 16px;
  line-height: 1.4;
}
.game-card .gc-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 22px 0 24px 22px;
}
.game-card .gc-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 10px;
  border-radius: 22%;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.prose .game-card p { margin: 0; }
.prose .game-card .gc-name a {
  color: inherit;
  font: 700 23px/1.15 var(--display);
  text-decoration: none;
}
.prose .game-card .gc-name a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.game-card .gc-sub { font: 600 15px/1.3 var(--display); color: var(--accent); }
.game-card .actions { margin-top: 14px; gap: 10px 18px; }
.game-card .store img { width: 132px; }
.game-card .site { font-size: 15px; }
.prose .game-card .coming-soon { padding: 10px 18px; font-size: 16px; }
.game-card .gc-shot { position: relative; margin-right: 22px; }
.game-card .gc-shot img {
  position: absolute;
  top: 24px;
  left: 0;
  width: 100%;
  border-radius: 16px;
  rotate: 4deg;
  box-shadow: 0 16px 34px -14px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.article-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  max-width: 680px;
  margin: 48px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.article-foot a {
  font: 600 17px/1.2 var(--display);
  color: var(--link);
  text-decoration: none;
}
.article-foot a:hover,
.article-foot a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

.footer-nav { font: 600 16px/1.4 var(--display); }
.footer .footer-nav a { text-decoration: none; }
.footer .footer-nav a:hover { text-decoration: underline; }

/* ---------- Screenshot viewer ---------- */

.viewer {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
}
.viewer::backdrop {
  background: rgba(8, 7, 6, 0.9);
  backdrop-filter: blur(6px);
}
.viewer[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.viewer img {
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 96px);
  width: auto;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.viewer button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: 400 32px/1 var(--body);
  cursor: pointer;
}
.viewer button:hover,
.viewer button:focus-visible { background: rgba(255, 255, 255, 0.24); outline: none; }
.viewer .close { top: 16px; right: 16px; }
.viewer .prev { left: 16px; top: 50%; translate: 0 -50%; }
.viewer .next { right: 16px; top: 50%; translate: 0 -50%; }
.viewer .count {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font: 600 14px/1 var(--display);
  color: rgba(255, 255, 255, 0.7);
}
@media (max-width: 640px) {
  .viewer .prev, .viewer .next { top: auto; bottom: 8px; translate: none; }
  .viewer .count { bottom: 24px; }
}
