/* ─── /assets/common.css — shared chrome across all gorilla pages ───
   Canonical styles for design tokens, reset, body atmosphere, nav,
   header rule, primary/secondary buttons, endgame strip, and footer.
   Page-specific styles (hero, run-card, lobby, etc.) stay inline on
   each page. Edit here for site-wide changes. */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&family=Chakra+Petch:wght@400;500;600;700&display=swap');

:root {
  --bg: #0a0612;
  --bg2: #140928;
  --ink: #ffffff;
  --green: #10b981;
  --red: #ff3355;
  --yellow: #ffd23f;
  --teal: #25f4ee;
  --linkedin: #0a66c2;
  --pixel: 'Press Start 2P', monospace;
  --crt: 'VT323', monospace;
  --ui: 'Chakra Petch', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  overflow-x: hidden;
}
body {
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(139,92,246,.15), transparent),
    radial-gradient(ellipse 60% 40% at 90% 20%, rgba(255,80,153,.1), transparent),
    var(--bg);
  min-height: 100vh;
}
a { color: inherit; }
img { max-width: 100%; height: auto; }

.scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 100;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,.18) 3px, rgba(0,0,0,0) 4px);
  mix-blend-mode: multiply;
}
.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 99;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,.6));
}

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

/* ─── NAV ─── */
nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 36px;
  background: rgba(10,6,18,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-img { width: 32px; height: 32px; image-rendering: pixelated; display: block; }
.logo-text {
  font-family: var(--pixel);
  font-size: 13px;
  color: var(--ink);
  letter-spacing: 1.5px;
}
nav ul { list-style: none; display: flex; gap: 24px; }
nav ul a {
  font-family: var(--pixel);
  color: rgba(255,255,255,.55);
  text-decoration: none;
  font-size: 10px;
  letter-spacing: 1.5px;
  transition: color .15s;
}
nav ul a:hover { color: var(--yellow); }

.nav-actions { display: inline-flex; align-items: center; gap: 10px; }
.nav-login {
  font-family: var(--pixel);
  font-size: 10px;
  background: transparent;
  color: var(--ink);
  padding: 11px 16px;
  border: 1.5px solid rgba(255,255,255,0.40);
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 1px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  transition: border-color .15s;
}
.nav-login:hover { border-color: var(--ink); }
.nav-cta {
  font-family: var(--pixel);
  font-size: 10px;
  background: var(--yellow);
  color: #1a0d2e;
  padding: 11px 16px;
  border: 2px solid #1a0d2e;
  border-radius: 6px;
  box-shadow: 0 4px 0 var(--red);
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 1px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  transition: transform .1s, box-shadow .1s;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--red); }
.nav-cta:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--red); }

.header-rule {
  height: 4px;
  background: var(--red);
  box-shadow: 0 1px 0 #000 inset;
}

/* ─── PRIMARY ARCADE BUTTONS ─── */
.btn-arcade {
  font-family: var(--pixel);
  font-size: 16px;
  padding: 26px 32px;
  background: var(--yellow);
  color: #1a0d2e;
  border: 2px solid #1a0d2e;
  border-radius: 8px;
  box-shadow: 0 4px 0 var(--red);
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 1.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  gap: 12px;
  transition: transform .1s, box-shadow .1s;
}
.btn-arcade:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--red); }
.btn-arcade:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--red); }
.btn-secondary { display: none; }

/* ─── ENDGAME STRIP ─── */
/* Stacked background image: top red border, top yellow caution stripe,
   bottom yellow caution stripe, bottom red border, solid black behind.
   All contiguous so there's no gap risk between the bands. */
.endgame {
  text-align: center;
  padding: 100px 48px;
  background-color: #000;
  background-image:
    linear-gradient(var(--red), var(--red)),
    repeating-linear-gradient(90deg, var(--yellow) 0 20px, transparent 20px 40px),
    repeating-linear-gradient(90deg, var(--yellow) 0 20px, transparent 20px 40px),
    linear-gradient(var(--red), var(--red));
  background-repeat: no-repeat;
  background-size: 100% 6px, 100% 14px, 100% 14px, 100% 6px;
  background-position:
    0 0,
    0 6px,
    0 calc(100% - 20px),
    0 calc(100% - 6px);
  border: 0;
  margin-top: 80px;
  /* Full-bleed: always span the viewport width, even when the .endgame
     element is nested inside a max-width container (e.g. blog posts). */
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  position: relative;
  overflow: visible;
}
.endgame h2 {
  font-family: var(--pixel);
  font-size: 32px;
  color: var(--ink);
  margin-bottom: 16px;
  text-shadow: 4px 4px 0 var(--red);
  line-height: 1.4;
}
.endgame .credits {
  font-family: var(--crt);
  font-size: 22px;
  color: var(--yellow);
  margin-bottom: 36px;
}

