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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  color: #f5f7fa;
  background-color: #0b1727;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* Container helper */
.container {
  width: 90%;
  max-width: 1140px;
  margin: 0 auto;
}

/* Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999;
  background: rgba(2, 9, 28, 0.9);
  backdrop-filter: blur(6px);
  transition: background 0.3s ease;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Increase vertical padding further to accommodate an even larger logo */
  padding: 1.2rem 0;
}

.logo img {
  /* Further enlarge the navigation logo for greater prominence */
  height: 200px;
  width: auto;
}

/*
 * New logo styling
 * The logo now consists of an icon (a bordered square containing "S") and text.
 * We override the previous image sizing by defining layout for the new elements.
 */
/* Remove default spacing for the anchor wrapper */
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #f5f7fa;
}

/* Icon container: a square with rounded corners and a border */
.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border: 2px solid #f5f7fa;
  border-radius: 12px;
  font-size: 2rem;
  font-weight: 600;
  color: #f5f7fa;
  line-height: 1;
}

/* Text part of the logo */
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  font-size: 1.4rem;
}

.logo-subtext {
  font-size: 0.7rem;
  letter-spacing: 2px;
  font-weight: 400;
  color: #c0d8ff;
}

nav ul {
  display: flex;
  gap: 1.5rem;
}

nav a {
  font-weight: 500;
  color: #f5f7fa;
  transition: color 0.2s ease;
}

nav a:hover {
  color: #5aa0f0;
}

/* Hero Section */
.hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #ffffff;
  background-image: url('images/hero-bg.png');
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Slightly lighter overlay to allow dynamic particles to show through */
  background: rgba(4, 11, 35, 0.65);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 1rem;
}

/* Large logo overlay in hero */
.hero-logo {
  /* The hero logo is hidden since the navigation logo has been enlarged */
  display: none;
}

.hero-logo img {
  display: none;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 2px;
}

.hero h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-top: 0.5rem;
  color: #c0d8ff;
}

.subtitle {
  margin-top: 1rem;
  margin-bottom: 2rem;
  font-size: 1rem;
  color: #a9bcd7;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  background: #5aa0f0;
  color: #fff;
  font-weight: 600;
  border-radius: 30px;
  transition: background 0.3s ease;
}

.btn:hover {
  background: #4784c7;
}

/* Features Section */
.features {
  background: linear-gradient(180deg, #0b152e 0%, #0a1940 100%);
  padding: 6rem 0 4rem 0;
  text-align: center;
}

.features-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}

.feature-item {
  flex: 1 1 280px;
  max-width: 320px;
  padding: 2rem 1.5rem;
  border-radius: 12px;
  background: rgba(4, 15, 42, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(90, 160, 240, 0.2);
  transition: transform 0.3s ease;
}

.feature-item:hover {
  transform: translateY(-5px);
}

.feature-item i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #5aa0f0;
}

.feature-item h3 {
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
}

.feature-item p {
  font-size: 0.9rem;
  color: #a9bcd7;
}

