@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

/* default settings  */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  border: none;
  outline: none;
  font-family: 'Poppins', sans-serif;
}

/* theme colors */
:root {
  --bg-color: #1f242d;
  --second-bg-color: #323946;
  --main-color: #7cf03d;
  --white-color: #fff;
  --disabled-color: #fff3;
  --header-height: 6.5rem;
}

html {
  font-size: 62.5%;
}

body {
  color: var(--white-color);
  background: var(--bg-color);
  overflow-x: hidden;
}

/* full-screen matrix background */
canvas#matrix {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg-color);
  z-index: -1;
  pointer-events: none;
}

/* header */

header {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  padding: 2rem 9%;
  display: flex;
  background: var(--bg-color);
  justify-content: space-between;
  align-items: center;
  z-index: 100;
}

/* logo style */
.logo {
  font-size: 3rem;
  color: var(--white-color);
  font-weight: 700;
}

/* navbar links */

nav a {
  font-size: 2rem;
  color: var(--white-color);
  font-weight: 500;
  margin-left: 3.5rem;
  transition: 0.5s;
}

nav a:hover,
nav a.active {
  color: var(--main-color);
}

/* mobile menu icon */
#menu-icon {
  font-size: 4rem;
  display: none;
  cursor: pointer;
}

section {
  width: 100%;
  background: var(--bg-color);
  visibility: hidden;
  opacity: 0;
}
/* the “visible” page */
section.active {
  visibility: visible;
  opacity: 1;
}

/* headings */

.heading {
  font-size: 4.5rem;
  text-align: center;
  margin-bottom: 2rem;
}
.heading span {
  color: var(--main-color);
}

/* smooth, soft page enter */
@keyframes softPageIn {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* footer */
.site-footer {
  margin-top: 4rem;
  padding: 2.2rem 9%;
  border-top: 0.1rem solid rgba(255, 255, 255, 0.06);
  background: radial-gradient(
      circle at 0% 0%,
      rgba(124, 240, 61, 0.08),
      transparent 40%
    ),
    var(--bg-color);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.8rem;
  font-size: 1.35rem;
}

.footer-logo {
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--main-color);
}

.footer-text {
  margin-top: 0.2rem;
  color: rgba(255, 255, 255, 0.7);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-link {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 999px;
  border: 0.1rem solid rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(27, 32, 41, 0.9);
  transition: transform 0.25s ease, border-color 0.25s ease,
    box-shadow 0.25s ease, color 0.25s ease;
}

.footer-link ion-icon {
  font-size: 1.7rem;
}

.footer-link:hover {
  transform: translateY(-2px);
  border-color: var(--main-color);
  color: var(--main-color);
  box-shadow: 0 0.7rem 1.6rem rgba(124, 240, 61, 0.25);
}

@media (max-width: 700px) {
  .site-footer {
    padding: 2rem 7%;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* cursor pointer effects */
#cursor-trail-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

/* Matrix-style cursor glyph */
.cursor-glyph {
  position: absolute;
  width: 3px;
  height: 16px;
  border-radius: 999px;
  background: rgba(124, 240, 61, 0.9);
  box-shadow: 0 0 14px rgba(124, 240, 61, 0.85);
  transform: translate(-50%, -50%);
  animation: cursorGlyphFade 0.6s ease-out forwards;
  animation: cursorClickSplash 0.45s ease-out forwards;
}

@keyframes cursorGlyphFade {
  0% {
    opacity: 0.95;
    transform: translate(-50%, -50%) translateY(0) scaleY(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(14px) scaleY(1.3);
  }
}

@keyframes cursorClickSplash {
  0% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(0.6);
  }
  60% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.4);
  }
}

/* sound btn  */
/* Sound toggle styling */
.sound-toggle {
  font-size: 1.2rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0.04em;
  backdrop-filter: blur(6px);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.25s ease, border-color 0.25s ease,
    transform 0.15s ease;
  margin-bottom: 0.6rem;
  display: none;
}

.sound-toggle:hover {
  background: rgba(22, 101, 52, 0.9);
  border-color: rgba(74, 222, 128, 0.8);
  transform: translateY(-1px);
}

.sound-toggle[aria-pressed='false'] {
  opacity: 0.7;
}

/* Matrix-style transition overlay for inner pages */
.matrix-transition-layer {
  position: fixed;
  inset: 0;
  z-index: 998;
  pointer-events: none;

  /* Dark glass, but let the rain show through */
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);

  opacity: 0;
  visibility: hidden;
}

