@import url("https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap");

:root {
  --primary: #00ffff;
  --secondary: #ff00ff;
  --accent: #7c3aed;
  --dark: #0a0a0f;
  --darker: #050508;
  --light: #ffffff;
  --gray: #6b7280;
  --grayer: #f2f2f2;
  --success: #00ff88;
  --darkblue: #03506e;
  --cblue: #0575e6;
  --cred: #ce3232;
  --khaki: #f0e68c;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Nunito", sans-serif;
  overflow-x: hidden;
  line-height: 1.6;
  display: grid;
  width: 100vw;
  height: 100vh;
  max-width: 1608px;
  text-align: center;
  margin: 0 auto;
  grid-template-columns: 1fr;
  grid-template-rows: 4rem 1fr 3rem;
  grid-template-areas:
    "header"
    "content"
    "footer";
}

section h2 {
  font-size: 2rem;
  /* text-align: center; */
  margin-bottom: 3rem;
  background: linear-gradient(45deg, var(--gray), var(--secondary));
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

img {
  border-radius: 20px;
}

a {
  text-decoration: none;
}

section {
  margin: 0 auto;
  padding: 4rem 2rem;
}

.content {
  text-align: justify;
}

/* Preloader Container */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1001; /* Ensures it stays on top */
  transition:
    opacity 2s ease,
    visibility 2s ease;
}

/* The Spinner Animation */
.spinner {
  width: 50px;
  height: 50px;
  border: 2px solid var(--gray);
  border-top: 2px solid var(--light);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Fade Out Class */
.preloader-hidden {
  opacity: 0;
  visibility: hidden;
}

/* Header */
header {
  grid-area: header;
  position: fixed;
  top: 0;
  width: 100%;
  max-width: 1608px;
  padding: 0.8rem;
  background: rgba(10, 10, 15, 0.9);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 999;
}

header .logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  transition: transform 0.3s ease;
}

header .logo-icon {
  width: 40px;
  height: 40px;
}

header .logo-text {
  font-size: 1.5rem;
  letter-spacing: 2px;
  background: linear-gradient(45deg, var(--primary), var(--success));
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
}

header .logo:hover {
  transform: translateY(-5px);
}

header nav ul {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

header nav ul li {
  margin-right: 15px;
}

header nav ul li a {
  color: var(--light);
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 30px;
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 255, 255, 0.6);
}

header nav ul li a:hover {
  background: linear-gradient(45deg, var(--success), var(--primary));
  color: var(--dark);
  transform: scale(1.02);
}

.mobile-menu {
  display: none;
  flex-direction: column;
  position: sticky;
  cursor: pointer;
  z-index: 1000;
  padding: 0.5rem;
  border-radius: 8px;
  transition: background 0.3s ease;
}

.mobile-menu:hover {
  background: rgba(255, 255, 255, 0.1);
}

.mobile-menu span {
  width: 25px;
  height: 2px;
  background: var(--light);
  margin: 3px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

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

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

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

.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  padding-top: 5rem;
  background: rgba(20, 20, 30, 0.8);
  backdrop-filter: blur(10px);
  z-index: 998;
}

.mobile-nav.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.mobile-nav a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-size: 1.2rem;
  margin: 0.5rem 0;
  padding: 1rem 2rem;
  border-radius: 30px;
  transition: all 0.3s ease;
  background: rgba(0, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  min-width: 200px;
  text-align: center;
  font-weight: 300;
  overflow: hidden;
}

.mobile-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 255, 255, 0.3);
  color: var(--primary);
  transform: scale(1.02);
}

main {
  grid-area: content;
  width: 100%;
}

.bg-overlay {
  background: linear-gradient(to right, var(--cblue), var(--success));
  opacity: 0.8;
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1;
}

/* Home Section */
.home {
  background: url("../images/home-bg.jpg") no-repeat center center;
  background-size: cover;
  display: flex;
  margin: 0;
  position: relative;
  color: white;
  font-size: 1rem;
  align-items: center;
  padding: 2rem 2rem;
  transition: all 0.3s ease;
  scroll-margin-top: 4rem;
}

