*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --dirt: #8B5E3C;
  --grass-top: #5D8A3C;
  --grass-side: #6AAA40;
  --stone: #888;
  --wood: #B8843F;
  --leaves: #2D6A1F;
  --sky: #87CEEB;
  --night: #1a1a2e;
  --sand: #E2C07A;
  --pixel: 4px;
  --mc-green: #5AAE2E;
  --mc-dark: #1b1b1b;
  --mc-text: #f0f0f0;
  --mc-yellow: #FFDC00;
  --mc-blue: #3399FF;
  --mc-red: #CC3333;
  --mc-panel: #2c2c2c;
  --mc-panel-border: #555;
  --mc-btn: #4a4a4a;
  --mc-btn-hover: #5e5e5e;
  --mc-accent: #5AAE2E;
  --hp-green: #3aaf3a;
  --hp-bg: #1a1a1a;
}

body {
  cursor: url('./img/curso_32.png') 1 1, auto;
  font-family: 'Press Start 2P', monospace;
  background: var(--sky);
  color: var(--mc-text);
  min-height: 100vh;
  overflow-x: hidden;
  image-rendering: pixelated;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #2c2c2c;
}

::-webkit-scrollbar-thumb {
  background: var(--mc-green);
  border: 2px solid #2c2c2c;
}

/* NAVBAR */
nav {
  background: rgba(28, 28, 28, 0.97);
  border-bottom: 4px solid #000;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  font-size: 11px;
  color: var(--mc-yellow);
  letter-spacing: 1px;
  text-shadow: 2px 2px 0 #7a6000;
  /* cursor: pointer; */
}

.nav-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-links a {
  font-size: 8px;
  color: #ccc;
  text-decoration: none;
  padding: 6px 10px;
  border: 2px solid transparent;
  transition: 0.1s;
}

.nav-links a:hover {
  color: var(--mc-yellow);
  border-color: var(--mc-yellow);
  background: rgba(255, 220, 0, 0.08);
}

/* HERO */
.hero {
  background: linear-gradient(180deg, #87CEEB 0%, #a8d8ea 60%, #5D8A3C 60%, #5D8A3C 62%, #8B5E3C 62%, #8B5E3C 100%);
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 60px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 30px;
  right: 80px;
  width: 48px;
  height: 48px;
  background: var(--mc-yellow);
  box-shadow: 4px 0 0 #f0c800, -4px 0 0 #f0c800, 0 4px 0 #f0c800, 0 -4px 0 #f0c800;
  image-rendering: pixelated;
}

.cloud {
  position: absolute;
  background: #fff;
  image-rendering: pixelated;
}

.cloud1 {
  top: 40px;
  left: 60px;
  width: 64px;
  height: 24px;
  box-shadow: 16px -12px 0 #fff, 32px -12px 0 #fff, 48px -8px 0 #fff;
}

.cloud2 {
  top: 70px;
  left: 220px;
  width: 48px;
  height: 18px;
  box-shadow: 12px -10px 0 #fff, 24px -10px 0 #fff;
}

.tree {
  position: absolute;
  bottom: 62px;
}

.tree-trunk {
  width: 16px;
  height: 32px;
  background: var(--wood);
  border: 2px solid #7a5a20;
}

.tree-leaves {
  width: 48px;
  height: 48px;
  background: var(--leaves);
  margin-left: -16px;
  border: 2px solid #1a4a10;
  position: relative;
  top: -4px;
}

.tree1 {
  left: 40px;
}

.tree2 {
  right: 60px;
}

.hero-card {
  background: rgba(28, 28, 28, 0.92);
  border: 4px solid #555;
  border-bottom: 4px solid #000;
  border-right: 4px solid #000;
  padding: 28px 36px;
  text-align: center;
  position: relative;
  z-index: 2;
  max-width: 500px;
  width: 100%;
}

.hero-avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
}

.pixel-head {
  width: 64px;
  height: 64px;
  background: #c68642;
  border: 2px solid #000;
  position: relative;
  overflow: hidden;
}

.pixel-eyes {
  display: flex;
  justify-content: space-around;
  padding: 0 8px;
  margin-bottom: 4px;
}

