@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300..700&family=Funnel+Sans:ital,wght@0,300..800;1,300..800&family=Gidole&family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

:root {
  --primary-color: #1a0b2e;
  --secondary-color: #763cac;
  --tertiary-color: #271044;
  --text-color1: #ffffff;
  --text-color2: #7127ba;
  --text-color3: #00ff00;
  --text-color4: #cfcfcf;
}

html {
  scroll-behavior: smooth;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Fira Code', sans-serif;
  color: var(--text-color1);
}

#navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to right, var(--tertiary-color), var(--primary-color));
  position: fixed;
  width: 100%;
  height: auto;
  top: 0;
  padding: 1rem 3rem;
  z-index: 100;
  transition: background 150ms ease-in;
}

#navbar.scrolled {
  background: #181227;
  border-bottom: solid 1px #00ff00;
}

#navbar .navbar-logo {
  display: flex; 
  align-items: center;
}

.navbar-logo img {
  height: 26px; 
  margin-right: 2px;
}

.navbar-logo span {
  font-size: 14px;
  font-weight: bold;;
}

#navbar .navbar-links {
  display: flex; 
  gap: 24px; 
  list-style: none; 
  margin: 0; 
  padding: 0;
}

#navbar .navbar-links li {
  margin: 0 15px;
}

#navbar .navbar-links li a {
  color: var(--text-color1);
  text-decoration: none;
  font-size: 14px;
  font-weight: normal;
  transition: color 0.3s;
}

#navbar .navbar-links li a span {
  color: var(--text-color3);
}

#navbar .navbar-links li a.nav-active,
#navbar .navbar-links li a:hover {
  color: var(--text-color3);
  transition: color 0.3s;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 201;
  margin-top: -2.40rem;
  margin-left: auto;
  margin-right: 0.85rem;
}

.sidebar-toggle span {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--text-color1);
  border-radius: 2px;
  transition: 0.3s;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  z-index: 200;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.35);
}

.sidebar-menu {
  display: none;
  position: fixed;
  top: 0; right: 0;
  width: 65vw;
  max-width: 320px;
  height: 100vh;
  background: var(--primary-color);
  box-shadow: 2px 0 16px rgba(0,0,0,0.25);
  z-index: 202;
  flex-direction: column;
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  animation: sidebar-slide-in 0.25s;
}

@keyframes sidebar-slide-in {
  from { transform: translateX(100%);}
  to { transform: translateX(0);}
}

.sidebar-menu ul {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-menu li a {
  color: var(--text-color1);
  font-size: 1rem;
  text-decoration: none;
  font-family: 'Fira Code', monospace;
}

.sidebar-menu li a span {
  color: var(--text-color3);
}

.sidebar-close {
  background: none;
  border: none;
  color: var(--text-color1);
  font-size: 2.2rem;
  position: absolute;
  top: 0.30rem;
  right: 2.50rem;
  cursor: pointer;
}

#welcome-section {
  height: 100vh;
  background: linear-gradient(to right, var(--tertiary-color), var(--primary-color));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: var(--text-color1);
  padding: 2rem;
}

.welcome-flex {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8rem;
  padding: 2rem;
  width: 75vw;
}

.terminal-window {
  width: 600px;
  height: 250px;
  background: rgba(20, 20, 30, 0.7);
  border-radius: 15px;
  box-shadow: 0 0 32px 0 rgba(0,0,0,0.25);
  border: 1.5px solid var(--text-color3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.terminal-header {
  background: linear-gradient(to bottom, #323232, #232323);
  height: 45px;
  line-height: 45px;
  color: var(--text-color1);
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 14px;
}

.terminal-button {
  height: 12px;
  width: 12px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.terminal-button.close {
  background-color: #ff5f56; /* Red */
}

.terminal-button.minimize {
  background-color: #ffbd2e; /* Yellow */
}

.terminal-button.maximize {
  background-color: #27c93f; /* Green */
}

.welcome-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  min-height: 170px;
  width: 100%;
  max-width: 600px;
  padding: 1.5rem 2rem 2rem 2rem;
  position: relative;
  overflow: hidden;
}

.welcome-text h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.welcome-text h1 span {
  color: var(--text-color3);
}

.welcome-text p {
  font-size: 1.5rem;
}

.welcome-text p span {
  color: var(--text-color3);
}

#cmd-typing {
  font-family: 'Fira Code', monospace;
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--text-color1);
  margin-bottom: 0.5rem;
  line-height: 1.5;
  word-break: break-word;
}

#cmd-subtyping {
  font-family: 'Fira Code', monospace;
  font-size: 1.2rem;
  color: var(--text-color1);
  margin-top: 0.5rem;
  line-height: 1.3;
  word-break: break-word;
}

