/*
Theme Name: Mate Studios
Theme URI: https://mate-studios.com
Author: Mate Studios
Description: Studio catalog for Mate Studios. Steam, itch.io, and Google Play games, with about and press pages. Activating it replaces the public front of the site. The previous theme stays installed.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: mate-studios
*/

:root {
  --red: #dc0605;
  --red-deep: #9e0403;
  --cream: #f3efe8;
  --paper: #fffdfb;
  --ink: #241312;
  --muted: #5c403c;
  --line: #e4dcd2;
  --font: "Karla", ui-sans-serif, sans-serif;
  --heading: "Work Sans", ui-sans-serif, sans-serif;
  --shadow: 0 10px 30px rgba(36, 19, 18, 0.06);
  --ring: 0 0 0 1px rgba(36, 19, 18, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

main {
  flex: 1;
}

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

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

::selection {
  background: var(--red);
  color: #fff8f2;
}

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.on-red :focus-visible {
  outline-color: #fff8f2;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 80;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  padding: 0.6rem 1rem;
  font-family: var(--heading);
  font-weight: 700;
  text-decoration: none;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: min(72rem, calc(100% - 2.5rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--red);
  color: var(--cream);
}

body.admin-bar .site-header {
  top: 32px;
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 4rem;
}

.logo-link {
  margin-right: auto;
  display: flex;
  border-radius: 0.375rem;
}

.logo-link img {
  height: 2.75rem;
  width: auto;
}

.primary-nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
}

.primary-nav a {
  font-family: var(--heading);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.primary-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}

.primary-nav a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}

.nav-toggle {
  display: inline-flex;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.icon-close {
  display: none;
}

.is-nav-open .icon-open {
  display: none;
}

.is-nav-open .icon-close {
  display: block;
}

.mobile-nav {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  background: var(--red-deep);
  padding: 0.75rem 1.25rem 1rem;
}

.mobile-nav a {
  display: block;
  border-radius: 0.75rem;
  padding: 0.75rem 0.5rem;
  font-family: var(--heading);
  font-size: 1.125rem;
  font-weight: 600;
  text-decoration: none;
}

.hero {
  position: relative;
  overflow: hidden;
  background: var(--red);
  color: var(--cream);
}

.hero-orb {
  position: absolute;
  left: -12rem;
  top: 2.5rem;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  background: rgba(158, 4, 3, 0.7);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  padding-top: 3.5rem;
  padding-bottom: 4rem;
}

.hero h1,
.display {
  margin: 0;
  max-width: 48rem;
  font-family: var(--heading);
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.95;
  text-wrap: balance;
}

.hero-lead,
.intro,
.summary,
.lede {
  font-size: 1.125rem;
  line-height: 1.6;
}

.hero-lead {
  max-width: 36rem;
  margin: 1.25rem 0 0;
  color: rgba(243, 239, 232, 0.9);
}

.hero-actions,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.hero-wave {
  position: relative;
  display: block;
  width: 100%;
  height: 3.5rem;
  color: var(--cream);
}

.btn {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
  font-family: var(--heading);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}

.btn-cream {
  background: var(--cream);
  color: var(--red);
}

.btn-cream:hover {
  background: #fff;
}

.btn-ghost {
  border: 1px solid rgba(243, 239, 232, 0.5);
  color: var(--cream);
  background: transparent;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-red {
  background: var(--red);
  color: var(--cream);
}

.btn-red:hover {
  background: var(--red-deep);
}

.btn-paper {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--ring);
}

.btn-paper:hover {
  box-shadow: 0 0 0 1px var(--red);
}

.section {
  padding: 3rem 0;
}

.section-line {
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section-head h2,
.block h2,
.subhead,
.panel h2 {
  margin: 0;
  font-family: var(--heading);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section-head h2,
.subhead {
  font-size: 1.875rem;
}

.block h2,
.panel h2 {
  font-size: 1.5rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter {
  border-radius: 999px;
  padding: 0.5rem 1rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--ring);
  font-family: var(--heading);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

.filter span {
  margin-left: 0.375rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
}

.filter.is-active {
  background: var(--red);
  color: var(--cream);
  box-shadow: none;
}

.game-grid {
  display: grid;
  align-items: start;
  gap: 1rem;
  margin-top: 2rem;
}

.game-grid.is-single {
  max-width: 32rem;
}

.game-card {
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  background: var(--paper);
  padding: 0.75rem;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow), var(--ring);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(220, 6, 5, 0.14), var(--ring);
}

.game-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
}

.game-card-body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.5rem 0.25rem;
}

.game-card h3 {
  margin: 0;
  font-family: var(--heading);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.25;
}

.game-card p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.35;
}

.badge {
  display: inline-flex;
  margin-top: 0.125rem;
  flex-shrink: 0;
  border-radius: 999px;
  padding: 0.25rem 0.625rem;
  font-family: var(--heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-red {
  background: var(--red);
  color: var(--cream);
}

.badge-ink {
  background: rgba(36, 19, 18, 0.08);
  color: var(--ink);
}

.kicker {
  margin: 0;
  font-family: var(--heading);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
}

.display {
  margin-top: 0.75rem;
}

.lede {
  max-width: 48rem;
  margin-top: 1.5rem;
}

.lede p {
  margin: 0 0 1rem;
}

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

.credits li {
  border-radius: 24px;
  background: var(--paper);
  padding: 1.25rem;
  box-shadow: var(--ring);
}

.credits h3 {
  margin: 0;
  font-family: var(--heading);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.25;
}

.credit-detail {
  margin: 0.25rem 0 0;
  font-family: var(--heading);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--red);
}

.credit-note {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.subhead {
  margin-top: 3rem;
}

.aside {
  margin-top: 2rem;
  color: var(--muted);
}

.aside a,
.store-link,
.back {
  color: var(--red);
  font-weight: 600;
}

.aside a:hover,
.store-link:hover,
.back:hover {
  text-decoration: none;
}

.narrow {
  width: min(48rem, calc(100% - 2.5rem));
  margin-inline: auto;
}

.intro {
  margin: 1rem 0 0;
  color: var(--muted);
}

.panel {
  margin-top: 2.5rem;
  border-radius: 28px;
  background: var(--paper);
  padding: 1.5rem;
  box-shadow: var(--ring);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.panel p {
  margin: 1rem 0 0;
  line-height: 1.6;
}

.block {
  margin-top: 2.5rem;
}

.logo-grid,
.swatches {
  display: grid;
  gap: 1rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.logo-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border-radius: 24px;
  padding: 1.5rem;
  text-decoration: none;
}

.logo-tile-red {
  background: var(--red);
  color: var(--cream);
}

.logo-tile-red img {
  height: 3.5rem;
  width: auto;
}

.logo-tile-paper {
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(36, 19, 18, 0.1);
}

.logo-tile-paper img {
  width: 4rem;
  height: 4rem;
}

.logo-tile span {
  margin-top: 1.5rem;
  font-family: var(--heading);
  font-size: 0.875rem;
  font-weight: 700;
}

.logo-tile-paper span {
  margin-top: 1rem;
}

.swatches li {
  border-radius: 24px;
  padding: 1.25rem;
  box-shadow: 0 0 0 1px rgba(36, 19, 18, 0.15);
}

.swatches p {
  margin: 0;
  font-family: var(--heading);
  font-weight: 700;
}

.swatches p + p {
  margin-top: 1.5rem;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.game-list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--ring);
}

.game-list li {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--line);
}

.game-list li:first-child {
  border-top: 0;
}

.game-list a:first-child {
  font-family: var(--heading);
  font-weight: 700;
  text-decoration: none;
}

.game-list a:first-child:hover {
  color: var(--red);
}

.store-link {
  font-size: 0.875rem;
}

.back {
  font-family: var(--heading);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

.back:hover {
  text-decoration: underline;
}

.game-hero {
  display: grid;
  align-items: start;
  gap: 2rem;
  margin-top: 1.5rem;
}

.game-cover {
  width: 100%;
  border-radius: 28px;
  box-shadow: 0 16px 40px rgba(36, 19, 18, 0.12);
}

.game-hero .chip-row {
  margin-top: 0;
}

.summary {
  max-width: 36rem;
  margin: 1rem 0 0;
}

.game-hero .btn {
  margin-top: 1.5rem;
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 28rem;
  margin: 2rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.facts dt {
  font-family: var(--heading);
  font-weight: 700;
}

.facts dd {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

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

.highlights li {
  border-radius: 1rem;
  background: var(--paper);
  padding: 0.75rem 1rem;
  box-shadow: var(--ring);
}

.gallery {
  margin-top: 1rem;
  border-radius: 28px;
  background: var(--paper);
  padding: 0.75rem;
  box-shadow: var(--shadow), var(--ring);
}

.gallery-stage {
  position: relative;
  display: flex;
  min-height: 16rem;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  background: var(--cream);
  padding: 1.5rem 3rem;
}

.gallery-stage img {
  max-height: 68vh;
  width: auto;
  max-width: 100%;
  border-radius: 1rem;
}

.gallery-stage button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(36, 19, 18, 0.08), 0 0 0 1px rgba(36, 19, 18, 0.1);
  cursor: pointer;
}

.gallery-stage button:hover {
  background: #fff;
}

.gallery-stage [data-prev] {
  left: 0.5rem;
}

.gallery-stage [data-next] {
  right: 0.5rem;
}

.gallery-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 0 0.25rem;
}

.gallery-meta p {
  margin: 0;
}

.gallery-meta p:first-child {
  font-family: var(--heading);
  font-size: 0.875rem;
  font-weight: 600;
}

.gallery-meta p:last-child {
  color: var(--muted);
  font-size: 0.75rem;
}

.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  margin-top: 0.75rem;
  padding-bottom: 0.25rem;
}

.gallery-thumbs button {
  flex-shrink: 0;
  border: 0;
  border-radius: 0.75rem;
  padding: 2px;
  background: transparent;
  opacity: 0.7;
  cursor: pointer;
}

.gallery-thumbs button[aria-current="true"] {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--red);
}

.gallery-thumbs img {
  display: block;
  height: 4rem;
  width: auto;
  max-width: 6rem;
  object-fit: cover;
  object-position: top;
  border-radius: 10px;
}

.site-footer {
  background: var(--red);
  color: var(--cream);
}

.footer-bar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2.5rem 0;
}