.eye {
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid #000;
  position: relative;
  overflow: hidden;
  top: 20px;
}

.pupil {
  width: 6px;
  height: 4px;
  background: #3a3aff;
  box-shadow: 24px 0 0 #3a3aff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.pixel-hair {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 18px;
  background: #4a2f00;
  border-bottom: 2px solid #000;
}

.pixel-mouth {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 4px;
  background: #7a3a00;
}

.hero-name {
  font-size: 16px;
  color: var(--mc-yellow);
  text-shadow: 3px 3px 0 #7a6000;
  margin-bottom: 0px;
  letter-spacing: 2px;
}

.hero-title {
  font-size: 8px;
  color: var(--mc-green);
  margin-bottom: 0px;
  letter-spacing: 1px;
}

/* Typing Animation Wrappers */
.typing-wrapper {
  display: inline-grid;
  margin: 0 auto;
}

.name-wrapper {
  margin-bottom: 10px;
}

.title-wrapper {
  margin-bottom: 18px;
}

.typing-wrapper>* {
  grid-area: 1 / 1;
}

.hidden-text {
  visibility: hidden;
}

.typing-text {
  justify-self: start;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
}

.name-wrapper .hidden-text {
  border-right: 4px solid transparent;
}

.title-wrapper .hidden-text {
  border-right: 2px solid transparent;
}

.name-wrapper .typing-text {
  border-right: 4px solid var(--mc-yellow);
  animation:
    typing 1.5s steps(19, end) forwards,
    blink-yellow .75s step-end 2,
    hide-border-yellow 0s 1.5s forwards;
}

.title-wrapper .typing-text {
  border-right: 2px solid transparent;
  animation:
    typing 1.5s steps(25, end) 1.5s forwards,
    blink-green .8s step-end 1.5s infinite;
}

@keyframes typing {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

@keyframes blink-yellow {

  0%,
  100% {
    border-right-color: var(--mc-yellow);
  }

  50% {
    border-right-color: transparent;
  }
}

@keyframes hide-border-yellow {
  to {
    border-right-color: transparent;
  }
}

@keyframes blink-green {

  0%,
  100% {
    border-right-color: var(--mc-green);
  }

  50% {
    border-right-color: transparent;
  }
}

.hero-xp {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-size: 7px;
  color: #aaa;
  margin-top: 10px;
}

.xp-bar {
  flex: 1;
  height: 8px;
  background: #111;
  border: 2px solid #333;
  max-width: 200px;
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  background: var(--mc-green);
  width: 78%;
  animation: xp-grow 1.5s ease-out;
}

@keyframes xp-grow {
  from {
    width: 0;
  }

  to {
    width: 78%;
  }
}

/* SECTIONS */
section {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px;
}

.section-title {
  font-size: 12px;
  color: var(--mc-yellow);
  text-shadow: 2px 2px 0 #7a6000;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: repeating-linear-gradient(90deg, #555 0, #555 6px, transparent 6px, transparent 12px);
}

.block-icon {
  width: 24px;
  height: 24px;
  display: inline-block;
  image-rendering: pixelated;
  border: 2px solid #000;
  flex-shrink: 0;
}

.icon-grass {
  background: var(--grass-top);
  border-color: #2a5a10;
}

.icon-diamond {
  background: #4AF7F7;
  border-color: #005555;
}

.icon-wood {
  background: var(--wood);
  border-color: #7a5a20;
}

.icon-redstone {
  background: var(--mc-red);
  border-color: #800000;
}

.icon-book {
  background: var(--sand);
  border-color: #a07000;
}

.icon-paper {
  background: #e0e0e0;
  border-color: #888;
}

/* ABOUT */
.about-bg {
  background: #1e1e1e;
  border-top: 4px solid #333;
  border-bottom: 4px solid #000;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.mc-panel {
  background: var(--mc-panel);
  border: 3px solid #555;
  border-bottom: 3px solid #000;
  border-right: 3px solid #000;
  padding: 18px;
  font-size: 7px;
  line-height: 2;
  color: #ccc;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed #333;
}

.stat-label {
  color: #aaa;
}

.stat-val {
  color: var(--mc-green);
}

/* SKILLS */

.skill-category {
  margin-bottom: 28px;
}

.skill-category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 9px;
  color: #fff;
  padding: 8px 14px;
  margin-bottom: 14px;
  border-left: 5px solid;
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 #000;
  background: rgba(0,0,0,0.3);
}

