@import url("https://fonts.googleapis.com/css2?family=Arvo:ital,wght@0,400;0,700;1,400;1,700&family=Bricolage+Grotesque:opsz,wght@12..96,200..800&family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Namdhinggo:wght@400;500;600;700;800&family=Special+Elite&display=swap");

/* =========================================================
   Base / Globals
   ========================================================= */
html,
body {
  margin: 0;
  padding: 0;
  font-family: "Bricolage Grotesque", Arvo, serif;
  scroll-behavior: smooth;
}

/* GPU acceleration — exclude html/body so navbar stays fixed */
#particles-js,
#particles-footer {
  will-change: transform;
  transform: translateZ(0);
}

/* =========================================================
   Navbar
   ========================================================= */
.navbar {
  padding-top: 0.6rem !important;
  padding-bottom: 0.6rem !important;
  min-height: 60px;
  --bs-navbar-color: #000;
  --bs-navbar-hover-color: #009999;
  --bs-navbar-active-color: #009999;
}

.navbar-brand img {
  width: 52px;
  height: 52px;
}

.navbar-nav .nav-link {
  position: relative;
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
}

/* =========================================================
   Section Offset
   ========================================================= */
section {
  scroll-margin-top: 75px;
}

/* =========================================================
   Home Section
   ========================================================= */
#home {
  position: relative;
  width: 100%;
  min-height: 100vh;
}

#home .container {
  position: relative;
  z-index: 2;
}

#particles-js {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh;
  background: #004c4c;
  z-index: 0;
  will-change: transform;
  transform: translateZ(0);
}

@supports (-webkit-touch-callout: none) {
  #particles-js,
  #particles-footer {
    height: -webkit-fill-available;
  }
}

/* Hero text */
#name {
  margin-top: 16rem;
  margin-bottom: 1.85rem;
  font-size: 64px;
  font-weight: 600;
  color: #fff;
  text-align: center;
}

#tagline {
  margin-top: 1rem;
  font-size: 2.15rem;
  font-family: "Special Elite", "Bricolage Grotesque", Arvo, serif;
  color: #d9d3d3fb;
  text-align: center;
}

#learn-more {
  display: block;
  margin: 1rem auto 0;
  padding: 0.4rem 1rem;
  max-width: 10rem;
  color: #fff;
  text-align: center;
  text-decoration: none;
  border: 2px solid #fff;
  border-radius: 0.8rem;
  transform: translateX(11.55rem);
  transition: background 0.25s ease;
}

#learn-more:hover {
  background: #009999;
}

/* =========================================================
   Hero Layout
   ========================================================= */
main {
  display: flex;
  justify-content: center;
  padding: 6rem 1rem 2rem;
  text-align: center;
}

.hero-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.hero-text {
  flex: 1 1 300px;
  max-width: 600px;
  text-align: left;
}

.hero-text h1 {
  margin: 4rem 0 0.5rem;
  font-size: clamp(4rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
}

.hero-image {
  flex: 0 0 auto;
  width: 340px;
  height: 340px;
  margin-top: 28px;
}

.hero-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: auto;
  backface-visibility: hidden;
  transform: translateZ(0);
  border-radius: 4%;
  margin-left: auto;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.4s ease, box-shadow 0.4s ease, filter 0.4s ease;
}

.hero-image img:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
  filter: brightness(1.05);
}

/* =========================================================
   Typewriter
   ========================================================= */
.typewriter {
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  font-weight: 500;
  min-height: 3rem;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  font-family: "Special Elite", monospace;
  color: #e9dedefb;
  position: relative;
}

.typewriter::after {
  content: "";
  position: absolute;
  right: 0;
  top: 10%;
  width: 1.25px;
  height: 50%;
  background: #fff;
  animation: blink 0.7s infinite;
}

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

  50%,
  100% {
    opacity: 0;
  }
}

/* =========================================================
   Resume
   ========================================================= */
#resume {
  width: 100%;
  padding: 2rem 0;
}

#resume .card {
  margin: 0 auto;
}

#resume .card img {
  height: 170px;
}

/* =========================================================
   Portfolio
   ========================================================= */
#portfolio {
  width: 100%;
  padding: 2rem 0;
}

#portfolio .grid {
  position: relative;
  text-align: center;
  margin-top: 30px;
}

#portfolio .grid img {
  display: block;
  max-width: 90%;
  margin: 0 auto;
  height: auto;
  image-rendering: auto;
  backface-visibility: hidden;
  transform: translateZ(0);
}

#portfolio .overlay {
  margin: 0 auto;
  left: 0;
  right: 0;
  width: 90%;
}

#portfolio .grid .overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 90%;
  opacity: 0;
  background: #009999;
  transition: 0.5s ease;
}

#portfolio .grid:hover .overlay {
  opacity: 1;
}

#portfolio .grid .text {
  color: #fff;
  font-size: 1.7rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* =========================================================
   Contact
   ========================================================= */
#contact {
  width: 100%;
  padding: 4rem 0;
}

#contact form {
  width: 100%;
}

#contact form input,
#contact form textarea {
  background: #f8f8ff;
}

.submit-message {
  background: #009999;
  border-color: #009999;
  color: #fff;
  transition: background-color 0.2s ease;
}

.submit-message:hover {
  background: #004c4c;
  border-color: #004c4c;
}

/* =========================================================
   Footer
   ========================================================= */