.footer-name {
  margin: 0;
  font-family: var(--heading);
  font-size: 1.125rem;
  font-weight: 700;
}

.footer-note {
  max-width: 24rem;
  margin: 0.25rem 0 0;
  color: rgba(243, 239, 232, 0.85);
  font-size: 0.875rem;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.socials a {
  font-family: var(--heading);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
}

.socials a:hover {
  text-decoration-color: currentColor;
}

.prose {
  margin-top: 1.5rem;
}

.prose > *:first-child {
  margin-top: 0;
}

#games,
#about {
  scroll-margin-top: 5rem;
}

@media (min-width: 640px) {
  .hero-copy {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }

  .hero-wave {
    height: 5rem;
  }

  .section {
    padding: 4rem 0;
  }

  .section-head {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .game-grid:not(.is-single) {
    grid-template-columns: 1fr 1fr;
  }

  .is-wide {
    grid-column: span 2;
  }

  .highlights,
  .logo-grid {
    grid-template-columns: 1fr 1fr;
  }

  .swatches {
    grid-template-columns: repeat(3, 1fr);
  }

  .game-list li {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
  }

  .footer-bar {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .panel {
    padding: 2rem;
  }

  .gallery {
    padding: 1rem;
  }
}

@media (min-width: 768px) {
  .primary-nav {
    display: flex;
  }

  .nav-toggle,
  .mobile-nav {
    display: none;
  }
}

@media (min-width: 1024px) {
  .game-grid:not(.is-single) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .credits {
    grid-template-columns: repeat(3, 1fr);
  }

  .game-hero {
    grid-template-columns: minmax(0, 420px) 1fr;
  }
}

@media (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

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

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

  .game-card:hover {
    transform: none;
  }
}
