:root {
  --bg: #09070f;
  --bg-soft: #141022;
  --panel: rgba(18, 14, 33, 0.88);
  --panel-2: rgba(26, 20, 46, 0.95);
  --text: #f7f2ff;
  --muted: #b8acd0;
  --line: rgba(255, 255, 255, 0.1);
  --pink: #ff4fd8;
  --cyan: #61f4ff;
  --lime: #b6ff6a;
  --yellow: #ffe66d;
  --shadow: 0 0 0 2px rgba(255, 255, 255, 0.06), 0 18px 60px rgba(0, 0, 0, 0.45);
  --max-width: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "VT323", monospace;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 79, 216, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(97, 244, 255, 0.11), transparent 25%),
    linear-gradient(180deg, #08060d 0%, #0b0814 50%, #07060b 100%);
  overflow-x: hidden;
}

body.menu-open,
body.lightbox-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image:
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 4px 4px;
  mix-blend-mode: soft-light;
  z-index: 0;
}

.container {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* =========================
   GAME HUD CLOCK + LIVES
   ========================= */

.game-hud {
  position: fixed;
  top: 96px;
  right: 1rem;
  z-index: 40;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.hud-box {
  min-height: 58px;
  padding: 0.75rem 0.9rem;
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02)),
    rgba(18, 14, 33, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hud-label {
  display: block;
  margin-bottom: 0.35rem;
  font-family: "Press Start 2P", cursive;
  font-size: 0.42rem;
  color: var(--cyan);
  letter-spacing: 0.08em;
}

.hud-time {
  display: block;
  font-family: "Press Start 2P", cursive;
  font-size: 0.7rem;
  color: var(--yellow);
  text-shadow: 0 0 12px rgba(255, 230, 109, 0.25);
}

.lives {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.life {
  font-size: 1.25rem;
  color: var(--pink);
  text-shadow:
    0 0 8px rgba(255, 79, 216, 0.45),
    2px 2px 0 rgba(0,0,0,0.6);
  animation: lifePulse 1.4s ease-in-out infinite alternate;
}

.life:nth-child(2) {
  animation-delay: 0.15s;
}

.life:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes lifePulse {
  from {
    transform: scale(1);
    opacity: 0.85;
  }

  to {
    transform: scale(1.12);
    opacity: 1;
  }
}

/* =========================
   PROJECT IMAGE BLOCK
   ========================= */

.project-image {
  position: relative;
  margin-top: 1.5rem;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.project-image img {
  width: 100%;
  height: auto;
  display: block;
}

.project-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255,79,216,0.08),
    rgba(97,244,255,0.05) 40%,
    transparent 70%
  );
  pointer-events: none;
}

.project-image:hover {
  transform: translateY(-4px);
}

.image-caption {
  margin-top: 0.5rem;
  font-size: 1.2rem;
  line-height: 1.4;
  color: var(--muted);
}

/* nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(7, 6, 11, 0.7);
  border-bottom: 1px solid var(--line);
}

.navbar {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-tag {
  font-family: "Press Start 2P", cursive;
  font-size: 1.5rem;
  line-height: 1.6;
  color: var(--yellow);
  text-shadow:
    2px 2px 0 rgba(0, 0, 0, 0.6),
    0 0 18px rgba(255, 230, 109, 0.2);
  transition: all 0.25s ease;
}

.brand-tag:hover {
  color: var(--yellow);
  text-shadow:
    0 0 8px rgba(255, 230, 109, 0.6),
    0 0 16px rgba(255, 79, 216, 0.4),
    0 0 24px rgba(97, 244, 255, 0.25);
  transform: translateY(-1px);
}

.desktop-nav,
.mobile-nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.desktop-nav a,
.mobile-nav-links a {
  font-family: "Press Start 2P", cursive;
  font-size: 0.62rem;
  padding: 0.95rem 1rem;
  border: 2px solid transparent;
  transition: 0.25s ease;
}

.desktop-nav a:hover,
.mobile-nav-links a:hover,
.desktop-nav a.active {
  border-color: var(--pink);
  color: var(--pink);
  background: rgba(255, 79, 216, 0.08);
}

.menu-toggle {
  display: none;
  width: 54px;
  height: 54px;
  border: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
}

.menu-toggle span {
  width: 24px;
  height: 3px;
  background: var(--text);
  display: block;
  transition: 0.25s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

.mobile-menu {
  display: none;
  border-top: 1px solid var(--line);
  background: rgba(10, 8, 18, 0.96);
}

.mobile-menu.open {
  display: block;
}

.mobile-nav-links {
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.mobile-nav-links a {
  display: block;
  padding: 1rem;
  border-radius: 12px;
}

/* hero */
.project-page {
  padding-bottom: 4rem;
}

.project-hero {
  padding: 4rem 0 2rem;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.5rem;
  align-items: center;
}

.section-label,
.content-label,
.sidebar-title,
.mini-label {
  font-family: "Press Start 2P", cursive;
  font-size: 0.56rem;
  color: var(--cyan);
  letter-spacing: 0.08em;
}

.project-hero h1 {
  margin: 1rem 0;
  font-family: "Press Start 2P", cursive;
  font-size: clamp(1.5rem, 4vw, 3.3rem);
  line-height: 1.4;
}

.hero-text {
  margin: 0;
  font-size: clamp(1.3rem, 1.8vw, 1.7rem);
  line-height: 1.4;
  color: var(--muted);
}

.hero-actions,
.next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.9rem 1.25rem;
  border-radius: 16px;
  border: 2px solid var(--line);
  font-family: "Press Start 2P", cursive;
  font-size: 0.58rem;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(180deg, rgba(255, 79, 216, 0.24), rgba(255, 79, 216, 0.1));
  border-color: rgba(255, 79, 216, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.6rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  font-family: "Press Start 2P", cursive;
  font-size: 0.5rem;
}

/* hero preview */
.preview-window,
.content-card,
.sidebar-card,
.next-project-card {
  background: var(--panel-2);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.preview-window {
  overflow: hidden;
}

.window-top {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.window-top p {
  margin: 0 0 0 0.5rem;
  color: var(--muted);
  font-size: 1.15rem;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.pink { background: var(--pink); }
.dot.yellow { background: var(--yellow); }
.dot.green { background: var(--lime); }

/* shell */
.project-shell {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.project-sidebar {
  position: sticky;
  top: 100px;
  display: grid;
  gap: 1rem;
}

.sidebar-card,
.content-card,
.next-project-card {
  padding: 1.3rem;
}

.project-nav {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 1rem;
}

.project-nav-link {
  display: block;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  font-family: "Press Start 2P", cursive;
  font-size: 0.52rem;
  transition: 0.2s ease;
}

.project-nav-link:hover,
.project-nav-link.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(97, 244, 255, 0.08);
  transform: translateX(4px);
}

.stats-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}

.stats-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 1.25rem;
  color: var(--muted);
}

.stats-list strong {
  color: var(--text);
  font-weight: normal;
}

/* content */
.project-content {
  display: grid;
  gap: 1rem;
}

.content-card h2,
.next-project-card h2 {
  margin: 0.8rem 0 1rem;
  font-family: "Press Start 2P", cursive;
  font-size: clamp(1rem, 2.6vw, 1.6rem);
  line-height: 1.5;
}

.content-card p,
.solution-card p,
.timeline-step p,
.overview-block p,
.final-callout p {
  font-size: clamp(1.2rem, 1.7vw, 1.5rem);
  line-height: 1.42;
  color: var(--muted);
}

.overview-grid,
.solution-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.overview-block,
.solution-card,
.highlight-panel,
.timeline-step,
.gallery-card,
.final-callout {
  background: rgba(255,255,255,0.03);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 1.1rem;
}

.overview-block h3,
.solution-card h3,
.timeline-step h3 {
  margin: 0 0 0.7rem;
  font-family: "Press Start 2P", cursive;
  font-size: 0.68rem;
  line-height: 1.6;
}

.highlight-panel,
.final-callout {
  margin-top: 1rem;
  background:
    linear-gradient(180deg, rgba(97,244,255,0.08), transparent 60%),
    rgba(255,255,255,0.03);
}

.timeline {
  display: grid;
  gap: 0.9rem;
}

.step-tag {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: "Press Start 2P", cursive;
  font-size: 0.44rem;
  color: var(--yellow);
  margin-bottom: 0.8rem;
}

/* gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.gallery-card {
  text-align: left;
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.gallery-card:hover,
.gallery-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--cyan);
  box-shadow:
    var(--shadow),
    0 0 18px rgba(97, 244, 255, 0.22);
}

.gallery-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: top;
  display: block;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255,79,216,0.2), rgba(97,244,255,0.12)),
    #141022;
}

.gallery-card span {
  display: block;
  margin-top: 0.8rem;
  font-family: "Press Start 2P", cursive;
  font-size: 0.55rem;
  line-height: 1.6;
}

.next-project-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.25rem;
  align-items: center;
}

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}

.lightbox.open {
  display: block;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 5, 10, 0.82);
  backdrop-filter: blur(8px);
}

.lightbox-panel {
  position: relative;
  z-index: 2;
  width: min(calc(100% - 2rem), 900px);
  margin: 6vh auto 0;
  background: var(--panel-2);
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 72px;
  height: 48px;
  padding: 0 0.7rem;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.5);
  color: var(--text);
  font-family: "Press Start 2P", cursive;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  z-index: 5;
  transition: all 0.2s ease;
}

.lightbox-close:hover {
  border-color: var(--pink);
  color: var(--pink);
  background: rgba(255, 79, 216, 0.12);
  transform: scale(1.06);
}

.lightbox-close:active {
  transform: scale(0.95);
}

.close-label {
  font-size: 0.45rem;
}

.lightbox-preview {
  height: 420px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,79,216,0.18), transparent 30%),
    linear-gradient(180deg, #101525, #17152a);
  margin-bottom: 1rem;
  overflow: hidden;
}

.lightbox-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #09070f;
}

.lightbox-copy {
  padding-top: 0.25rem;
}

.lightbox-panel h3 {
  margin: 0 0 0.7rem;
  font-family: "Press Start 2P", cursive;
  font-size: 0.78rem;
  line-height: 1.6;
}

.lightbox-panel p {
  margin: 0;
  font-size: 1.35rem;
  color: var(--muted);
  line-height: 1.4;
}

/* =========================
   COMPACT PROTOTYPE SECTION
   ========================= */

.prototype-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.prototype-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0.85rem 1.2rem;
  border-radius: 14px;
  border: 2px solid rgba(97, 244, 255, 0.4);
  background: linear-gradient(
    180deg,
    rgba(97, 244, 255, 0.18),
    rgba(97, 244, 255, 0.06)
  );
  color: var(--cyan);
  font-family: "Press Start 2P", cursive;
  font-size: 0.55rem;
  text-align: center;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.prototype-btn:hover {
  transform: translateY(-2px);
  border-color: var(--cyan);
  box-shadow:
    0 0 10px rgba(97, 244, 255, 0.35),
    0 10px 30px rgba(0,0,0,0.4);
}

.prototype-btn:active {
  transform: scale(0.96);
}

.prototype-btn.alt {
  border-color: rgba(255, 230, 109, 0.4);
  color: var(--yellow);
  background: linear-gradient(
    180deg,
    rgba(255, 230, 109, 0.18),
    rgba(255, 230, 109, 0.06)
  );
}

.prototype-btn.alt:hover {
  border-color: var(--yellow);
  box-shadow:
    0 0 10px rgba(255, 230, 109, 0.35),
    0 10px 30px rgba(0,0,0,0.4);
}

.prototype-intro {
  margin: 0.6rem 0 1rem;
  max-width: 640px;
  font-size: clamp(1.2rem, 1.6vw, 1.4rem);
  line-height: 1.4;
  color: var(--muted);
}

/* =========================
   CHUNKY PIXEL WINDOWS ARROW
   ========================= */

body {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48' shape-rendering='crispEdges'%3E%3Cpath d='M4 2 L4 36 L14 28 L20 44 L28 41 L22 26 L36 26 Z' fill='%23ffffff' stroke='%23000000' stroke-width='4'/%3E%3C/svg%3E") 4 2, auto;
}

a,
button,
.btn,
.menu-toggle,
.menu-item,
.roulette-card,
.project-card,
.gallery-card,
input[type='submit'] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48' shape-rendering='crispEdges'%3E%3Cpath d='M4 2 L4 36 L14 28 L20 44 L28 41 L22 26 L36 26 Z' fill='%23ffe66d' stroke='%23000000' stroke-width='4'/%3E%3C/svg%3E") 4 2, pointer;
}

a:active,
button:active,
.btn:active,
.menu-item:active,
.roulette-card:active,
.project-card:active,
.gallery-card:active {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48' shape-rendering='crispEdges'%3E%3Cpath d='M4 2 L4 36 L14 28 L20 44 L28 41 L22 26 L36 26 Z' fill='%23ff4fd8' stroke='%23000000' stroke-width='4'/%3E%3C/svg%3E") 4 2, pointer;
}

/* responsive */
@media (max-width: 1100px) {
  .project-shell {
    grid-template-columns: 1fr;
  }

  .project-sidebar {
    position: static;
    grid-template-columns: repeat(2, 1fr);
  }

  .overview-grid,
  .solution-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .project-hero {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-card img {
    height: 260px;
  }

  .next-project-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .game-hud {
    position: static;
    width: min(calc(100% - 2rem), var(--max-width));
    margin: 1rem auto 0;
    justify-content: space-between;
  }

  .hud-box {
    flex: 1;
  }

  .hud-time {
    font-size: 0.58rem;
  }

  .desktop-nav {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .navbar {
    min-height: 74px;
  }

  .project-hero {
    padding-top: 2.2rem;
  }

  .project-sidebar {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
  }

  .hero-actions,
  .next-actions {
    gap: 0.7rem;
  }

  .lightbox-panel {
    margin-top: 4vh;
    padding: 1rem;
  }

  .lightbox-preview {
    height: 260px;
  }
}

@media (max-width: 480px) {
  .container {
    width: min(calc(100% - 1rem), var(--max-width));
  }

  .content-card,
  .sidebar-card,
  .next-project-card {
    padding: 1rem;
    border-radius: 18px;
  }

  .project-hero h1 {
    font-size: clamp(1.25rem, 8vw, 2rem);
  }

  .hero-text,
  .content-card p,
  .solution-card p,
  .timeline-step p,
  .overview-block p,
  .final-callout p,
  .lightbox-panel p {
    font-size: 1.15rem;
  }

  .content-card h2,
  .next-project-card h2,
  .project-nav-link,
  .meta-pill,
  .gallery-card span,
  .section-label,
  .content-label,
  .sidebar-title,
  .mini-label {
    letter-spacing: 0.02em;
  }

  .gallery-card img {
    height: 210px;
  }

  .lightbox-close {
    min-width: 60px;
    height: 42px;
    font-size: 0.62rem;
  }

  .close-label {
    display: none;
  }

  .prototype-actions {
    flex-direction: column;
  }

  .prototype-btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .game-hud {
    flex-direction: column;
    align-items: stretch;
  }

  .lives-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .hud-label {
    margin-bottom: 0.25rem;
  }
}

@media (hover: none) {
  body,
  a,
  button {
    cursor: auto;
  }
}