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

/* Prevent horizontal scroll on small devices */
html, body {
  overflow-x: hidden;
}

/* Root colors for easy theme management */
:root {
  --color-bg: #121212;
  --color-bg-light: #1e1e1e;
  --color-primary: #ff5722;
  --color-primary-hover: #e64a19;
  --color-text-light: #e0e0e0;
  --color-text-muted: #bbbbbb;
  --color-shadow: rgba(0, 0, 0, 0.7);
}

/* Body */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  font-size: 16px;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--color-bg-light);
  box-shadow: 0 2px 10px var(--color-shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 1px;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.3s ease;
}

.logo:hover {
  opacity: 0.8;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
  padding: 0 1rem; /* Added padding for better spacing on small screens */
}

.nav-links li {
  margin-bottom: 0;
}

.nav-links li a {
  color: var(--color-text-light);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 0.3rem 0;
  position: relative;
  transition: color 0.3s ease;
}

.nav-links li a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  left: 0;
  bottom: -4px;
  transition: width 0.3s ease;
}

.nav-links li a:hover,
.nav-links li a:focus {
  color: var(--color-primary);
}

.nav-links li a:hover::after,
.nav-links li a:focus::after {
  width: 100%;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 10px; /* Increased padding for easier tap on mobile */
  user-select: none;
  transition: transform 0.3s ease;
}

.hamburger span {
  width: 28px;
  height: 3px;
  background-color: var(--color-text-light);
  border-radius: 2px;
  transition: all 0.4s ease;
}

/* Hamburger active animation */
.hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

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

.hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile menu */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    background-color: var(--color-bg-light);
    position: fixed;
    top: 60px;
    right: 0;
    width: 250px;
    height: calc(100% - 60px);
    padding: 2rem 1.5rem;
    box-shadow: -5px 0 15px var(--color-shadow);
    border-left: 1px solid #333;
    overflow-y: auto;
    overscroll-behavior: contain; /* Prevent scroll chaining */
    z-index: 999;
    transition: transform 0.3s ease;
    transform: translateX(100%);
  }

  .nav-links.active {
    display: flex;
    transform: translateX(0);
  }

  .nav-links li {
    margin-bottom: 1.5rem; /* More spacing between items on mobile */
  }

  .nav-links li:last-child {
    margin-bottom: 0;
  }
}

