/* Games page: "level select", with cyan HUD brackets, jump links and the menu-screen grid. */

/* The grid belongs only here: "level select" is a game menu screen, and the grid reads as its playfield. */
.page-games .page-hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 48px 48px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 90%);
  mask-image: linear-gradient(180deg, #000, transparent 90%);
}
.games-kicker::after { content: '_'; margin-left: -4px; color: var(--cyan-text); }
@media (prefers-reduced-motion: no-preference) {
  /* Blinks four times (under 5 seconds) on load, then stays visible. */
  .games-kicker::after { animation: caret 1.1s steps(1) 4; }
}
@keyframes caret { 50% { opacity: 0; } }
.games-count { display: grid; justify-items: end; gap: 6px; text-align: right; }
.games-count strong { font-family: var(--font-display); font-weight: 700; font-size: clamp(5rem, 3rem + 8vw, 9rem); line-height: .8; color: var(--cyan-text); }
.games-count span { font-family: var(--font-display); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }

/* Jump links to each group */
.level-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-bottom: 32px; padding-bottom: 20px; border-bottom: 1px solid var(--line-strong); }
.level-filters { display: flex; flex-wrap: wrap; gap: 10px; }
.level-filter {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 9px 16px; border: 0; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-2); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-strong);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: color .2s ease, background-color .2s ease;
}
.level-filter:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--cyan); }
.level-status { font-size: var(--fs-sm); color: var(--ink-3); }

.games-catalogue { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; margin-top: clamp(56px, 7vw, 88px); padding-top: 24px; border-top: 1px solid var(--line); }

@media (max-width: 860px) {
  .games-count { justify-items: start; text-align: left; }
}
/* Groups: full-time job, freelance, own games */
a.level-filter { text-decoration: none; }
.engine-legend { display: flex; align-items: center; gap: 4px; }
.engine-legend .engine { margin: 0 0 0 4px; }
.games-sections { display: grid; gap: clamp(64px, 8vw, 112px); }
.game-group > .studio-card { margin-top: 24px; }
.studio-card {
  --cut: 16px; position: relative; display: grid; gap: 8px; max-width: 560px; padding: 24px 80px 24px 26px; text-decoration: none; background: var(--panel);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  box-shadow: inset 0 0 0 1px var(--line); transition: background-color .2s ease;
}
.studio-card .label { color: var(--rose-text); }
.studio-card strong { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: 1.5rem; line-height: 1; }
.studio-card span:not(.label):not(.studio-go) { color: var(--ink-2); font-size: var(--fs-sm); }
.studio-go { position: absolute; right: 26px; top: 50%; transform: translateY(-50%); font-family: var(--font-display); font-size: 2rem; color: var(--rose-text); transition: transform .25s var(--ease); }
.studio-card:hover { background: var(--panel-2); }
.studio-card:hover .studio-go { transform: translate(4px, -54%); }
.level-meta small .engine { margin-right: 6px; font-size: .625rem; }
/* Smaller cartridges: cap the title so two-word names never overflow the frame */
.level-card .frame-card strong { font-size: clamp(1.25rem, min(calc(70cqi / (var(--chars, 8) * .68)), 14cqi), 3.5rem); }

/* Featured games: each section is a case study plus a strip of screenshots */
.game-group .project-index { margin-top: 8px; }
.game-group-freelance .case { --accent-a: var(--magenta); --accent-b: var(--cyan); --case-text: var(--magenta-text); }
.game-group-own .case { --accent-a: var(--rose); --accent-b: var(--magenta); --case-text: var(--rose-text); }
.shot-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 10px; align-items: center; margin-top: 28px; text-decoration: none; }
.shot-strip img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border: 1px solid var(--line-strong); transition: border-color .2s ease, transform .25s var(--ease); }
.shot-strip > span { padding-left: 10px; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-sm); color: var(--cyan-text); white-space: nowrap; }
.shot-strip:hover img { border-color: var(--cyan); }
.shot-strip:hover img:nth-child(odd) { transform: translateY(-3px); }
.games-sections > .studio-card { margin-top: 8px; }
@media (max-width: 560px) {
  .shot-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shot-strip > span { grid-column: 1 / -1; padding: 4px 0 0; }
}
.game-group-bar { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 28px; padding-bottom: 14px; border-bottom: 1px solid var(--line-strong); }
.game-group-no { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-3); color: var(--cyan-text); }
.game-group-bar h2 { font-size: var(--fs-sm); letter-spacing: .1em; text-transform: uppercase; color: var(--cyan-text); }
.game-group-bar p { color: var(--ink-3); font-size: var(--fs-sm); }
.game-group-freelance .game-group-no, .game-group-freelance .game-group-bar h2 { color: var(--magenta-text); }
.game-group-own .game-group-no, .game-group-own .game-group-bar h2 { color: var(--rose-text); }
