:root {
  --bg: #07050f;
  --bg-alt: #10071c;
  --panel: rgba(19, 10, 31, 0.92);
  --panel-strong: #1b0d2d;
  --border: #4f266b;
  --text: #f7eefc;
  --muted: #bfaad4;
  --cyan: #4df3ff;
  --pink: #ff4fd8;
  --yellow: #ffe36b;
  --green: #7effa2;
  --shadow: rgba(0, 0, 0, 0.55);
  --radius: 18px;
  --max-width: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(255, 79, 216, 0.16), transparent 30%),
    radial-gradient(circle at 80% 20%, rgba(77, 243, 255, 0.11), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.05) 0, transparent 60%);
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

body.loaded {
  animation: pageFade 700ms ease-out;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.page-shell {
  position: relative;
  z-index: 1;
}

.background-grid,
.scanlines,
.crt-overlay,
.particle-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.background-grid {
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), transparent 95%);
}

.scanlines {
  z-index: 1;
  background: repeating-linear-gradient(
    180deg,
    rgba(255,255,255,0.03) 0,
    rgba(255,255,255,0.03) 1px,
    transparent 2px,
    transparent 4px
  );
  mix-blend-mode: soft-light;
  opacity: 0.2;
}

.crt-overlay {
  z-index: 1;
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.02) 50%, transparent 100%);
  animation: flicker 9s infinite;
}

.particle-field {
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--yellow), var(--pink));
  box-shadow: 0 0 10px rgba(255,255,255,0.2);
  animation: floatParticle linear infinite;
  opacity: 0.9;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 2.5vw, 2rem);
  margin: 0 auto;
  max-width: calc(var(--max-width) + 2rem);
  backdrop-filter: blur(16px);
  background: rgba(9, 5, 16, 0.76);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  border: 2px solid var(--cyan);
  background: linear-gradient(180deg, rgba(77,243,255,0.18), rgba(255,79,216,0.12));
  color: var(--text);
  font-family: 'Press Start 2P', monospace;
  font-size: 0.58rem;
  box-shadow: 5px 5px 0 rgba(77,243,255,0.12), 10px 10px 0 rgba(255,79,216,0.08);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 1rem;
  font-weight: 800;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.74rem;
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.nav-links a,
.sound-toggle {
  position: relative;
  padding: 0.7rem 0.95rem;
  border: 1px solid transparent;
  color: var(--text);
  background: transparent;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.nav-links a::after,
.sound-toggle::after,
.pixel-button::after,
.card-actions a::after,
.terminal-links a::after,
.achievement-card a::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--pink), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 180ms ease;
}

.nav-links a:hover,
.sound-toggle:hover {
  transform: translateY(-2px);
  border-color: rgba(77,243,255,0.45);
  background: rgba(77,243,255,0.08);
}

.nav-links a:hover::after,
.sound-toggle:hover::after,
.pixel-button:hover::after,
.card-actions a:hover::after,
.terminal-links a:hover::after,
.achievement-card a:hover::after {
  transform: scaleX(1);
}

.sound-toggle {
  cursor: pointer;
  border-color: rgba(255,255,255,0.1);
  border-radius: 0;
  min-width: 6.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

main {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
  padding-bottom: 4rem;
}

.section-surface,
.section-block,
.footer {
  position: relative;
  z-index: 2;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.85fr);
  gap: 2rem;
  align-items: center;
  min-height: calc(100vh - 5rem);
  padding: 2.5rem 0 4rem;
}

.hero-copy h1,
.stage-heading h2 {
  margin: 0;
  font-family: 'Press Start 2P', monospace;
  letter-spacing: 0.04em;
}

.hero-copy h1 {
  font-size: clamp(2.15rem, 4vw, 4.5rem);
  line-height: 1.28;
  max-width: 11ch;
}

.hero-copy h1 span {
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(77,243,255,0.4);
}

.stage-tag,
.stage-heading p,
.hud-label,
.timeline-year,
.certificate-tag,
.scoreboard-head span,
.frame-pill,
.typing-prefix {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

.stage-tag {
  color: var(--yellow);
  margin-bottom: 1rem;
}

.role-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.5rem 0 1rem;
}

