/* ==========================================================================
   THE SIDE PATH — style.css

   A single stylesheet shared by the catalogue and the editorial article
   pages. No frameworks, no build tools, no images.

   Contents
   1.  Design tokens (custom properties, light and dark themes)
   2.  Base styles
   3.  Header and navigation
   4.  Hero
   5.  Featured games
   6.  About
   7.  Footer
   8.  Tablet adjustments
   9.  Mobile adjustments
   10. Reduced-motion support
   11. Editorial feature page
   12. Catalogue feature link
   13. Editorial page mobile adjustments
   14. Homepage editorial spotlight
   ========================================================================== */


/* ==========================================================================
   1. DESIGN TOKENS
   Custom properties are variables. They are declared once on :root
   (the <html> element) and reused with var(--name) everywhere below.
   Change a value here and it updates across the whole site.

   Colours: the light palette is the default. theme.js writes a
   data-theme="dark" attribute onto <html> when the visitor has chosen the
   dark theme or their operating system asks for it, and the block below
   then swaps the palette. Components only ever use these tokens, so both
   themes stay in sync.
   ========================================================================== */

:root {
  /* Light theme palette */
  color-scheme: light;

  --color-bg: #f2eee4;              /* warm paper background */
  --color-surface: #fffcf5;         /* card and panel background */
  --color-surface-deep: #f7f2e7;    /* card gradient end */

  --color-border: #ddd5c6;          /* subtle dividing lines */
  --color-border-strong: #c8bfae;   /* slightly firmer outlines */
  --color-text: #242a26;            /* main readable text */
  --color-muted: #666b60;           /* secondary text */

  --color-accent: #526b4f;          /* primary green accent */
  --color-accent-soft: rgba(82, 107, 79, 0.32);
  --color-accent-wash: rgba(82, 107, 79, 0.08);
  --color-accent-glow: rgba(82, 107, 79, 0.12);
  --color-accent-border: rgba(82, 107, 79, 0.32);
  --color-on-accent: #fffcf5;       /* text placed on an accent fill */

  --color-secondary: #a85e42;       /* warm clay accent */
  --color-secondary-soft: rgba(168, 94, 66, 0.32);
  --color-secondary-wash: rgba(168, 94, 66, 0.08);

  --shadow-accent: 0 20px 40px -24px rgba(82, 107, 79, 0.45);

  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 5rem;

  /* Layout */
  --content-width: 1080px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --header-offset: 0px;             /* header scrolls away, so anchors land flush */

  /* Shape */
  --radius-sm: 6px;
  --radius-lg: 16px;

  /* Typography. Newsreader carries the wordmark and editorial headlines;
     DM Sans carries interface and body text. Both have system fallbacks
     so the page stays readable if the webfonts are unavailable. */
  --font-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype",
    Palatino, "Book Antiqua", Georgia, serif;
  --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Dark theme palette. Applied by theme.js, so the attribute is always
   present before the page paints. */
:root[data-theme="dark"] {
  color-scheme: dark;

  --color-bg: #171b22;
  --color-surface: #222832;
  --color-surface-deep: #1c222b;

  --color-border: #2d3541;
  --color-border-strong: #3d4756;
  --color-text: #e9e6de;
  --color-muted: #9aa4b0;

  --color-accent: #8fb7e8;
  --color-accent-soft: rgba(143, 183, 232, 0.32);
  --color-accent-wash: rgba(143, 183, 232, 0.08);
  --color-accent-glow: rgba(143, 183, 232, 0.12);
  --color-accent-border: rgba(143, 183, 232, 0.32);
  --color-on-accent: #171b22;

  --color-secondary: #c18a70;
  --color-secondary-soft: rgba(193, 138, 112, 0.32);
  --color-secondary-wash: rgba(193, 138, 112, 0.08);

  --shadow-accent: 0 20px 40px -24px rgba(0, 0, 0, 0.65);
}



/* ==========================================================================
   2. BASE STYLES
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-text);
  background-color: var(--color-bg);

  /* A very faint accent glow behind the top of the page.
     Drawn with CSS only, so no image file is needed. */
  background-image: radial-gradient(
    ellipse 75% 50% at 78% -10%,
    var(--color-accent-glow),
    transparent 70%
  );
  background-repeat: no-repeat;

  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

::selection {
  background-color: var(--color-accent-soft);
  color: var(--color-text);
}

/* A visible focus ring for keyboard users. This only appears when someone
   navigates with the Tab key, not when they click with a mouse. */
a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

/* ==========================================================================
   3. HEADER AND NAVIGATION
   The header is deliberately not sticky: it sits at the top of the page and
   scrolls away with the content. The wordmark leads on the left, while the
   two navigation links and the theme toggle sit together on the right.
   ========================================================================== */

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md) var(--space-lg);

  padding-block: clamp(1.25rem, 3vw, 1.75rem);

  /* This centres the header content in the same column as <main> below,
     while the header's background still spans the full window width. */
  padding-inline: max(var(--gutter), calc((100% - var(--content-width)) / 2));

  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

