/* =========================================================
   chupko.xyz
   ========================================================= */

@font-face {
  font-family: "Silkscreen";
  src: url("/assets/fonts/silkscreen-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Silkscreen";
  src: url("/assets/fonts/silkscreen-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("/assets/fonts/pixelify-var.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --ink: #08080d;
  --ink-2: #0e0e16;
  --panel: #14141d;
  --panel-2: #1a1a25;
  --line: #2a2a3a;
  --line-2: #3d3d54;

  --text: #eceade;
  --dim: #8d8ba0;
  --faint: #5c5a70;

  --gold: #ffc93c;
  --cyan: #6fe3ff;
  --pink: #ff6b8a;
  --green: #7cf29a;

  --max: 1120px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }

html {
  background: var(--ink);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--text);
  font-family: "Pixelify Sans", ui-monospace, Menlo, monospace;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }

::selection { background: var(--gold); color: var(--ink); }

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: 24px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--ink);
}
.skip:focus { left: 12px; top: 12px; }

h1, h2, h3, h4 { margin: 0; font-weight: 400; }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8, 8, 13, .94);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 64px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Silkscreen", monospace;
  font-size: 15px;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}

.logo .mark {
  width: 22px;
  height: 22px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.logo .cur {
  display: inline-block;
  width: 8px;
  height: 13px;
  margin-left: 2px;
  background: var(--gold);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: block;
  padding: 7px 12px;
  border: 1px solid transparent;
  color: var(--dim);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color .14s, border-color .14s, background .14s;
}

.nav-links a:hover { color: var(--text); border-color: var(--line); }

.nav-links a[aria-current="page"] {
  color: var(--ink);
  background: var(--gold);
  border-color: var(--gold);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform .12s steps(2, end), background .12s;
}

.nav-cta:hover { background: var(--panel-2); }
.nav-cta:active { transform: translate(2px, 2px); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
  padding-block: 88px 96px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: .18;
  mask-image: radial-gradient(70% 70% at 28% 45%, #000 10%, transparent 78%);
  -webkit-mask-image: radial-gradient(70% 70% at 28% 45%, #000 10%, transparent 78%);
  pointer-events: none;
}

.hero > * { position: relative; z-index: 1; }

.hero h1 {
  font-family: "Silkscreen", monospace;
  font-size: clamp(40px, 7vw, 82px);
  line-height: 1.02;
  letter-spacing: -.02em;
}

.hero h1 span { display: block; color: var(--gold); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 20px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--text);
  font-family: "Silkscreen", monospace;
  font-size: 12px;
  letter-spacing: .04em;
  text-decoration: none;
  transition: transform .12s steps(2, end), background .14s, border-color .14s;
}

.btn:hover { background: var(--panel-2); border-color: #4d4d68; }
.btn:active { transform: translate(2px, 2px); }

.btn.solid {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.btn.solid:hover { background: #ffd76a; border-color: #ffd76a; }

/* ---------- cabinet (pixel art, integer scale) ---------- */

.cabinet {
  width: 224px;
  flex: none;
}

.cabinet svg {
  width: 100%;
  height: auto;
  shape-rendering: crispEdges;
  image-rendering: pixelated;
}

.screen-flicker { animation: flicker 6s steps(1) infinite; }

@keyframes flicker {
  0%, 91%, 100% { opacity: 1; }
  92% { opacity: .5; }
  93% { opacity: 1; }
  96% { opacity: .7; }
  97% { opacity: 1; }
}

/* ---------- sections ---------- */

.section { padding-block: 64px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}

.section-head h2 {
  font-family: "Silkscreen", monospace;
  font-size: 15px;
  letter-spacing: .05em;
}

/* ---------- game grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--panel);
  text-decoration: none;
  color: var(--text);
  transition: transform .13s steps(2, end), border-color .13s;
}

.card:hover,
.card:focus-visible {
  transform: translate(-3px, -3px);
  border-color: var(--line-2);
  outline: none;
}

.card-screen {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .028) 0 2px, transparent 2px 4px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .028) 0 2px, transparent 2px 4px),
    linear-gradient(160deg, #101020, #0a0a12);
}

.card-screen .glyph {
  font-family: "Silkscreen", monospace;
  font-size: 74px;
  line-height: 1;
  color: var(--accent, var(--gold));
  text-shadow: 0 0 26px color-mix(in srgb, var(--accent, var(--gold)) 45%, transparent);
  transition: transform .16s steps(2, end);
}

.card:hover .glyph { transform: scale(1.06); }

.card-screen img { width: 100%; height: 100%; object-fit: cover; }

.card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 15px 15px;
}

.card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.card-title {
  font-family: "Silkscreen", monospace;
  font-size: 13px;
  letter-spacing: .03em;
}

.card-year {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 10.5px;
  color: var(--faint);
}

.card-blurb {
  margin: 0;
  color: var(--dim);
  font-size: 15px;
  line-height: 1.45;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
}

.tag {
  padding: 3px 7px;
  border: 1px solid var(--line);
  color: var(--dim);
}

.tag.hot { border-color: rgba(255, 107, 138, .4); color: var(--pink); }

/* "more soon" placeholder */
.card.soon {
  border-style: dashed;
  background: transparent;
  cursor: default;
}

.card.soon:hover { transform: none; border-color: var(--line); }

.card.soon .card-screen { background: none; border-bottom: 1px dashed var(--line); }

.card.soon .dots span {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-inline: 3px;
  background: var(--dim);
  animation: dot 1.4s steps(1) infinite;
}

.card.soon .dots span:nth-child(2) { animation-delay: .2s; }
.card.soon .dots span:nth-child(3) { animation-delay: .4s; }

@keyframes dot {
  0%, 60% { background: var(--dim); }
  61%, 100% { background: var(--line); }
}

/* ---------- chips ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.chip {
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .14s, border-color .14s, background .14s;
}

.chip:hover { color: var(--text); border-color: var(--line-2); }

.chip[aria-pressed="true"] {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

/* ---------- empty state ---------- */

.empty {
  padding: 46px 24px;
  border: 1px dashed var(--line);
  text-align: center;
  color: var(--dim);
}

.empty strong {
  display: block;
  margin-bottom: 6px;
  font-family: "Silkscreen", monospace;
  font-size: 13px;
  color: var(--text);
}

/* ---------- footer ---------- */

.foot {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  background: var(--ink-2);
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

.foot-inner a { color: var(--faint); text-decoration: none; }
.foot-inner a:hover { color: var(--text); }

/* ---------- page header ---------- */

.page-head {
  padding-block: 64px 44px;
  border-bottom: 1px solid var(--line);
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

.crumbs a { color: var(--faint); text-decoration: none; }
.crumbs a:hover { color: var(--gold); }

.page-head h1 {
  font-family: "Silkscreen", monospace;
  font-size: clamp(30px, 4.6vw, 48px);
  line-height: 1.1;
}

.page-head p {
  max-width: 52ch;
  margin: 16px 0 0;
  color: var(--dim);
}

/* ---------- prose ---------- */

.prose { max-width: 64ch; }
.prose p { margin: 0 0 16px; color: var(--dim); }
.prose h2 {
  margin: 40px 0 14px;
  font-family: "Silkscreen", monospace;
  font-size: 14px;
  color: var(--text);
}
.prose ul { margin: 0 0 18px; padding-left: 20px; color: var(--dim); }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--cyan); text-decoration: none; border-bottom: 1px solid rgba(111, 227, 255, .3); }
.prose a:hover { border-bottom-color: var(--cyan); }
.prose code {
  padding: 2px 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
  color: var(--gold);
}

pre {
  margin: 0 0 18px;
  padding: 16px;
  overflow-x: auto;
  background: var(--ink-2);
  border: 1px solid var(--line);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--dim);
}

pre .c { color: var(--faint); }
pre .s { color: var(--green); }
pre .k { color: var(--pink); }

/* ---------- game page ---------- */

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 600px) 300px;
  justify-content: center;
  gap: 28px;
  align-items: start;
  padding-block: 40px 64px;
}

.cab {
  border: 1px solid var(--line-2);
  background: var(--panel);
}

.cab-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--ink-2);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

.stage {
  position: relative;
  background: #05050a;
  padding: 14px;
}

.stage canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  image-rendering: pixelated;
  background: #0a0a12;
  border: 1px solid #1b1b28;
  touch-action: none;
}

