/* Retro game mode overrides (applies only when body has .retro-theme) */
body.retro-theme {
  --bg-dark: #fff8d1;
  --bg-card: #fff0b4;
  --bg-card-hover: #ffe38a;
  --accent: #ff2f92;
  --accent-dark: #ff7e33;
  --text-primary: #2e1651;
  --text-secondary: #5f3f85;
  --border: rgba(46, 22, 81, 0.28);

  font-family: "Trebuchet MS", "Lucida Console", "Courier New", monospace;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 0, 170, 0.14) 0%, transparent 35%),
    radial-gradient(circle at 80% 20%, rgba(255, 126, 51, 0.18) 0%, transparent 32%),
    radial-gradient(circle at 50% 80%, rgba(255, 210, 0, 0.15) 0%, transparent 40%),
    linear-gradient(180deg, #fff9de 0%, #ffeec4 55%, #fff7d6 100%);
}

body.retro-theme::before {
  opacity: 0.3;
  background:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.08) 0,
      rgba(255, 255, 255, 0.08) 1px,
      transparent 1px,
      transparent 3px
    ),
    radial-gradient(
      320px 320px at var(--mx, 50%) var(--my, 50%),
      rgba(255, 47, 146, 0.15),
      rgba(255, 169, 64, 0.13) 45%,
      rgba(0, 0, 0, 0) 65%
    );
}

body.retro-theme .section-wave {
  display: none;
}

body.retro-theme section {
  position: relative;
  margin: 2.1rem auto;
  max-width: 1220px;
  border: 3px solid rgba(46, 22, 81, 0.45);
  border-radius: 0;
  box-shadow:
    0 0 0 3px rgba(255, 214, 92, 0.65),
    8px 8px 0 rgba(46, 22, 81, 0.18);
  padding-top: 5rem;
  background:
    linear-gradient(180deg, rgba(255, 251, 232, 0.93) 0%, rgba(255, 242, 195, 0.9) 100%);
}

body.retro-theme section:not(.hero)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.4rem;
  border-bottom: 2px solid rgba(46, 22, 81, 0.35);
  background: linear-gradient(90deg, #ffd868 0%, #ff8cc3 45%, #ff9f5c 100%);
  z-index: 1;
}

body.retro-theme section:not(.hero)::after {
  content: "WINDOW";
  position: absolute;
  top: 0.52rem;
  left: 1rem;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: rgba(46, 22, 81, 0.85);
  z-index: 2;
}

body.retro-theme #about::after {
  content: "ABOUT.EXE";
}

body.retro-theme #skills::after {
  content: "SKILLS.SYS";
}

body.retro-theme #projects::after {
  content: "PROJECTS.LOG";
}

body.retro-theme #timeline::after {
  content: "TIMELINE.DAT";
}

body.retro-theme #contact::after {
  content: "CONTACT.MSG";
}

body.retro-theme section:not(.hero) .section-title {
  position: static;
}

body.retro-theme .hero {
  border-color: rgba(46, 22, 81, 0.35);
  box-shadow:
    0 0 0 3px rgba(255, 214, 92, 0.58),
    8px 8px 0 rgba(46, 22, 81, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 252, 232, 0.92) 0%, rgba(255, 238, 196, 0.9) 100%),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      rgba(255, 47, 146, 0.05) 10px,
      rgba(255, 47, 146, 0.05) 20px
    );
}

body.retro-theme #about,
body.retro-theme #skills,
body.retro-theme #projects,
body.retro-theme #timeline,
body.retro-theme #contact {
  background:
    linear-gradient(180deg, rgba(255, 251, 232, 0.96) 0%, rgba(255, 242, 195, 0.92) 100%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 16px,
      rgba(255, 47, 146, 0.04) 16px,
      rgba(255, 47, 146, 0.04) 17px
    );
}

body.retro-theme section:nth-child(even),
body.retro-theme section:nth-child(odd) {
  background:
    linear-gradient(180deg, rgba(255, 251, 232, 0.96) 0%, rgba(255, 242, 195, 0.92) 100%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 16px,
      rgba(255, 47, 146, 0.04) 16px,
      rgba(255, 47, 146, 0.04) 17px
    );
}

body.retro-theme .navbar.scrolled {
  background: rgba(255, 247, 207, 0.92);
  box-shadow: 0 4px 16px rgba(46, 22, 81, 0.18);
}

body.retro-theme .projects-grid,
body.retro-theme .skills-grid {
  gap: 1.3rem;
}

body.retro-theme .project-card,
body.retro-theme .skill-card,
body.retro-theme .timeline-content,
body.retro-theme .about-stats-card,
body.retro-theme .contact-content,
body.retro-theme .terminal-card {
  background: rgba(255, 255, 255, 0.72);
  border: 2px solid rgba(255, 47, 146, 0.35);
  border-radius: 0;
  box-shadow:
    0 0 0 2px rgba(46, 22, 81, 0.08),
    5px 5px 0 rgba(255, 47, 146, 0.18);
}

body.retro-theme .project-card:hover,
body.retro-theme .skill-card:hover,
body.retro-theme .timeline-content:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 126, 51, 0.76);
  box-shadow:
    0 0 0 2px rgba(46, 22, 81, 0.08),
    8px 8px 0 rgba(255, 126, 51, 0.2);
}

body.retro-theme .project-image,
body.retro-theme .project-badge,
body.retro-theme .tech-badge,
body.retro-theme .timeline-badge,
body.retro-theme .meta-chip,
body.retro-theme .project-chip {
  background: rgba(255, 47, 146, 0.14);
  color: #5c1a99;
  border-color: rgba(255, 47, 146, 0.35);
  border-radius: 0;
}