.home-info {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-info .typing-effect {
  font-family: monospace;
  font-size: 2rem;
  margin-bottom: 2rem;

  /* Styling the characters */
  background: linear-gradient(45deg, var(--light), var(--primary));
  -webkit-text-fill-color: transparent;
  background-clip: text;

  /* Start hidden */
  width: 0;
  overflow: hidden;
  white-space: nowrap;

  /* The cursor effect */
  border-right: 2px solid #000;

  /* Animation properties */
  animation:
    typing 3s steps(7) infinite alternate,
    blink-cursor 0.75s step-end infinite;
}

/* The typing logic: expanding the width */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 7ch;
  } /* 'ch' represents the width of one character */
}

/* The cursor blinking logic */
@keyframes blink-cursor {
  from,
  to {
    border-color: transparent;
  }
  50% {
    border-color: orange;
  }
}

.home .hero-title {
  font-size: 2rem;
  margin-bottom: 0;
  background: var(--light);
  background-clip: text;
}

.home-content,
.home-img {
  z-index: 10;
}

.home-img img {
  margin-top: 30px;
  margin-left: 30px;
  max-width: 350px;
  z-index: 10;
}

.social-links {
  margin: 10px 0;
}

ul.social-links {
  list-style: none;
  display: flex;
  justify-content: center;
}

.social-links li {
  margin-right: 15px;
  border-radius: 15px;
  border: 2px solid var(--light);
  padding: 5px 10px;
  transition: all 0.3s ease;
  background: transparent;
}

.social-links li:hover {
  background: #ce3232;
  border-color: transparent;
}

.social-links li a {
  text-decoration: none;
  font-size: 18px;
  color: var(--light);
}