.stage-overlay {
  position: absolute;
  inset: 14px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  background: rgba(5, 5, 10, .86);
  border: 1px solid var(--line);
}

.stage-overlay[hidden] { display: none; }

.stage-overlay h3 {
  font-family: "Silkscreen", monospace;
  font-size: 17px;
  margin-bottom: 8px;
}

.stage-overlay p { margin: 0 0 16px; color: var(--dim); font-size: 15px; }

.hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  background: var(--ink-2);
}

.hud div {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  font-family: ui-monospace, Menlo, monospace;
}

.hud div:last-child { border-right: 0; }

.hud .k {
  display: block;
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
}

.hud .v { font-size: 17px; color: var(--text); }

.side-card {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 16px;
  margin-bottom: 16px;
}

.side-card h3 {
  font-family: "Silkscreen", monospace;
  font-size: 12px;
  margin-bottom: 12px;
  color: var(--dim);
}

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

.keys li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 15px;
  color: var(--dim);
}

.keys li:last-child { border-bottom: 0; }

kbd {
  display: inline-block;
  min-width: 24px;
  padding: 2px 6px;
  border: 1px solid var(--line-2);
  border-bottom-width: 3px;
  background: var(--panel-2);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: var(--text);
  text-align: center;
}

.dpad {
  display: none;
  grid-template-columns: repeat(3, 54px);
  grid-template-rows: repeat(2, 54px);
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

.dpad button {
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  font-family: "Silkscreen", monospace;
  font-size: 15px;
  cursor: pointer;
  touch-action: manipulation;
}

.dpad button:active { background: var(--panel); }

.dpad .up { grid-column: 2; }
.dpad .left { grid-column: 1; grid-row: 2; }
.dpad .down { grid-column: 2; grid-row: 2; }
.dpad .right { grid-column: 3; grid-row: 2; }

/* ---------- 404 ---------- */

.center-screen {
  min-height: calc(100vh - 65px);
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: 60px;
}

.center-screen h1 {
  font-family: "Silkscreen", monospace;
  font-size: clamp(34px, 8vw, 68px);
  line-height: 1.05;
}

.center-screen h1 em { font-style: normal; color: var(--pink); }

.center-screen p { max-width: 40ch; margin: 18px auto 0; color: var(--dim); }

.center-screen .actions { justify-content: center; margin-top: 32px; }

/* ---------- reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .42s var(--ease), transform .42s var(--ease);
  transition-delay: calc(var(--i, 0) * 55ms);
}

.reveal.in { opacity: 1; transform: none; }

/* ---------- focus ---------- */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 44px;
    padding-block: 60px 72px;
  }
  .cabinet { width: 168px; order: -1; }
  .game-layout { grid-template-columns: 1fr; }
  .dpad { display: grid; }
}

@media (max-width: 640px) {
  .nav-links li:not(:first-child) { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .section { padding-block: 48px; }
  .page-head { padding-block: 48px 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