/* Wordmark: the brand name set in Newsreader. No decorative mark competes
   with the type, so the name carries the identity. It links home. */
.wordmark {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.6vw, 1.85rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.18s ease;
}

.wordmark:hover {
  color: var(--color-accent);
}

.wordmark:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* The navigation and theme toggle travel together. On wide screens they
   share the right-hand side; on phones they drop to their own compact row. */
.header-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) var(--space-lg);
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-lg);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Small uppercase labels keep the two links quiet next to the wordmark.
   min-height gives the links a comfortable touch target. */
nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding-block: 0.25rem;
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

nav a:hover {
  color: var(--color-text);
  border-bottom-color: var(--color-accent-soft);
}

/* Keyboard focus for navigation links. outline-offset gives the ring
   a little breathing room so it never touches the text. */
nav a:focus-visible {
  color: var(--color-text);
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* Theme toggle: a quiet pill beside the navigation. theme.js reveals it
   once the theme has been resolved, so it never appears as a dead control. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0.35rem 0.85rem;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  background-color: transparent;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease,
    border-color 0.18s ease;
}

.theme-toggle::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background-color: var(--color-secondary);
}

.theme-toggle:hover {
  color: var(--color-text);
  background-color: var(--color-accent-wash);
  border-color: var(--color-accent-soft);
}

.theme-toggle:focus-visible {
  color: var(--color-text);
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.theme-toggle[hidden] {
  display: none;
}

/* <main> uses the same centred column as the header. */
main {
  padding-inline: max(var(--gutter), calc((100% - var(--content-width)) / 2));
}

/* ==========================================================================
   4. HERO
   On desktop the hero is two balanced columns: the introduction on the left
   and a three-panel visual sampler on the right. The sampler panels are
   intentional CSS-drawn placeholders, not screenshots or generated artwork.
   ========================================================================== */

#home {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);

  padding-block: clamp(3.5rem, 9vw, 6.5rem);
  scroll-margin-top: var(--header-offset);
}

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

/* The publication descriptor, set quietly above the headline. */
.hero-eyebrow {
  margin: 0 0 var(--space-md);
  color: var(--color-accent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

#home h1 {
  max-width: 15ch;                  /* keeps the headline to a few strong lines */
  margin: 0 0 var(--space-md);
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero-lede {
  max-width: 46ch;                  /* comfortable reading width */
  margin: 0 0 var(--space-lg);
  color: var(--color-muted);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  line-height: 1.7;
}

/* Call to action: the single, obvious route into the catalogue. */
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0.75rem 1.5rem;
  color: var(--color-on-accent);
  background-color: var(--color-accent);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hero-cta::after {
  content: "\2192";
  transition: transform 0.18s ease;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent);
}

.hero-cta:hover::after {
  transform: translateX(3px);
}

.hero-cta:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Visual sampler ------------------------------------------------------- */

/* Desktop composition: a tall panel on the left with two stacked panels
   beside it, laid out inside one fixed-shape block. */
.hero-sampler {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
  aspect-ratio: 1;
}

.hero-panel {
  display: block;
  overflow: hidden;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.hero-panel--one {
  grid-row: span 2;
  background-image:
    radial-gradient(circle at 68% 76%, var(--color-secondary-wash) 0 24%, transparent 25%),
    linear-gradient(180deg, var(--color-accent-wash), transparent 58%);
}

.hero-panel--two {
  background-image:
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 25% 25%, 25% 25%;
}

.hero-panel--three {
  background-image: repeating-radial-gradient(
    circle at 32% 68%,
    transparent 0 18%,
    var(--color-accent-wash) 18% 20%
  );
}

/* Tablet: the hero becomes a single column and the sampler turns into a
   row of three equal panels. */
@media (max-width: 900px) {
  #home {
    grid-template-columns: 1fr;
    padding-block: clamp(3rem, 8vw, 5rem);
  }

  .hero-sampler {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: none;
    aspect-ratio: auto;
  }

  .hero-panel {
    aspect-ratio: 1;
  }

  .hero-panel--one {
    grid-row: auto;
  }
}

/* Mobile: the same three-panel strip with tighter spacing. */
@media (max-width: 600px) {
  .hero-sampler {
    gap: var(--space-xs);
  }

  .hero-lede {
    max-width: none;
  }
}

/* ==========================================================================
   5. FEATURED GAMES
   CSS Grid places the three <article> cards side by side on wide screens
   and stacks them into one column when space runs out.
   auto-fill (rather than auto-fit) keeps empty columns in reserve, so a
   single card keeps its normal width when the filter hides the other two.
   ========================================================================== */

#featured {
  display: grid;
  /* auto-fill keeps any hidden cards' columns in reserve, so a single match
     keeps its normal width. A 300px minimum gives three columns on wide
     windows, two in between, and one on phones. */
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: var(--space-md);

  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  scroll-margin-top: var(--header-offset);
  border-top: 1px solid var(--color-border);
}

