/* ============================================================
   CHRISTOPH KROGEL – 8-BIT PORTFOLIO
   NES / Nintendo Dark Theme
   ============================================================ */

/* ----- CUSTOM PROPERTIES ----- */
:root {
  --bg-dark: #0b0b1a;
  --bg-section: #0f0f23;
  --bg-card: #161631;
  --bg-card-hover: #1c1c40;

  --nes-red: #e43b44;
  --nes-blue: #0078f8;
  --nes-green: #3cbf00;
  --nes-yellow: #f8d830;
  --nes-orange: #f89868;
  --nes-cyan: #00b8d8;
  --nes-magenta: #d800cc;
  --nes-white: #f0f0f0;
  --nes-light-gray: #b0b0b0;
  --nes-gray: #787878;
  --nes-dark-gray: #383850;

  --text-primary: #e8e8e8;
  --text-secondary: #a0a0b8;
  --text-accent: #f8d830;

  --border-color: #4a4a68;
  --border-highlight: #f0f0f0;

  --pixel: 4px;
  --font-pixel: 'Press Start 2P', monospace;
  --transition-speed: 0.3s;

  --section-max: 960px;
}

/* ----- RESET & BASE ----- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
  font-size: 16px;
  image-rendering: pixelated;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}

body {
  font-family: var(--font-pixel);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 2;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: var(--nes-cyan);
  text-decoration: none;
  transition: color var(--transition-speed);
}
a:hover { color: var(--nes-yellow); }

::selection {
  background: var(--nes-blue);
  color: var(--nes-white);
}

/* ----- LOADING SCREEN ----- */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#loading-screen.hidden ~ * .hero-content {
  animation-delay: 0.15s;
}

.loading-content {
  text-align: center;
}

.loading-title {
  font-size: 1.1rem;
  color: var(--nes-yellow);
  margin-bottom: 2rem;
  letter-spacing: 2px;
}

.loading-bar {
  width: 280px;
  height: 24px;
  border: 4px solid var(--nes-white);
  background: var(--bg-dark);
  margin: 0 auto 1.5rem;
  padding: 4px;
}

.loading-fill {
  height: 100%;
  width: 0%;
  background: var(--nes-green);
  transition: width 0.1s steps(10);
}

.loading-label {
  font-size: 0.6rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.press-start {
  font-size: 0.7rem;
  color: var(--nes-white);
  cursor: pointer;
  margin-top: 1rem;
}

/* ----- STARFIELD CANVAS ----- */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ----- SCANLINES ----- */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.4;
}

/* ----- BLINK ANIMATION ----- */
.blink {
  animation: blink-anim 1s steps(1) infinite;
}
@keyframes blink-anim {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ----- NAVIGATION ----- */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(11, 11, 26, 0.92);
  border-bottom: 3px solid var(--border-color);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color var(--transition-speed);
}

#navbar.scrolled {
  border-bottom-color: var(--nes-blue);
}

.nav-inner {
  max-width: var(--section-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
}

.nav-logo {
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  color: var(--nes-yellow);
  text-decoration: none;
  letter-spacing: 1px;
}
.logo-bracket { color: var(--nes-blue); }

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: 1px;
  padding: 0.3rem 0;
  position: relative;
  transition: color var(--transition-speed);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--nes-red);
  transition: width var(--transition-speed);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--nes-white);
}
.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* ----- PIXEL BUTTONS ----- */
.pixel-btn {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  padding: 0.45rem 0.9rem;
  border: 3px solid var(--nes-white);
  background: transparent;
  color: var(--nes-white);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: all var(--transition-speed);
  position: relative;
}

.pixel-btn:hover {
  background: var(--nes-white);
  color: var(--bg-dark);
}

.btn-primary {
  border-color: var(--nes-red);
  color: var(--nes-red);
  box-shadow: 4px 4px 0 rgba(228, 59, 68, 0.3);
}
.btn-primary:hover {
  background: var(--nes-red);
  color: var(--nes-white);
}

.btn-secondary {
  border-color: var(--nes-blue);
  color: var(--nes-blue);
  box-shadow: 4px 4px 0 rgba(0, 120, 248, 0.3);
}
.btn-secondary:hover {
  background: var(--nes-blue);
  color: var(--nes-white);
}

