:root {
  --primary-dark: #1a1a2e;
  --primary-blue: #16213e;
  --accent-teal: #0f3460;
  --accent-green: #04aa6d;
  --text-light: #f1f1f1;
  --text-muted: #b8b8b8;
  --card-bg: rgba(255, 255, 255, 0.05);
  --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-hard: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

/* =====================
   GLOBAL SMOOTH SCROLL
   ===================== */
html {
  scroll-behavior: smooth; /* This handles the smooth click scrolling */
}

canvas#bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

@keyframes bounce-cta {
  0%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-4px);
  }
}
@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  list-style: none;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background-image: radial-gradient(rgb(0, 91, 107) 10%, rgb(47, 8, 66) 85%, #020204);
  color: white;
  overflow-x: hidden;
  width: 100%;
  margin: 0px;
  line-height: 1.6;
}

@keyframes fallin {
  from {
    transform: translate(-20px, -20px);
    opacity: 0.3;
  }
  to {
    transform: translate(0, 0);
    opacity: 1;
  }
}
@keyframes fallin_down {
  from {
    transform: translateY(-30px);
    opacity: 0.3;
  }
  to {
    transform: translate(0, 0);
    opacity: 1;
  }
}
@keyframes fallin_invers {
  from {
    transform: translate(20px, -20px);
    opacity: 0;
  }
  to {
    transform: translate(0, 0);
    opacity: 1;
  }
}
header {
  height: 90px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5%;
  border-bottom: 3px solid rgb(245, 222, 179);
  position: fixed;
  width: 100%;
  z-index: 100;
  box-shadow: 0 0 60px 20px rgba(0, 0, 0, 0.662);
  background: linear-gradient(-45deg, rgb(47, 8, 66), rgb(0, 91, 107), #16213e);
  animation: bg-animation 3s infinite alternate;
  background-size: 400%;
}
header .logo_content {
  display: flex;
  align-items: center;
  animation: fallin 0.7s ease-in forwards;
}
header .logo_content img {
  margin-right: 25px;
  width: 75px;
  height: 75px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.223px solid teal;
  box-shadow: 5px 4px 5px cyan;
}
header .logo_content img:hover {
  box-shadow: 5px 4px 5px wheat;
  width: 80px;
  height: 80px;
  border: 2.223px solid black;
  transition: box-shadow 1s ease, border 1s ease, width 0.5s ease, height 0.5s ease;
}
header .logo_content .brand-text h1 {
  font-family: "Courier New", monospace;
  color: rgb(245, 222, 179);
  font-size: 1.5rem;
  margin-bottom: 0;
}
header .logo_content .brand-text .subtitle {
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.7);
}
header .logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
header .navi1 ul {
  animation: fallin_invers 0.7s ease-in forwards;
  display: flex;
  gap: 50px;
  width: 100%;
}
@media (max-width: 900px) {
  header .navi1 ul {
    display: none;
  }
}
header .navi1 ul li a {
  color: wheat;
  font-weight: bold;
  font-size: 1.2rem;
  transition: color 0.3s;
}
header .navi1 ul li a:hover {
  color: whitesmoke;
  text-shadow: 0 0 10px cyan;
}
header .nav-link {
  /* Using your Wheat color instead of undefined var */
  color: rgb(245, 222, 179);
  font-weight: 500;
  position: relative; /* Essential for the underline to stick to the text */
  padding: 5px 0;
  transition: color 0.3s;
}
header {
  /* The Underline Effect */
}
header .nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0; /* Start hidden */
  height: 1px;
  background: cyan;
  transition: width 0.3s ease-in-out; /* The smooth animation */
}
header {
  /* Hover State */
}
header .nav-link:hover::after {
  width: 100%;
}
header {
  /* Active State (Triggered by JS) */
}
header .nav-link.active::after {
  width: 100%;
  background: rgb(245, 222, 179); /* Wheat color when active */
}

main {
  padding-top: 90px;
  opacity: 0.85;
}