/* The heading and the italic note should span the full grid width,
   not sit in a narrow card-sized column. */
#featured > h2,
#featured > p {
  grid-column: 1 / -1;
}

#featured h2 {
  font-size: clamp(1.6rem, 3vw, 2rem);
}

/* The "these games are fictional" note, styled as a quiet callout. */
#featured > p {
  max-width: 62ch;
  padding-left: var(--space-md);
  color: var(--color-muted);
  font-size: 0.9rem;
  border-left: 2px solid var(--color-accent-soft);
}

/* Catalogue controls: search, pillar buttons, genre dropdown, result count,
   and a clear action. The wrapper is a grid child, so spanning every column
   keeps the controls exactly as wide as the card grid below. */
.catalogue-controls {
  grid-column: 1 / -1;
  display: grid;
  gap: var(--space-md);
}

/* Search field ----------------------------------------------------------- */

/* Search, genre, and the result tools share one compact row. */
.catalogue-search-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-md);
}

.search-field {
  display: flex;
  flex: 1 1 16rem;
  flex-direction: column;
  gap: var(--space-xs);
  max-width: 34rem;
}

.search-label {
  color: var(--color-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.search-input {
  min-height: 2.75rem;
  padding: 0.6rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  transition: border-color 0.18s ease;
}

.search-input::placeholder {
  color: var(--color-muted);
  opacity: 0.75;
}

.search-input:hover {
  border-color: var(--color-accent-soft);
}

.search-input:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-color: var(--color-accent-soft);
}

/* Filter groups ---------------------------------------------------------- */

/* Each group pairs a visible label with its own control, so the pillar and
   genre filters can be told apart visually and by screen readers. */
.filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.filter-group-label {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

/* Compact genre dropdown. appearance: none removes the platform arrow so the
   control keeps the site's pill shape; the two small triangles below draw a
   quiet chevron instead. */
.genre-select {
  min-height: 2.75rem;
  width: 13rem;
  max-width: 100%;
  padding: 0.55rem 2.2rem 0.55rem 1.1rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 1.15rem) calc(50% + 0.05rem),
    calc(100% - 0.85rem) calc(50% + 0.05rem);
  background-size: 0.3rem 0.3rem, 0.3rem 0.3rem;
  background-repeat: no-repeat;
  transition: border-color 0.18s ease;
}

.genre-select:hover {
  border-color: var(--color-accent-soft);
}

.genre-select:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-color: var(--color-accent-soft);
}

/* Pillar filters -------------------------------------------------------- */

/* Pillar buttons. They sit in their own row so all four stay visible. */
.category-button {
  padding: 0.45rem 1.05rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  background-color: transparent;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease,
    border-color 0.18s ease;
}

.category-button:hover {
  color: var(--color-text);
  border-color: var(--color-accent-soft);
}

.category-button[aria-pressed="true"] {
  color: var(--color-accent);
  background-color: var(--color-accent-wash);
  border-color: var(--color-accent-soft);
}

.category-button:focus-visible {
  color: var(--color-text);
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Result count and the clear action sit at the right of the first row. */
.catalogue-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) var(--space-md);
  margin-left: auto;
}

