@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Poppins", sans-serif;
  color: white;
  background-color: white;
  text-size-adjust: 100%;
  overflow-x: hidden;
  text-size-adjust: 100%;
}

header {
  display: flex;
  justify-content: space-between;
  background-color: white;
  padding: 20px 40px;
  color: #002147;
  margin-bottom: 50px;
  align-items: center;
  border: 3px solid white;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  transition: background-color 0.3s ease;
}

header.blue-bg {
  background-color: #002147 !important;
  color: white !important;
  border-color: #002147 !important;
}

header.blue-bg nav a {
  color: white !important;
}

header.blue-bg .menu-toggle i {
  color: white !important;
}

header.blue-bg .nav-links ul.show {
  background-color: #002147 !important;
}

header.blue-bg .nav-links ul.show a {
  color: white !important;
}

header.blue-bg #close {
  color: white !important;
}

header.blue-bg .contact-btn {
  background-color: #002147 !important;
  color: white !important;
  border-color: white !important;
}

.logo {
  font-size: 1.6rem;
  font-weight: bold;
  margin: 0;
  padding: 0;
}

nav ul {
  display: flex;
  gap: 50px;
  list-style: none;
  padding: 10px;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

nav a {
  text-decoration: none;
  font-weight: bold;
  color: #002147;
}

/* .nav-link.active {
  border-bottom: 3px solid #f5f5f5;
  padding-bottom: 6px;
  font-weight: bold;
} */

.menu-toggle {
  display: none;
}

/* .nav-link:hover {
  border-bottom: 3px solid #1e3a8a;
  padding-bottom: 6px;
  font-weight: bold;
} */

.hero {
  align-items: center;
  display: flex;
  flex-direction: column;
  text-align: center;
  justify-content: center;
  height: 100vh;
  background-color: #002147;
  /* padding-top: 50px; */
}

.hero a {
  margin-top: 14px;
  background-color: #002147;
  color: white;
  padding: 12px 20px;
  border-radius: 50px;
  font-weight: 600;
  transition: background-color 0.2s ease-in-out, transform 0.2s ease;
  border: 2px solid white;
}

/* .hero a:hover {
  background-color: #f5f5f5;
  color: #1e3a8a;
  transform: scale(1.05);
} */

.hero-icons {
  margin-top: 15px;
  display: flex;
  gap: 15px;
  justify-content: center;
}

.hero-icons a {
  color: #f5f5f5;
  font-size: 1.5rem;
  transition: color 0.3s ease, transform 0.3s ease;
  border: none;
  outline: none;
}

.hero-icons a:hover {
  color: #1e3a8a;
  transform: scale(1.05);
}

.hero h3 {
  font-size: 1.7rem;
  margin-bottom: 10px;
  font-weight: 600;
  padding-top: 150px;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.hero h3::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: #f5f5f5;
  animation: blink-caret 1s step-end infinite;
}

.hero h3.typing-done::after {
  display: none;
}

.hero h2 {
  font-size: 4rem;
  margin-bottom: 20px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.hero h2::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: #f5f5f5;
  animation: blink-caret 1s step-end infinite;
}

.hero h2.typing-done::after {
  display: none;
}

.hero p {
  font-size: 1.125rem;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.hero p::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: #f5f5f5;
  animation: blink-caret 1s step-end infinite;
}

.hero p.typing-done::after {
  display: none;
}

@keyframes blink-caret {
  from,
  to {
    border-color: transparent;
  }
  50% {
    border-color: #f5f5f5;
  }
}

.skills-section {
  text-align: center;
  padding: 60px 20px;
  background-color: #002147;
}
.skills-section h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: #f5f5f5;
  font-weight: 700;
}

.skills-section p {
  font-size: 1rem;
  margin-bottom: 30px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.skills-grid i {
  background-color: #002147;
  font-size: 3rem;
}

.skills-card {
  border: 2px solid #002147;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(78, 44, 30, 0.15);
  transition: transform 0.3s ease;
}

.skills-card p {
  color: #f5f5f5;
}

.skills-card h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  margin-top: 10px;
  font-weight: 700;
  color: #f5f5f5;
}

.skills-card:hover {
  transform: translateY(-5px);
}

.projects.projects-page {
  padding-top: 80px;
}

.projects.projects-page .projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
}

