/* =============================================
   CHRISTIAN DIA PORTFOLIO — PIXEL EDITION
   Brutalist base + 8-bit gamification layer
   ============================================= */

/* --- Google Font: Press Start 2P for pixel feel --- */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Helvetica+Neue:wght@400;700&display=swap');

/* --- CSS Reset & Variables --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black: #000000;
  --white: #ffffff;
  --gray-light: #e0e0e0;
  --gray-mid: #cccccc;
  --pixel-gold: #f5c400;
  --pixel-green: #00c853;
  --pixel-red: #d50000;
  --pixel-blue: #2979ff;
  --pixel-purple: #aa00ff;
  --pixel-cyan: #00e5ff;
  --grid-size: 30px;
  --border-heavy: 4px solid var(--black);
  --shadow-pixel: 6px 6px 0px var(--black);
  --font-pixel: 'Press Start 2P', monospace;
  --font-main: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

body {
  font-family: var(--font-main);
  background-color: var(--white);
  background-image:
    linear-gradient(to right, var(--gray-light) 1px, transparent 1px),
    linear-gradient(to bottom, var(--gray-light) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  animation: scrollGrid 5s linear infinite;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@keyframes scrollGrid {
  0%   { background-position: 0px 0px; }
  100% { background-position: 30px 30px; }
}

/* =============================================
   HEADER
   ============================================= */
.top-header {
  width: 100%;
  background-color: var(--black);
  border-bottom: 5px solid var(--black);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: 0 5px 15px rgba(0,0,0,0.25);
  position: relative;
  z-index: 10;
}

.cool-title {
  font-family: var(--font-main);
  font-size: clamp(1rem, 2.5vw, 1.8rem);
  font-weight: bold;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 2px;
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.header-info {
  font-size: 0.75rem;
  color: var(--gray-mid);
  letter-spacing: 1px;
  white-space: nowrap;
}

/* --- Resume Button (pixel style) --- */
.resume-btn {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--black);
  background-color: var(--pixel-gold);
  border: 3px solid var(--black);
  padding: 8px 12px;
  cursor: pointer;
  box-shadow: 4px 4px 0px var(--white);
  transition: all 0.1s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.resume-btn:hover {
  background-color: var(--white);
  box-shadow: 6px 6px 0px var(--pixel-gold);
  transform: translate(-2px, -2px);
}

.resume-btn:active {
  box-shadow: 0 0 0 transparent;
  transform: translate(4px, 4px);
}

.resume-btn-icon { font-size: 0.9rem; }

/* =============================================
   XP BAR & LEVEL SYSTEM
   ============================================= */
.xp-system {
  background: var(--black);
  border-bottom: 4px solid var(--pixel-gold);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.xp-level-badge {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  background: var(--pixel-gold);
  color: var(--black);
  padding: 4px 8px;
  border: 2px solid var(--white);
  white-space: nowrap;
  letter-spacing: 1px;
}

.xp-bar-wrapper {
  flex: 1;
  min-width: 120px;
}

.xp-label {
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  color: var(--gray-mid);
  margin-bottom: 4px;
  letter-spacing: 1px;
}

.xp-bar-track {
  width: 100%;
  height: 10px;
  background: #333;
  border: 2px solid var(--pixel-gold);
  position: relative;
  image-rendering: pixelated;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(to right, var(--pixel-gold), #ffe066);
  transition: width 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
  position: relative;
}

.xp-bar-fill::after {
  content: '';
  position: absolute;
  right: 0; top: 0;
  width: 4px; height: 100%;
  background: var(--white);
  opacity: 0.6;
}

.xp-score {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--pixel-gold);
  white-space: nowrap;
  letter-spacing: 1px;
}

/* =============================================
   ACHIEVEMENT POPUP (pixel toast)
   ============================================= */
.achievement-toast {
  position: fixed;
  top: -120px;
  right: 20px;
  z-index: 9999;
  background: var(--black);
  border: 3px solid var(--pixel-gold);
  padding: 12px 16px;
  box-shadow: 6px 6px 0 var(--pixel-gold);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 320px;
  transition: top 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.achievement-toast.show { top: 20px; }

.achievement-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.achievement-text { flex: 1; }

.achievement-label {
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  color: var(--pixel-gold);
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.achievement-title {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--white);
  letter-spacing: 0.5px;
  line-height: 1.6;
}

/* =============================================
   MAIN LAYOUT
   ============================================= */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 16px;
  width: 100%;
}

/* =============================================
   CAROUSEL
   ============================================= */
.carousel-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 960px;
}

.arrow {
  font-size: clamp(24px, 4vw, 52px);
  background: var(--white);
  border: 4px solid var(--black);
  cursor: pointer;
  user-select: none;
  color: var(--black);
  transition: all 0.1s;
  padding: 8px 12px;
  box-shadow: var(--shadow-pixel);
  flex-shrink: 0;
}

.arrow:hover {
  background: var(--black);
  color: var(--white);
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--black);
}

.arrow:active {
  transform: translate(6px, 6px);
  box-shadow: 0 0 0 transparent;
}

.slider-container {
  flex: 1;
  aspect-ratio: 16 / 9;
  border: 5px solid var(--black);
  position: relative;
  overflow: hidden;
  background-color: var(--white);
  box-shadow: 12px 12px 0px var(--black);
  max-height: 62vh;
}

.slide {
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  position: relative;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide.active { display: flex; }

/* Slide transition effect */
.slide.entering {
  animation: slideIn 0.25s ease forwards;
}

@keyframes slideIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

/* Pixel corner decorations on slider */
.slider-container::before,
.slider-container::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  z-index: 5;
  pointer-events: none;
}
.slider-container::before {
  top: 6px; left: 6px;
  border-top: 4px solid var(--pixel-gold);
  border-left: 4px solid var(--pixel-gold);
}
.slider-container::after {
  bottom: 6px; right: 6px;
  border-bottom: 4px solid var(--pixel-gold);
  border-right: 4px solid var(--pixel-gold);
}