.role-stack span,
.chip-row span {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  padding: 0.55rem 0.75rem;
  color: var(--text);
}

.typing-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 1.2rem;
  color: var(--muted);
}

.typing-role {
  color: var(--pink);
  font-weight: 800;
  min-height: 1.5rem;
}

.hero-summary {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 1.6rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 1.6rem;
}

.pixel-button,
.card-actions a,
.terminal-links a,
.achievement-card a,
.scoreboard-card a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.2rem;
  border: 1px solid rgba(255,255,255,0.12);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.06em;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.pixel-button {
  min-width: 13rem;
}

.pixel-button.primary {
  background: linear-gradient(180deg, rgba(255,79,216,0.24), rgba(255,79,216,0.06));
  box-shadow: 0 8px 0 rgba(255,79,216,0.14), 0 0 18px rgba(255,79,216,0.25);
}

.pixel-button.secondary {
  background: rgba(77,243,255,0.06);
  box-shadow: 0 8px 0 rgba(77,243,255,0.1), 0 0 18px rgba(77,243,255,0.15);
}

.pixel-button:hover,
.card-actions a:hover,
.terminal-links a:hover,
.achievement-card a:hover,
.scoreboard-card a:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 0 rgba(0,0,0,0.22), 0 0 20px rgba(255,255,255,0.08);
}

.hud-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.hud-panel,
.content-card,
.inventory-panel,
.project-card,
.scoreboard-card,
.terminal-card {
  background: var(--panel);
  border: 2px solid rgba(255,255,255,0.09);
  box-shadow: 10px 10px 0 rgba(0,0,0,0.32), 0 24px 40px rgba(0,0,0,0.24);
}

.hud-panel {
  padding: 1rem;
}

.hud-panel strong {
  display: block;
  margin-top: 0.55rem;
  font-size: 1rem;
}

.status-online {
  color: var(--green);
}

.hero-console {
  display: flex;
  justify-content: center;
}

.console-frame {
  width: min(100%, 430px);
  padding: 1rem;
  border: 2px solid rgba(77,243,255,0.35);
  background: linear-gradient(180deg, rgba(22, 12, 35, 0.96), rgba(12, 7, 19, 0.96));
  box-shadow: 12px 12px 0 rgba(77,243,255,0.08), 22px 22px 0 rgba(255,79,216,0.08);
}

.frame-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.frame-pill {
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(255,255,255,0.13);
  background: rgba(255,255,255,0.04);
}

.frame-pill.alt {
  color: var(--cyan);
}

.portrait-card {
  margin: 0;
  border: 2px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  padding: 0.8rem;
}

.portrait-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.1);
}

.portrait-card figcaption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.85rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.portrait-card figcaption strong {
  color: var(--yellow);
}

.console-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}

.console-stats div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

.console-stats span {
  color: var(--muted);
}

.arcade-art {
  padding: 0.9rem;
  border: 2px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
}

.arcade-screen {
  position: relative;
  min-height: 290px;
  overflow: hidden;
  border: 2px solid rgba(77,243,255,0.28);
  background:
    radial-gradient(circle at 50% 18%, rgba(255,227,107,0.2), transparent 18%),
    radial-gradient(circle at 20% 82%, rgba(255,79,216,0.16), transparent 22%),
    linear-gradient(180deg, #12091f 0%, #090510 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.arcade-stars,
.arcade-avatar,
.arcade-wave,
.arcade-caption {
  position: absolute;
}

.arcade-stars {
  width: 5px;
  height: 5px;
  background: var(--yellow);
  box-shadow: 0 0 16px rgba(255,227,107,0.8);
  animation: starBlink 2.8s ease-in-out infinite;
}

.star-a {
  top: 18%;
  left: 16%;
}

.star-b {
  top: 34%;
  right: 18%;
  animation-delay: 0.8s;
}

.star-c {
  bottom: 18%;
  left: 26%;
  animation-delay: 1.2s;
}

.arcade-avatar {
  left: 50%;
  top: 44%;
  width: 160px;
  height: 160px;
  transform: translate(-50%, -50%);
  animation: floatHero 3.8s ease-in-out infinite;
}

.arcade-avatar::before {
  content: '';
  position: absolute;
  inset: 25px 22px 30px;
  border-radius: 50% 50% 42% 42%;
  background:
    radial-gradient(circle at 50% 34%, rgba(77,243,255,0.92) 0 16%, transparent 17%),
    linear-gradient(180deg, rgba(255,79,216,0.98) 0 34%, rgba(255,227,107,0.96) 34% 70%, rgba(77,243,255,0.96) 70% 100%);
  clip-path: polygon(50% 0, 86% 8%, 98% 36%, 88% 96%, 12% 96%, 2% 36%, 14% 8%);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.06);
}

.arcade-avatar::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 20px;
  width: 120px;
  height: 18px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(77,243,255,0), rgba(77,243,255,0.8), rgba(255,79,216,0.8), rgba(77,243,255,0));
  filter: blur(0.4px);
}