/* Hero */
.hero {
  padding: 4rem 2rem;
  background: linear-gradient(135deg, #ff5722, #e64a19);
  color: white;
  text-align: center;
  clip-path: polygon(0 0, 100% 0, 100% 95%, 0% 100%);
  box-shadow: 0 8px 30px rgba(230, 74, 25, 0.5);
}

.hero-content {
  max-width: 900px;
  margin: auto;
  padding: 0 1rem; /* Added horizontal padding */
}

.hero-text h1 {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 1rem;
  letter-spacing: 1.2px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hero-text p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  font-weight: 500;
  text-shadow: 0 1px 5px rgba(0,0,0,0.25);
}

.hero-btn {
  background-color: var(--color-bg);
  color: var(--color-primary);
  font-weight: 700;
  padding: 1rem 2rem;
  border-radius: 40px;
  text-transform: uppercase;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
  display: inline-block;
  text-decoration: none;
  user-select: none;
}

.hero-btn:hover,
.hero-btn:focus {
  background-color: var(--color-primary);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(230, 74, 25, 0.5);
  outline: none;
}

/* Responsive hero text */
@media (max-width: 768px) {
  .hero-text h1 {
    font-size: 2.2rem;
  }

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

@media (max-width: 480px) {
  .hero {
    padding: 2rem 1rem;
  }
  
  .hero-text h1 {
    font-size: 1.8rem;
  }

  .hero-text p {
    font-size: 0.95rem;
  }
  
  /* Grid box tweak for very small screens */
  .grid-boxes {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
  
  body {
    font-size: 14px;
    line-height: 1.5;
  }

  .footer {
    font-size: 0.85rem;
  }
}

/* Footer */
.footer {
  background-color: var(--color-bg-light);
  color: var(--color-text-muted);
  padding: 3rem 2rem 2rem;
  font-size: 0.95rem;
  box-shadow: inset 0 1px 0 #333;
}

.footer-content {
  max-width: 1100px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-section {
  flex: 1;
  min-width: 250px;
}

.footer-section h3 {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
  border-bottom: 3px solid var(--color-primary);
  padding-bottom: 0.3rem;
}

.footer-section p,
.footer-section ul,
.footer-section a {
  color: var(--color-text-muted);
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
}

.footer-section ul li a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
}

.footer-section ul li a:hover,
.footer-section ul li a:focus {
  color: var(--color-primary);
  text-decoration: underline;
}

.social-icons a {
  margin-right: 15px;
  display: inline-block;
  transition: transform 0.3s ease;
}

.social-icons img {
  width: 28px;
  height: 28px;
  filter: brightness(80%);
  transition: filter 0.3s ease, transform 0.3s ease;
}

.social-icons a:hover img,
.social-icons a:focus img {
  filter: brightness(120%);
  transform: scale(1.3);
}

/* Footer bottom */
.footer-bottom {
  border-top: 1px solid #333;
  margin-top: 2rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  padding-top: 1rem;
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-width: 500px;
  margin-top: 1rem;
}

.contact-form input,
.contact-form textarea {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: none;
  font-size: 1rem;
  resize: vertical;
  box-shadow: 0 0 5px rgba(255, 87, 34, 0.5);
  background-color: var(--color-bg);
  color: var(--color-text-light);
  transition: box-shadow 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  box-shadow: 0 0 8px var(--color-primary);
}

.contact-form button {
  background-color: var(--color-primary);
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  border-radius: 50px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.contact-form button:hover,
.contact-form button:focus {
  background-color: var(--color-primary-hover);
  transform: scale(1.05);
  outline: none;
}

/* Grid boxes */
.grid-boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.8rem;
  margin: 2rem 0;
}

.box {
  background-color: var(--color-bg-light);
  padding: 1.8rem 1.5rem;
  border-radius: 15px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
  text-align: center;
  color: var(--color-text-light);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: default;
}

.box:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 25px rgba(255, 87, 34, 0.6);
}

.box span {
  font-size: 2.7rem;
  margin-bottom: 0.7rem;
  display: block;
  color: var(--color-primary);
}

.box strong {
  font-size: 1.2rem;
  margin-bottom: 0.7rem;
  display: block;
  font-weight: 700;
}

.box p {
  font-size: 1rem;
  color: var(--color-text-muted);
}

/* Scroll to top button */
#topBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1001;
  font-size: 1.7rem;
  border: none;
  outline: none;
  background-color: var(--color-bg-light);
  color: var(--color-primary);
  cursor: pointer;
  padding: 0.8rem 1.2rem;
  border-radius: 50%;
  box-shadow: 0 6px 15px rgba(255, 87, 34, 0.5);
  display: none;
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  user-select: none;
}

#topBtn:hover {
  background-color: var(--color-primary);
  color: white;
  transform: scale(1.15);
  box-shadow: 0 10px 25px rgba(255, 87, 34, 0.8);
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    align-items: center;
  }
}
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
  }

  .nav-links.active {
    display: flex;
  }
}
@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    background-color: var(--color-bg-light);
    position: fixed;
    top: 60px;
    right: 0;
    width: 250px;
    height: calc(100% - 60px);
    padding: 2rem 1.5rem;
    box-shadow: -5px 0 15px var(--color-shadow);
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }

  .nav-links.active {
    display: flex;
    transform: translateX(0);
  }
}
.nav-links {
  transition: transform 0.3s ease-in-out;
}
:root {
  --color-bg: #121212;
  --color-bg-light: #1e1e1e;
  --color-primary: #ff5722;
  --color-primary-hover: #e64a19;
  --color-text-light: #e0e0e0;
  --color-text-muted: #bbbbbb;
  --color-shadow: rgba(0, 0, 0, 0.7);
}

body.light {
  --color-bg: #f9f9f9;
  --color-bg-light: #ffffff;
  --color-primary: #ff5722;
  --color-primary-hover: #e64a19;
  --color-text-light: #111;
  --color-text-muted: #555;
  --color-shadow: rgba(0, 0, 0, 0.1);
}

/* Theme toggle button */
#themeToggle {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--color-primary);
  cursor: pointer;
  margin-left: 1rem;
  transition: transform 0.5s ease;
}

#themeToggle:hover {
  transform: scale(1.2);
}