/* Slide index counter */
.slide-counter {
  position: absolute;
  bottom: 8px;
  left: 12px;
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  color: var(--white);
  background: rgba(0,0,0,0.75);
  padding: 4px 8px;
  border: 1px solid var(--pixel-gold);
  z-index: 6;
  letter-spacing: 1px;
  pointer-events: none;
}

/* =============================================
   PIXEL NAVIGATION BADGES
   ============================================= */
.square-buttons-container {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 960px;
  width: 100%;
}

.square-btn {
  width: 28px;
  height: 28px;
  border: 3px solid var(--black);
  background-color: var(--white);
  cursor: pointer;
  box-shadow: 4px 4px 0px var(--black);
  transition: all 0.15s;
  position: relative;
  flex-shrink: 0;
}

/* Removed hover text overlap code from here */

.square-btn.active {
  background-color: var(--black);
  box-shadow: 0 0 0 transparent;
  transform: translate(4px, 4px);
}

/* Unlocked vs locked slide indicator */
.square-btn.unlocked {
  border-color: var(--pixel-gold);
  box-shadow: 4px 4px 0 var(--pixel-gold);
}

.square-btn.unlocked.active {
  background: var(--pixel-gold);
  box-shadow: 0 0 0 transparent;
  transform: translate(4px, 4px);
  border-color: var(--black);
}

/* =============================================
   STATS PANEL (gamification)
   ============================================= */
.stats-panel {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 960px;
  width: 100%;
}

.stat-chip {
  font-family: var(--font-pixel);
  font-size: 0.38rem;
  border: 2px solid var(--black);
  padding: 5px 10px;
  background: var(--white);
  box-shadow: 3px 3px 0 var(--black);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  color: var(--black);
}

.stat-chip .stat-icon { font-size: 0.9rem; }

.stat-chip.gold { background: var(--pixel-gold); }
.stat-chip.green { background: #b9f6ca; }
.stat-chip.blue { background: #bbdefb; }

/* =============================================
   FOOTER
   ============================================= */
.bottom-bar {
  width: 100%;
  border-top: 5px solid var(--black);
  background-color: var(--white);
  padding: 18px 24px;
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
}

.circle-link {
  width: 40px;
  height: 40px;
  border: 3px solid var(--black);
  border-radius: 50%;
  background-color: var(--white);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--black);
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--black);
  transition: all 0.15s;
  text-decoration: none;
  flex-shrink: 0;
}

.circle-link:hover {
  background-color: var(--black);
  color: var(--white);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--black);
}

.circle-link:active {
  box-shadow: 0 0 0 transparent;
  transform: translate(4px, 4px);
}

/* =============================================
   RESPONSIVE — TABLET (≤768px)
   ============================================= */
@media (max-width: 768px) {
  .top-header { padding: 10px 16px; }
  .cool-title { font-size: clamp(0.85rem, 3.5vw, 1.2rem); }
  .resume-btn { font-size: 0.38rem; padding: 7px 10px; }
  .xp-system { padding: 6px 16px; gap: 10px; }
  .xp-level-badge { font-size: 0.38rem; }
  .xp-label { font-size: 0.32rem; }
  .xp-score { font-size: 0.38rem; }

  .carousel-section { gap: 6px; }
  .arrow { font-size: clamp(18px, 5vw, 32px); padding: 6px 8px; }
  .slider-container { max-height: 55vw; box-shadow: 6px 6px 0 var(--black); }

  .square-btn { width: 22px; height: 22px; }
  .stats-panel { gap: 6px; }
  .stat-chip { font-size: 0.32rem; padding: 4px 8px; }
  .bottom-bar { padding: 14px 16px; gap: 10px; }
  .circle-link { width: 36px; height: 36px; }
}

/* =============================================
   RESPONSIVE — MOBILE (≤480px)
   ============================================= */
@media (max-width: 480px) {
  .top-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
  }
  .header-right { width: 100%; justify-content: space-between; }
  .cool-title { font-size: 0.85rem; }
  .resume-btn { font-size: 0.35rem; padding: 6px 9px; }

  .xp-system { padding: 6px 12px; }
  .xp-bar-wrapper { min-width: 80px; }

  .main-content { padding: 12px 8px 10px; }
  .carousel-section { gap: 4px; }
  .arrow { font-size: 22px; padding: 5px 7px; border-width: 3px; box-shadow: 3px 3px 0 var(--black); }
  .slider-container {
    max-height: none;
    aspect-ratio: 16/9;
    border-width: 3px;
    box-shadow: 4px 4px 0 var(--black);
  }

  .square-buttons-container { gap: 6px; margin-top: 14px; }
  .square-btn { width: 18px; height: 18px; border-width: 2px; box-shadow: 3px 3px 0 var(--black); }

  .stats-panel { margin-top: 10px; gap: 6px; }
  .stat-chip { font-size: 0.3rem; padding: 4px 7px; gap: 3px; }
  .stat-chip .stat-icon { font-size: 0.75rem; }

  .bottom-bar { padding: 12px; gap: 8px; }
  .circle-link { width: 32px; height: 32px; border-width: 2px; box-shadow: 3px 3px 0 var(--black); }
  .circle-link svg { width: 18px; height: 18px; }

  .achievement-toast { right: 10px; left: 10px; min-width: unset; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
  .achievement-toast { transition: none; }
  .xp-bar-fill { transition: none; }
}