.avatar-helmet,
.avatar-face,
.avatar-shield {
  position: absolute;
  inset: 0;
}

.avatar-helmet::before,
.avatar-helmet::after,
.avatar-face::before,
.avatar-face::after,
.avatar-shield::before,
.avatar-shield::after {
  content: '';
  position: absolute;
}

.avatar-helmet::before {
  left: 38px;
  top: 18px;
  width: 84px;
  height: 60px;
  border: 5px solid rgba(255,255,255,0.9);
  border-bottom: 0;
  border-radius: 42px 42px 18px 18px;
  box-shadow: 0 0 18px rgba(77,243,255,0.45);
}

.avatar-helmet::after {
  left: 50%;
  top: 64px;
  width: 96px;
  height: 24px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--yellow), var(--cyan));
}

.avatar-face::before {
  left: 54px;
  top: 58px;
  width: 52px;
  height: 42px;
  border-radius: 14px 14px 24px 24px;
  background: rgba(9, 5, 16, 0.92);
  box-shadow: inset 0 -6px 0 rgba(255,255,255,0.08);
}

.avatar-face::after {
  left: 64px;
  top: 72px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 28px 0 0 var(--pink), 14px 18px 0 12px rgba(255,227,107,0.08);
}

.avatar-shield::before {
  left: 26px;
  top: 86px;
  width: 108px;
  height: 52px;
  border: 4px solid rgba(255,255,255,0.88);
  border-radius: 22px 22px 34px 34px;
  background: linear-gradient(180deg, rgba(77,243,255,0.16), rgba(255,79,216,0.14));
  box-shadow: 0 0 24px rgba(255,79,216,0.18);
}

.avatar-shield::after {
  left: 50%;
  top: 102px;
  width: 22px;
  height: 22px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--yellow), var(--pink));
  clip-path: polygon(50% 0, 100% 35%, 78% 100%, 22% 100%, 0 35%);
  box-shadow: 0 0 12px rgba(255,227,107,0.45);
}

.arcade-wave {
  left: 50%;
  bottom: 24px;
  width: 190px;
  height: 24px;
  transform: translateX(-50%);
  background: repeating-linear-gradient(90deg, rgba(77,243,255,0.15) 0 12px, rgba(255,79,216,0.65) 12px 24px, rgba(255,227,107,0.25) 24px 36px);
  clip-path: polygon(0 70%, 10% 40%, 18% 72%, 28% 24%, 36% 66%, 46% 30%, 54% 60%, 64% 18%, 74% 66%, 84% 34%, 92% 70%, 100% 48%, 100% 100%, 0 100%);
  animation: waveShift 3s ease-in-out infinite;
}

.arcade-caption {
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0.9rem 0.2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.arcade-caption strong {
  color: var(--yellow);
}

.section-block {
  padding: 4rem 0 0;
  scroll-margin-top: 6.2rem;
}

.stage-heading {
  margin-bottom: 1.4rem;
}

.stage-heading p {
  margin: 0 0 0.8rem;
  color: var(--pink);
}

.stage-heading h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.5rem);
  line-height: 1.45;
}

.stage-heading span {
  display: inline-block;
  margin-top: 0.6rem;
  color: var(--muted);
}

.content-card {
  padding: clamp(1.15rem, 2vw, 1.6rem);
}

.wide-card {
  max-width: 900px;
}

