/* -------------------------
   Color Palette:
    - Light Blue:       #39a0ed
    - Dark Blue:        #1e3a5f
    - Gold/Orange:      #cf9c0e
    - Dark Gray:       #333333
    - Off White:        #f0e7d8
   -------------------------- */

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
  font-family: 'Press Start 2P', cursive;

}

body {
  margin: 0;
  padding: 0;
  /* background-color: #f0e7d8; */
  color: #333;
  padding-top: 80px; /* adjust if navbar is taller */
  background-color: #f0e7d8;

  background-image:
    linear-gradient(to bottom, rgba(0,0,0,0.04), rgba(0,0,0,0)),
    linear-gradient(45deg, #eae0c8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eae0c8 75%),
    linear-gradient(45deg, #eae0c8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eae0c8 75%);

  background-size: 40px 40px; /* Size of squares */
  background-position:
    0 0,
    0 0,
    20px 20px,  /* offset for checkerboard */
    20px 20px;
  
  animation: retroShift 5s steps(4) infinite;
}

@keyframes retroShift {
  from {
    background-position: 
      0 0,
      0 0,
      20px 20px,
      20px 20px;
  }
  to {
    background-position: 
      0 40px,
      0 40px,
      20px 60px,
      20px 60px;
  }
}

/* Prevent scrolling when loading screen is active */
body.lock-scroll {
  overflow: hidden;
  height: 100vh; /* optional: ensures no scroll area */
}

/* Header */
header {
  background: black;
  color: #fff;
}


/* -------------------------
   Navbar (Unified for Mobile + Desktop)
-------------------------- */
.logo {
  height: 40px;  /* adjust to your navbar height */
  width: auto;   /* keeps aspect ratio */
}

.logo-link {
  display: inline-block;  /* makes the grow effect work */
}

.logo-link:hover,
.logo-link:active,
.logo-link:focus .logo {
  transform: scale(1.2);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.9); /* almost opaque */
  image-rendering: pixelated;
  padding: 1.5rem 1rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
  transition: transform 0.3s steps(4); /* keep chunky transitions on scroll */
}

/* Intro animation (only runs once) */
.navbar.chunky-enter {
  transform: translateY(-100%);
  animation: chunkySlideDown 0.6s steps(6) forwards;
}

@keyframes chunkySlideDown {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(0); }
}

.navbar.hidden {
  transform: translateY(-100%);
}

/* Shared nav list */
.nav-links {
  list-style: none;
  position: fixed;
  display: flex;
  flex-direction: column; /* mobile: stacked */
  padding: 0;
  margin: 0;
  top: 0;
  right: -100%; /* hidden by default */
  width: 60%;
  height: 100dvh;
  background: black;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  line-height: 4rem;
  text-align: center;
  transition: right 0.3s ease;
  z-index: 999;
}

.nav-links.active {
  right: 0; /* slide in */
}

.nav-links li {
  margin: 0;
}

.nav-links a {
  text-decoration: none;
  color: #fff;

}

.nav-links a:hover,
.nav-links a:active,
.nav-links a:focus {
  color: #cf9c0e;
}

/* Hamburger Menu */
.ham-menu {
  margin-left: auto;
  height: 40px;
  width: 40px;
  position: relative;
  cursor: pointer;
  z-index: 1100;
}

.ham-menu span {
  height: 4px;
  width: 100%;
  background: #cf9c0e;
  position: absolute;
  left: 0;
  transition: 0.3s;
}

.ham-menu span:nth-child(1) { top: 8px; }
.ham-menu span:nth-child(2) { top: 18px; }
.ham-menu span:nth-child(3) { top: 28px; }

.ham-menu.active span:nth-child(1) {
  transform: rotate(45deg);
  top: 18px;
}

.ham-menu.active span:nth-child(2) {
  opacity: 0;
}

.ham-menu.active span:nth-child(3) {
  transform: rotate(-45deg);
  top: 18px;
}

/* Tablet Layout */
@media (min-width: 768px) {
  .nav-links {
    width: 50%;
    font-size: 2rem;
  }
}

