/* Шрифты лежат рядом с сайтом, внешние сервисы не нужны */
@font-face {
  font-family: "Press Start 2P";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/press-start-2p-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Press Start 2P";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/press-start-2p-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Exo 2";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/exo-2-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Exo 2";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/exo-2-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #0f0618;
  --panel: #1a0b2e;
  --well: #12081f;
  --line: #3d2b5e;
  --text: #f2eefb;
  --dim: #b8b0d0;

  --cyan: #00f5ff;
  --magenta: #ff006e;
  --yellow: #ffbe0b;
  --violet: #9d7bff;

  --pixel: "Press Start 2P", ui-monospace, monospace;
  --body: "Exo 2", system-ui, sans-serif;
  --wrap: 960px;
}

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

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(#2a1745 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

main {
  flex: 1;
}

a:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 4px;
}

.wrap {
  width: min(100% - 2rem, var(--wrap));
  margin-inline: auto;
}

/* Шапка */
.site-header {
  padding-block: 1.25rem;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
  color: var(--text);
  font-family: var(--pixel);
  font-size: 0.75rem;
  line-height: 1;
  text-decoration: none;
}

.brand::before {
  content: "";
  width: 12px;
  height: 12px;
  background: var(--cyan);
  box-shadow: 4px 4px 0 var(--magenta);
}

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

.nav a {
  color: var(--dim);
  font-weight: 600;
  text-decoration: none;
}

.nav a:hover {
  color: var(--cyan);
}

/* Заглавный блок */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 3rem;
  align-items: center;
  padding-block: clamp(2.5rem, 8vw, 5rem) clamp(3rem, 8vw, 4.5rem);
}

.hero h1 {
  margin: 0 0 1.75rem;
  font-family: var(--pixel);
  font-size: clamp(1.5rem, 4.6vw, 2.75rem);
  font-weight: 400;
  line-height: 1.3;
  text-shadow: 0.1em 0.1em 0 var(--magenta);
}

.lead {
  max-width: 30rem;
  margin: 0 0 1.75rem;
  color: var(--dim);
  font-size: 1.25rem;
}

.button {
  display: inline-block;
  padding: 0.95rem 1.25rem;
  background: var(--cyan);
  box-shadow: 4px 4px 0 var(--magenta);
  color: var(--bg);
  font-family: var(--pixel);
  font-size: 0.75rem;
  line-height: 1;
  text-decoration: none;
}

.button:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--magenta);
}

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

.tags li {
  padding: 0.25rem 0.75rem;
  border: 2px solid var(--line);
  color: var(--dim);
  font-size: 0.9375rem;
}

/* «Экран» с иконками игр */
.screen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  justify-self: end;
  width: min(100%, 20rem);
  background: var(--line);
  border: 2px solid var(--line);
}

.screen img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  padding: 14%;
  background: var(--well);
  image-rendering: pixelated;
}

/* Разделы с играми */
.section {
  padding-bottom: 3.5rem;
  scroll-margin-top: 1rem;
}

.section h2,
.about h2 {
  margin: 0 0 0.75rem;
  font-family: var(--pixel);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
}

.section__lead {
  margin: 0 0 1.75rem;
  color: var(--dim);
}

.games {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.games > li {
  display: flex;
}

.game {
  --accent: var(--cyan);
  display: flex;
  flex: 1;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 6px 6px 0 var(--accent);
  color: inherit;
  text-decoration: none;
}

.game--snake {
  --accent: var(--cyan);
}
.game--2048 {
  --accent: var(--yellow);
}
.game--tetris {
  --accent: var(--magenta);
}
.game--breakout {
  --accent: var(--violet);
}

.game:hover {
  transform: translate(2px, 2px);
  box-shadow: 4px 4px 0 var(--accent);
}

.game__art {
  display: grid;
  flex: none;
  place-items: center;
  width: 8rem;
  height: 8rem;
  background: var(--well);
  border: 2px solid var(--line);
}

.game__art img {
  display: block;
  width: 5.5rem;
  height: 5.5rem;
  image-rendering: pixelated;
}

.game__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
}

.game__name {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
}

.game__desc {
  margin: 0;
  color: var(--dim);
}

.game__play {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-family: var(--pixel);
  font-size: 0.75rem;
  line-height: 1;
}

.game:hover .game__play {
  background: var(--accent);
  color: var(--bg);
}

/* О сайте */
.about {
  padding-bottom: 4.5rem;
  scroll-margin-top: 1rem;
}

.about p {
  max-width: 38rem;
  margin: 0 0 1rem;
  color: var(--dim);
}

/* Подвал */
.site-footer {
  padding-block: 2.5rem 1.5rem;
  border-top: 2px solid var(--line);
  color: var(--dim);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 2rem;
}

.footer-title {
  margin: 0 0 0.75rem;
  color: var(--text);
  font-weight: 700;
}

.footer-brand p {
  max-width: 22rem;
  margin: 0;
}

.footer-brand .footer-title {
  margin-bottom: 0.75rem;
}

.footer-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links li + li {
  margin-top: 0.35rem;
}

.footer-links a {
  color: var(--dim);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--cyan);
}

.footer-bottom {
  margin: 2rem 0 0;
  font-size: 0.9375rem;
}

/* Узкие экраны */
@media (max-width: 48rem) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .screen {
    justify-self: start;
    width: min(100%, 14rem);
  }
}

@media (max-width: 40rem) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 36rem) {
  .game {
    flex-direction: column;
    align-items: stretch;
  }

  .game__art {
    width: auto;
    height: auto;
    padding-block: 1.25rem;
  }
}

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

  .button:hover,
  .game:hover {
    transform: none;
  }
}