/* Walker animation — gorilla paces along the red top border, picks up the
   banana, eats it, walks back. Stage extends above .endgame so the
   walker stands on the red line. */
.endgame-stage {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 0; right: 0;
  height: 80px;
  pointer-events: none;
  z-index: 3;
}
.walker, .endgame-banana {
  position: absolute;
  bottom: 0;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  background-repeat: no-repeat;
}
.walker-walk {
  left: 0;
  width: 80px; height: 70px;
  background-image: url('/assets/gorilla-walk.png');
  background-size: 320px 70px;
  transform-origin: center;
  animation:
    walk-cycle 0.7s steps(4) infinite,
    walk-pace 16s linear infinite;
}
.walker-eat {
  right: 80px; left: auto;
  width: 56px; height: 72px;
  background-image: url('/assets/gorilla-grab-eat.png');
  background-size: 392px 72px;
  opacity: 0;
  animation: eat-master 16s steps(1) infinite;
}
.endgame-banana {
  right: 96px;
  width: 24px; height: 24px;
  background-image: url('/assets/gorilla-banana.png');
  background-size: contain;
  animation: banana-vis 16s steps(1) infinite;
}
@keyframes walk-cycle { to { background-position: -320px 0; } }
@keyframes walk-pace {
  0%      { left: 0;                              transform: scaleX(1); opacity: 1; }
  35%     { left: calc(100% - 80px - 80px);       transform: scaleX(1); opacity: 1; }
  36%     { left: calc(100% - 80px - 80px);       transform: scaleX(1); opacity: 0; }
  54%     { left: calc(100% - 80px - 80px);       transform: scaleX(-1); opacity: 0; }
  55%     { left: calc(100% - 80px - 80px);       transform: scaleX(-1); opacity: 1; }
  90%     { left: 0;                              transform: scaleX(-1); opacity: 1; }
  91%     { left: 0;                              transform: scaleX(1); opacity: 1; }
  100%    { left: 0;                              transform: scaleX(1); opacity: 1; }
}
@keyframes eat-master {
  0%      { opacity: 0; background-position: 0 0; }
  35%     { opacity: 1; background-position: 0 0; }
  37.857% { background-position: -56px 0; }
  40.714% { background-position: -112px 0; }
  43.571% { background-position: -168px 0; }
  46.428% { background-position: -224px 0; }
  49.285% { background-position: -280px 0; }
  52.142% { background-position: -336px 0; }
  55%     { opacity: 0; background-position: -336px 0; }
  100%    { opacity: 0; background-position: -336px 0; }
}
@keyframes banana-vis {
  0%, 35% { opacity: 1; }
  36%, 89% { opacity: 0; }
  90%, 100% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .walker, .endgame-banana { animation: none; }
  .walker-walk { left: 24px; }
  .walker-eat { opacity: 0; }
}

/* ─── FOOTER ─── */
/* No top border — the .endgame strip's bottom red rule already
   acts as the page's hard divider into the footer. */
footer {
  background: #000;
  padding: 48px 48px 32px;
  font-family: var(--ui);
  color: rgba(255,255,255,.6);
}
.footer-grid {
  max-width: 1400px;
  margin: 0 auto 32px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer-brand .logo-text { display: block; margin-top: 12px; }
.footer-tagline {
  font-family: var(--crt);
  font-size: 18px;
  color: rgba(255,255,255,.5);
  margin-top: 14px;
  max-width: 240px;
  line-height: 1.4;
}
.footer-col h3,
.footer-col h4 {
  font-family: var(--pixel);
  font-size: 10px;
  color: var(--yellow);
  margin-bottom: 16px;
  letter-spacing: 1px;
  font-weight: normal;
}
.footer-col a {
  display: block;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  font-size: 13px;
  padding: 5px 0;
  transition: color .15s;
}
.footer-col a:hover { color: var(--green); }
.footer-ascii {
  max-width: 1400px;
  margin: 24px auto 0;
  font-family: var(--crt);
  font-size: 14px;
  color: var(--green);
  white-space: pre;
  text-align: center;
  line-height: 1.2;
  opacity: .8;
}
.footer-bottom {
  max-width: 1400px;
  margin: 24px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--pixel);
  font-size: 9px;
  color: rgba(255,255,255,.35);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 1000px) {
  nav { padding: 12px 16px; }
  nav ul { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
  .logo-img { width: 28px; height: 28px; }
  .logo-text { font-size: 11px; }
  .endgame { padding: 78px 18px 80px; }
  .endgame h2 { font-size: 22px; }
  .endgame .credits { font-size: 18px; }
}
