* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

html {
  scroll-behavior: smooth;
  overflow-x: scroll;
  overflow-y: hidden;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

body {
  font-family: "Courier New", Courier, monospace;
  line-height: 1.6;
  color: #000;
  background-color: #fff;
  image-rendering: pixelated;
  margin: 0;
  padding: 0;
  position: relative;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: auto;
  overflow-y: hidden;
}

/* CRT Scanlines Effect */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.04) 0px,
    rgba(0, 0, 0, 0.04) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 1000;
  animation: scanline-flicker 0.15s linear infinite;
  will-change: opacity;
}

@keyframes scanline-flicker {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.98;
  }
  100% {
    opacity: 1;
  }
}

body.dark-mode::before {
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.04) 0px,
    rgba(255, 255, 255, 0.04) 1px,
    transparent 1px,
    transparent 2px
  );
}

/* Dark Mode Styles */
body.dark-mode {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

body.dark-mode .hamburger-menu {
  background-color: #1a1a1a;
  border-color: #e0e0e0;
  box-shadow: 4px 4px 0 #e0e0e0;
}

body.dark-mode .hamburger-menu span {
  background-color: #e0e0e0;
}

body.dark-mode .hamburger-menu:hover {
  box-shadow: 2px 2px 0 #e0e0e0;
}

body.dark-mode .nav-overlay {
  background-color: rgba(26, 26, 26, 0.98);
  border-color: #e0e0e0;
  box-shadow: 4px 4px 0 #e0e0e0;
}

body.dark-mode .nav-overlay a {
  color: #e0e0e0;
  border-color: transparent;
}

body.dark-mode .nav-overlay a:hover {
  border-color: #e0e0e0;
  background-color: #e0e0e0;
  color: #1a1a1a;
  box-shadow: 4px 4px 0 #e0e0e0;
}

body.dark-mode .dark-mode-toggle {
  background-color: #1a1a1a;
  border-color: #e0e0e0;
  box-shadow: 4px 4px 0 #e0e0e0;
}

body.dark-mode .dark-mode-toggle:hover {
  box-shadow: 2px 2px 0 #e0e0e0;
}

body.dark-mode .section-nav-btn {
  background-color: #1a1a1a;
  border-color: #e0e0e0;
  box-shadow: 4px 4px 0 #e0e0e0;
  color: #e0e0e0;
}

body.dark-mode .section-nav-btn:hover {
  box-shadow: 2px 2px 0 #e0e0e0;
}

body.dark-mode h1 {
  text-shadow: 4px 4px 0 #e0e0e0;
  color: #e0e0e0;
}

body.dark-mode h2 {
  background-color: #fff;
  border-bottom-color: #fff;
  box-shadow: 0 4px 0 #fff;
  color: #000;
  padding: 0.5rem 1rem 0.5rem 1rem;
}

body.dark-mode .btn {
  border-color: #e0e0e0;
  color: #e0e0e0;
  box-shadow: 4px 4px 0 #e0e0e0;
}

body.dark-mode .btn:hover {
  background-color: #e0e0e0;
  color: #1a1a1a;
  box-shadow: 2px 2px 0 #e0e0e0;
}

body.dark-mode .skill-item {
  background-color: #1a1a1a;
  border-color: #e0e0e0;
  box-shadow: 4px 4px 0 #e0e0e0;
}

body.dark-mode .skill-item:hover {
  box-shadow: 2px 2px 0 #e0e0e0;
}

body.dark-mode .project-item {
  background-color: #1a1a1a;
  border-color: #e0e0e0;
  box-shadow: 4px 4px 0 #e0e0e0;
}

body.dark-mode .project-item:hover {
  box-shadow: 2px 2px 0 #e0e0e0;
}

body.dark-mode .contact-link {
  background-color: #1a1a1a;
  border-color: #e0e0e0;
  color: #e0e0e0;
  box-shadow: 4px 4px 0 #e0e0e0;
}

body.dark-mode .contact-link:hover {
  background-color: #e0e0e0;
  color: #1a1a1a;
  box-shadow: 2px 2px 0 #e0e0e0;
}

body.dark-mode footer {
  border-top-color: #e0e0e0;
  box-shadow: 0 -4px 0 #e0e0e0;
  color: #e0e0e0;
}

/* Hamburger Menu Button */
.hamburger-menu {
  position: fixed;
  top: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background-color: #fff;
  border: 4px solid #000;
  box-shadow: 4px 4px 0 #000;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 0;
  transition: none;
}

.hamburger-menu:hover {
  box-shadow: 2px 2px 0 #000;
  transform: translate(2px, 2px);
}

.hamburger-menu:active {
  box-shadow: 0px 0px 0 #000;
  transform: translate(4px, 4px);
}

.hamburger-menu span {
  display: block;
  width: 24px;
  height: 4px;
  background-color: #000;
  transition: all 0.3s ease;
}

.hamburger-menu.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Navigation Overlay */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.98);
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  border: 4px solid #000;
  box-shadow: 4px 4px 0 #000;
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