.profile-grid,
.inventory-grid,
.project-grid,
.achievement-grid,
.stats-grid {
  display: grid;
  gap: 1rem;
}

.profile-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-card h3,
.inventory-panel h3,
.project-body h3,
.timeline .content-card h3,
.achievement-card h3,
.scoreboard-head h3 {
  margin: 0 0 0.55rem;
  font-size: 1.2rem;
}

.profile-card p,
.content-card p,
.project-body p,
.achievement-card p,
.mini-score span,
.terminal-line span,
.terminal-line strong {
  color: var(--muted);
}

.accent-card {
  border-color: rgba(77,243,255,0.3);
}

.inventory-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.inventory-panel {
  padding: 1rem;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.inventory-panel:hover,
.project-card:hover,
.scoreboard-card:hover,
.achievement-card:hover,
.timeline .content-card:hover {
  transform: translateY(-6px);
  border-color: rgba(77,243,255,0.45);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}

.panel-icon {
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--yellow);
  background: rgba(255,255,255,0.04);
  font-size: 1.2rem;
}

.panel-head p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.progress-track {
  position: relative;
  height: 12px;
  margin-top: 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--pink), var(--yellow));
  box-shadow: 0 0 12px rgba(255,255,255,0.15);
}

.project-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-card {
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.project-art {
  position: relative;
  min-height: 180px;
  background: linear-gradient(135deg, rgba(255,79,216,0.16), rgba(77,243,255,0.1));
  border-bottom: 2px solid rgba(255,255,255,0.1);
}

.project-art::before,
.project-art::after,
.pixel-scene::before,
.pixel-scene::after {
  content: '';
  position: absolute;
}

.project-art::before {
  inset: 14px;
  border: 2px solid rgba(255,255,255,0.14);
  background:
    linear-gradient(180deg, transparent 0 65%, rgba(0,0,0,0.3) 65% 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.06) 0 12px, transparent 12px 24px);
}

.project-art::after {
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  height: 18px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  opacity: 0.35;
}

.project-art-ai { background: linear-gradient(135deg, rgba(77,243,255,0.2), rgba(255,79,216,0.18)); }
.project-art-security { background: linear-gradient(135deg, rgba(255,227,107,0.2), rgba(255,79,216,0.14)); }
.project-art-ml { background: linear-gradient(135deg, rgba(126,255,162,0.18), rgba(77,243,255,0.16)); }
.project-art-flutter { background: linear-gradient(135deg, rgba(77,243,255,0.22), rgba(126,255,162,0.16)); }

.project-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(7, 5, 15, 0.82);
  color: var(--yellow);
  font-family: 'Press Start 2P', monospace;
  font-size: 0.56rem;
}

.pixel-scene {
  position: absolute;
  inset: 2.5rem;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.85), transparent 6%),
    radial-gradient(circle at 70% 35%, rgba(255,255,255,0.55), transparent 7%),
    linear-gradient(180deg, rgba(12, 7, 19, 0) 0 55%, rgba(0,0,0,0.22) 55% 100%);
}

.pixel-scene::before {
  inset: auto 1rem 1rem;
  height: 22px;
  background: repeating-linear-gradient(90deg, var(--pink) 0 10px, transparent 10px 20px);
  opacity: 0.5;
}

.pixel-scene::after {
  left: 55%;
  top: 18%;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.95) 0 14%, transparent 14% 100%);
  box-shadow: -90px 84px 0 -72px rgba(255,227,107,0.55), 36px 54px 0 -66px rgba(77,243,255,0.6);
}