.cmd-prefix {
  color: var(--text-color3);
  font-weight: bold;
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.cmd-cursor {
  display: inline-block;
  width: 1ch;
  background: var(--text-color3);
  height: 1.2em;
  vertical-align: middle;
  animation: blink-cursor 0.8s steps(1) infinite;
  margin-left: 2px;
}

@keyframes blink-cursor {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.logo-image {
  position: absolute;
  top: -50px;
  left: -140px;
  width: 400px;      /* It can adjust the size as needed */
  opacity: 0.5;      /* It makes it subtle behind the main image */
  z-index: 0;        /* Behind the main image */
  pointer-events: none;
}

.welcome-image {
  width: 300px;
  margin-top: 0;
  position: relative;
  z-index: 1;
}

.welcome-image-glow {
  position: relative;
  display: flex;
  flex-direction: column;   /* It stacks children vertically */
  align-items: center;
  justify-content: center;
}

.welcome-image-glow::before {
  content: "";
  position: absolute;
  z-index: 0;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  left: 40%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #ffffff 0%, var(--tertiary-color) 60%, transparent 100%);
  opacity: 0.6;
  filter: blur(20px);
}

.status-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1.5px solid var(--text-color3);
  padding: 0.5rem 1rem;
  background: transparent;
  width: fit-content;
  position: relative;
  z-index: 2;
}

.status-bullet {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-color3);
  margin-right: 0.25rem;
}

.status-text {
  color: var(--text-color1);
  font-size: 0.75rem;
}

/* Projects Section */
#projects {
  height: 100vh;
  background: linear-gradient(to right, var(--tertiary-color), var(--primary-color));
  padding: 2rem 2rem;
  text-align: center;
}

.sub-header h2 {
  font-size: 1.5rem;
  font-weight: normal;
  margin-left: 7.5rem;
  text-align: left;
}

.sub-header h2 span {
  color: var(--text-color3);
}

.sub-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  margin-top: 3rem;
  margin-bottom: 7.5rem;
  position: relative;
}

.sub-header .center-line {
  flex: 1;
  height: 0.5px;
  background: var(--text-color3);
  margin-left: 0.25rem;
  margin-right: 15rem;
  border: none;
}

.sub-header .view-more-link {
  color: var(--text-color1);
  font-size: 1rem;
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}

.sub-header .view-more-link:hover {
  color: var(--text-color3);
}

#projects h3 {
  font-size: 1rem;
  padding: 0.5rem;
  border-bottom: 1px solid var(--text-color3);
}

#projects p {
  padding: 0.5rem;
  font-size: 0.90rem;
  border-bottom: 1px solid var(--text-color3);
  margin: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: flex-start;
  text-align: left;
}

#projects .view-button {
  background-color: transparent;
  border: none;
  width: 100%;
  padding: 0.5rem 1rem;
}

#projects .view-button:hover {
  background-color: var(--text-color3);
  font-weight: bold;
  border: none;
  width: 100%;
  padding: 0.5rem 1rem;
}

#projects .view-button a {
  color: var(--text-color1);
  font-family: 'Fira Code', sans-serif;
  font-size: 0.90rem;
  text-decoration: none;
}

.projects-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.project-tile {
  width: 250px;
  border: 1px solid var(--text-color3);
  background: rgba(20, 20, 30, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 180px;
  margin-top: -2rem;
  box-sizing: border-box;
}

.project-tile h3 {
  font-size: 1rem;
  padding: 0.5rem;
  border-bottom: 1px solid var(--text-color3);
  margin: 0;
  width: 100%;
}

.project-tile p {
  padding: 0.5rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--text-color3);
  margin: 0;
  width: 100%;
  min-height: 48px; /* It makes sure that the description area is consistent */
  flex: 1 1 auto;   /* It allows description to grow/shrink */
  display: flex;
  align-items: flex-start;
}

.project-tile img {
  width: 100%;
  border-bottom: 1px solid var(--text-color3);
  display: block;
}

/* About Me Section */
#about-me {
  height: 100vh;
  background: linear-gradient(to right, var(--tertiary-color), var(--primary-color));
  padding: 2rem 2rem;
  text-align: center;
}