.cat-icon {
  font-size: 14px;
}

.cat-languages  { border-left-color: #FFDC00; color: #FFDC00; }
.cat-frontend   { border-left-color: #61DBFB; color: #61DBFB; }
.cat-backend    { border-left-color: #5AAE2E; color: #5AAE2E; }
.cat-database   { border-left-color: #fc8c03; color: #fc8c03; }
.cat-devops     { border-left-color: #CC3333; color: #CC3333; }

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

/* Image thumb for project cards */
.thumb-img {
  height: 80px;
  border-bottom: 2px solid #333;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.skill-card {
  background: var(--mc-panel);
  border: 3px solid #555;
  border-bottom: 3px solid #000;
  border-right: 3px solid #000;
  padding: 14px;
  transition: transform 0.15s, border-color 0.15s;
  position: relative;
  overflow: hidden;
}

.skill-card:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--mc-yellow);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
}

.skill-shine {
  position: absolute;
  top: 0;
  left: -100px;
  width: 50px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: skewX(-20deg);
  opacity: 0;
}

.skill-card:hover .skill-shine {
  animation: shine-sweep 0.7s ease-in-out forwards;
}

@keyframes shine-sweep {
  0% {
    left: -100px;
    opacity: 1;
  }

  100% {
    left: 150%;
    opacity: 1;
  }
}

.skill-name {
  font-size: 8px;
  color: var(--mc-yellow);
  margin-bottom: 8px;
  text-shadow: 1px 1px 0 #7a6000;
}

.skill-bar-wrap {
  background: #111;
  border: 2px solid #333;
  height: 10px;
  margin-bottom: 6px;
  overflow: hidden;
  position: relative;
}

.skill-bar {
  height: 100%;
  background: linear-gradient(to bottom, #84e858 0%, var(--mc-green) 50%, #3c8218 100%);
  animation: bar-in 1.2s cubic-bezier(0.1, 0.7, 0.1, 1) forwards;
  transform-origin: left;
  transform: scaleX(0);
}

@keyframes bar-in {
  to {
    transform: scaleX(1);
  }
}

.skill-pct {
  font-size: 6px;
  color: #888;
  text-align: right;
  margin-top: -3px;
}

/* HOTBAR */
.hotbar {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 32px 0 0;
}

.hotbar-slot {
  width: 44px;
  height: 44px;
  background: #555;
  border: 3px solid #888;
  border-bottom: 3px solid #222;
  border-right: 3px solid #222;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: 0.1s;
  image-rendering: pixelated;
  position: relative;
}

.hotbar-slot.active {
  border-color: var(--mc-yellow);
  background: #3a3a3a;
  transform: scale(1.1);
  z-index: 2;
  box-shadow: 2px 2px 0 #000;
}

.hotbar-slot:hover {
  background: #666;
}

/* Custom Minecraft Tooltip */
.hotbar-slot[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: #100010;
  border: 2px solid #2b003a;
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  white-space: nowrap;
  padding: 6px 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s;
  z-index: 100;
  pointer-events: none;
  text-shadow: 1px 1px 0 #3f3f3f;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
}

.hotbar-slot:hover::after {
  opacity: 1;
  visibility: visible;
}

/* CERTIFICATIONS */
.certifications-bg {
  background: #222;
  border-top: 4px solid #444;
  border-bottom: 4px solid #000;
}

/* PROJECTS */
.projects-bg {
  background: #1a1a1a;
  border-top: 4px solid #333;
  border-bottom: 4px solid #000;
}

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

.project-card {
  background: var(--mc-panel);
  border: 3px solid #555;
  border-bottom: 3px solid #000;
  border-right: 3px solid #000;
  overflow: hidden;
  /* cursor: pointer; */
  transition: transform 0.1s;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--mc-blue);
}

.project-thumb {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  border-bottom: 2px solid #333;
}

.thumb-web {
  background: repeating-linear-gradient(45deg, #1a2a4a 0, #1a2a4a 8px, #0d1a2e 8px, #0d1a2e 16px);
}

.thumb-app {
  background: repeating-linear-gradient(45deg, #1a3a1a 0, #1a3a1a 8px, #0d2a0d 8px, #0d2a0d 16px);
}

.thumb-api {
  background: repeating-linear-gradient(45deg, #3a1a1a 0, #3a1a1a 8px, #2a0d0d 8px, #2a0d0d 16px);
}

.project-body {
  padding: 14px;
}

.project-name {
  font-size: 8px;
  color: var(--mc-yellow);
  margin-bottom: 8px;
}

.project-desc {
  font-size: 8px;
  word-spacing: 2px;
  color: #aaa;
  line-height: 2;
  margin-bottom: 10px;
}

.tag-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tag {
  font-size: 8px;
  padding: 3px 6px;
  border: 1px solid;
}

.tag-js {
  color: var(--mc-yellow);
  border-color: #7a6000;
  background: #2a2000;
}

.tag-react {
  color: #61DBFB;
  border-color: #004060;
  background: #001a28;
}

.tag-node {
  color: var(--mc-green);
  border-color: #1a5000;
  background: #0d2800;
}

.tag-css {
  color: #ff69b4;
  border-color: #8b0057;
  background: #3a001a;
}

.tag-ts {
  color: #3178c6;
  border-color: #0a3060;
  background: #001428;
}

.tag-api {
  color: #fc8c03;
  border-color: #804400;
  background: #2a1800;
}

.tag-html {
  color: #ff6b35;
  border-color: #8b3a00;
  background: #2a1200;
}

/* LINKS */
.links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.link-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--mc-btn);
  border: 3px solid #666;
  border-bottom: 3px solid #000;
  border-right: 3px solid #000;
  padding: 14px 20px;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--mc-text);
  /* cursor: pointer; */
  text-decoration: none;
  transition: 0.1s;
  min-width: 140px;
  justify-content: center;
}

.link-btn:hover {
  background: var(--mc-btn-hover);
  border-color: var(--mc-yellow);
  color: var(--mc-yellow);
  transform: scale(1.04);
}

.link-btn:active {
  transform: scale(0.97);
}

/* CONTACT */
.contact-bg {
  background: #1e1e1e;
  border-top: 4px solid #333;
  border-bottom: 4px solid #000;
}

.contact-form {
  max-width: 480px;
  margin: 0 auto;
}

.mc-label {
  font-size: 7px;
  color: #aaa;
  display: block;
  margin-bottom: 6px;
}

.mc-input,
.mc-textarea {
  width: 100%;
  background: #111;
  border: 3px solid #555;
  border-bottom: 3px solid #000;
  border-right: 3px solid #000;
  color: var(--mc-text);
  font-family: 'Courier New', Courier, monospace;
  font-size: 15px;
  padding: 10px;
  margin-bottom: 16px;
  outline: none;
}

.mc-input:focus,
.mc-textarea:focus {
  border-color: var(--mc-green);
}

.mc-textarea {
  height: 90px;
  resize: vertical;
}

.mc-btn-primary {
  display: block;
  width: 100%;
  background: var(--mc-green);
  border: 3px solid #2a7a00;
  border-bottom: 3px solid #000;
  border-right: 3px solid #000;
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  padding: 14px;
  /* cursor: pointer; */
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 #1a5000;
  transition: 0.1s;
}

.mc-btn-primary:hover {
  background: #6ac83a;
}

.mc-btn-primary:active {
  transform: scale(0.98);
}

/* FOOTER */
footer {
  background: #111;
  border-top: 4px solid #000;
  text-align: center;
  padding: 20px;
  font-size: 6px;
  color: #555;
}

footer span {
  color: var(--mc-green);
}

/* HEALTH BAR */
.health-bar {
  display: flex;
  gap: 3px;
  justify-content: center;
  margin: 10px 0 0;
}

.heart {
  font-size: 10px;
  filter: drop-shadow(1px 1px 0 #800);
}

@media (max-width: 600px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .hero-name {
    font-size: 11px;
  }

  nav {
    padding: 10px 12px;
  }

  .nav-links a {
    font-size: 6px;
    padding: 4px 7px;
  }
}

/* INVENTORY CHEST MODAL */
.chest-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  padding: 20px;
}

.chest-modal-box {
  background: var(--mc-panel);
  border: 4px solid #555;
  border-bottom: 4px solid #000;
  border-right: 4px solid #000;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.8);
  transition: transform 0.2s cubic-bezier(0.1, 0.7, 0.1, 1);
}

.chest-modal-box::-webkit-scrollbar {
  width: 8px;
}

.chest-modal-box::-webkit-scrollbar-thumb {
  background: #555;
}

.chest-modal-header {
  background: #111;
  border-bottom: 4px solid #000;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chest-modal-title {
  font-size: 10px;
  color: var(--mc-yellow);
}

.chest-close-btn {
  background: #aa0000;
  color: white;
  border: 2px solid #ff5555;
  border-bottom: 2px solid #550000;
  border-right: 2px solid #550000;
  padding: 4px 8px;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  cursor: pointer;
}

.chest-close-btn:hover {
  background: #ff3333;
  transform: scale(1.05);
}

.chest-modal-body {
  padding: 24px;
}

.chest-modal-tags {
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chest-modal-tags .tag {
  font-size: 8px;
}

.chest-video-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border: 3px solid #333;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.chest-placeholder-video {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 10px;
  text-shadow: 2px 2px 0 #000;
}

.chest-placeholder-video video,
.chest-placeholder-video img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  outline: none;
}

.chest-long-desc {
  color: #ccc;
  font-size: 8px;
  line-height: 2;
  margin-bottom: 24px;
}

.chest-modal-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.project-card {
  cursor: pointer;
}

.project-card:hover {
  border-color: var(--mc-green);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
  transform: translateY(-3px) scale(1.02);
}

/* =====================================================
   UX UPGRADES
   ===================================================== */

/* Sticky nav was covering anchor targets on jump */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

/* Keyboard focus ring — visible everywhere, mouse users unaffected */
a:focus-visible,
button:focus-visible,
.project-card:focus-visible,
.mc-input:focus-visible,
.mc-textarea:focus-visible,
.hotbar-slot:focus-visible {
  outline: 3px solid var(--mc-yellow);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
  background: var(--mc-yellow);
  color: #000;
  font-size: 8px;
  padding: 10px 14px;
  border: 3px solid #000;
  text-decoration: none;
}

.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* MOBILE NAV */
.nav-toggle {
  display: none;
  background: var(--mc-btn);
  color: var(--mc-yellow);
  border: 3px solid #666;
  border-bottom-color: #000;
  border-right-color: #000;
  font-family: inherit;
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
}

.nav-toggle:hover {
  background: var(--mc-btn-hover);
}

/* Scroll-spy: highlight the section you are actually reading */
.nav-links a.active {
  color: var(--mc-yellow);
  border-color: var(--mc-yellow);
  background: rgba(255, 220, 0, 0.14);
}

/* PROJECT FILTER BAR */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.filter-btn {
  font-family: inherit;
  font-size: 8px;
  color: #ccc;
  background: var(--mc-btn);
  border: 3px solid #666;
  border-bottom-color: #000;
  border-right-color: #000;
  padding: 8px 12px;
  cursor: pointer;
  transition: 0.1s;
}

.filter-btn:hover {
  background: var(--mc-btn-hover);
  color: var(--mc-yellow);
}

.filter-btn.active {
  background: var(--mc-green);
  border-color: #8ede5c;
  border-bottom-color: #2c5a15;
  border-right-color: #2c5a15;
  color: #fff;
}

.filter-count {
  font-size: 7px;
  color: #9a9a9a;
  margin-left: auto;
}

/* PROJECT CARDS */
.project-card {
  display: flex;
  flex-direction: column;
}

.project-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Tags pinned to the bottom so cards line up regardless of blurb length */
.project-body .tag-row {
  margin-top: auto;
  padding-top: 10px;
}

/* Image thumbnails deserve more room than an emoji does */
.project-thumb.thumb-img {
  height: 140px;
}

.project-thumb {
  position: relative;
}

/* Click affordance — the cards were silently clickable */
.project-card::after {
  content: '[ VIEW ]';
  display: block;
  font-size: 7px;
  color: #000;
  background: var(--mc-yellow);
  text-align: center;
  padding: 7px 4px;
  opacity: 0;
  transition: opacity 0.12s;
}

.project-card:hover::after,
.project-card:focus-visible::after,
.project-card:focus-within::after {
  opacity: 1;
}

#projects-grid .project-card::after {
  content: '[ OPEN CHEST ]';
}

.project-card.is-hidden {
  display: none;
}

/* MODAL */
.chest-modal-overlay[aria-hidden='true'] {
  display: none !important;
}

/* Fixed-size iframe attributes were overflowing the 16/9 frame */
.chest-video-wrap iframe,
.chest-placeholder-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.chest-placeholder-video img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.chest-modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
}

