:root {
  --retro-pink: #ec4899;
  --retro-lavender: #E6E6FA;
  --retro-black: #333333;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

.font-pixel {
  font-family: 'Press Start 2P', cursive;
}

.bg-lavender {
  background-color: var(--retro-lavender);
}

.section-title {
  position: relative;
  width: 100%;
  text-align: center;
  margin-bottom: 2rem;
  padding: 0.5rem 0;
}

.section-title::before, 
.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
}

.section-title::before {
  top: 0;
  background: linear-gradient(90deg, var(--retro-pink), #9c5bff);
}

.section-title::after {
  bottom: 0;
  background: linear-gradient(90deg, #9c5bff, var(--retro-pink));
}

.timeline-item {
  opacity: 1;
  transform: translateX(0);
  margin-bottom: 2rem;
}

.dialog-box {
  position: relative;
  transition: transform 0.3s ease;
  box-shadow: 5px 5px 0px rgba(0,0,0,0.2);
  background-color: white;
  border: 2px solid var(--retro-pink);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.dialog-box:hover {
  transform: scale(1.05);
  box-shadow: 8px 8px 0px rgba(0,0,0,0.2);
}

.dialog-box::after {
  content: '';
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 10px solid #fff;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
}

.side-dialog {
  position: relative;
  animation: float 3s ease-in-out infinite;
  box-shadow: 3px 3px 0px rgba(0,0,0,0.2);
  background-color: #ffebf5;
  border: 2px solid var(--retro-pink);
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-top: 1rem;
  margin-left: 2rem;
  max-width: 80%;
}

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

.retro-text {
  text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

.animate-glitch {
  animation: glitch 1s linear infinite;
}

@keyframes glitch {
  2%, 64% { transform: translate(2px,0) skew(0deg); }
  4%, 60% { transform: translate(-2px,0) skew(0deg); }
  62% { transform: translate(0,0) skew(5deg); }
}

.pixel-border {
  border-style: solid;
  border-width: 4px;
  border-image: linear-gradient(45deg, var(--retro-pink) 0%, #9c5bff 100%) 1;
  image-rendering: pixelated;
}

.typing-cursor {
  display: inline-block;
  width: 10px;
  height: 20px;
  background-color: var(--retro-pink);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.retro-button {
  background-color: var(--retro-pink);
  color: white;
  font-family: 'Press Start 2P', cursive;
  padding: 10px 20px;
  border: none;
  box-shadow: 4px 4px 0px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
}

.retro-button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px rgba(0,0,0,0.2);
}

.retro-button:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px rgba(0,0,0,0.2);
}

/* Chibi Avatar and Dialog Styles */
.chibi-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: float 4s ease-in-out infinite;
  display: none; /* Hide by default */
  width: 200px;
}

/* Only show on screens larger than 1280px */
@media (min-width: 1280px) {
  .chibi-container {
    display: flex;
  }
}

.chibi-avatar {
  border: 3px solid var(--retro-pink);
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  image-rendering: pixelated;
}

.chibi-dialog {
  width: 100%; /* Make dialog box full width */
  text-align: center;
  font-size: 0.7rem;
  line-height: 1.2;
  padding: 0.75rem !important;
  box-sizing: border-box;
  min-height: 80px; /* Ensure enough height for the content */
  overflow: visible; /* Ensure content isn't cut off */
}

.chibi-dialog::after {
  right: auto;
  left: 50%;
  top: -10px;
  transform: translateX(-50%) rotate(-90deg);
  border-left: 10px solid #fff;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
}

.chibi-dialog .flex {
  justify-content: space-around;
  margin-top: 8px;
  display: flex;
  flex-wrap: nowrap;
}

.chibi-dialog .typed-cursor {
  font-size: 0.8rem;
  color: var(--retro-pink);
  opacity: 1;
  animation: blink 0.7s infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.retro-link {
  background-color: var(--retro-pink);
  color: white;
  font-size: 0.6rem;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 2px 2px 0px rgba(0,0,0,0.2);
  display: inline-block;
  padding: 6px 12px;
  margin: 0 4px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.retro-link:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px rgba(0,0,0,0.2);
}

.retro-link:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0px rgba(0,0,0,0.2);
}

/* Scanlines effect */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0) 50%,
    rgba(0,0,0,0.02) 50%
  );
  background-size: 100% 4px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.3;
}

.skill-card {
  background-color: white;
  border: 2px solid var(--retro-pink);
  border-radius: 0.5rem;
  padding: 1rem;
  transition: all 0.3s ease;
}

.skill-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Responsive fixes */
@media (max-width: 640px) {
  .timeline-item {
    margin-bottom: 2rem;
  }
  
  .side-dialog {
    margin-left: 0;
    margin-top: 1rem;
    max-width: 100%;
  }
}