/* Desktop Layout */
@media (min-width: 992px) {
  .ham-menu {
    display: none;
  }

  .navbar {
    padding: 1.5rem;
  }

  .nav-links {
    position: static;       /* override fixed */
    top: auto;              /* reset */
    right: auto;            /* reset */
    height: auto;           /* reset full screen height */
    width: auto;            /* reset mobile width */
    z-index: auto;          /* reset overlay */
    flex-direction: row;    /* horizontal layout */
    background: none;       /* remove black overlay */
    font-size: 1rem;
    line-height: normal;
    justify-content: flex-end;
  }

  .nav-links li {
    margin: 0 1rem;
  }
}

/* -------------------------
  Sections (Pixelated Fade-In)
-------------------------- */
section {
  opacity: 0;
  transform: scale(0.95);
  filter: contrast(150%) brightness(90%);
  image-rendering: pixelated;
  transition: none;
  clip-path: inset(50% 50% 50% 50%); /* start completely hidden */
}

@media (max-width: 480px) {
  section {
    clip-path: none; /* disable for very small screens */
  }
}

section.visible {
  animation: topToBottomFadeIn 0.7s steps(6) forwards;
}

.section-title {
  animation: nes-bounce 1s steps(2, jump-none) infinite;
}

.section-title:hover,
.section-title:active,
.section-title:focus {
  color: #cf9c0e;
}

@keyframes topToBottomFadeIn {
  0% {
    opacity: 0;
    clip-path: inset(0% 0% 100% 0%); /* fully hidden from bottom */
    transform: scale(0.95);
  }
  40% {
    opacity: 1;
    clip-path: inset(0% 0% 60% 0%);
  }
  70% {
    clip-path: inset(0% 0% 20% 0%);
  }
  100% {
    opacity: 1;
    clip-path: inset(0% 0% 0% 0%); /* fully revealed */
    transform: scale(1);
  }
}

.main h2 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* NES Container look for each section */
.main-hero,
.main-about,
.main-skills,
.main-projects,
.main-contact {
  border: none;
  background: none;
  width: 90%;
  max-width: 1000px;
  margin: 3rem auto;  /* adds more vertical space between sections */
  padding: 1rem;    /* adds vertical spacing inside sections */
}

.main-about, .main-skills, .main-projects, .main-contact {
  opacity: 0;
  transform: translateY(20px);
}

.main-about.visible, .main-skills.visible, .main-projects.visible, .main-contact.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ------------------------------
   Base Hero (Mobile First)
--------------------------------*/
.main-hero {
  display: flex;
  flex-direction: column;
  align-items: center;   /* <- centers EVERYTHING inside */
  text-align: center;
  width: 90%;
  min-height: auto;
  color: black;
}

.main-hero h2 {
  line-height: 1.7;
  text-align: center;
  margin-bottom: 1.5rem;
}

.main-hero p {
  font-size: 1.2rem;
  line-height: 1.7;
  text-align: center;
  margin-bottom: 2.5rem;
}

.highlight {
  color: #cf9c0e; /* NES gold/orange accent */
  display: inline-block;
  animation: nes-bounce 1s steps(2, jump-none) infinite;
}

/* Controls the animation movement for titles */
@keyframes nes-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px); /* how high it bounces */
  }
}

/* Remove padding from NES container if needed */
.video-wrapper.nes-container {
  padding: 0.5rem !important;
}

/* Responsive iframe */
.video-wrapper {
  width: 100%;
  margin: 0 auto;   /* centers horizontally */
  display: block;
}

.video-wrapper iframe {
  width: 100%;
  aspect-ratio: 16 / 9; /* keeps height EXACTLY proportional on all devices */
  display: block;
  border: none;
}

/* Hover effect */
.video-wrapper:hover {
  transition: transform 0.05s steps(1);
  box-shadow: 0 0 30px #cf9c0e;
  transform: translateY(-8px);
}