.filter-status {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.catalogue-clear {
  min-height: 2.5rem;
  padding: 0.45rem 1.05rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  background-color: transparent;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease,
    border-color 0.18s ease;
}

.catalogue-clear:hover:not(:disabled) {
  color: var(--color-text);
  background-color: var(--color-accent-wash);
  border-color: var(--color-accent-soft);
}

.catalogue-clear:focus-visible {
  color: var(--color-text);
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.catalogue-clear:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Empty state: hidden until a later phase decides there are no matches. */
.catalogue-empty {
  margin: 0;
  padding: var(--space-lg);
  text-align: center;
  color: var(--color-muted);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
}

/* Cards hidden by script.js must leave the grid completely.
   Without this rule, the card's own display: flex below would win. */
.catalogue-card[hidden] {
  display: none;
}

/* Each catalogue entry. The card is a flex column: one landscape image on
   top, then the editorial text. position: relative lets the entry's single
   link cover the whole card. */
.catalogue-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);

  transition: transform 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease;
}

/* Hover lifts the card; :focus-within gives the same emphasis to keyboard
   users when the card's link has focus. */
.catalogue-card:hover,
.catalogue-card:focus-within {
  transform: translateY(-3px);
  border-color: var(--color-accent-soft);
  box-shadow: var(--shadow-accent);
}

/* Exactly one primary image per card, in landscape. These are intentional
   CSS-drawn placeholders: no screenshots, no generated game art, and no
   overlays or image labels. */
.card-media {
  aspect-ratio: 16 / 10;
  background-color: var(--color-surface-deep);
  border-bottom: 1px solid var(--color-border);
  background-image:
    radial-gradient(circle at 74% 26%, var(--color-secondary-wash) 0 20%, transparent 21%),
    linear-gradient(180deg, var(--color-accent-wash), transparent 62%);
}

/* Revisit entries use a study grid and community entries use contour rings,
   so the three editorial pillars stay visually distinct without labels. */
.catalogue-card[data-category="revisit"] .card-media {
  background-image:
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 12.5% 20%, 12.5% 20%;
}

.catalogue-card[data-category="community"] .card-media {
  background-image: repeating-radial-gradient(
    circle at 30% 72%,
    transparent 0 14%,
    var(--color-accent-wash) 14% 15.5%
  );
}

/* The editorial text sits in its own padded column beneath the image. */
.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md) clamp(1.1rem, 2vw, 1.4rem) var(--space-lg);
}

.catalogue-card h3 {
  font-size: 1.3rem;
  letter-spacing: -0.015em;
}

.catalogue-card p {
  margin: 0;
}

/* Metadata row: editorial pillar, genre, and any badge. min-height keeps the
   row consistent when a card carries only one or two items. */
.card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.7rem;
  min-height: 1.6rem;
}

/* Editorial pillar label, e.g. "Discover" or "Community Projects". */
.card-category {
  color: var(--color-accent);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* A small accent dot before each pillar label. */
.card-category::before {
  content: "";
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  margin-right: 0.5rem;
  border-radius: 50%;
  background-color: var(--color-accent);
  vertical-align: middle;
}

/* Genre metadata, kept quieter than the pillar. */
.card-genre {
  color: var(--color-muted);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-genre strong {
  color: var(--color-muted);
  font-weight: 600;
}

/* The "Editor's pick" badge. It sits in the metadata row, pushed to the
   right by its auto margin. */
.card-badge {
  margin-left: auto;
  padding: 0.2rem 0.6rem;
  white-space: nowrap;
  background-color: var(--color-accent);
  color: var(--color-on-accent);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.6;
  text-transform: uppercase;
}

/* The "Practice placeholder" label marks fictional sample entries. It uses
   a quiet outline instead of the solid accent fill, so it stays visually
   distinct from the Editor's Pick badge when a card carries both. */
.card-placeholder {
  margin-left: auto;
  padding: 0.2rem 0.55rem;
  white-space: nowrap;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.6;
  text-transform: uppercase;
}

/* When both labels are present, keep them together at the right edge. */
.card-badge + .card-placeholder {
  margin-left: 0;
}

.card-description {
  color: var(--color-muted);
  font-size: 0.95rem;
}

/* Platform and year, pinned to the bottom of every card. margin-top auto
   pushes it down so the meta rows line up across a row of cards. */
.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
  color: var(--color-muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-meta li + li {
  padding-left: 0.75rem;
  border-left: 1px solid var(--color-border);
}

/* ==========================================================================
   6. ABOUT
   ========================================================================== */

#about {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  scroll-margin-top: var(--header-offset);
  border-top: 1px solid var(--color-border);
}

#about h2 {
  margin-bottom: var(--space-md);
  font-size: clamp(1.6rem, 3vw, 2rem);
}

#about p {
  max-width: 66ch;
  margin: 0;
  color: var(--color-muted);
}