.about-me-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  width: 100%;
  max-width: 1100px;
  margin: 75px auto;
}

.about-me-text {
  flex: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  margin-top: -2.5rem;
  gap: 40px;
}

.about-me-text p span {
  color: var(--text-color3);
}

.about-me-skills {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.about-me-skills .skill-badge {
  color: var(--text-color1);
  background: rgba(20, 20, 30, 0.7);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.95rem;
  border: 1px solid var(--text-color3);
}

.about-me-image {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-direction: column;
  position: relative; /* This is needed for pseudo-element positioning */
}

/* Glow effect behind about-me-image */
.about-me-image::before {
  content: "";
  position: absolute;
  z-index: 0;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #ffffff 0%, var(--tertiary-color) 60%, transparent 100%);
  opacity: 0.6;
  filter: blur(20px);
  pointer-events: none;
}

.about-me-image img {
  width: 300px;
  max-width: 100%;
  height: auto;
  margin-top: 0;
  position: relative;
  z-index: 1;
  border-bottom: 1px solid var(--text-color3);
}

/* Contacts Section */
#contacts {
  height: 100vh;
  background: linear-gradient(to right, var(--tertiary-color), var(--primary-color));
  padding: 2rem 2rem;
  text-align: center;
}

.contact-section-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10rem;
  width: 100%;
  max-width: 1100px;
  margin: 5rem auto 0 auto;
}

.contact-text {
  flex: 2;
  text-align: left;
  color: var(--text-color1);
}

.contact-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  background: rgba(20, 20, 30, 0.7);
  border: 1px solid var(--text-color3);
  padding: 1rem 1rem;
  min-width: 260px;
}

.contact-info h4 {
  margin-bottom: 1rem;
  color: var(--text-color1);
}

.contact-info p {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0;
}

.contact-info a {
  color: var(--text-color4);
  text-decoration: none;
}

.contact-info a:hover {
  color: var(--text-color3);
}

.icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  vertical-align: middle;
}

.download-cv-btn {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.75rem 2rem;
  background: rgba(20, 20, 30, 0.7);
  color: var(--text-color3);
  border: 1px solid var(--text-color3);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.download-cv-btn:hover {
  background: var(--text-color3);
  color: var(--text-color1);
  font-weight: bold;
}

/* Footer Section */
footer {
  background: linear-gradient(to right, var(--tertiary-color), var(--primary-color));
  color: #fff;
  border-top: 1px solid var(--text-color3);
  padding: 3.5rem 0 2rem 0; 
  position: relative;
}

.footer-content {
  display: flex;
  align-items: stretch; /* It stretches the children vertically */
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 0 2rem;
  min-height: 160px; /* It makes the footer taller */
}

.footer-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.75rem;
  min-width: 220px;
  height: 100%;
  position: relative;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.footer-name {
  font-size: 0.95rem;
  font-weight: bold;
  display: inline-block;
}

.footer-url {
  color: var(--text-color4);
  font-size: 0.95rem;
  text-decoration: none;
  margin-left: 0.5rem;
  display: inline-block;
}

.footer-url:hover {
  color: var(--text-color3);
}

.footer-desc {
  position: absolute;
  left: 12px;
  top: 50px;
  width: 150%;
  text-align: left;
  font-size: 1rem;
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  min-width: 220px;
  height: 100%;
  justify-content: flex-start;
}

.footer-social-title {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  align-self: normal;
  letter-spacing: 1px;
}

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

.footer-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  transition: filter 0.2s;
  filter: grayscale(98%);
}

.footer-icon:hover {
  filter: none;
}

.footer-bottom {
  text-align: center;
  color: var(--text-color4);
  font-size: 0.95rem;
  margin-top: 2rem;
  letter-spacing: 0.5px;
}