body.retro-theme .project-chip--secondary {
  background: rgba(169, 236, 81, 0.2);
  color: #3f4f12;
  border-color: rgba(145, 209, 61, 0.45);
}

body.retro-theme .terminal-card {
  max-width: 520px;
  border-width: 3px;
  border-color: rgba(46, 22, 81, 0.52);
  box-shadow:
    0 0 0 2px rgba(255, 214, 92, 0.6),
    7px 7px 0 rgba(46, 22, 81, 0.2);
  background: linear-gradient(180deg, rgba(255, 246, 209, 0.98), rgba(255, 234, 176, 0.94));
}

body.retro-theme .terminal-card::before {
  opacity: 0;
}

body.retro-theme .terminal-card .terminal-header {
  padding: 0.65rem 0.8rem;
  border-bottom: 2px solid rgba(46, 22, 81, 0.42);
  background:
    linear-gradient(90deg, #ffe06a 0%, #ff8ec4 54%, #ffad5a 100%);
  gap: 0.8rem;
}

body.retro-theme .terminal-card .terminal-buttons {
  gap: 0.35rem;
}

body.retro-theme .terminal-card .terminal-btn {
  width: 0.82rem;
  height: 0.82rem;
  border-radius: 0;
  border: 1px solid rgba(46, 22, 81, 0.65);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.58);
}

body.retro-theme .terminal-card .terminal-btn.close {
  background: #ff7a9c;
}

body.retro-theme .terminal-card .terminal-btn.minimize {
  background: #ffd248;
}

body.retro-theme .terminal-card .terminal-btn.maximize {
  background: #8be34f;
}

body.retro-theme .terminal-card .terminal-title {
  position: relative;
  color: transparent;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
  text-shadow: none;
  text-align: left;
  margin-right: 0;
}

body.retro-theme .terminal-card .terminal-title::after {
  content: "QUEST-LOG.EXE";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  color: rgba(46, 22, 81, 0.9);
  font-size: 0.75rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 1px;
}

body.retro-theme .terminal-card .terminal-body {
  padding: 1.25rem 1.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.45);
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.2) 0,
      rgba(255, 255, 255, 0.2) 1px,
      transparent 1px,
      transparent 22px
    ),
    linear-gradient(180deg, rgba(255, 248, 220, 0.98), rgba(255, 238, 196, 0.95));
}

body.retro-theme .terminal-card .terminal-line {
  color: #3b225d;
  gap: 0.28rem;
}

body.retro-theme .terminal-card .terminal-comment {
  color: #614387;
}

body.retro-theme .terminal-card .terminal-prompt {
  color: #ff2f92;
}

body.retro-theme .terminal-card .terminal-text {
  color: #2e1651;
  font-weight: 700;
  text-shadow: none;
}

body.retro-theme .terminal-card .terminal-symbol {
  color: #ff7e33;
}

body.retro-theme .btn,
body.retro-theme .project-link,
body.retro-theme .contact-action,
body.retro-theme .hero-cta-btn,
body.retro-theme .theme-toggle-btn {
  border-color: rgba(255, 47, 146, 0.58);
  color: #5c1a99;
  background: linear-gradient(
    135deg,
    rgba(255, 47, 146, 0.17),
    rgba(255, 211, 71, 0.18)
  );
  border-radius: 0;
}

body.retro-theme .hero-cta-btn .btn-icon,
body.retro-theme .project-link::after,
body.retro-theme .contact-action::after {
  filter: none;
}

body.retro-theme .project-link::after,
body.retro-theme .contact-action::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff7e33' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7'/%3E%3Cpath d='M8 7h9v9'/%3E%3C/svg%3E");
}

body.retro-theme .btn:hover,
body.retro-theme .project-link:hover,
body.retro-theme .contact-action:hover,
body.retro-theme .hero-cta-btn:hover,
body.retro-theme .theme-toggle-btn:hover {
  color: #2e1651;
  border-color: rgba(255, 126, 51, 0.82);
  background: linear-gradient(
    135deg,
    rgba(255, 183, 82, 0.32),
    rgba(255, 96, 178, 0.28)
  );
}

body.retro-theme .project-link:hover::after,
body.retro-theme .contact-action:hover::after {
  filter: drop-shadow(0 0 8px rgba(255, 126, 51, 0.45));
}

body.retro-theme .contact-action--primary {
  color: #1f1238;
  background: linear-gradient(135deg, #ffb347 0%, #ff59b1 100%);
  border-color: rgba(255, 126, 51, 0.84);
}

body.retro-theme .nav-links a {
  color: #3f245f;
}

body.retro-theme .nav-links a:hover,
body.retro-theme .nav-links a.active {
  color: #ff2f92;
}

body.retro-theme .project-modal__panel {
  background: linear-gradient(170deg, rgba(255, 247, 207, 0.97), rgba(255, 232, 178, 0.97));
  border-color: rgba(255, 47, 146, 0.45);
  border-radius: 0;
}

body.retro-theme .project-modal__section {
  background: rgba(255, 255, 255, 0.56);
  border-color: rgba(46, 22, 81, 0.16);
  border-radius: 0;
}

body.retro-theme .footer-text {
  color: #6d538a;
}

body.retro-theme .timeline-meta,
body.retro-theme .project-impact li,
body.retro-theme .skills-summary,
body.retro-theme .about-text p {
  color: var(--text-secondary);
}

@media (max-width: 900px) {
  body.retro-theme section {
    margin: 1.2rem 0.8rem;
  }
}