#about p + p {
  margin-top: var(--space-md);
}

/* ==========================================================================
   7. FOOTER
   The wordmark and tagline sit on the left, the footer navigation on the
   right, and the small print spans the full width underneath.
   ========================================================================== */

footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-lg) var(--space-xl);

  padding-block: clamp(2.5rem, 6vw, 4.5rem);

  /* Matches the centred column used by the header and <main>. */
  padding-inline: max(var(--gutter), calc((100% - var(--content-width)) / 2));

  color: var(--color-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--color-border);
}

.footer-wordmark {
  margin: 0 0 var(--space-xs);
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

.footer-tagline {
  margin: 0;
  max-width: 34ch;
}

/* Footer links use the same quiet uppercase treatment as the header. */
.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-lg);
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding-block: 0.25rem;
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.footer-nav a:hover {
  color: var(--color-text);
  border-bottom-color: var(--color-accent-soft);
}

.footer-nav a:focus-visible {
  color: var(--color-text);
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* Small print spanning the full width, divided from the content above. */
.footer-legal {
  grid-column: 1 / -1;
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  font-size: 0.78rem;
}

.footer-legal p {
  margin: 0;
}

.footer-legal p + p {
  margin-top: var(--space-xs);
  max-width: 72ch;
}

/* ==========================================================================
   8. TABLET ADJUSTMENTS
   Below about 820px the grid already reflows on its own thanks to
   auto-fit; these rules just soften the large spacing.
   ========================================================================== */

@media (max-width: 820px) {
  header {
    padding-block: var(--space-md);
  }
}

/* ==========================================================================
   9. MOBILE ADJUSTMENTS
   Below 600px the header becomes two short rows: the wordmark on its own,
   then the two navigation links and the theme toggle together.
   ========================================================================== */

@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
    padding-block: var(--space-md);
  }

  /* Navigation and toggle share the second row, one at each edge. */
  .header-end {
    width: 100%;
    justify-content: space-between;
    gap: var(--space-xs) var(--space-md);
  }

  nav ul {
    gap: var(--space-xs) var(--space-md);
  }

  nav a {
    font-size: 0.72rem;
  }

  #featured {
    grid-template-columns: 1fr;
  }

  /* Stack the search row and let each control use the full width. */
  .catalogue-search-row {
    flex-direction: column;
    align-items: stretch;
  }

  .search-field,
  .genre-select {
    max-width: none;
  }

  .genre-select {
    width: 100%;
  }

  .catalogue-tools {
    margin-left: 0;
    justify-content: space-between;
  }

  footer {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
}

/* ==========================================================================
   10. REDUCED-MOTION SUPPORT
   Respects the operating-system setting that asks for less animation.
   ========================================================================== */

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   11. EDITORIAL FEATURE PAGE
   The article page reuses the catalogue's design tokens and header/footer.
   A single centred column of about 66 characters keeps long-form reading
   comfortable. Figures are allowed to extend wider than that text column on
   desktop, while staying inside it on smaller screens.
   ========================================================================== */

.article-shell {
  max-width: 66ch;
  margin-inline: auto;
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(3.5rem, 9vw, 6.5rem);
}

/* The "Back to catalogue" link. It sits above the article header and uses
   the accent colour plus a small arrow so it reads as navigation rather
   than body copy. */
.article-back {
  margin: 0 0 var(--space-lg);
}

.article-back a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding-block: 0.25rem;
  color: var(--color-accent);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.article-back a:hover {
  color: var(--color-text);
  border-bottom-color: var(--color-accent-soft);
}

.article-back a:focus-visible {
  color: var(--color-text);
  border-radius: var(--radius-sm);
}

/* Article header: category and genre labels, title, subtitle, and the
   concise game information strip. */
.article-header {
  padding-bottom: clamp(2rem, 5vw, var(--space-xl));
  margin-bottom: clamp(2rem, 5vw, var(--space-xl));
  border-bottom: 1px solid var(--color-border);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-sm);
  margin: 0 0 var(--space-md);
}