footer {
  position: relative;
  width: 100%;
  background: #d0f5f5;
  padding: 2rem 0 4rem;
  overflow: hidden;
}

#particles-footer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #004c4c;
  z-index: 0;
  pointer-events: none;
  image-rendering: auto;
  transform: translateZ(0);
  will-change: transform;
}

footer .container {
  position: relative;
  z-index: 1;
}

footer .row {
  align-items: center;
}

footer ul {
  list-style: none;
  padding-left: 0;
  color: #fff;
  font-size: 16px;
}

footer a,
footer p {
  color: #fff;
  font-size: 12px;
  text-decoration: none;
}

footer a:hover,
.back-to-top:hover {
  color: #009999;
}

.back-to-top {
  display: block;
  width: 100%;
  font-size: 1rem;
  text-align: center;
  color: #fff;
}

footer ul#social {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
  text-align: right;
}

footer ul#social li {
  display: inline-block;
  margin-left: 1rem;
}

footer ul#social a {
  color: #fff;
  text-decoration: none;
  font-size: 2rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

footer ul#social a i {
  font-size: inherit;
  vertical-align: middle;
  line-height: 1;
}

footer ul#social a:hover {
  color: #009999;
  transform: scale(1.1);
}

footer p {
  margin-top: 1rem;
  text-align: right;
}

/* =========================================================
   Success / Error / Connection Popups
   ========================================================= */
.success-modal,
.error-modal,            /* NEW */
.connection-modal {
  /* NEW */
  border-radius: 18px;
  border: none;
  padding: 2.5rem 2.75rem 2.25rem;
}

.success-modal .modal-body,
.error-modal .modal-body,        /* NEW */
.connection-modal .modal-body {
  /* NEW */
  padding: 0;
}

.success-icon,
.error-icon,              /* NEW */
.connection-icon {
  /* NEW */
  width: 90px;
  height: 90px;
  margin: 0 auto 1.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.7rem;
}

/* Type-specific colors */
.success-icon {
  border: 3px solid #28a745;
  color: #28a745;
}

.error-icon {
  /* NEW */
  border: 3px solid #dc3545;
  color: #dc3545;
}

.connection-icon {
  /* NEW */
  border: 3px solid #dc3545;
  color: #dc3545;
}

.success-title,
.error-title,             /* NEW */
.connection-title {
  /* NEW */
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.success-title {
  color: #28a745;
}

.error-title {
  /* NEW */
  color: #dc3545;
}

.connection-title {
  /* NEW */
  color: #dc3545;
}

.success-text,
.error-text,              /* NEW */
.connection-text {
  /* NEW */
  color: #6c757d;
  margin-bottom: 1.75rem;
  font-size: 0.98rem;
}

.success-back,
.error-back,              /* NEW */
.connection-back {
  /* NEW */
  font-weight: 500;
  text-decoration: none;
  color: #333;
}

.success-back:hover,
.error-back:hover,        /* NEW */
.connection-back:hover {
  /* NEW */
  text-decoration: none;
  color: #009999;
}

/* =========================================================
   Wave Animation
   ========================================================= */
.wave-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin-left: 0.375rem;
  vertical-align: middle;
  animation: waveAnim 1.8s infinite ease-in-out;
  transform-origin: 65% 65%;
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.2));
}

@keyframes waveAnim {
  0% {
    transform: rotate(0deg);
  }

  15% {
    transform: rotate(14deg);
  }

  30% {
    transform: rotate(-10deg);
  }

  45% {
    transform: rotate(12deg);
  }

  60% {
    transform: rotate(-6deg);
  }

  75% {
    transform: rotate(10deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 900px) {
  .hero-container {
    flex-direction: column-reverse;
    align-items: center;
  }

  .hero-text {
    text-align: center;
  }

  .hero-image {
    margin-bottom: 1.5rem;
  }

  #learn-more {
    transform: none;
    margin: 1rem auto 0;
  }

  #name {
    margin-top: 10rem;
  }
}

@media (max-width: 480px) {
  .hero-image {
    width: 250px;
    height: 250px;
  }

  .hero-image img {
    margin-left: 0;
  }

  .navbar-nav .nav-link {
    font-size: 0.95rem;
    padding: 0.25rem 0.5rem;
  }

  .hero-text h1 {
    font-size: clamp(1.8rem, 6vw, 2.3rem);
  }

  #name {
    margin-top: 8rem;
    font-size: 2.3rem;
  }

  .typewriter {
    font-size: clamp(1rem, 4vw, 1.5rem);
  }

  footer ul {
    font-size: 12px;
  }

  footer p,
  footer a {
    font-size: 10px;
  }

  #social a {
    font-size: 1.2rem;
  }

  #social a i {
    font-size: inherit;
  }

  footer .back-to-top i {
    font-size: 2.2rem;
    padding-bottom: 0.5rem;
  }

  footer {
    padding-top: 1.5rem;
    padding-bottom: 2rem;
  }

  .success-modal,
  .error-modal,               /* NEW */
  .connection-modal {
    /* NEW */
    padding: 2rem 1.5rem 1.75rem;
  }

  .success-icon,
  .error-icon,                /* NEW */
  .connection-icon {
    /* NEW */
    width: 70px;
    height: 70px;
    font-size: 2.2rem;
    margin-bottom: 1.25rem;
  }

  .success-title,
  .error-title,               /* NEW */
  .connection-title {
    /* NEW */
    font-size: 1.1rem;
  }
}