body.page-leaving .matrix-transition-layer {
  opacity: 1;
  visibility: visible;
  animation: matrixOverlayExit 0.9s ease-in forwards;
}
body.page-leaving header,
body.page-leaving .home,
body.page-leaving .about,
body.page-leaving .resume,
body.page-leaving .projects,
body.page-leaving .contact,
body.page-leaving .site-footer {
  opacity: 0;
  transition: opacity 0.4s ease-out;
}

@keyframes matrixOverlayExit {
  0% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
  60% {
    opacity: 0.4;
    transform: scale(1.02);
    filter: blur(4px);
  }
  100% {
    opacity: 0;
    transform: scale(1.05);
    filter: blur(8px);
  }
}

.sound-hint {
  position: fixed;
  top: 7rem;
  right: 5rem;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;

  background: rgba(0, 0, 0, 0.85);
  color: #e5ffe4;
  font-size: 1.3rem;
  letter-spacing: 0.04em;

  border: 1px solid rgba(124, 240, 61, 0.6);
  box-shadow: 0 0 18px rgba(124, 240, 61, 0.35);

  z-index: 1200;
  opacity: 0;
  animation: soundHintIn 0.4s ease-out forwards;
}

.sound-hint--hide {
  animation: soundHintOut 0.25s ease-in forwards;
}

@keyframes soundHintIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes soundHintOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-4px);
  }
}

/* smaller device light animation */
@keyframes mobileOverlayFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 1200px), (pointer: coarse) {
  .sound-hint {
    display: none !important;
  }
}

/* Desktop only */
@media (min-width: 1250px) {
  .sound-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
  }
}

/* Tablets + mobile */
@media (max-width: 1023px) {
  .sound-hint {
    display: none;
  }

  /* turn OFF matrix rain on smaller devices */
  canvas#matrix {
    display: none;
  }

  body.page-leaving .matrix-transition-layer {
    opacity: 0 !important;
    visibility: hidden !important;
    animation: none !important;
  }

  /* keep content visible, no fade-out */
  body.page-leaving header,
  body.page-leaving .home,
  body.page-leaving .about,
  body.page-leaving .resume,
  body.page-leaving .projects,
  body.page-leaving .contact,
  body.page-leaving .site-footer {
    opacity: 1 !important;
    transition: none !important;
  }

  /* no enter animation either */
  section.active {
    animation: none !important;
  }

  /* keep cursor + sound tweaks you already had */
  .sound-hint {
    display: none;
  }

  #cursor-trail-container {
    display: none;
  }

  /* ✨ Soft, tiny fade/slide in for the page content itself */
  .home,
  .about,
  .resume,
  .projects,
  .contact {
    animation: softPageIn 0.22s ease-out;
  }
}

/* mobile navbar */
@media (max-width: 836px) {
  header {
    padding: 1.6rem 7%;
  }

  /* keep cursor + sound tweaks you already had */
  .sound-hint {
    display: none;
  }

  /* show burger icon on mobile */
  #menu-icon {
    display: block;
    z-index: 101;
  }

  header nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1.2rem 9%;
    gap: 1rem;
    background: rgba(31, 36, 45, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  header nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  header nav a {
    margin: 0;
    font-size: 1.8rem;
  }

  body.nav-open {
    overflow: hidden;
  }
}
