:root {
  color-scheme: dark;
  --background: #0e1928;
  --surface: #233347;
  --accent: #1755ed;
  --text: #f7f8fc;
  --muted: #899ab1;
  --gap: 13px;
  --tile-height: 524px;
  --meta-height: 122px;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--text);
  background: var(--background);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body { margin: 0; min-width: 280px; }

button, a { -webkit-tap-highlight-color: transparent; }

button { font: inherit; }

a { color: inherit; }

button:focus-visible, a:focus-visible, .about-tile:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 6px;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 16px;
  left: 16px;
  padding: 12px 20px;
  background: var(--accent);
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.site-shell {
  width: 90%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 78px 0 100px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.wordmark {
  margin: 0 0 0 -4px;
  font-size: 80px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -3.8px;
}

.site-nav {
  display: flex;
  gap: 48px;
  padding-top: 7px;
}

.nav-link {
  position: relative;
  padding: 9px 5px 14px;
  color: #94a0b2;
  font-size: 30px;
  line-height: 1.25;
  text-decoration: none;
  transition: color 160ms ease;
}

.nav-link::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: currentColor;
  content: "";
  transform: scaleX(0);
  transition: transform 160ms ease;
}

.nav-link.is-active { color: #1460ff; }
.nav-link.is-active::after { transform: scaleX(1); }

.games-section { margin-top: 94px; scroll-margin-top: 32px; }

.section-heading { margin-bottom: 16px; }

.section-heading h2, .about-heading h2 {
  margin: 0;
  font-size: 46px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 2px;
}

.section-heading > p, .about-heading > p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 1px;
}

.tile-grid {
  display: grid;
  grid-template-columns: minmax(0, 418fr) minmax(0, 561fr) minmax(0, 375fr);
  gap: var(--gap);
  align-items: start;
}

.game-tile { position: relative; height: var(--tile-height); }

