:root {
  --accent: #0F4C5C;      
  --accent-light: #2C7A7B;
  --bg-light: #E5E5DC;  
  --text-dark: #222;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Open Sans', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-light);
  scroll-behavior: smooth;
  max-width: 1920px;
  margin: 0 auto;
}

h1, h2, h3 {
  font-family: 'Poppins', sans-serif;
}

nav.buttons {
  background: linear-gradient(270deg, #111, #333, #111);
  background-size: 400% 400%;
  animation: gradientMove 10s ease infinite;
  display: flex;
  justify-content: flex-end;
  gap: 30px;
  padding: 15px 50px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  border: none;
}

nav a {
  position: relative;
  color: white; /* text now white */
  text-decoration: none;
  font-weight: bold;
  padding: 10px 15px;
  border-radius: 5px;
  transition: color 0.3s ease;
  letter-spacing: 0.5px;
}

nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 2px;
  background-color: #008280; /* gold underline */
  transition: width 0.3s ease;
  transition: width 0.3s ease, background-color 0.3s ease; /* ✅ smooth underline */
}

nav a:hover {
  color: #008280; /* gold on hover */
}

/* Active state */
nav a.active {
  color: #20B2AA; /* teal active colour */
  transition: color 0.3s ease;
}

nav a.active::after {
  width: 100%; /* full underline for active */
  background-color: #20B2AA;
  transition: width 0.3s ease, background-color 0.3s ease;
}

nav a:hover::after {
  width: 100%;
}

header {
  background: linear-gradient(270deg, #111, #333, #111);
  background-size: 400% 400%;
  color: white;
  text-align: center;
  padding: 100px 20px;
  animation: gradientMove 10s ease infinite;
}

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Header text animations */
header h1 {
  font-size: clamp(2rem, 6vw, 6.5rem);  
  margin-bottom: 8px;
  color: white;
  font-weight: bold;
  white-space: nowrap;                  
  overflow: hidden;                     
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1.2s ease forwards, glowPulse 3s ease-in-out infinite 1.2s;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

header h2 {
  font-size: clamp(1.5rem, 3vw, 3.5rem);
  margin-top: 0;
  color: #ccc;
  font-weight: normal;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1.2s ease 0.3s forwards, glowPulseSoft 3s ease-in-out infinite 1.5s;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes glowPulse {
  0%,100% { text-shadow: 0 0 15px rgba(255,255,255,0.3), 0 0 30px rgba(255,255,255,0.2); }
  50% { text-shadow: 0 0 25px rgba(255,255,255,0.6), 0 0 40px rgba(255,255,255,0.4); }
}

@keyframes glowPulseSoft {
  0%,100% { text-shadow: 0 0 10px rgba(255,255,255,0.1); }
  50% { text-shadow: 0 0 20px rgba(255,255,255,0.25); }
}

@media (max-width: 600px) {
  header h1 {
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.2),
                 0 0 15px rgba(255, 255, 255, 0.1);
    animation: fadeInUp 1.2s ease forwards; /* keep fade-in, remove glow pulse animation */
  }
}

/* Sections */
.content-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 60px;
  flex-wrap: wrap;
  margin-bottom: 80px;
  padding: 80px 40px;
}

.text-content {
  flex: 1 1 450px;
  font-size: clamp(1rem, 2vw, 1.8rem);
  line-height: 1.6;
}

.image-content {
  flex: 1 1 350px;
  display: flex;
  justify-content: center;
}

.image-content img {
  max-width: 100%;
  max-width: 450px;
  height: auto;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  transition: transform 0.3s ease;
}

.image-content img:hover {
  transform: scale(1.03);
}

/* Portfolio */
#portfolio {
  background-color: white;
  text-align: center;
  padding: 50px 40px 100px;
  margin: 40px 0 80px;
}

#portfolio h2 { font-size: 2.5rem; margin-bottom: 40px; }

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 5px;
}

.project {
  background-color: #f0f0f0;
  padding: 10px;
  border-radius: 10px;
  transition: 0.3s;
}

.project img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
}

.project:hover {
  transform: scale(1.03);
  background-color: #e8e8e8;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Contact Section */
#contact {
  background-color: #f0f0f0;
  border-radius: 10px;
  padding: 40px;
  max-width: 600px;
  margin: 0 auto 80px;
  text-align: center;
}

#contact form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#contact label {
  font-weight: bold;
  text-align: left;
}

#contact input,
#contact textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

#contact input:focus,
#contact textarea:focus {
  border-color: var(--accent);
  outline: none;
}

button {
  background-color: var(--accent);
  color: white; /* send button text black */
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
}

button:hover {
  background-color: var(--accent-light);
}

/* Footer */
footer {
  text-align: center;
  padding: 20px;
  background-color: #222;
  color: white;
}

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hover border effect for main sections */
#about-me,
#portfolio,
#contact {
  border-radius: 15px;
  transition: border 0.3s ease, box-shadow 0.3s ease;
}

/* Progress bar */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 5px;
  background: linear-gradient(to right, var(--accent), var(--accent-light));
  width: 0%;
  z-index: 2000;
  transition: width 0.2s ease;
}

/* Section bottom decorative line */
section::after {
  content: '';
  display: block;
  height: 3px;
  margin: 40px auto 0 auto; /* top smaller, no bottom gap */
  width: 60%;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  opacity: 0.3;
  border-radius: 2px;
}

/* specifically for mobile fix */
@media (max-width: 900px) {
  #about-me::after {
    order: 3; /* ensures the line appears after text, not after image */
    margin-top: 20px;
  }
}

.lightbox {
  display: none; /* hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  z-index: 3000;
}


.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  transition: transform 0.3s ease;
}

.lightbox img:hover {
  transform: scale(1.02);
}

/* ===== MODAL (Floating Window) ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 4000;
}

.modal-content {
  background-color: white;
  width: 90%;
  max-width: 600px;
  padding: 40px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: modalFadeIn 0.4s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 2rem;
  cursor: pointer;
  color: #333;
  transition: color 0.2s ease;
}

.close-btn:hover {
  color: var(--accent);
}

#modal-title {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

#modal-message {
  font-size: 1.3rem;
  color: #555;
}


/* Responsive */
@media (max-width: 900px) {
  .content-section {
    flex-direction: column-reverse;
    text-align: center;
    gap: 40px;
    padding: 60px 20px;
  }

  nav.buttons {
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    padding: 10px 20px;
  }

  header {
    padding: 60px 20px;
  }

  .image-content img {
    max-width: 300px;
  }
}

@media (max-width: 600px) {
  header h1 {
    font-size: 2.2rem;  /* smaller on tiny screens */
    letter-spacing: 0.5px;
  }
}

#about-me {
  scroll-margin-top: 60px;  /* moves 'About Me' higher up */
}

#portfolio {
  scroll-margin-top: 100px;  /* perfect as you said */
}

#contact {
  scroll-margin-top: 90px;   /* a bit tighter for that form */
}

@media (max-width: 600px) {
  nav a {
    font-size: 0.95rem;
    color: #f5f5f5;
  }
}