/* Deliberately minimal. Styling comes after the site is live and working. */

/* Bricolage Grotesque, self-hosted. Variable 400-800 plus an optical size
   axis, so one 75KB file covers every weight the site uses. Licence in
   fonts/OFL.txt. swap keeps text visible while it loads. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

/* Anton, self-hosted. Single weight, 12KB — it sets the wordmark only.
   Licence in fonts/OFL-Anton.txt. */
@font-face {
  font-family: "Anton";
  src: url("/fonts/anton-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --display: "Bricolage Grotesque", Georgia, serif;
  --wordmark: "Anton", "Bricolage Grotesque", sans-serif;
}

html {
  overflow-x: hidden; /* required by the .hero full-bleed technique */
}

body {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem 1rem;
  font: 1rem/1.6 system-ui, sans-serif;
  /* Long tokens (URLs, inline code) must wrap rather than widen the page. */
  overflow-wrap: break-word;
}

/* Scoped: a bare `header` selector would also match header.hero and turn the
   banner into a flex container, collapsing .hero-inner to its content width. */
.site-header {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 3rem;
}

/* Display face on headings only; body stays on the system stack, which reads
   better at paragraph sizes and costs nothing to load. */
h1,
h2,
h3,
.wall-copy p,
.post-list a {
  font-family: var(--display);
}

/* Same face as the hero wordmark. Condensed type needs a little more tracking
   and size at nav scale to stay as readable as the grotesque it replaced. */
.brand {
  font-family: var(--wordmark);
  font-weight: 400;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}

nav a {
  margin-right: 0.75rem;
}

/* --- Homepage mosaic ---------------------------------------------------- */

.wall {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: -2rem;
  margin-bottom: 3rem;
  overflow: hidden;
  background: #05060a;
  isolation: isolate;
}

/* 15 tiles divide evenly by 5 and by 3, so the grid is always a full
   rectangle and each cell lands near 16:9 — the source art's own ratio. */
.wall-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  height: clamp(22rem, 34vw, 34rem);
}

.tile {
  background-size: cover;
  background-position: center;
  /* Muted at rest so the whole wall reads as one texture rather than fifteen
     competing images; colour returns on hover. */
  filter: saturate(0.82) brightness(0.82);
  transform: scale(1.01);
  transition:
    filter 0.5s ease,
    transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
  animation: tile-in 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  animation-delay: calc(var(--i) * 55ms);
}

.wall-grid:hover .tile {
  filter: saturate(0.5) brightness(0.5);
}

.wall-grid .tile:hover {
  filter: saturate(1.15) brightness(1.05);
  transform: scale(1.06);
  z-index: 2;
}

@keyframes tile-in {
  from {
    opacity: 0;
    transform: scale(1.12);
  }
  to {
    opacity: 1;
    transform: scale(1.01);
  }
}

/* Scrim: dark at the bottom-left where the copy sits, clearer top-right so the
   artwork still shows. Pointer-events off so tile hover still works beneath. */
.wall::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(5, 6, 10, 0.92) 0%, rgba(5, 6, 10, 0.34) 34%, rgba(5, 6, 10, 0) 62%, rgba(5, 6, 10, 0.42) 100%),
    radial-gradient(90% 70% at 12% 100%, rgba(5, 6, 10, 0.7), transparent 62%);
}

.wall-copy {
  position: absolute;
  z-index: 2;
  left: 50%;
  transform: translateX(-50%);
  bottom: clamp(1.25rem, 3vw, 2.5rem);
  width: 100%;
  max-width: 42rem;
  padding: 0 1rem;
  pointer-events: none;
  color: #fff;
}

.wall-copy h1 {
  margin: 0;
  /* Anton is condensed, so it can run larger than a grotesque at the same
     measure. It ships one weight and is already tightly spaced. */
  font-family: var(--wordmark);
  font-weight: 400;
  font-size: clamp(3rem, 10.5vw, 6.75rem);
  line-height: 0.86;
  letter-spacing: 0.005em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.8);
}

.wall-copy p {
  margin: 0.6rem 0 0;
  max-width: 34rem;
  font-size: clamp(0.9rem, 1.6vw, 1.05rem);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.9);
}

@media (max-width: 40rem) {
  .wall-grid {
    grid-template-columns: repeat(3, 1fr);
    height: clamp(20rem, 68vw, 26rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile {
    animation: none;
    transition: filter 0.2s ease;
    transform: none;
  }

  .wall-grid .tile:hover {
    transform: none;
  }
}

/* --- Game post banner -------------------------------------------------- */

/* Full-bleed: escape the centred body column without a wrapper element.
   html has overflow-x hidden so 100vw can't induce a horizontal scrollbar. */
.hero {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: -2rem;
  margin-bottom: 2.5rem;
  padding: 3.5rem 0 1.75rem;
  position: relative;
  isolation: isolate;
  color: #fff; /* fixed: text always sits on the darkened backdrop */
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  /* Centred crop by default. Override per post with `backdropY: 15%`. */
  background:
    linear-gradient(to bottom, rgba(10, 12, 20, 0.65), rgba(10, 12, 20, 0.92)),
    var(--backdrop, none) center var(--backdrop-y, 50%) / cover no-repeat;
  background-color: #0a0c14; /* shows through when a game has no artwork */
}

/* Same max-width + padding + content-box as body, so the cover's left edge
   lines up exactly with the article text below the banner. */
.hero-inner {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
}

.hero-cover {
  flex: none;
  width: 11rem;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.hero-meta {
  min-width: 0;
}

.hero-meta h1 {
  margin: 0 0 0.4rem;
  font-size: 1.75rem;
  line-height: 1.15;
}

.hero-released {
  margin: 0;
  font-size: 0.9rem;
}

.hero-platforms {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  opacity: 0.7;
}

@media (max-width: 34rem) {
  .hero-inner {
    align-items: center;
    gap: 1rem;
  }

  .hero-cover {
    width: 7rem;
  }

  .hero-meta h1 {
    font-size: 1.3rem;
  }
}

.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
}

.post-list time {
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

footer .sep {
  margin: 0 0.35rem;
  opacity: 0.4;
}

footer {
  clear: both; /* drop below a floated cover rather than beside it */
  margin-top: 4rem;
  font-size: 0.875rem;
  opacity: 0.6;
}

pre {
  overflow-x: auto;
  padding: 0.75rem;
  background: color-mix(in srgb, currentColor 8%, transparent);
  border-radius: 4px;
}