.game-toggle {
  display: grid;
  grid-template-rows: minmax(0, 1fr) var(--meta-height);
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.game-thumbnail {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  background: #000;
  font-size: 268px;
  font-weight: 700;
  line-height: 1;
}

.game-meta {
  display: flex;
  align-items: center;
  padding: 24px 170px 24px 26px;
  background: var(--surface);
  transition: background-color 180ms ease;
}

.game-name {
  font-size: clamp(23px, 1.89vw, 29px);
  line-height: 1.25;
  white-space: nowrap;
}

.download-button {
  position: absolute;
  right: 13px;
  bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: clamp(108px, 9.38vw, 144px);
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: #909aa7;
  background: #49586b;
  font-size: 23px;
  cursor: not-allowed;
}

.download-button svg { width: 32px; height: 32px; }

.game-details {
  display: grid;
  grid-template-rows: 274px minmax(0, 1fr);
  height: var(--tile-height);
  background: var(--surface);
  transform-origin: left center;
}

.game-details[hidden] { display: none; }

.game-details.is-opening { animation: details-reveal 200ms ease-out; }

.game-screenshot {
  background-color: #d9dce0;
  background-image: conic-gradient(#9299a1 25%, #d9dce0 0 50%, #9299a1 0 75%, #d9dce0 0);
  background-size: 92px 92px;
}

.game-description { padding: 32px 30px; }
.game-description p { margin: 0; font-size: 23px; line-height: 1.5; letter-spacing: 3px; }

.about-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: var(--tile-height);
  padding: 30px 32px;
  background: var(--accent);
  scroll-margin-top: 24px;
}

.about-heading h2 { font-weight: 400; letter-spacing: 4px; }
.about-heading > p { color: #a2bcfc; }
.about-info { margin-top: auto; }

.about-info h3 {
  margin: 0;
  font-size: 52px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -1.8px;
}

.bio { margin: 14px 0 0; font-size: 20px; line-height: 1.5; }
.contact { margin-top: 32px; }
.contact-label { margin: 0 0 9px; color: #a2bcfc; font-size: 14px; line-height: 1.2; letter-spacing: .8px; }
.contact a { font-size: 22px; line-height: 1.25; letter-spacing: .7px; text-decoration: none; text-underline-offset: 6px; }

/* Keep the about tile in its column when the adjacent game details are closed. */
.tile-grid.is-collapsed .about-tile { grid-column: 3; }

@media (hover: hover) {
  .nav-link:hover { color: var(--text); }
  .game-toggle:hover .game-meta { background: #2d4057; }
  .contact a:hover { text-decoration: underline; }
}

@keyframes details-reveal {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 1450px) and (min-width: 1201px) {
  :root { --tile-height: 480px; --meta-height: 106px; }
  .tile-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr) minmax(0, 1fr); }
  .game-meta { padding-left: 20px; padding-right: 133px; }
  .game-name { font-size: 23px; }
  .download-button { right: 12px; bottom: 26px; width: 108px; height: 54px; gap: 8px; font-size: 19px; }
  .download-button svg { width: 26px; height: 26px; }
  .game-details { grid-template-rows: 250px minmax(0, 1fr); }
  .about-tile { padding: 28px 24px; }
  .about-info h3 { font-size: 42px; }
  .bio { font-size: 18px; }
  .contact a { font-size: 19px; letter-spacing: 0; }
}

@media (max-width: 1200px) {
  :root { --tile-height: 460px; --meta-height: 106px; }
  .site-shell { padding-top: 48px; padding-bottom: 64px; }
  .wordmark { margin-left: -2px; font-size: 62px; letter-spacing: -3px; }
  .site-nav { gap: 28px; }
  .nav-link { font-size: 25px; }
  .games-section { margin-top: 72px; }
  .tile-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
  .game-thumbnail { font-size: 240px; }
  .game-meta { padding: 20px 135px 20px 20px; }
  .game-name { font-size: 24px; }
  .download-button { bottom: 26px; width: 110px; height: 54px; gap: 8px; font-size: 20px; }
  .download-button svg { width: 26px; height: 26px; }
  .game-details { grid-template-rows: 240px minmax(0, 1fr); }
  .about-tile, .tile-grid.is-collapsed .about-tile { grid-column: 1 / -1; height: auto; min-height: 270px; }
  .about-tile { display: grid; grid-template-columns: 1fr 1.15fr; gap: 40px; }
  .about-info { margin: 0; }
  .about-info h3 { font-size: 44px; }
  .bio { font-size: 19px; }
  .contact { margin-top: 26px; }
}

@media (max-width: 900px) and (min-width: 701px) {
  .game-meta { padding-left: 16px; padding-right: 110px; }
  .game-name { font-size: 22px; }
  .download-button { right: 10px; width: 88px; gap: 6px; font-size: 18px; }
  .download-button svg { width: 22px; height: 22px; }
}

@media (max-width: 700px) {
  :root { --tile-height: 480px; --meta-height: 106px; }
  .site-shell { width: calc(100% - 40px); padding-top: 32px; padding-bottom: 40px; }
  .site-header { align-items: flex-start; flex-direction: column; gap: 24px; }
  .wordmark { font-size: clamp(45px, 10vw, 62px); letter-spacing: -2.5px; }
  .site-nav { gap: 30px; padding-top: 0; }
  .nav-link { padding: 5px 3px 10px; font-size: 22px; }
  .games-section { margin-top: 48px; }
  .section-heading h2, .about-heading h2 { font-size: 36px; }
  .section-heading > p, .about-heading > p { font-size: 16px; }
  .tile-grid { grid-template-columns: minmax(0, 1fr); }
  .game-tile { height: auto; }
  .game-toggle { grid-template-rows: auto var(--meta-height); }
  .game-thumbnail { aspect-ratio: 1.065; font-size: clamp(200px, 60vw, 290px); }
  .game-meta { padding-left: 22px; }
  .game-name { font-size: clamp(22px, 5.8vw, 28px); }
  .game-details { grid-template-rows: auto minmax(110px, 1fr); height: auto; }
  .game-screenshot { aspect-ratio: 2.05; background-size: 72px 72px; }
  .game-description { padding: 24px; }
  .about-tile { display: flex; gap: 56px; padding: 28px; }
  .about-info h3 { font-size: 44px; }
  .bio { font-size: 18px; }
  .contact a { font-size: 21px; }
}

@media (max-width: 359px) {
  .site-shell { width: calc(100% - 32px); }
  .game-meta { padding-left: 14px; padding-right: 107px; }
  .game-name { font-size: 20px; }
  .download-button { right: 10px; width: 88px; gap: 6px; font-size: 18px; }
  .download-button svg { width: 22px; height: 22px; }
  .about-tile { padding: 24px 20px; }
  .about-info h3 { font-size: 39px; }
  .contact a { font-size: 19px; letter-spacing: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