/* About */
.about {
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-img img {
  width: 250px;
  height: 250px;
  padding: 2px;
  border-radius: 50%;
  box-shadow: 3px 5px 30px var(--darkblue);
  object-fit: cover;
}

.about-content {
  margin-left: 100px;
  text-align: justify;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 2rem;
}

td,
th {
  border: 1px solid var(--dark);
  padding: 8px;
}

tr:nth-child(even) {
  background-color: var(--grayer);
}

tr:hover {
  background-color: #ddd;
}

th {
  padding-top: 12px;
  padding-bottom: 12px;
  text-align: left;
  background: linear-gradient(45deg, var(--dark), var(--secondary));
  color: var(--light);
}

/* Projects Article */
.projects {
  padding: 4rem 2rem;
  text-align: center;
  background: var(--grayer);
}

.projects-article {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 20px;
}

.projects-content {
  border: 2px solid var(--darkblue);
  border-radius: 10px;
  padding: 20px;
  flex-grow: 1;
  flex-basis: 350px;
  text-align: justify;
  color: var(--darker);
  background-color: var(--light);
}

.projects-content:hover {
  color: var(--darker);
  background-color: var(--khaki);
  transition: transform 0.5s ease;
  transform: translateY(-15px);
  cursor: pointer;
}

.projects-content h3 {
  padding-bottom: 6px;
  color: var(--darkblue);
  line-height: 1rem;
}

.project-title {
  margin-bottom: 2.5rem;
  text-align: center;
}

.projects-content .side-info {
  width: 40%;
  padding-left: 0.5rem;
  margin-left: 1rem;
  float: right;
  box-shadow: inset 5px 0 5px -5px var(--darkblue);
  font-style: italic;
  color: var(--darkblue);
}

.projects-content .side-info > p {
  margin: 0.5rem;
}

.projects-content figure {
  text-align: center;
}

.projects-content img {
  max-width: 400px;
  margin-top: 1rem;
}

.projects-content ul li::marker {
  font-style: italic;
  color: var(--cred);
}

.projects-content ul li ol {
  padding: 1rem;
}

/* Contact Section */
.contact {
  text-align: center;
}

.contact form input,
textarea,
select {
  width: 300px;
  margin-bottom: 10px;
  padding: 5px 8px;
  border-radius: 5px;
  border: 2px solid var(--gray);
  outline: none;
  resize: none;
  transition: background-color 0.3s ease;
}

.contact form input:focus,
textarea:focus,
select:focus {
  background-color: var(--khaki);
}

.contact button {
  background-color: var(--darkblue);
  color: var(--light);
  padding: 12px 34px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s ease;
}

.contact button:hover {
  background-color: var(--success);
  color: black;
  cursor: pointer;
}

/* Footer */
footer {
  grid-area: footer;
  background-color: #054743;
  color: var(--light);
  padding: 10px 5px;
  font-size: 13px;
  text-align: center;
}

.footer-info {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}

footer .email-img {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

.about-content ul,
.projects-content ul {
  padding: 1.5rem;
}

.dot-bar {
  color: var(--cblue);
  display: block;
  font-size: 3em;
  line-height: 0;
}

@media screen and (max-width: 512px) {
  .mobile-menu {
    display: flex;
  }
  header nav ul {
    display: none;
  }
  .desktop-nav {
    display: none;
  }
  header .logo-text {
    font-size: 1.2rem;
  }
  /* Home Section */
  .home {
    flex-direction: column-reverse;
    align-items: center;
    justify-content: flex-end;
    padding-top: 0;
  }

  .home-img img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    box-shadow: 3px 5px 30px var(--gray);
    object-fit: cover;
  }

  /* About Section */
  .about {
    flex-direction: column;
    scroll-margin-top: 1rem;
  }

  .about-section {
    flex-direction: column;
  }

  .about-content {
    margin-left: 1rem;
  }
  .about-img img {
    display: none;
  }

  .about-content h2 {
    text-align: center;
  }

  /* Project section */
  .projects-content img {
    max-width: 250px;
  }
}

@media screen and (min-width: 513px) and (max-width: 797px) {
  header .logo-text {
    display: none;
  }
  .desktop-nav {
    display: none;
  }

  /* Home Section */
  .home {
    flex-direction: column-reverse;
    align-items: center;
    justify-content: flex-end;
    height: 100vh;
  }

  .home-img img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    box-shadow: 3px 5px 30px var(--gray);
    object-fit: cover;
  }

  /* About Section */
  .about {
    flex-direction: column;
    scroll-margin-top: 1rem;
  }

  .about-section {
    flex-direction: column;
  }

  .about-content {
    margin-left: 1rem;
  }
  .about-img img {
    display: none;
  }

  .about-content h2 {
    text-align: center;
  }
}

@media screen and (min-width: 798px) and (max-width: 1208px) {
  .desktop-nav {
    display: none;
  }

  .home {
    height: 100vh;
  }
  .projects-content {
    flex-basis: 400px;
  }
}

@media screen and (min-width: 1209px) {
  body {
    grid-template-columns: 200px 1fr;
    grid-template-areas:
      "header header"
      "aside content"
      "footer footer";
    overflow-x: hidden;
  }

  aside {
    grid-area: aside;
  }

  .desktop-nav {
    display: flex;
    flex-direction: column;
    width: 200px;
    justify-content: start;
    align-items: center;
    padding: 2rem 2rem;
    gap: 1rem;
    position: sticky;
    top: 3rem;
  }

  .desktop-nav .logo-icon {
    width: 4rem;
    height: 4rem;
  }

  .desktop-nav ul {
    margin-top: 1rem;
    list-style: none;
    transition: all 0.3s ease;
  }

  .desktop-nav ul li {
    margin-bottom: 1.5rem;
  }

  .desktop-nav a {
    color: var(--dark);
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 15px;
    border-bottom: 2px solid var(--gray);
  }

  .desktop-nav a:hover {
    color: var(--dark);
    border: none;
    border-radius: 15px;
    background: linear-gradient(45deg, var(--success), var(--primary));
  }

  header nav ul {
    display: none;
  }

  header {
    justify-content: center;
  }

  header h1 {
    position: relative;
    left: 80px;
  }

  .home {
    height: 100vh;
  }

  .projects-content {
    flex-basis: 400px;
  }
  footer .footer-info {
    position: relative;
    left: 100px;
  }
}
