html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
:root {
  --bg: #0d0d1a;
  --bg2: #141428;
  --green: #00ff88;
  --yellow: #ffe600;
  --pink: #ff2e88;
  --cyan: #00e5ff;
  --bd: #000;
}
body {
  background: var(--bg);
  color: #e8e8f0;
  font-family: "VT323", monospace;
  font-size: 20px;
  overflow-x: hidden;
}
h1,
h2,
h3,
.logo,
.pixel-btn,
.sec-title {
  font-family: "Press Start 2P", monospace;
}
a {
  color: inherit;
  text-decoration: none;
}
#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transform: translateZ(0);
}
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.22) 0 2px,
    transparent 2px 4px
  );
  opacity: 0.55;
}
.section {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 90px 20px 40px;
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}
.pixel-box {
  background: var(--bg2);
  border: 4px solid #000;
  box-shadow:
    0 -4px 0 0 #000,
    0 4px 0 0 #000,
    -4px 0 0 0 #000,
    4px 0 0 0 #000,
    inset -4px -4px 0 0 rgba(0, 0, 0, 0.45),
    inset 4px 4px 0 0 rgba(255, 255, 255, 0.08),
    8px 8px 0 0 #000;
  padding: 24px;
  image-rendering: pixelated;
}
.pixel-box.dark {
  background: #0a0a16;
}
.tag {
  color: var(--green);
  margin-bottom: 12px;
}
.accent {
  color: var(--yellow);
  text-shadow: 3px 3px 0 var(--pink);
}
.blink {
  animation: blink 1s steps(2) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
#loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s;
}
#loader.hide {
  opacity: 0;
  pointer-events: none;
}
.load-box {
  text-align: center;
  font-family: "Press Start 2P", monospace;
  font-size: 14px;
}
.load-bar {
  width: 280px;
  height: 24px;
  border: 4px solid #fff;
  margin: 20px auto;
  background: #000;
}
#loadFill {
  height: 100%;
  width: 0;
  background: var(--green);
}
#loadText {
  color: var(--green);
}
.pixel-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: #0a0a16;
  border-bottom: 4px solid #000;
  box-shadow: 0 4px 0 rgba(0, 255, 136, 0.35);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 13px;
  color: var(--green);
}
.nav-links {
  display: flex;
  gap: 18px;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
}
.nav-links a {
  position: relative;
  padding: 4px 2px;
  transition: color 0.15s;
}
.nav-links a:hover {
  color: var(--yellow);
}
.nav-links a.active {
  color: var(--yellow);
}
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 4px;
  background: var(--yellow);
  box-shadow: 2px 2px 0 #000;
}
#menuBtn {
  display: none;
  background: var(--green);
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
  font-size: 20px;
  padding: 2px 10px;
  cursor: pointer;
}
.nav-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
#langBtn {
  background: var(--yellow);
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  padding: 8px 10px;
  cursor: pointer;
  color: #000;
}
#langBtn:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}
#hero {
  padding-top: 130px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 24px;
}
.hero-text h1 {
  font-size: clamp(22px, 4vw, 38px);
  line-height: 1.4;
  margin: 10px 0;
}
#typewriter {
  font-size: 15px;
  color: var(--cyan);
  min-height: 22px;
  margin-bottom: 12px;
}
.desc {
  opacity: 0.85;
  margin-bottom: 16px;
}
.stats {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 18px;
}
.stat {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 10px;
}
.bar {
  height: 16px;
  background: #000;
  border: 3px solid #000;
  outline: 2px solid #333;
}
.fill {
  display: block;
  height: 100%;
  width: 0;
  transition: width 1.2s steps(20);
}
.fill.hp {
  background: var(--green);
  width: var(--w);
}
.fill.mp {
  background: var(--cyan);
  width: var(--w);
}
.fill.xp {
  background: var(--yellow);
  width: var(--w);
}
.skill .fill {
  background: var(--green);
}
.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-row.center {
  justify-content: center;
  margin: 20px 0;
}
.pixel-btn {
  background: var(--green);
  color: #000;
  font-size: 11px;
  padding: 14px 16px;
  border: 4px solid #000;
  box-shadow:
    inset -4px -4px 0 rgba(0, 0, 0, 0.3),
    inset 4px 4px 0 rgba(255, 255, 255, 0.4),
    6px 6px 0 #000;
  display: inline-block;
  cursor: pointer;
}
.pixel-btn:hover {
  transform: translate(2px, 2px);
  box-shadow:
    inset -4px -4px 0 rgba(0, 0, 0, 0.3),
    4px 4px 0 #000;
}
.pixel-btn.alt {
  background: var(--yellow);
}
.pixel-btn.small {
  font-size: 9px;
  padding: 10px;
}
.hero-sprite {
  text-align: center;
}
.sprite-wrap {
  position: relative;
  height: 190px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.pixel-avatar {
  width: 96px;
  height: 96px;
  background: linear-gradient(
    #ffd79d 0 20%,
    #222 20% 32%,
    #ffd79d 32% 62%,
    #00ff88 62% 82%,
    #222 82%
  );
  box-shadow:
    0 0 0 4px #000,
    0 -8px 0 4px #ff2e88,
    0 8px 0 4px #222;
  animation: float 1.2s steps(2) infinite;
}
@keyframes float {
  50% {
    transform: translateY(-10px);
  }
}
.shadow {
  position: absolute;
  bottom: 18px;
  width: 110px;
  height: 14px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
}
.lvl {
  font-family: "Press Start 2P", monospace;
  font-size: 14px;
  color: var(--yellow);
  margin: 18px 0;
}
.lvl small {
  font-size: 9px;
  color: #fff;
}
.coin-row {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  color: var(--green);
  border-top: 2px dashed #333;
  padding-top: 10px;
}
.scroll-hint {
  text-align: center;
  margin-top: 26px;
  color: var(--green);
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
}
.sec-title {
  font-size: clamp(14px, 2.5vw, 22px);
  color: var(--yellow);
  text-shadow: 3px 3px 0 #000;
  margin-bottom: 24px;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.big-text {
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 12px;
}
.about-list {
  list-style: none;
  margin: 14px 0 18px;
  display: grid;
  gap: 6px;
  color: var(--cyan);
}
.code {
  background: #000;
  color: var(--green);
  padding: 14px;
  font-size: 19px;
  overflow-x: auto;
  border: 2px solid #333;
}
.achieve {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 17px;
}
.achieve span {
  background: #1c1c34;
  border: 2px solid #000;
  box-shadow: 3px 3px 0 #000;
  padding: 6px 8px;
}
.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.skill h3 {
  font-size: 11px;
  margin-bottom: 12px;
}
.skill span {
  font-size: 17px;
  color: var(--yellow);
}
.proj-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.proj-img {
  font-size: 56px;
  text-align: center;
  padding: 22px 0;
  border: 4px solid #000;
  margin-bottom: 14px;
  image-rendering: pixelated;
}
.proj-img img {
  width: 72px;
  height: 72px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(4px 4px 0 #000);
}
.p1 {
  background: linear-gradient(135deg, #2b0a3d, #6c1bd1);
}
.p2 {
  background: linear-gradient(135deg, #3d1c00, #e07b00);
}
.p3 {
  background: linear-gradient(135deg, #002b2b, #00b3a6);
}
.p4 {
  background: linear-gradient(135deg, #2b002b, #a600a6);
}
.p5 {
  background: linear-gradient(135deg, #0a2b00, #3fa600);
}
.p6 {
  background: linear-gradient(135deg, #2b0000, #e01b1b);
}
.proj h3 {
  font-size: 11px;
  line-height: 1.6;
  margin-bottom: 8px;
}
.proj p {
  opacity: 0.8;
  margin-bottom: 10px;
  min-height: 52px;
}
.tags {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.tags span {
  background: #000;
  color: var(--cyan);
  font-size: 16px;
  padding: 2px 8px;
  border: 2px solid #333;
}
.contact-box {
  text-align: center;
}
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 30px 16px;
  border-top: 4px solid #000;
  background: #0a0a16;
  color: #888;
}
footer .credit {
  margin-top: 8px;
  font-size: 16px;
  color: #666;
}
footer .credit a {
  color: var(--cyan);
}
/* section transition */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.5s steps(12),
    transform 0.5s steps(12);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
.reveal .pixel-box {
  transition: transform 0.2s steps(4);
}
.proj:hover,
.skill:hover {
  transform: translateY(-4px);
}
.sec-title {
  overflow: hidden;
  white-space: nowrap;
}
.sec-title.typing {
  animation: caret 0.8s steps(2) infinite;
}
@keyframes caret {
  50% {
    opacity: 0.4;
  }
}
#trans {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 13, 26, 0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s steps(3);
}
#trans.go {
  opacity: 1;
  pointer-events: all;
}
.trans-box {
  text-align: center;
  background: var(--bg2);
  border: 4px solid #000;
  box-shadow: 8px 8px 0 #000;
  padding: 28px 32px;
  min-width: min(340px, 86vw);
}
.trans-title {
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  color: var(--yellow);
  margin-bottom: 14px;
  line-height: 1.8;
}
.trans-sec {
  color: var(--green);
  margin-bottom: 12px;
  min-height: 26px;
}
.trans-bar {
  height: 20px;
  background: #000;
  border: 3px solid #000;
  outline: 2px solid #333;
  margin-bottom: 10px;
}
#transFill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--green);
}
.trans-pct {
  color: var(--cyan);
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .pixel-avatar,
  .blink {
    animation: none;
  }
  #stars {
    display: none;
  }
}
@media (max-width: 860px) {
  .hero-grid,
  .two-col {
    grid-template-columns: 1fr;
  }
  .skill-grid,
  .proj-grid {
    grid-template-columns: 1fr 1fr;
  }
  #menuBtn {
    display: block;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0a0a16;
    flex-direction: column;
    padding: 16px 20px;
    border-bottom: 4px solid var(--green);
  }
  .nav-links.open {
    display: flex;
  }
}
@media (max-width: 560px) {
  .skill-grid,
  .proj-grid {
    grid-template-columns: 1fr;
  }
}