/* --- Responsive Enhancements for Mobile Devices --- */
@media (max-width: 700px) {
  #navbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.7rem 1rem;
    height: auto;
    gap: 0.5rem;
  }
  .navbar-logo {
    margin-bottom: 0.5rem;
  }
  .sidebar-toggle {
    display: flex;
  }
  .navbar-links {
    display: none !important;
  }
  .sidebar-menu.active {
    display: flex;
  }
  .sidebar-overlay.active {
    display: block;
  }
  .terminal-window {
    width: 300px;
    height: 160px;
  }
  .terminal-header {
    display: hidden;
  }
  .terminal-button {
    height: 12px;
    width: 12px;
  }
  .welcome-flex {
    flex-direction: column;
    gap: 1.2rem;
    padding: 1rem 0.2rem;
    width: 98vw;
  }
  .welcome-text {
    align-items: center;
    text-align: center;
    padding: 1rem 0.5rem;
    min-width: unset;
    max-width: 98vw;
    font-size: 1.1rem;
  }
  #cmd-typing {
    font-size: 1.3rem;
  }
  #cmd-subtyping {
    font-size: 1rem;
  }
  .welcome-image-glow::before {
    width: 70vw;
    height: 70vw;
    left: 50%;
    top: 50%;
  }
  .welcome-image {
    width: 60vw;
    max-width: 260px;
  }
  .logo-image {
    width: 60vw;
    max-width: 260px;
    left: -60px;
    top: -30px;
  }
  .status-box {
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
    gap: 0.3rem;
  }

  #projects {
    padding: 1rem 0.2rem;
    min-height: unset;
  }
  .sub-header {
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    align-items: flex-start;
  }
  .sub-header h2 {
    margin-left: 0;
    font-size: 1.1rem;
  }
  .sub-header .center-line {
    margin-right: 0;
    margin-left: 0;
    width: 60vw;
  }
  .sub-header .view-more-link {
    font-size: 0.95rem;
    padding: 0.2rem 0;
  }
  .projects-grid {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 1rem;
    justify-content: flex-start;
    padding: 0 0.2rem;
  }
  .project-tile {
    min-width: 60vw;
    max-width: 70vw;
    width: 90vw;
    margin-top: 0;
  }
  .project-tile h3, .project-tile p {
    font-size: 0.85rem;
    padding: 0.4rem;
  }
  .project-tile .view-button {
    font-size: 0.85rem;
    padding: 0.4rem 0.5rem;
  }

  #about-me {
    padding: 1rem 0.2rem;
    min-height: unset;
  }
  .about-me-content {
    flex-direction: column;
    gap: 1.2rem;
    width: 100vw;
    max-width: 100vw;
    margin: 0 auto;
  }
  .about-me-text {
    align-items: center;
    text-align: center;
    font-size: 0.85rem;
    gap: 1rem;
    margin-top: 0;
    margin-right: 10px;
    width: 85%;
  }
  .about-me-skills {
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .about-me-skills .skill-badge {
    font-size: 0.85rem;
    padding: 0.25rem 0.7rem;
  }
  .about-me-image {
    display: none;
  }
  .about-me-image img {
    display: none;
  }
  .about-me-image::before {
    width: 60vw;
    height: 60vw;
    max-width: 260px;
    max-height: 260px;
  }

  #contacts {
    padding: 1rem 0.2rem;
    min-height: unset;
  }
  .contact-section-content {
    flex-direction: column;
    gap: 1.2rem;
    width: 100vw;
    max-width: 100vw;
    margin: 1.5rem auto 0 auto;
  }
  .contact-text {
    width: 85%;
    text-align: center;
    font-size: 0.85rem;
    margin-right: 10px;
  }
  .download-cv-btn {
    width: 80%;
    font-size: 0.85rem;
    padding: 0.6rem 0;
  }
  .contact-info {
    width: 80%;
    min-width: unset;
    align-items: center;
    padding: 1rem 0.5rem;
    font-size: 1rem;
  }
  .contact-info h4 {
    font-size: 1rem;
  }
  .contact-info p {
    font-size: 0.85rem;
    gap: 0.5rem;
  }
  .icon {
    width: 22px;
    height: 22px;
  }

  footer {
    padding: 2rem 0 1rem 0;
  }
  .footer-content {
    flex-direction: column;
    gap: 1.2rem;
    align-items: center;
    padding: 0 0.5rem;
    min-height: unset;
  }
  .footer-left, .footer-right {
    min-width: unset;
    width: 100%;
    align-items: center;
    position: static;
  }
  .footer-brand {
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
  }
  .footer-url {
    margin-left: 0;
    font-size: 0.85rem;
    word-break: break-all;
  }
  .footer-desc {
    position: static;
    width: 100%;
    text-align: center;
    margin-top: 0.7rem;
    font-size: 0.85rem;
  }
  .footer-social-title {
    align-self: center;
    font-size: 0.85rem;
  }
  .footer-social-links {
    gap: 0.7rem;
  }
  .footer-icon {
    width: 22px;
    height: 22px;
  }
  .footer-bottom {
    font-size: 0.85rem;
    margin-top: 1rem;
  }
}

@media (max-width: 1200px) {
  .projects-grid {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
}