.project-body {
  padding: 1rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.9rem 0 1rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.card-actions a,
.terminal-links a,
.achievement-card a,
.scoreboard-card a {
  background: rgba(255,255,255,0.05);
}

.card-actions a {
  min-width: 8.75rem;
}

.timeline {
  display: grid;
  gap: 1rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.timeline-mark {
  width: 1rem;
  height: 1rem;
  margin-top: 1.4rem;
  background: var(--yellow);
  box-shadow: 0 0 0 6px rgba(255,227,107,0.14), 0 0 14px rgba(255,227,107,0.28);
}

.timeline-item .content-card {
  position: relative;
}

.timeline-item .content-card::before {
  content: '';
  position: absolute;
  left: -0.65rem;
  top: 1.5rem;
  width: 0.65rem;
  height: 2px;
  background: rgba(255,255,255,0.2);
}

.timeline-year {
  color: var(--cyan);
}

.achievement-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.achievement-card {
  padding: 1.2rem;
  transition: transform 180ms ease, border-color 180ms ease;
}

.certificate-tag {
  color: var(--yellow);
}

.achievement-card a,
.scoreboard-card a {
  margin-top: 1rem;
}

.stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scoreboard-card {
  padding: 1rem;
}

.scoreboard-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.scoreboard-head span {
  color: var(--yellow);
}

.scoreboard-card img {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.22);
}

.scoreboard-mini .mini-score {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem;
  border: 1px dashed rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.02);
}

.mini-score strong {
  color: var(--cyan);
  font-size: 1.2rem;
  text-transform: uppercase;
}

.terminal-card {
  padding: 1rem;
}

.terminal-line {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.terminal-line span {
  color: var(--yellow);
}

.terminal-line strong {
  justify-self: end;
}

.terminal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.footer {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 2rem auto 0;
  padding: 2rem 0 3rem;
  text-align: center;
  color: var(--muted);
}

.footer-title {
  font-family: 'Press Start 2P', monospace;
  color: var(--pink);
  margin-bottom: 0.8rem;
}

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 650ms ease, transform 650ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes starBlink {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.5); opacity: 1; }
}

@keyframes floatHero {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-10px); }
}

@keyframes waveShift {
  0%, 100% { transform: translateX(-50%) scaleX(1); }
  50% { transform: translateX(-50%) scaleX(1.03); }
}

@keyframes pageFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes flicker {
  0%, 100% { opacity: 0.16; }
  50% { opacity: 0.26; }
  72% { opacity: 0.18; }
}

@keyframes floatParticle {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0;
  }
  15% {
    opacity: 0.9;
  }
  50% {
    transform: translate3d(var(--particle-x), -18px, 0) scale(1.15);
  }
  100% {
    transform: translate3d(calc(var(--particle-x) * -1), -40px, 0) scale(0.8);
    opacity: 0;
  }
}

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

  .hero-copy h1 {
    max-width: none;
  }

    .hero-console {
    justify-content: flex-start;
  }

    .arcade-art {
      width: min(100%, 430px);
    }

  .inventory-grid,
  .project-grid,
  .stats-grid,
  .achievement-grid,
  .profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hud-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .navbar {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-links {
    order: 3;
    width: 100%;
  }

  .hero {
    padding-top: 1.5rem;
  }

  .hero-copy h1 {
    font-size: clamp(1.8rem, 7vw, 3rem);
  }

  .hero-actions,
  .terminal-links,
  .card-actions {
    flex-direction: column;
  }

  .pixel-button,
  .card-actions a,
  .terminal-links a,
  .achievement-card a,
  .scoreboard-card a {
    width: 100%;
  }

  .hud-grid,
  .inventory-grid,
  .project-grid,
  .achievement-grid,
  .stats-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .terminal-line {
    grid-template-columns: 1fr;
  }

  .terminal-line strong {
    justify-self: start;
  }

  .arcade-caption {
    flex-direction: column;
    gap: 0.3rem;
  }

  .section-block {
    padding-top: 3rem;
  }
}

@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;
    scroll-behavior: auto !important;
  }

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

/* Stitch prototype refinements: more legible, arcade-style content panels. */
.section-block > .stage-heading {
  text-align: center;
}

.stage-heading h2 {
  margin: 0;
  text-shadow: 0 0 14px rgba(77, 243, 255, 0.16);
}

.wide-card {
  position: relative;
  margin-inline: auto;
  border-width: 2px;
  font-family: 'Courier New', monospace;
}

.wide-card::before,
.wide-card::after {
  content: '';
  position: absolute;
  width: 0.5rem;
  height: 0.5rem;
  border-color: var(--cyan);
  filter: drop-shadow(0 0 4px var(--cyan));
}

.wide-card::before {
  top: -2px;
  left: -2px;
  border-top: 2px solid;
  border-left: 2px solid;
}