/* Category label, echoing the small uppercase labels in the catalogue. */
.article-category {
  color: var(--color-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.article-category::before {
  content: "";
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  margin-right: 0.5rem;
  border-radius: 50%;
  background-color: var(--color-accent);
  vertical-align: middle;
}

/* Genre pill, matching the catalogue card's genre line. */
.article-genre {
  padding: 0.25rem 0.7rem;
  background-color: var(--color-accent-wash);
  border: 1px solid var(--color-accent-border);
  border-radius: 999px;
  color: var(--color-accent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  line-height: 1.6;
  text-transform: uppercase;
}

.article-header h1 {
  max-width: 22ch;
  margin-bottom: var(--space-md);
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.article-subtitle {
  max-width: 52ch;
  margin: 0 0 var(--space-lg);
  color: var(--color-muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.55;
}

/* Game information strip: a quiet inset panel with the same border and
   surface colours used by the catalogue cards. */
.article-game {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.9rem;
  margin: 0;
  padding: var(--space-sm) var(--space-md);
  list-style: none;
  color: var(--color-muted);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-game li + li {
  padding-left: 0.9rem;
  border-left: 1px solid var(--color-border);
}

/* Figures ---------------------------------------------------------------- */

/* Article images may run wider than the text column. On wider screens each
   figure is pulled 5rem past the column on both sides, which keeps it
   centred and still inside the page gutters. */
.article-figure {
  margin-block: clamp(2rem, 5vw, 3rem);
}

.article-figure--lead {
  margin-top: 0;
}

.article-image {
  aspect-ratio: 16 / 9;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

/* These are intentional CSS-drawn placeholders, not screenshots or generated
   game art. Each variation suggests a different moment in the game. */
.article-image--lead {
  background-image:
    radial-gradient(circle at 76% 24%, var(--color-secondary-wash) 0 16%, transparent 17%),
    linear-gradient(180deg, var(--color-accent-wash), transparent 58%),
    linear-gradient(0deg, var(--color-accent-wash), transparent 38%);
}

.article-image--day {
  background-image:
    linear-gradient(180deg, var(--color-accent-wash), transparent 55%),
    repeating-linear-gradient(
      90deg,
      transparent 0 4.5%,
      var(--color-accent-wash) 4.5% 9%
    );
}

.article-image--night {
  background-image:
    radial-gradient(circle at 30% 30%, var(--color-accent-glow) 0 12%, transparent 13%),
    radial-gradient(circle at 68% 22%, var(--color-secondary-wash) 0 8%, transparent 9%),
    linear-gradient(0deg, var(--color-accent-wash), transparent 45%);
}

@media (min-width: 860px) {
  .article-figure {
    width: calc(100% + 10rem);
    margin-inline: -5rem;
  }
}

/* Long-form body copy. Sections are separated by generous space, and each
   paragraph is followed by a comfortable gap. */
.article-body {
  font-size: clamp(1rem, 1.6vw, 1.075rem);
  line-height: 1.8;
}

.article-body p {
  margin: 0 0 clamp(1.25rem, 2.4vw, 1.6rem);
}

.article-body h2 {
  margin: var(--space-xl) 0 var(--space-md);
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.article-body section:first-child h2 {
  margin-top: 0;
}

.article-body strong {
  color: var(--color-text);
}

/* ==========================================================================
   12. CATALOGUE FEATURE LINK
   The quiet destination link inside a catalogue card. Its invisible overlay
   makes the whole card clickable while keeping a single link per card, so
   there is never a nested link.
   ========================================================================== */

.card-action {
  margin: 0;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-block: 0.2rem;
  color: var(--color-accent);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

/* The stretched link: an invisible layer covering the whole card. The card
   is position: relative, so inset: 0 fills it. */
.card-link::before {
  content: "";
  position: absolute;
  inset: 0;
}

.card-link::after {
  content: "\2192";
  transition: transform 0.18s ease;
}

.card-link:hover {
  color: var(--color-text);
  border-bottom-color: var(--color-accent-soft);
}

.card-link:hover::after {
  transform: translateX(3px);
}

.card-link:focus-visible {
  color: var(--color-text);
  border-radius: 2px;
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* ==========================================================================
   13. EDITORIAL PAGE — MOBILE ADJUSTMENTS
   The article keeps the same reading column on small screens; only spacing
   and the information strip change so everything stays comfortable.
   ========================================================================== */

@media (max-width: 600px) {
  .article-shell {
    padding-block: var(--space-lg) var(--space-xl);
  }

  .article-header h1 {
    max-width: none;
  }

  .article-game {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
    padding: var(--space-md);
  }

  .article-game li + li {
    padding-left: 0;
    border-left: 0;
  }

  .article-figure {
    margin-block: var(--space-lg);
  }

  .article-body {
    line-height: 1.75;
  }
}

/* ==========================================================================
   14. HOMEPAGE EDITORIAL SPOTLIGHT
   The lead feature between the hero and the catalogue: one image beside the
   article introduction on desktop, stacking image-first on small screens.
   It keeps the existing section rhythm and a faint accent wash rather than
   catalogue card styling.
   ========================================================================== */

.editorial-spotlight {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);

  /* A small left inset so the content clears the panel's left edge. It sits
     inside the section, so the panel's outer position and width are
     unchanged. 1.5rem is 24px. */
  padding-inline-start: 1.5rem;

  scroll-margin-top: var(--header-offset);
  border-top: 1px solid var(--color-border);
  background-image: linear-gradient(
    90deg,
    var(--color-accent-wash),
    transparent 65%
  );
  background-repeat: no-repeat;
}

/* Small editorial label above the feature title. */
.editorial-kicker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 var(--space-lg);
  color: var(--color-accent);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* The accent dot mirrors the category labels used across the catalogue. */
.editorial-kicker::before {
  content: "";
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background-color: var(--color-accent);
  box-shadow: 0 0 12px var(--color-accent-soft);
}

/* Desktop: the single feature image beside the article introduction. */
.editorial-spotlight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
}

/* The one feature image. This is an intentional CSS-drawn placeholder with a
   dusk mood; it is not a screenshot or generated game art. */
.editorial-art {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background-image:
    radial-gradient(circle at 72% 28%, var(--color-secondary-wash) 0 22%, transparent 23%),
    linear-gradient(180deg, var(--color-accent-wash), transparent 60%),
    linear-gradient(0deg, var(--color-accent-wash), transparent 40%);
}

.editorial-spotlight-copy {
  min-width: 0;
  max-width: 47ch;
}

/* The article title leads the spotlight. */
.editorial-spotlight-copy h2 {
  max-width: 18ch;
  margin: 0 0 var(--space-md);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

/* Game, category, and genre, kept secondary to the article title. */
.editorial-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.9rem;
  margin: 0 0 var(--space-md);
  padding: 0;
  list-style: none;
  color: var(--color-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.editorial-meta li + li {
  padding-left: 0.9rem;
  border-left: 1px solid var(--color-border);
}

.editorial-excerpt {
  margin: 0 0 var(--space-md);
  color: var(--color-muted);
  font-size: clamp(1rem, 1.7vw, 1.1rem);
  line-height: 1.7;
}

/* The call to action uses the same accent and arrow motion as the
   catalogue's feature link. */
.editorial-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-block: 0.2rem;
  color: var(--color-accent);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.editorial-link::after {
  content: "\2192";
  transition: transform 0.18s ease;
}

.editorial-link:hover {
  color: var(--color-text);
  border-bottom-color: var(--color-accent-soft);
}

.editorial-link:hover::after {
  transform: translateX(3px);
}

.editorial-link:focus-visible {
  color: var(--color-text);
  border-radius: 2px;
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Tablet: a single reading column, image first. */
@media (max-width: 820px) {
  .editorial-spotlight-grid {
    grid-template-columns: 1fr;
  }

  .editorial-art {
    aspect-ratio: 3 / 2;
  }

  .editorial-kicker {
    margin-bottom: var(--space-md);
  }
}

/* Mobile: tighter spacing, a smaller left inset, a full-width title, and
   metadata that wraps without stray divider lines. */
@media (max-width: 600px) {
  .editorial-spotlight {
    padding-block: var(--space-lg);
    padding-inline-start: 1rem;     /* 16px on small screens */
    scroll-margin-top: 0;
  }

  .editorial-spotlight-copy h2 {
    max-width: none;
  }

  .editorial-meta {
    gap: var(--space-xs) var(--space-md);
  }

  .editorial-meta li + li {
    padding-left: 0;
    border-left: 0;
  }
}