.projects {
  margin: 40px 20px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.projects h2 {
  width: 100%;
  text-align: center;
  margin-bottom: 40px;
  font-size: 2.5rem;
  font-weight: 700;
  color: #002147;
}

.project-card {
  /* background-color: #f5f5f5; */
  padding: 20px;
  display: flex;
  flex-direction: column;
  max-width: 600px;
  margin: 20px auto;
  align-items: center;
  justify-content: flex-start;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  min-height: 400px;
  max-height: 500px;
}

.project-card-2 {
  /* background-color: #f5f5f5; */
  padding: 20px;
  display: flex;
  flex-direction: row-reverse;
  width: 100%;
}

.project-card-3 {
  /* background-color: #f5f5f5; */
  padding: 20px;
  display: flex;
  flex-direction: row;
  width: 100%;
}

.project-card-3 img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 15px;
}

.project-card-2 img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 15px;
}

.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 15px;
}

.project-card a {
  flex: 1;
}

.project-info {
  padding: 20px;
  text-align: center;
}

.project-info i {
  margin-right: 5px;
  color: #f5f5f5;
}

.project-info h4 {
  font-size: 1.6rem;
  margin-bottom: 10px;
  color: #002147;
}

.project-info h4 a {
  text-decoration: none;
  color: #002147;
  transition: color 0.2s ease;
}

.project-info h4 a:hover .project-info a:hover {
  color: #1e3a8a;
}

.project-info p {
  font-size: 1rem;
  margin-bottom: 15px;
  color: #002147;
  line-height: 1.5;
}

.project-info a {
  width: fit-content;
}

.btn {
  display: inline-block;
  padding: 10px 10px;
  background-color: #002147;
  color: #f5f5f5;
  text-decoration: none;
  border-radius: 5px;
  transition: background 0.3s ease;
}

.view-all-btn {
  display: block;
  margin: 40px auto;
  width: 200px;
  margin-top: 40px;
  text-align: center;
}

.about-section {
  padding: 80px 20px;
  color: #002147;
}

.about-container {
  display: flex;
  align-self: center;
  justify-content: center;
  gap: 60px;
  margin: auto;
  flex-wrap: wrap;
}
.about-image img {
  width: 400px;
  max-width: 100%;
  height: auto;
}

.about-text {
  max-width: 800px;
  margin: auto;
  flex: 1;
}

.about-text h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  font-weight: 700;
  text-align: center;
}

.about-text h2 span {
  border-bottom: 3px solid #1e3a8a;
  padding-bottom: 6px;
}

.about-text p {
  font-size: 1.125rem;
  line-height: 1.5;
  margin-bottom: 20px;
}

.contact-form {
  margin-top: 40px;
  text-align: center;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.contact-form h3 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: #002147;
  font-weight: 700;
}

.contact-form form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 20px;
}

.contact-form input,
.contact-form textarea {
  padding: 12px;
  border: 1px solid #002147;
  border-radius: 10px;
  font-size: 1rem;
  box-shadow: 0 4px 8px rgba(78, 44, 30, 0.1);
  background-color: #f5f5f5;
  color: #002147;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #002147;
  opacity: 0.7;
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

/* .contact-form button {
  background-color: #002147;
  color: #f5f5f5;
  padding: 12px 20px;
  border-radius: 50px;
  font-weight: 600;
  transition: background-color 0.2s ease-in-out, transform 0.2s ease;
  border: 2px solid #f5f5f5;
  cursor: pointer;
  margin: 20px auto 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0; 
  white-space: nowrap; 
  width: auto; 
} */

/* Space and alignment for the icon inside the submit button */
.contact-form button i {
  margin-left: 10px; /* space between text and icon on desktop */
  vertical-align: middle;
  font-size: 0.95em;
  transition: transform 0.15s ease;
  line-height: 1;
  display: inline-block;
}

.contact-form p {
  font-size: 1rem;
  color: #002147;
  margin-top: 10px;
  line-height: 1.4;
  margin-bottom: 15px;
}

.footer {
  background-color: #002147;
  color: #f5f5f5;
  padding: 40px 20px;
  text-align: center;
}

.footer-content h3 {
  font-size: 1.8rem;
  margin-bottom: 20px;
}

.footer-icons {
  margin: 20px 0;
}

.footer-icons a {
  color: #f5f5f5;
  font-size: 1.5rem;
  margin: 0 10px;
  transition: color 0.3s ease;
  cursor: pointer;
}

.footer-icons a:hover {
  color: #ccc;
}

.footer-contact-details {
  margin-bottom: 20px;
}

.footer-contact-details p {
  margin: 5px 0;
  font-size: 1rem;
}

.footer-contact-details a {
  color: #f5f5f5;
  text-decoration: none;
  transition: color 0.3s ease;
  cursor: pointer;
}

.footer-contact-details i {
  margin-right: 8px;
}

.footer hr {
  border: none;
  border-top: 1px solid white;
  margin: 30px auto;
  width: 80%;
}

.footer-copy {
  font-size: 0.9rem;
  color: #ddd;
}

/* Scroll to top button */
.scroll-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #f5f5f5;
  color: #002147;
  border: 2px solid #002147;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(30, 58, 138, 0.12);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 1500;
}