.chest-long-desc p {
  margin-bottom: 4px;
}

/* BACK TO TOP */
.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 900;
  width: 44px;
  height: 44px;
  font-family: inherit;
  font-size: 12px;
  color: #000;
  background: var(--mc-yellow);
  border: 3px solid #fff3a0;
  border-bottom-color: #7a6000;
  border-right-color: #7a6000;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: #fff06a;
}

/* SCROLL REVEAL */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.45s ease-out, transform 0.45s ease-out;
}

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

/* FORM FEEDBACK */
.form-status {
  font-size: 8px;
  line-height: 1.8;
  margin-top: 12px;
  min-height: 14px;
}

.form-status.ok {
  color: var(--mc-green);
}

.form-status.err {
  color: #ff6b6b;
}

@media (max-width: 780px) {
  .nav-toggle {
    display: block;
  }

  nav {
    flex-wrap: wrap;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 4px;
    padding-top: 10px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    font-size: 8px;
    padding: 10px;
  }

  .filter-count {
    margin-left: 0;
    width: 100%;
  }
}

/* Respect users who ask the OS for less motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

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

/* The nav was 3% transparent, so the skills hotbar showed through it while scrolling */
nav {
  background: #1c1c1c;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}

/* Keep the grid even — the full write-up lives in the modal */
.project-desc {
  display: -webkit-box;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =====================================================
   CREEPER RUN — hero mini game
   ===================================================== */
.game-bg {
  background: var(--mc-dark);
  border-bottom: 4px solid #000;
  padding: 22px 0 26px;
}

.game-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.game-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.game-heading {
  font-size: 10px;
  color: var(--mc-yellow);
  text-shadow: 2px 2px 0 #7a6000;
}

.game-scores {
  display: flex;
  gap: 12px;
  margin-left: auto;
  font-size: 8px;
}

.game-score {
  color: var(--mc-green);
}

.game-best {
  color: #9a9a9a;
}

.game-stage {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  border: 4px solid #555;
  border-bottom: 4px solid #000;
  border-right: 4px solid #000;
  background: var(--sky);
  line-height: 0;
  overflow: hidden;
  cursor: pointer;
  touch-action: manipulation;
}

#game-canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.62);
  line-height: 1.8;
  text-align: center;
  padding: 12px;
}

.game-overlay.hidden-overlay {
  display: none;
}

.game-msg {
  font-size: 10px;
  color: var(--mc-yellow);
  text-shadow: 2px 2px 0 #000;
}

.game-hint {
  font-size: 7px;
  color: #bbb;
}

.game-btn {
  font-family: inherit;
  font-size: 9px;
  color: #fff;
  background: var(--mc-green);
  border: 3px solid #8ede5c;
  border-bottom-color: #2c5a15;
  border-right-color: #2c5a15;
  padding: 10px 16px;
  cursor: pointer;
  transition: 0.1s;
}

.game-btn:hover {
  background: #6cc93a;
}

@media (max-width: 600px) {
  .game-section {
    padding: 0 12px;
  }

  .game-scores {
    margin-left: 0;
    width: 100%;
    font-size: 7px;
  }

  /* The stage is only ~110px tall here, so the overlay has to be compact */
  .game-overlay {
    gap: 6px;
    line-height: 1.4;
  }

  .game-msg {
    font-size: 8px;
  }

  .game-btn {
    font-size: 8px;
    padding: 7px 12px;
  }

  .game-hint {
    font-size: 6px;
  }
}