/* About Section */
.about {
  background: linear-gradient(180deg, #0a1940 0%, #0b152e 100%);
  padding: 6rem 0;
}

.about-container {
  display: flex;
  flex-wrap: wrap;
  /* Stretch items so text and images end at the same baseline */
  align-items: stretch;
  gap: 3rem;
}

/* Image column for About section containing two stacked images */
.about-images {
  /* Slightly narrower column for the two images */
  flex: 1 1 35%;
  min-width: 240px;
  /* Stack the two images vertically so the column height can stretch to match the text */
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.about-images img {
  /* When a single image is present, let it flex to fill the entire column height */
  flex: 1 1 auto;
  width: 100%;
  /* The height will be dictated by the flex container so the image extends to match the text */
  height: auto;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.about-content {
  flex: 1;
  min-width: 300px;
}

.section-label {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  background: rgba(90, 160, 240, 0.2);
  color: #5aa0f0;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.about h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.about p {
  font-size: 0.95rem;
  color: #c5d2e3;
  margin-bottom: 1rem;
}

.about-highlight {
  display: flex;
  align-items: center;
  margin-top: 1.5rem;
}

.highlight-number {
  font-size: 3rem;
  font-weight: 700;
  color: #5aa0f0;
  margin-right: 0.5rem;
}

.highlight-text {
  font-size: 1.2rem;
  color: #c5d2e3;
}

/* Portfolio Section */
.portfolio {
  background: linear-gradient(180deg, #0b152e 0%, #0a1940 100%);
  padding: 6rem 0;
  text-align: center;
}

.portfolio .section-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.portfolio-note {
  max-width: 700px;
  margin: 0 auto 2rem auto;
  font-size: 0.95rem;
  color: #a9bcd7;
}

.portfolio-grid {
  display: grid;
  /* Use four equal columns for the portfolio items and center them */
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  justify-items: stretch;
}

.portfolio-item {
  background: rgba(4, 15, 42, 0.6);
  border: 1px dashed rgba(90, 160, 240, 0.4);
  border-radius: 8px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5aa0f0;
  font-weight: 600;
  text-align: center;
  transition: background 0.3s ease;

  /* Allow items to fill the available grid cell so labels align consistently */
  width: 100%;
}

.portfolio-item:hover {
  background: rgba(90, 160, 240, 0.1);
}

/* Contact Section */
.contact {
  position: relative;
  background-image: url('images/hero-bg.png');
  background-size: cover;
  background-position: center;
  padding: 6rem 0;
  color: #f5f7fa;
}

.contact-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 11, 35, 0.85);
  z-index: 1;
}

.contact-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 3rem;
  align-items: flex-start;
}

.contact-info {
  flex: 1;
  min-width: 280px;
}

.contact-info h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.contact-info p {
  font-size: 0.95rem;
  color: #c5d2e3;
  margin-bottom: 0.8rem;
}

.contact-form {
  flex: 1;
  min-width: 300px;
  background: rgba(4, 15, 42, 0.8);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.contact-form h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(90, 160, 240, 0.3);
  border-radius: 6px;
  background: rgba(5, 20, 52, 0.6);
  color: #f5f7fa;
  font-size: 0.95rem;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #7c91b2;
}

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

.contact-form button {
  width: 100%;
  padding: 0.8rem;
  background: #5aa0f0;
  border: none;
  border-radius: 30px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s ease;
}

.contact-form button:hover {
  background: #4784c7;
}

/* Footer */
.footer {
  background: #02091c;
  color: #7c91b2;
  padding: 2rem 0;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.footer-brand img {
  height: 35px;
  margin-bottom: 0.5rem;
}

.footer-brand p {
  max-width: 300px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  font-size: 0.9rem;
  color: #7c91b2;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #5aa0f0;
}

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #5aa0f0;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1.2rem;
  z-index: 999;
  transition: background 0.3s ease;
}

.back-to-top:hover {
  background: #4784c7;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.2rem;
  }
  .hero h2 {
    font-size: 1.3rem;
  }
  .nav-container nav ul {
    gap: 1rem;
  }
  .about-container {
    flex-direction: column;
  }
  .features-container {
    flex-direction: column;
    align-items: center;
  }
  .contact-container {
    flex-direction: column;
  }
}

/* Additional responsive tweaks for improved mobile support */
@media (max-width: 992px) {
  /* Scale down logo for medium viewports */
  .logo-icon {
    width: 50px;
    height: 50px;
    font-size: 1.6rem;
  }
  .logo-text {
    font-size: 1.2rem;
  }
  .logo-subtext {
    font-size: 0.6rem;
  }
}

@media (max-width: 768px) {
  /* Reduce navigation padding on smaller screens */
  .nav-container {
    padding: 0.8rem 0;
  }
  /* Further scale down logo for tablet widths */
  .logo-icon {
    width: 42px;
    height: 42px;
    font-size: 1.4rem;
  }
  .logo-text {
    font-size: 1rem;
  }
  .logo-subtext {
    font-size: 0.5rem;
  }
  /* Display portfolio items in two columns on smaller screens */
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  /* On very small screens stack the logo above the navigation links */
  .nav-container {
    flex-direction: column;
    align-items: center;
  }
  /* Wrap navigation links and center align for very small screens */
  nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 0.5rem;
  }
  /* Give the logo more prominence on phones */
  .logo-icon {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }
  .logo-text {
    font-size: 1.1rem;
  }
  .logo-subtext {
    font-size: 0.55rem;
  }
  /* Single column portfolio grid on phones */
  .portfolio-grid {
    grid-template-columns: 1fr;
  }
}