.scroll-top i {
  font-size: 18px;
}

.scroll-top.show {
  opacity: 1;
  transform: translateY(0);
}

.menu-toggle i {
  color: #f5f5f5;
  font-size: 1.8rem;
  cursor: pointer;
  margin-left: 10px;
}

/* Blog section styles */
.blog-section {
  padding: 80px 20px;
  color: #002147;
}

.blog-preview {
  padding: 60px 20px;
  background-color: #f5f5f5;
  color: #002147;
}

.blog-section h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 20px;
  font-weight: 700;
  margin-top: 20px;
  color: #002147;
}

.center {
  text-align: center !important;
}

.blog-section p {
  /* text-align: center; */
  font-size: 1.1rem;
  margin-bottom: 40px;
  color: #666;
}

.blog-preview h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 10px;
  font-weight: 700;
  color: #002147;
}

.blog-preview .subtitle {
  text-align: center;
  font-size: 1.1rem;
  margin-bottom: 40px;
  color: #666;
}

.blog-grid {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
}

.blog-preview-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
}

.blog-card {
  border: 1px solid #e0e0e0;
  margin-bottom: 20px;
}

.blog-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
  border-radius: 8px 8px 0 0;
}

.blog-info {
  padding: 20px;
  text-align: left !important;
}

.blog-info h3 {
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: #002147;
  font-weight: 600;
  line-height: 1.3;
}

.blog-date {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 15px;
  font-weight: 500;
  text-align: left !important;
}

.blog-content {
  font-size: 1rem;
  line-height: 1.6;
  color: #002147;
  margin-bottom: 15px;
  text-align: left;
}

.blog-content p {
  margin-bottom: 1em;
}

.blog-content ol,
.blog-content ul {
  margin-bottom: 1em;
  padding-left: 2em;
}

.blog-content li {
  margin-bottom: 0.5em;
}

.blog-content .content-text {
  transition: all 0.3s ease;
}

.blog-content .content-text.preview {
  max-height: 109px;
  overflow: hidden;
  filter: blur(1px);
}

.blog-content .content-text.expanded {
  max-height: none;
  filter: none;
}

.blog-card .btn {
  background-color: #002147;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background-color 0.3s ease;
  display: inline-block;
}

/* .blog-card .btn:hover {
  background-color: #1e3a8a;
  color: white;
} */

.view-all-btn {
  display: block;
  margin: 40px auto;
  width: 200px;
  text-align: center;
}

.loading,
.error {
  text-align: center;
  padding: 40px;
  font-size: 1.1rem;
  color: #666;
}

.error {
  color: #d32f2f;
}