.wide-card::after {
  right: -2px;
  bottom: -2px;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.wide-card p::before {
  content: '> ';
  color: var(--cyan);
}

.project-card,
.achievement-card,
.scoreboard-card {
  box-shadow: 7px 7px 0 rgba(0, 0, 0, 0.22), 0 14px 28px rgba(0, 0, 0, 0.16);
}

.project-art {
  min-height: 150px;
  isolation: isolate;
}

.project-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
  filter: saturate(1.12) contrast(1.05) brightness(0.72);
  transition: transform 300ms ease, filter 300ms ease, opacity 300ms ease;
}

.project-card:hover .project-image {
  transform: scale(1.055);
  opacity: 0.96;
  filter: saturate(1.2) contrast(1.06) brightness(0.84);
}

.project-art::before,
.project-art::after {
  z-index: 1;
}

.project-art .pixel-scene {
  z-index: 1;
  pointer-events: none;
}

.project-badge {
  z-index: 2;
}

.project-art .pixel-scene {
  background:
    radial-gradient(circle at 18% 24%, rgba(77, 243, 255, 0.95) 0 1px, transparent 2px),
    radial-gradient(circle at 69% 30%, rgba(255, 227, 107, 0.8) 0 1px, transparent 2px),
    radial-gradient(circle at 37% 59%, rgba(255, 79, 216, 0.7) 0 1px, transparent 2px),
    linear-gradient(150deg, transparent 0 42%, rgba(255,255,255,0.12) 42% 43%, transparent 43% 100%),
    linear-gradient(180deg, rgba(12, 7, 19, 0.04), rgba(0, 0, 0, 0.46));
}

.project-badge {
  left: auto;
  right: 1rem;
  border-color: currentColor;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.28);
}

.project-art-security .project-badge { color: var(--yellow); }
.project-art-ml .project-badge { color: var(--green); }

.project-body {
  display: flex;
  min-height: 255px;
  flex-direction: column;
}

.project-body p {
  flex-grow: 1;
}

.card-actions a {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  text-align: center;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.54rem;
}

.achievement-card {
  position: relative;
  display: flex;
  min-height: 230px;
  flex-direction: column;
  overflow: hidden;
}

.achievement-card::before {
  content: '★';
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  color: rgba(255, 227, 107, 0.22);
  font-size: 2.25rem;
  line-height: 1;
}

.certificate-tag {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 0.85rem;
  padding: 0.38rem 0.55rem;
  border: 1px solid rgba(255, 227, 107, 0.32);
  background: rgba(255, 227, 107, 0.08);
  font-family: 'Press Start 2P', monospace;
  font-size: 0.52rem;
  line-height: 1.45;
}

.achievement-card p {
  flex-grow: 1;
}

.achievement-card a {
  width: 100%;
  border: 1px solid rgba(77, 243, 255, 0.35);
  text-align: center;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.54rem;
}

.terminal-card {
  max-width: 880px;
  margin-inline: auto;
  border: 2px solid rgba(126, 255, 162, 0.38);
  background: linear-gradient(135deg, rgba(3, 15, 12, 0.96), rgba(7, 5, 15, 0.96));
  box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.2), 0 18px 38px rgba(0, 0, 0, 0.36);
}

.terminal-line span,
.terminal-line strong {
  color: var(--green);
}

.terminal-links a {
  border: 1px solid rgba(126, 255, 162, 0.42);
  color: var(--green);
  font-family: 'Press Start 2P', monospace;
  font-size: 0.54rem;
}