/* ======================== */
/* HERO SECTION ANIMATION   */
/* ======================== */
/* CONTAINER SETUP */
.hero-split {
  background: linear-gradient(-45deg, rgb(47, 8, 66), rgb(0, 91, 107), #16213e);
  opacity: 0.98;
  padding: 30px 20px;
  border-bottom: 7px solid wheat;
  display: flex;
  justify-content: space-between;
}

.container-split {
  max-width: 1200px;
  width: 100%;
  display: flex;
  grid-template-columns: 1fr 1fr; /* Equal split: 50% Text | 50% Image */
  align-items: center;
}
@media (max-width: 610px) {
  .container-split {
    display: flex;
    flex-direction: column;
  }
}

/* TEXT STYLING */
.split-text h2 {
  font-size: 3.5rem;
  color: wheat;
  text-shadow: 0 0 10px cyan;
  margin-bottom: 20px;
  text-align: center;
}

.split-text p {
  font-size: 1.2rem;
  color: #ffffff;
  margin-bottom: 30px;
  line-height: 1.6;
  font-family: "Courier New", monospace;
  margin-left: 50px;
}

/* IMAGE BOX (The Magic Part) */
.split-image-box {
  position: relative;
  width: 100%;
  max-width: 500px; /* Limits width so it doesn't get too big */
  height: 500px; /* Sets the height of the image area */
  margin: 0 auto;
  /* Makes the photos look like a cool card */
  border: 2px solid wheat;
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  overflow: hidden; /* Crops anything sticking out */
}

/* IMAGE SETTINGS */
.fade-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensures image fills the box neatly */
}

/* ANIMATION LOGIC */
/* The top image fades in and out. The bottom image stays still behind it. */
.img-top {
  animation: fade-switch 6s infinite ease-in-out;
}