/* -------------------------
  About Layout (Mobile First)
-------------------------- */
.main-about {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.main-about p {
  line-height: 1.6;
  margin-bottom: 1rem;
}


/* Portrait */
.profile-portrait {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  position: relative;
}

.profile-portrait::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 92%;
  height: 80px;
  background: linear-gradient(to bottom, transparent, #f0e7d8); /* match your page bg */
  pointer-events: none;
  border-radius: 5px;
}

.profile-portrait img {
  width: 100%;
  max-width: 65vw;
  max-height: 65vh;
  height: auto;
  object-fit: cover;
  display: block;
}

/* Hover: switch to 8-bit version */
.profile-portrait img:hover {
  content: url("images/portrait-8bit.png");
}

/* Hover and highlight for ALL screen sizes */
.player-card:hover,
.player-card:active,
.player-card:focus {
  transition: transform 0.05s steps(1);
  box-shadow: 0 0 30px #cf9c0e;
  transform: translateY(-8px);
}

.player-card h3 {
  margin: 1rem 0.5rem 32px;
}

.player-card:hover h3,
.player-card:active h3,
.player-card:focus h3 {
  color: #39a0ed; /* your NES blue */
}

.player-card p {
  margin: 1rem 0.5rem 16px;
  line-height: 1.7;
}

.player-card:hover p strong,
.player-card:active p strong,
.player-card:focus p strong {
  color: #cf9c0e; /* your NES yellow */
}

/* Add margin after the last <p> element in each card */
.player-card p:last-child {
  margin-bottom: 1rem;
}

/* About Layout - Desktop */
@media (min-width: 992px) {
  .main-about {
    display: grid;
    grid-template-columns: 1fr 1.2fr; /* left narrower, right slightly wider */
    grid-template-rows: auto auto auto auto; /* add an extra row for the heading */
    grid-template-areas:
      "heading heading"
      "info training"
      "attributes training"
      "talents talents";
    gap: 1.8rem;
    margin: 0 auto;
  }

  /* Assign grid areas */
  .main-about h2 {
    grid-area: heading; /* <-- add this */
    text-align: center; /* optional, center heading */
  }
  
  .player-card:nth-of-type(1) { grid-area: info; }
  .player-card:nth-of-type(2) { grid-area: training; }
  .player-card:nth-of-type(3) { grid-area: attributes; }
  .player-card:nth-of-type(4) { grid-area: talents; }

  /* Optional sizing balance */
  .player-card:nth-of-type(1),
  .player-card:nth-of-type(3) {
    min-height: 160px; /* short panels */
  }

  .player-card:nth-of-type(2) {
    grid-row: 2 / span 2; /* adjust rows for training card */
  }

  .player-card:nth-of-type(4) {
    grid-column: 1 / 3; /* full width bottom */
  }
}


/* -------------------------
  Skills/Abilities Layout (Mobile First)
-------------------------- */
.main-skills {
  display: flex;
  flex-direction: column;
  row-gap: 1rem; /* vertical spacing between skill cards */
}

.main-skills .nes-container {
  display: flex;
  flex-direction: column;
}

.main-skills .nes-container:hover,
.main-skills .nes-container:active,
.main-skills .nes-container:focus {
  transition: transform 0.05s steps(1);
  box-shadow: 0 0 30px #cf9c0e;
  transform: translateY(-8px);
}

.main-skills .nes-container h3 {
  margin-left: 0.3rem;
  margin-top: 0.5rem;
}

.main-skills .nes-container:hover h3,
.main-skills .nes-container:active h3,
.main-skills .nes-container:focus h3 {
  color: #39a0ed; /* your NES blue */
}

.main-skills .nes-container p {
  margin-left: 0.3rem;
  margin-bottom: 4px;       /* gap below text */
}

.main-skills .nes-container:hover p,
.main-skills .nes-container:active p,
.main-skills .nes-container:focus p {
  color: #cf9c0e; /* your NES yellow */
}

.progress-wrapper {
  position: relative;
  width: 100%;
}

.progress-label {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: black;
  pointer-events: none;
}

/* Pixelated NES-style progress bars */
.main-skills .nes-container progress {
  margin: 0 0 1rem 0;               /* remove default spacing */
}

/* Abilities Layout - Desktop */
@media (min-width: 992px) {
  .main-skills {
    display: grid;
    grid-template-areas:
      "heading heading heading"
      "motion motion motion"
      "design web game";
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    justify-items: center;
    align-items: stretch;
  }

  .main-skills .nes-container {
    width: 100%;
  }

  /* Assign areas to each element */
  .main-skills h2 {
    grid-area: heading;
    text-align: center;
  }

  /* Assign each of your existing NES containers */
  .main-skills .nes-container:nth-of-type(1) { grid-area: motion; }
  .main-skills .nes-container:nth-of-type(2) { grid-area: design; }
  .main-skills .nes-container:nth-of-type(3) { grid-area: web; }
  .main-skills .nes-container:nth-of-type(4) { grid-area: game; }
}


/* -------------------------
  Project Carousel + Gallery (Mobile First)
-------------------------- */
.main-projects {
  width: 100%;
  padding: 2rem 0;
}

.main-projects h2 {
  margin-bottom: 3rem;
}

/* Main Menu Buttons - Responsive */
.menu-options {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 80%;           /* relative width for mobile */
  margin: 0 auto;       /* center horizontally */
  padding: 0 1rem;      /* prevents touching edges on small screens */
}

.menu-option {
  padding: 1rem;
  font-size: 1rem;
  text-align: left;
}

.menu-option:hover,
.menu-option:active {
  transition: transform 0.05s steps(1);
  box-shadow: 0 0 30px #cf9c0e;
  transform: translateY(-8px);
}

.menu-option {
  color: #fff; /* default arrow + text color */
}

/* Hover → arrow turns gold */
.menu-option:hover {
  color: #cf9c0e; /* your gold */
}

/* Focus (keyboard navigation) → blue outline + arrow colored */
.menu-option:focus {
  color: #39a0ed;
}

/* Active (pressed) → dim or bold color */
.menu-option:active {
  color: #ffa500; /* brighter/orange */
  transform: scale(0.97); /* press effect */
}

.menu-option.blink {
  animation: blink 0.3s ease-in-out 2; /* blink twice */
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Carousel container: horizontal layout */
.project-carousel-container {
  display: flex;
  flex-direction: row;        /* arrows stay on the sides */
  align-items: center;
  justify-content: center;
  gap: 3rem;
  flex-wrap: nowrap;          /* prevent arrows from wrapping */
}

/* Arrows container below cards */
.carousel-arrows {
  display: flex;
  justify-content: center;
  gap: 1rem; /* space between left/right arrows */
  margin: 1rem 0 0 0; /* move up closer to cards, add space below for back button */
  width: 100%;   
}

/* Keep arrow styles */
.arrow {
  flex-shrink: 0;
  font-size: 1rem;
  width: auto;
  background: none;
  border: none;
  color: #cf9c0e;
}

/* Hover animations */
.arrow.right-arrow:hover,
.arrow.right-arrow:active {
  transform: translateX(8px);
}
.arrow.left-arrow:hover,
.arrow.left-arrow:active {
  transform: translateX(-8px);
}

.arrow:focus {
  outline: 1px solid transparent;
}

/* Project card wrapper */
.project-card-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Track holding cards */
.project-track {
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: center;
}

.project-card-display {
  width: 80vw;       /* more room on small screens */
  max-width: 325px;  /* cap it for desktop */
}

.prev-card {
  transform: translateX(-40px) scale(.85);
  opacity: .6;
}
.act-card {
  transform: scale(1);
  opacity: 1;
}
.next-card {
  transform: translateX(40px) scale(.85);
  opacity: .6;
}

.disabled-link {
  pointer-events: none;
  opacity: 0.4;
}

/* Single project card */
.project-card {
  width: 100%;
  min-height: 60vh;
  background: #cf9c0e;
  color: black;
  border: 10px solid black;
  box-shadow: 0 0 30px black;
  text-align: center;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.project-card:hover,
.project-card:active {
  transform: translateY(-8px);
}

/* Text scaling */
.project-info h3 {
  font-size: clamp(1rem, 2vw, 1.0rem);
  margin-bottom: 1rem;
  color: black;
}
.project-info p {
  font-size: clamp(0.8rem, 1.5vw, 0.6rem);
  line-height: 1.5;
}

.project-thumb {
  width: 100%;
  height: 175px;
  object-fit: cover;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 10px black;
}

.project-view-btn {
  margin-top: 1rem;
}

.project-view-btn:hover,
.project-view-btn:active {
  transform: translateY(-8px);
}

/* Back button */
.back-to-menu {
  background: black;
  color: #fff;
  padding: 1rem 2rem;
}

.back-to-menu:hover,
.back-to-menu:active {
  transition: transform 0.05s steps(1);
  box-shadow: 0 0 30px #cf9c0e;
  transform: translateY(-8px);
}


/* -------------------------
  Contact Section
-------------------------- */
/* Reset nes-field container spacing */

.main-contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin: 0 auto;
}

.main-contact h4 {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.main-contact .nes-container {
  margin-bottom: 3rem;;
}

/* Hover and highlight for ALL screen sizes */
.main-contact .nes-container:hover,
.main-contact .nes-container:active {
  transition: transform 0.05s steps(1);
  box-shadow: 0 0 30px #cf9c0e;
  transform: translateY(-8px);
}

.main-contact .nes-container h3 {
  margin: 1rem 0.5rem 32px;
}

.main-contact .nes-container:hover h3,
.main-contact .nes-container:active h3,
.main-contact .nes-container:focus h3 {
  color: #39a0ed; /* your NES blue */
}

.main-contact .nes-container p {
  margin: 1rem 0.5rem 16px;
  line-height: 1.7;
}

.main-contact .nes-container:hover p strong,
.main-contact .nes-container:active p strong,
.main-contact .nes-container:focus p strong {
  color: #cf9c0e; /* your NES yellow */
}

.nes-container.social-icons {
  display: flex;
  gap: 3rem;
  padding: 2rem 2rem;
  justify-content: center;
}

.nes-container.social-icons a:hover,
.nes-container.social-icons a:active {
  transform: translateY(-8px);
  transition: transform 0.05s steps(1);
}

/* -------------------------
   Popup Alert + Scroll-to-Top + Footer
-------------------------- */
#nes-alert {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  text-align: center;
  padding: 2rem;
}

.nes-btn {
  font-size: 1rem;
}

#scroll-top-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 500;
  opacity: 0;
  transform: translateY(50px);
  width: 40px;
  height: 40px;
  font-size: 1.3rem;
  padding: 0;
  line-height: 2.1;
  display: flex;
  justify-content: center;
  align-items: center;

  /* Add chunky transition */
  transition:
    transform 0.3s steps(5),
    opacity 0.3s steps(5);
}

/* Rotate the arrow inside the button */
#scroll-top-btn::after {
  content: '>';
  display: inline-block;
  transform: rotate(-90deg); /* points up */
}