@media (min-width: 1081px) {
  .project-grid,
  .achievement-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Project priority and terminal interaction refinements. */
.project-standard { order: 10; }
.project-priority-dependix { order: 1; }
.project-priority-sentinel { order: 2; }
.project-priority-nextmatch { order: 3; }

.project-grid .project-card {
  opacity: 0;
  transform: translateY(22px) scale(0.985);
}

.reveal.is-visible .project-grid .project-card {
  animation: projectCardEnter 520ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.reveal.is-visible .project-grid .project-card:nth-child(1) { animation-delay: 70ms; }
.reveal.is-visible .project-grid .project-card:nth-child(2) { animation-delay: 130ms; }
.reveal.is-visible .project-grid .project-card:nth-child(3) { animation-delay: 190ms; }
.reveal.is-visible .project-grid .project-card:nth-child(4) { animation-delay: 250ms; }
.reveal.is-visible .project-grid .project-card:nth-child(5) { animation-delay: 310ms; }
.reveal.is-visible .project-grid .project-card:nth-child(6) { animation-delay: 370ms; }
.reveal.is-visible .project-grid .project-card:nth-child(7) { animation-delay: 430ms; }
.reveal.is-visible .project-grid .project-card:nth-child(8) { animation-delay: 490ms; }
.reveal.is-visible .project-grid .project-card:nth-child(9) { animation-delay: 550ms; }
.reveal.is-visible .project-grid .project-priority-dependix { animation-delay: 70ms !important; }
.reveal.is-visible .project-grid .project-priority-sentinel { animation-delay: 130ms !important; }
.reveal.is-visible .project-grid .project-priority-nextmatch { animation-delay: 190ms !important; }
.reveal.is-visible .project-grid .project-standard:nth-child(1) { animation-delay: 250ms; }
.reveal.is-visible .project-grid .project-standard:nth-child(2) { animation-delay: 310ms; }
.reveal.is-visible .project-grid .project-standard:nth-child(3) { animation-delay: 370ms; }

.terminal-card {
  padding: 0;
  overflow: hidden;
  font-family: 'Courier New', monospace;
}

.terminal-topbar {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.72rem 0.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  background: linear-gradient(180deg, #263245, #182131);
}

.terminal-dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
}

.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #28c840; }

.terminal-title {
  margin-left: 0.55rem;
  color: #94a3b8;
  font-size: 0.74rem;
}

.terminal-body {
  min-height: 330px;
  padding: clamp(1.2rem, 3vw, 2rem);
  color: #d9f99d;
  background: radial-gradient(circle at 90% 5%, rgba(77, 243, 255, 0.06), transparent 30%), #020805;
  font-size: clamp(0.76rem, 1.7vw, 0.95rem);
  line-height: 1.7;
}

.terminal-body p {
  margin: 0 0 0.52rem;
}

.terminal-boot { color: var(--green); }
.terminal-prompt { color: #f8fafc; }
.terminal-response { padding-left: clamp(0.8rem, 3vw, 1.8rem); color: #a1a1aa; }
.terminal-response strong { color: var(--cyan); }
.terminal-response .terminal-granted { color: var(--pink); }

.terminal-links-wrap {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(126, 255, 162, 0.2);
}

.terminal-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.terminal-links a {
  display: block;
  padding: 0.68rem 0.45rem;
  background: rgba(6, 78, 59, 0.12);
  text-align: center;
  text-transform: uppercase;
}

.terminal-final { margin-top: 1rem !important; }

.terminal-cursor {
  display: inline-block;
  width: 0.55rem;
  height: 1em;
  vertical-align: -0.15em;
  background: var(--green);
  box-shadow: 0 0 10px rgba(126, 255, 162, 0.85);
  animation: cursorBlink 850ms steps(2, start) infinite;
}

.terminal-step { opacity: 0; }
.reveal.is-visible .terminal-step { animation: terminalLineEnter 280ms ease-out forwards; }
.reveal.is-visible .terminal-step:nth-child(1) { animation-delay: 100ms; }
.reveal.is-visible .terminal-step:nth-child(2) { animation-delay: 380ms; }
.reveal.is-visible .terminal-step:nth-child(3) { animation-delay: 600ms; }
.reveal.is-visible .terminal-step:nth-child(4) { animation-delay: 820ms; }
.reveal.is-visible .terminal-step:nth-child(5) { animation-delay: 1040ms; }
.reveal.is-visible .terminal-step:nth-child(6) { animation-delay: 1260ms; }
.reveal.is-visible .terminal-step:nth-child(7) { animation-delay: 1480ms; }
.reveal.is-visible .terminal-step:nth-child(8) { animation-delay: 1700ms; }

@keyframes projectCardEnter {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes terminalLineEnter {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

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

@media (max-width: 760px) {
  .terminal-body { min-height: 0; }
  .terminal-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .project-grid .project-card,
  .terminal-step {
    opacity: 1;
    transform: none;
  }
}