.lang-btn {
  font-size: 0.5rem;
  padding: 0.3rem 0.6rem;
  border-color: var(--nes-red);
  color: var(--nes-red);
}
.lang-btn:hover {
  background: var(--nes-red);
  color: var(--nes-white);
}

/* Hamburger */
.menu-btn {
  display: none;
  border-color: var(--nes-white);
  padding: 0.4rem 0.55rem;
}
.hamburger {
  display: block;
  width: 14px;
  height: 2px;
  background: var(--nes-white);
  position: relative;
}
.hamburger::before, .hamburger::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--nes-white);
}
.hamburger::before { top: -5px; }
.hamburger::after { top: 5px; }

/* ----- HERO ----- */
#hero {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 3rem;
}

.hero-content {
  opacity: 0;
  transform: translateY(20px);
  animation: fade-in-up 0.8s ease forwards;
  animation-delay: 0.5s;
}

@keyframes fade-in-up {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Pixel Art Computer */
.pixel-computer {
  margin: 0 auto 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pc-monitor {
  width: 180px;
  height: 130px;
  background: #555;
  border: 6px solid;
  border-color: #888 #333 #333 #888;
  border-radius: 4px;
  padding: 12px;
  position: relative;
}

.pc-screen {
  width: 100%;
  height: 100%;
  background: #001a00;
  border: 4px solid;
  border-color: #111 #444 #444 #111;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: inset 0 0 30px rgba(0, 255, 0, 0.08);
  overflow: hidden;
}

.screen-line {
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  color: #0f0;
  line-height: 2;
  white-space: nowrap;
}

.line-1 {
  animation: type-line 0.8s steps(12) forwards;
  animation-delay: 1s;
  overflow: hidden;
  width: 0;
}

@keyframes type-line {
  to { width: 100%; }
}

.pc-led {
  position: absolute;
  bottom: 6px;
  right: 12px;
  width: 6px;
  height: 6px;
  background: var(--nes-green);
  border-radius: 50%;
  animation: blink-anim 2s steps(1) infinite;
}

.pc-stand {
  width: 24px;
  height: 18px;
  background: #555;
  border: 4px solid;
  border-color: #888 #333 #333 #888;
  border-top: none;
}

.pc-base {
  width: 80px;
  height: 12px;
  background: #555;
  border: 4px solid;
  border-color: #888 #333 #333 #888;
  border-radius: 0 0 4px 4px;
}

/* Hero typography */
.hero-name {
  font-size: 2.2rem;
  letter-spacing: 3px;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.name-line {
  display: block;
}

.name-line.accent {
  color: var(--nes-red);
  text-shadow: 4px 4px 0 rgba(228, 59, 68, 0.25);
}

.hero-name.single-line {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: nowrap;
}

.name-part {
  display: inline;
}

.name-part.accent {
  color: var(--nes-red);
  text-shadow: 4px 4px 0 rgba(228, 59, 68, 0.25);
}

.name-part.domain {
  color: var(--nes-cyan);
  text-shadow: none;
}

.hero-subtitle {
  font-size: 0.6rem;
  color: var(--nes-cyan);
  letter-spacing: 2px;
  margin-bottom: 2.5rem;
}

.hero-tagline {
  display: none;
}

.tagline-icon {
  color: var(--nes-yellow);
  margin-right: 0.3rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ----- SECTIONS ----- */
.section {
  position: relative;
  z-index: 2;
  max-width: var(--section-max);
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

.section-title {
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--nes-yellow);
  letter-spacing: 2px;
}

.title-deco {
  color: var(--nes-red);
  font-size: 0.6rem;
  vertical-align: middle;
}

/* Reveal animation */
.section .nes-dialog,
.section .quick-stats,
.section .rpg-stats,
.section .inventory,
.section .achievements,
.section .save-point,
.section .contact-grid,
.section .achievement-card,
.section .inv-category {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.section .revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ----- ABOUT: NES DIALOG BOX ----- */
.nes-dialog {
  background: var(--bg-card);
  border: 4px solid var(--border-color);
  box-shadow:
    inset -4px -4px 0 var(--bg-dark),
    inset 4px 4px 0 rgba(255, 255, 255, 0.05),
    8px 8px 0 rgba(0, 0, 0, 0.3);
  padding: 0;
  margin-bottom: 3rem;
}


.dialog-body {
  padding: 1.5rem;
}

.dialog-body p {
  font-size: 0.55rem;
  line-height: 2.2;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
.dialog-body p:last-child { margin-bottom: 0; }

/* ----- ABOUT: QUICK STATS ----- */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 3px solid var(--border-color);
  text-align: center;
  padding: 1.2rem 0.5rem;
  transition: border-color var(--transition-speed), transform var(--transition-speed);
}

.stat-card:hover {
  border-color: var(--nes-cyan);
  transform: translateY(-4px);
}

.stat-number {
  font-size: 1.2rem;
  color: var(--nes-yellow);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.4rem;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

/* ----- SKILLS: RPG STATS ----- */
.rpg-stats {
  background: var(--bg-card);
  border: 4px solid var(--border-color);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.3);
  margin-bottom: 3rem;
}


.stat-bars {
  padding: 1.2rem;
}

.stat-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.8rem;
  gap: 0.8rem;
}
.stat-row:last-child { margin-bottom: 0; }

.stat-name {
  font-size: 0.42rem;
  color: var(--text-secondary);
  min-width: 120px;
  letter-spacing: 1px;
}

.hp-bar {
  flex: 1;
  height: 18px;
  background: var(--bg-dark);
  border: 3px solid var(--nes-dark-gray);
  padding: 2px;
}

.hp-fill {
  height: 100%;
  width: 0%;
  background: var(--nes-green);
  transition: width 1.2s steps(20);
  position: relative;
}

.hp-fill.animate {
  width: var(--fill);
}

/* Color variations for HP bars */
.stat-row:nth-child(1) .hp-fill { background: var(--nes-green); }
.stat-row:nth-child(2) .hp-fill { background: var(--nes-cyan); }
.stat-row:nth-child(3) .hp-fill { background: var(--nes-blue); }
.stat-row:nth-child(4) .hp-fill { background: var(--nes-orange); }
.stat-row:nth-child(5) .hp-fill { background: var(--nes-magenta); }
.stat-row:nth-child(6) .hp-fill { background: var(--nes-red); }

/* ----- SKILLS: INVENTORY ----- */
.inventory {
  background: var(--bg-card);
  border: 4px solid var(--border-color);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.3);
}

.inventory-title {
  background: var(--nes-blue);
  padding: 0.6rem 1.2rem;
  font-size: 0.6rem;
  color: var(--nes-white);
  letter-spacing: 1px;
  border-bottom: 4px solid var(--border-color);
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
}

.inv-category {
  padding: 1rem 1.2rem;
  border-bottom: 2px solid var(--border-color);
  border-right: 2px solid var(--border-color);
}

.inv-category:nth-child(even) {
  border-right: none;
}

.inv-category:nth-last-child(-n+2) {
  border-bottom: none;
}

.inv-cat-name {
  font-size: 0.42rem;
  color: var(--nes-yellow);
  margin-bottom: 0.6rem;
  letter-spacing: 1px;
}

.inv-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.inv-item {
  font-size: 0.42rem;
  padding: 0.25rem 0.5rem;
  background: var(--bg-dark);
  border: 2px solid var(--nes-dark-gray);
  color: var(--text-primary);
  letter-spacing: 0.5px;
  transition: border-color var(--transition-speed), color var(--transition-speed);
}

.inv-item:hover {
  border-color: var(--nes-cyan);
  color: var(--nes-cyan);
}

/* ----- CERTIFICATIONS: ACHIEVEMENTS ----- */
.achievements {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.achievement-card {
  background: var(--bg-card);
  border: 4px solid var(--border-color);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.3);
  display: flex;
  overflow: hidden;
  transition: border-color var(--transition-speed), transform var(--transition-speed);
}

.achievement-card:hover {
  border-color: var(--nes-yellow);
  transform: translateY(-4px);
}

.achievement-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  min-height: 100%;
  background: var(--nes-yellow);
  color: var(--bg-dark);
  font-size: 1.6rem;
  border-right: 4px solid var(--border-color);
  flex-shrink: 0;
}

.achievement-content {
  padding: 1.2rem;
  flex: 1;
}

.achievement-badge {
  font-size: 0.4rem;
  color: var(--nes-yellow);
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
}

.lang-badge {
  color: var(--nes-cyan);
}

.achievement-name {
  font-size: 0.55rem;
  color: var(--nes-white);
  margin-bottom: 0.3rem;
}

.achievement-date {
  font-size: 0.4rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.achievement-desc {
  font-size: 0.42rem;
  color: var(--text-secondary);
  line-height: 2;
}

.lang-flags {
  display: flex;
  gap: 1rem;
  margin-top: 0.3rem;
}

.lang-item {
  font-size: 0.5rem;
  color: var(--text-primary);
}

/* ----- CONTACT ----- */
.save-point {
  text-align: center;
  margin-bottom: 2.5rem;
}

.save-header {
  font-size: 0.7rem;
  color: var(--nes-yellow);
  margin-bottom: 0.8rem;
}

.save-icon {
  margin-right: 0.5rem;
}

.save-subtitle {
  font-size: 0.5rem;
  color: var(--text-secondary);
  line-height: 2;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.contact-card {
  background: var(--bg-card);
  border: 4px solid var(--border-color);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.3);
  padding: 1.5rem 1rem;
  text-align: center;
  text-decoration: none;
  transition: border-color var(--transition-speed), transform var(--transition-speed);
  display: block;
}

.contact-card:hover {
  border-color: var(--nes-cyan);
  transform: translateY(-4px);
  color: inherit;
}

.contact-icon {
  font-size: 1.5rem;
  color: var(--nes-cyan);
  margin-bottom: 0.8rem;
}

.contact-label {
  font-size: 0.4rem;
  color: var(--nes-yellow);
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
}

.contact-value {
  font-size: 0.42rem;
  color: var(--text-secondary);
  word-break: break-all;
}

/* ----- FOOTER ----- */
#footer {
  position: relative;
  z-index: 2;
  border-top: 3px solid var(--border-color);
  padding: 2rem 1.5rem;
  text-align: center;
}

.footer-inner {
  max-width: var(--section-max);
  margin: 0 auto;
}

.footer-copy {
  font-size: 0.4rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.footer-tagline {
  font-size: 0.38rem;
  color: var(--nes-gray);
  margin-bottom: 1rem;
}

.back-to-top {
  font-size: 0.4rem;
  padding: 0.3rem 0.8rem;
}

/* =======================================
   RESPONSIVE DESIGN
   ======================================= */

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(11, 11, 26, 0.97);
    border-bottom: 3px solid var(--border-color);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0.8rem;
  }

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

  .menu-btn {
    display: block;
  }

  .hero-name {
    font-size: 1.4rem;
  }

  .hero-subtitle {
    font-size: 0.5rem;
  }

  .hero-tagline {
    font-size: 0.42rem;
  }

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

  .stat-name {
    min-width: 80px;
    font-size: 0.35rem;
  }

  .inventory-grid {
    grid-template-columns: 1fr;
  }

  .inv-category {
    border-right: none !important;
  }

  .inv-category:nth-last-child(2) {
    border-bottom: 2px solid var(--border-color);
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .achievement-card {
    flex-direction: column;
  }

  .achievement-icon {
    width: 100%;
    min-height: 60px;
    border-right: none;
    border-bottom: 4px solid var(--border-color);
  }
}

@media (max-width: 480px) {
  html { font-size: 14px; }

  .hero-name {
    font-size: 1.1rem;
  }

  .section {
    padding: 3rem 1rem;
  }

  .pc-monitor {
    width: 140px;
    height: 100px;
  }

  .stat-name {
    min-width: 60px;
  }

  .rpg-header {
    flex-direction: column;
    gap: 0.4rem;
    text-align: center;
  }
}

/* ----- UTILITY: SCREEN-READER ONLY ----- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