.nav-overlay ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  padding: 0;
}

.nav-overlay a {
  color: #000;
  text-decoration: none;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 1rem;
  transition: none;
  border: 4px solid transparent;
  padding: 1rem 2rem;
  display: inline-block;
}

.nav-overlay a:hover {
  border: 4px solid #000;
  background-color: #000;
  color: #fff;
  box-shadow: 4px 4px 0 #000;
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background-color: #fff;
  border: 4px solid #000;
  box-shadow: 4px 4px 0 #000;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: none;
  font-size: 1.5rem;
}

/* Section Navigation Buttons */
.section-nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background-color: #fff;
  border: 4px solid #000;
  box-shadow: 4px 4px 0 #000;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: none;
  font-size: 2rem;
  font-weight: bold;
  font-family: "Courier New", Courier, monospace;
  color: #000;
}

.section-nav-btn--prev {
  left: 2rem;
}

.section-nav-btn--next {
  right: 2rem;
}

.section-nav-btn:hover {
  box-shadow: 2px 2px 0 #000;
  transform: translateY(-50%) translate(2px, 2px);
}

.section-nav-btn:active {
  box-shadow: 0px 0px 0 #000;
  transform: translateY(-50%) translate(4px, 4px);
}

.section-nav-btn.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.dark-mode-toggle:hover {
  box-shadow: 2px 2px 0 #000;
  transform: translate(2px, 2px);
}

.dark-mode-toggle:active {
  box-shadow: 0px 0px 0 #000;
  transform: translate(4px, 4px);
}

.dark-mode-toggle .moon-icon,
.dark-mode-toggle .sun-icon {
  display: inline-block;
  transition: opacity 0.2s ease;
}

.dark-mode-toggle .sun-icon {
  display: none;
  color: #fff;
}

body.dark-mode .dark-mode-toggle .moon-icon {
  display: none;
}

body.dark-mode .dark-mode-toggle .sun-icon {
  display: inline-block;
}

/* Scroll Indicator */
.scroll-indicator {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 998;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.scroll-indicator.hidden {
  opacity: 0;
  visibility: hidden;
}

.scroll-arrow {
  font-size: 2rem;
  font-weight: bold;
  color: #000;
  animation: scroll-pulse 1.5s ease-in-out infinite;
  font-family: "Courier New", Courier, monospace;
}

.scroll-text {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #000;
  font-weight: bold;
  font-family: "Courier New", Courier, monospace;
}

@keyframes scroll-pulse {
  0%,
  100% {
    transform: translateX(0);
    opacity: 1;
  }
  50% {
    transform: translateX(10px);
    opacity: 0.7;
  }
}

body.dark-mode .scroll-arrow,
body.dark-mode .scroll-text {
  color: #e0e0e0;
}

@media (max-width: 1024px) {
  .scroll-indicator {
    display: none;
  }

  .section-nav-btn {
    display: none;
  }
}

/* Floating GIF */
.floating-gif {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 997;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  pointer-events: none;
  animation: float 3s ease-in-out infinite;
}

.floating-gif img {
  display: block;
  height: 80px;
  width: auto;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

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

@media (max-width: 1024px) {
  .floating-gif {
    display: none;
  }
}

main {
  display: flex;
  flex-direction: row;
  width: max-content;
  min-width: 100%;
  height: 100vh;
  padding-top: 0;
  flex-shrink: 0;
  position: relative;
}

section {
  width: 100vw;
  height: 100vh;
  min-width: 100vw;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4rem 2rem;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
}

section > * {
  max-width: 900px;
  width: 100%;
}

h1 {
  font-size: 3rem;
  font-weight: normal;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: "Press Start 2P", "Courier New", monospace;
  line-height: 1.5;
  text-shadow: 4px 4px 0 #000;
}

h2 {
  font-size: 1.8rem;
  font-weight: normal;
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 4px solid #000;
  padding-bottom: 0.5rem;
  font-family: "Press Start 2P", "Courier New", monospace;
  line-height: 1.5;
  box-shadow: 0 4px 0 #000;
}

#hero {
  text-align: center;
  padding: 4rem 2rem;
  width: 100vw;
  height: 100vh;
  min-width: 100vw;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#hero > * {
  max-width: 900px;
  width: 100%;
}

#hero > p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: "Press Start 2P", "Courier New", monospace;
  line-height: 1.8;
  word-wrap: break-word;
}

#hero .btn {
  margin-top: 1rem;
  width: auto;
  max-width: none;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: 4px solid #000;
  color: #000;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: bold;
  transition: none;
  background-color: transparent;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 0.65rem;
  box-shadow: 4px 4px 0 #000;
  position: relative;
  top: 0;
  left: 0;
}

.btn:hover {
  background-color: #000;
  color: #fff;
  box-shadow: 2px 2px 0 #000;
  top: 2px;
  left: 2px;
}

.btn:active {
  box-shadow: 0px 0px 0 #000;
  top: 4px;
  left: 4px;
}

#about-content {
  font-size: 1rem;
  line-height: 1.8;
}