@keyframes fade-switch {
  0% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
/* MOBILE FIX */
@media (max-width: 768px) {
  .container-split {
    grid-template-columns: 1fr; /* Stack vertically */
    text-align: center;
  }
  .split-image-box {
    height: 400px; /* Smaller image on phone */
    order: -1; /* Puts image ABOVE text on mobile */
  }
  .hero_buttons {
    justify-content: center;
  }
  .split-text {
    margin-left: 0;
    line-height: 1.4;
    margin-top: 10px;
    text-align: left;
  }
  .split-text h2 {
    font-size: 2rem;
  }
  .split-text p {
    font-size: 0.8rem;
  }
  .split-text .hero-buttons {
    padding: 20px 0;
  }
}
@media (max-width: 890px) {
  .navi1 {
    display: none; /* Hide desktop menu */
  }
  header {
    justify-content: center;
  }
}
.hero_text h2 {
  font-size: 3.5rem;
  color: white;
  margin-bottom: 20px;
  line-height: 1.2;
}

.hero_text p {
  font-size: 1.2rem;
  color: #ddd;
  margin-bottom: 40px;
  font-family: "Courier New", monospace;
  font-weight: bold;
}

/* [5] BUTTONS */
.hero_buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.btn-primary:hover {
  transform: translate(-2px, -5px);
  transition: transform 0.5s;
  cursor: pointer;
}

.btn-secondary {
  display: flex;
  padding: 20px 20px;
  font-weight: bold;
  font-family: "Courier New", monospace;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: white;
  border-radius: 90px;
  border: 2px solid black;
  box-shadow: 3px 3px 3px cyan;
  justify-content: center;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  background-color: rgb(47, 8, 66);
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-secondary a {
  color: cyan;
}
.btn-secondary:hover a {
  color: white;
}
.btn-secondary:hover {
  background: linear-gradient(135deg, rgb(245, 222, 179), rgb(0, 91, 107), #04aa6d, #16213e, rgb(245, 222, 179));
  border: 2px solid wheat;
  background-size: 300% 300%;
  animation: bounce-cta 1.8s ease-in-out infinite, gradient-shift 4s ease infinite;
}

/* [6] THE KEYFRAMES (The magic logic) */
@keyframes fade-switch {
  0% {
    opacity: 0;
  } /* Show Image 1 */
  45% {
    opacity: 1;
  } /* Show Image 2 */
  55% {
    opacity: 1;
  } /* Stay on Image 2 a bit */
  100% {
    opacity: 0;
  } /* Back to Image 1 */
}
@keyframes bg-animation {
  0% {
    background-position: left;
  }
  100% {
    background-position: right;
  }
}
/* ===================== */
/* CONTACT SECTION */
/* ===================== */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.contact {
  padding: 60px 0;
  border-bottom: 3px solid wheat;
  animation: bg-animation 3s infinite alternate;
  background: linear-gradient(-45deg, rgb(47, 8, 66), rgb(0, 91, 107), #16213e);
}

.contact-content {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: center;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 15px;
}
.contact-item p {
  color: wheat;
}
.contact-item a {
  color: wheat;
}

.contact-icon {
  width: 50px;
  height: 50px;
  background: var(--card-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--accent-green);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-weight: 500;
}

.form-input, .form-textarea {
  padding: 12px 15px;
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  color: var(--text-light);
  font-family: inherit;
  transition: var(--transition);
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent-green);
}

/* ===================== */
/* RESPONSIVE STYLES */
/* ===================== */
@media (max-width: 992px) {
  h1 {
    font-size: 3rem;
  }
  h2 {
    font-size: 2rem;
  }
  .about-content {
    grid-template-columns: 1fr;
  }
  .contact-content {
    grid-template-columns: 1fr;
  }
  .timeline::after {
    left: 31px;
  }
  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }
  .timeline-item:nth-child(even) {
    left: 0;
  }
  .timeline-item::after {
    left: 21px;
  }
  .timeline-item:nth-child(even)::after {
    left: 21px;
  }
}
@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 80px;
    right: -100%;
    flex-direction: column;
    background: var(--primary-blue);
    width: 100%;
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    padding: 20px 0;
    gap: 0;
  }
  .nav-menu.active {
    right: 0;
  }
  .nav-item {
    margin: 15px 0;
  }
  .mobile-toggle {
    display: block;
  }
  .hero-title {
    font-size: 2.5rem;
  }
  .hero-subtitle {
    font-size: 1.2rem;
  }
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
}
footer {
  animation: bg-animation 3s infinite alternate;
  background: linear-gradient(-45deg, rgb(47, 8, 66), rgb(0, 91, 107), #16213e);
  background-size: 400%;
  text-align: center;
  padding: 40px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}
footer .socials {
  margin-top: 10px;
}
footer .socials a {
  color: rgb(245, 222, 179);
  font-size: 1.5rem;
  margin: 0 10px;
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  .research-card {
    flex-direction: column;
  }
  header {
    padding: 0 20px;
  }
  .navi1 {
    display: none;
  }
}
/* ===================== */
/* RESPONSIVE STYLES */
/* ===================== */
@media (max-width: 992px) {
  h1 {
    font-size: 3rem;
  }
  h2 {
    font-size: 2rem;
  }
  .about-content {
    grid-template-columns: 1fr;
  }
  .contact-content {
    grid-template-columns: 1fr;
  }
  .timeline::after {
    left: 31px;
  }
  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }
  .timeline-item:nth-child(even) {
    left: 0;
  }
  .timeline-item::after {
    left: 21px;
  }
  .timeline-item:nth-child(even)::after {
    left: 21px;
  }
}
@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 80px;
    right: -100%;
    flex-direction: column;
    background: var(--primary-blue);
    width: 100%;
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    padding: 20px 0;
    gap: 0;
  }
  .nav-menu.active {
    right: 0;
  }
  .nav-item {
    margin: 15px 0;
  }
  .mobile-toggle {
    display: block;
  }
  .hero-title {
    font-size: 2.5rem;
  }
  .hero-subtitle {
    font-size: 1.2rem;
  }
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
}
.btn {
  display: inline-block;
  padding: 12px 30px;
  background: var(--accent-green);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  text-align: center;
}