@media (max-width: 768px) {
  .scroll-top {
    right: 14px;
    bottom: 18px;
    width: 40px;
    height: 40px;
  }

  .nav-links ul {
    display: flex;
    flex-direction: column;
    background-color: white;
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    padding: 2rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    height: 100vh;
    transition: right 0.3s ease, padding-top 0.3s ease, opacity 0.3s ease;
    z-index: 999;
    margin: 0;

    pointer-events: auto;
  }

  .nav-links ul li a {
    pointer-events: auto;
    cursor: pointer;
  }

  /* .contact-form button {
    width: auto;
    padding-left: 14px;
    padding-right: 14px;
    font-size: 0.95rem;
    margin: 20px auto 20px;
  } */

  .contact-form button i {
    margin-left: 8px; /* slightly smaller gap on narrow screens */
    font-size: 0.95em;
  }

  .menu-toggle {
    display: flex;
    gap: 15px;
    align-items: center;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1001;
  }

  #menu,
  #close {
    font-size: 1.6rem;
    color: #002147;
    cursor: pointer;
  }

  .nav-links ul.show {
    right: 0;
    padding-top: 20vh;
    opacity: 1;
  }

  /* Closing state: animate the menu off-screen smoothly while keeping layout stable */
  .nav-links ul.closing {
    right: -100%;
    padding-top: 2rem; /* match the default so it transitions smoothly */
    opacity: 0.95;
  }

  #close {
    display: none;
  }

  .hero {
    text-align: center;
  }

  .hero h2 {
    font-size: 2.5rem;
  }

  .hero h3 {
    font-size: 1.5rem;
  }

  .hero p {
    padding: 0 10px;
    font-size: 1rem;
  }

  .skills-section h2 {
    font-size: 2.3rem;
  }

  .skills-section p {
    font-size: 1rem;
  }

  .skills-card h3 {
    font-size: 1.5rem;
  }

  .skills-card p {
    font-size: 1rem;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .projects h2 {
    font-size: 2.3rem;
  }

  .project-info h4 {
    font-size: 1.4rem;
  }

  .project-info p {
    font-size: 1rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .projects.projects-page .projects-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    margin-top: 10px;
  }

  .project-card,
  .project-card-2,
  .project-card-3 {
    flex-direction: column;
    align-items: center;
    max-height: none;
  }

  .project-card img,
  .project-card-2 img,
  .project-card-3 img {
    width: 100%;
    height: auto;
    margin-bottom: 20px;
    border-radius: 8px;
    margin-left: auto;
    margin-right: auto;
  }

  .project-info {
    width: 100%;
    text-align: center;
    padding: 10px 20px;
    box-sizing: border-box;
    padding-left: 20px;
    padding-right: 20px;
  }

  .about-text h2 {
    font-size: 2rem;
  }

  .about-text p {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 20px;
  }

  .project-info p {
    font-size: 1rem;
    margin-bottom: 15px;
    color: #002147;
    line-height: 1.7;
    margin-left: auto;
    margin-right: auto;
  }

  .contact-form {
    margin-top: 20px;
    padding: 0 10px;
  }

  form {
    margin-top: 20px;
  }

  .contact-form h3 {
    font-size: 1.5rem;
    margin-bottom: 30px;
    margin-top: 60px;
  }

  .contact-form p {
    font-size: 1rem;
    margin-left: 5px;
    margin-bottom: 20px;
  }

  .contact-form input,
  .contact-form textarea {
    padding: 10px;
    font-size: 1rem;
  }

  /* .contact-form button {
    width: 150px;
    padding: 12px 20px;
    font-size: 1rem;
  } */

  body,
  html {
    overflow-x: hidden;
  }

  .contact-btn {
    color: #002147;
    border: none;
    padding: 0;
    border-radius: 0;
    transform: none;
  }

  .blog-section,
  .blog-preview {
    padding: 80px 15px;
  }

  .blog-section h2,
  .blog-preview h2 {
    font-size: 2.2rem;
  }

  .blog-section p,
  .blog-preview .subtitle {
    font-size: 1rem;
  }

  .blog-grid,
  .blog-preview-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 10px;
  }

  .blog-card img {
    height: auto;
    width: 100%;
  }

  .blog-info {
    padding: 15px;
  }

  .blog-info h3 {
    font-size: 1.3rem;
  }

  .blog-date {
    font-size: 1rem;
  }

  .blog-content {
    font-size: 1rem;
  }

  .footer-content h3 {
    font-size: 1.5rem;
  }

  .footer-contact-details p {
    font-size: 1rem;
  }

  .footer-copy {
    font-size: 1rem;
  }

  .btn {
    font-size: 1rem;
  }

  .hero a {
    font-size: 1rem;
  }

  nav a {
    font-size: 1rem;
  }
}

/* iPad portrait improvements for projects section */
@media only screen and (min-width: 600px) and (max-width: 768px) and (orientation: portrait) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 700px;
    margin: 20px auto;
    padding: 10px 15px;
  }

  .projects.projects-page .projects-grid {
    max-width: 700px;
    padding: 10px 15px;
  }

  .project-card {
    max-width: 300px;
    min-height: 340px;
    margin: 10px auto;
  }

  /* Fix for text overflow in project-info */
  .project-info {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
  }
}

/* Landscape orientation adjustments for mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .hero h1 {
    font-size: 3rem;
    padding-top: 100px;
  }

  .hero p {
    font-size: 1rem;
  }

  .skills-section h2 {
    font-size: 2rem;
  }

  .projects h2 {
    font-size: 2rem;
    margin-top: 20px;
    margin-bottom: 20px;
  }

  .about-section {
    padding: 40px 20px;
  }

  .about-image img {
    width: 300px;
  }

  .about-text h2 {
    font-size: 2rem;
  }

  .contact-form h3 {
    font-size: 1.5rem;
    margin-top: 30px;
  }

  .footer {
    padding: 20px 20px;
  }

  .footer-content h3 {
    font-size: 1.5rem;
  }
}

/* iPad landscape layout improvements for projects section */
@media only screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    max-width: 1000px;
    margin: 30px auto;
    padding: 10px 20px;
  }

  .projects.projects-page .projects-grid {
    max-width: 1000px;
    padding: 10px 20px;
  }

  .project-card {
    max-width: 320px;
    min-height: 350px;
    margin: 10px auto;
  }
}