#about-content p {
  margin-bottom: 1.5rem;
}

#skills-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: 100%;
}

.skill-item {
  border: 4px solid #000;
  padding: 1rem;
  background-color: #fff;
  box-shadow: 4px 4px 0 #000;
  position: relative;
}

.skill-item:hover {
  box-shadow: 2px 2px 0 #000;
  transform: translate(2px, 2px);
}

.skill-title {
  font-size: 0.7rem;
  font-weight: normal;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: "Press Start 2P", "Courier New", monospace;
  line-height: 1.4;
}

.skill-description {
  font-size: 0.85rem;
  line-height: 1.5;
}

#projects-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  width: 100%;
}

.project-item {
  border: 4px solid #000;
  padding: 1.25rem;
  background-color: #fff;
  box-shadow: 4px 4px 0 #000;
  position: relative;
}

.project-item:hover {
  box-shadow: 2px 2px 0 #000;
  transform: translate(2px, 2px);
}

.project-name {
  font-size: 0.85rem;
  font-weight: normal;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: "Press Start 2P", "Courier New", monospace;
  line-height: 1.4;
}

.project-description {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

#contact-content {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.contact-link {
  color: #000;
  text-decoration: none;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: bold;
  border: 4px solid #000;
  padding: 1rem 2rem;
  font-family: "Press Start 2P", "Courier New", monospace;
  box-shadow: 4px 4px 0 #000;
  position: relative;
  top: 0;
  left: 0;
  transition: none;
  background-color: #fff;
  display: inline-block;
}

.contact-link:hover {
  background-color: #000;
  color: #fff;
  box-shadow: 2px 2px 0 #000;
  top: 2px;
  left: 2px;
}

.contact-link:active {
  box-shadow: 0px 0px 0 #000;
  top: 4px;
  left: 4px;
}

footer {
  text-align: center;
  padding: 2rem;
  border-top: 4px solid #000;
  margin-top: 0;
  font-size: 0.8rem;
  box-shadow: 0 -4px 0 #000;
  font-family: "Press Start 2P", "Courier New", monospace;
  min-height: auto;
  width: 100vw;
  min-width: 100vw;
  max-width: 100vw;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
}

/* Tablet and below - switch to vertical scrolling */
@media (max-width: 1024px) {
  html {
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: y proximity;
  }

  body {
    width: 100%;
    overflow-x: hidden;
  }

  main {
    flex-direction: column;
    width: 100%;
    min-width: 100%;
    height: auto;
  }

  section {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 100vh;
    padding: 3rem 2rem;
  }

  footer {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: auto;
    min-height: auto;
    padding: 2rem 2rem;
  }

  h1 {
    font-size: 2.5rem;
    line-height: 1.3;
    margin-bottom: 1rem;
    text-shadow: 3px 3px 0 #000;
  }

  h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }

  #hero {
    padding: 3rem 2rem;
    min-height: 100vh;
    justify-content: center;
  }

  #hero > * {
    max-width: 100%;
    padding: 0 1rem;
  }

  #hero > p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
  }

  #projects-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  #skills-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .project-item,
  .skill-item {
    padding: 1.5rem;
  }

  .project-name,
  .skill-title {
    font-size: 0.9rem;
  }

  .project-description,
  .skill-description {
    font-size: 0.95rem;
  }
}

@media (max-width: 768px) {
  section {
    padding: 2rem 1.5rem;
  }

  h1 {
    font-size: 1.8rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 0 #000;
  }

  h2 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
  }

  #hero {
    padding: 2rem 1.5rem;
    min-height: 100vh;
  }

  #hero > * {
    max-width: 100%;
    padding: 0 0.5rem;
  }

  #hero > p {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
  }

  nav ul {
    gap: 1.5rem;
  }

  nav a {
    font-size: 0.6rem;
  }

  main {
    padding: 0;
    padding-top: 0;
  }

  section {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 100vh;
    padding: 2rem 1rem;
  }

  footer {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: auto;
    min-height: auto;
    padding: 1.5rem 1rem;
  }

  .hamburger-menu {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
  }

  .dark-mode-toggle {
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .section-nav-btn {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .section-nav-btn--prev {
    left: 1rem;
  }

  .section-nav-btn--next {
    right: 1rem;
  }

  .hamburger-menu span {
    width: 20px;
    height: 3px;
  }

  .nav-overlay a {
    font-size: 0.7rem;
    padding: 0.8rem 1.5rem;
  }

  #contact-content {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }

  .btn,
  .contact-link {
    font-size: 0.6rem;
    padding: 0.8rem 1.5rem;
  }

  .skill-title,
  .project-name {
    font-size: 0.8rem;
  }

  #projects-content {
    grid-template-columns: 1fr;
  }

  #skills-content {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .skill-item {
    padding: 1rem;
  }

  .skill-title {
    font-size: 0.65rem;
  }

  .skill-description {
    font-size: 0.8rem;
  }
}

.inline-gif {
  height: 2em;
  width: auto !important;
  vertical-align: middle;
}