/* Slide in (chunky) */
#scroll-top-btn.show {
  opacity: 1;
  transform: translateY(0);
}

/* Slide out (chunky) */
#scroll-top-btn.hide {
  opacity: 0;
  transform: translateY(50px);
}

/* Footer */
.footer {
  display: flex;
  justify-content: center; /* centers horizontally */
  align-items: center; /* centers vertically */
  background: #333;
  color: #fff;
  padding: 1rem;  /* vertical + horizontal padding */
  width: 100%;
  text-align: center; /* ensures text stays centered if it wraps */
  font-size: 0.8rem;
  border: 4px solid #333; /* NES-style border */
}

.footer p {
  margin: 0; /* remove default top/bottom margin */
}


/* -------------------------
   Tablet (min-width: 768px)
-------------------------- */
@media (min-width: 768px) {
  .main-slogan,
  .main-about,
  .main-skills,
  .main-projects,
  .main-contact {
    max-width: 100%;
  }
}

/* -------------------------
   Desktop (min-width: 992px)
-------------------------- */
@media (min-width: 992px) {
  .main-slogan,
  .main-about,
  .main-skills,
  .main-projects,
  .main-contact {
    max-width: 1300px;
    padding: 3rem;
  }
}

/* Width of the scrollbar */
::-webkit-scrollbar {
  width: 15px;
}

/* Track (background of scrollbar) */
::-webkit-scrollbar-track {
  background: #333;  /* light gray background */
}

/* Thumb (draggable part) */
::-webkit-scrollbar-thumb {
  background-color: #cf9c0e; /* gold/orange color */
}

/* Hover effect on thumb */
::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:active,
::-webkit-scrollbar-thumb:focus {
  background-color: #e6b94d
}