* {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  box-sizing: border-box;
}

/* Screen reader only class for accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Skip link for keyboard navigation */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #667eea;
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 10000;
  font-weight: 600;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid #fff;
  outline-offset: 2px;
}

html {
  height: 100%;
  min-height: 100vh;
}

body {
  margin: 0;
  border: 0;
  padding: 0;
  background: #764ba2; /* Fallback solid color */
  min-height: 100vh;
  scroll-padding-top: 80px; /* Account for sticky header */
  overscroll-behavior: none; /* Prevent over-scroll */
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  z-index: -1;
}

main {
  margin: auto;
  width: 90%;
  max-width: 1200px;
  padding: 20px;
  padding-bottom: 40px; /* Ensure padding at bottom */
}

main > h1 {
  text-align: center;
  font-size: 3.5em;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  margin-bottom: 30px;
  animation: fadeInDown 1s ease-in;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
}

header {
  background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #8e44ad 100%);
  backdrop-filter: blur(20px);
  padding: 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 3px solid rgba(255, 255, 255, 0.3);
}

/* Navbar Container */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  position: relative;
}

/* Brand/Logo */
.navbar-brand h1 {
  color: #fff;
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Hamburger Button */
.hamburger {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
  transition: transform 0.3s ease;
}

.hamburger-line {
  width: 25px;
  height: 3px;
  background-color: #fff;
  margin: 3px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Hamburger Animation */
.hamburger.active {
  transform: rotate(180deg);
}

.hamburger.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

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

.hamburger.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Desktop Menu */
nav .menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 25px;
}

nav .menu li {
  margin: 0;
  position: relative;
}

nav .menu a {
  text-decoration: none;
  color: #fff;
  padding: 14px 24px;
  display: block;
  font-weight: 700;
  font-size: 0.95em;
  letter-spacing: 1px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  text-transform: uppercase;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
  border-radius: 20px;
}

nav .menu a::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.25);
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 20px;
}

nav .menu a::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

nav .menu a:hover {
  color: #fff;
  transform: translateY(-2px);
}

nav .menu a:hover::before {
  height: 100%;
}

nav .menu a:hover::after {
  transform: translate(-50%, -50%) scale(1);
}

nav .menu a:focus {
  outline: 3px solid #fff;
  outline-offset: 2px;
  background: rgba(255, 255, 255, 0.25);
}

/* Better focus-visible support for keyboard navigation */
nav .menu a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
}

nav .menu a:active {
  transform: translateY(0);
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .hamburger,
  .hamburger-line,
  nav .menu,
  nav .menu li,
  nav .menu a::before,
  nav .menu a::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Improved focus styles for hamburger button */
.hamburger:focus {
  outline: 3px solid #fff;
  outline-offset: 4px;
  border-radius: 4px;
}

.hamburger:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.3);
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  .navbar {
    padding: 1rem;
  }
  
  .navbar-brand h1 {
    font-size: 1.5rem;
  }
  
  .hamburger {
    display: flex;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1002;
  }
  
  nav .menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: right 0.3s ease-in-out;
    backdrop-filter: blur(20px);
    box-shadow: -5px 0 20px rgba(0,0,0,0.3);
    border-radius: 0;
    z-index: 1000;
  }
  
  nav .menu.active {
    right: 0;
  }
  
  nav .menu li {
    margin: 10px 0;
    opacity: 0;
    transform: translateX(50px);
    animation: slideInRight 0.3s ease forwards;
  }
  
  nav .menu.active li {
    animation-delay: calc(0.1s * var(--i, 0));
  }
  
  nav .menu a {
    padding: 20px 40px;
    font-size: 1.1rem;
    text-align: right;
    width: 100%;
    border-radius: 0;
    background: transparent;
    margin: 5px 0;
  }
  
  nav .menu a:hover,
  nav .menu a:focus {
    background: transparent;
    transform: translateX(-10px);
  }
}

@media (max-width: 480px) {
  nav .menu {
    width: 100%;
    right: -100%;
  }
  
  .navbar-brand h1 {
    font-size: 1.3rem;
  }
  
  nav .menu a {
    padding: 18px 30px;
    font-size: 1rem;
  }
}

/* Animation for mobile menu items */
@keyframes slideInRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* General styles for all sections */
section {
  padding: 30px;
  margin: 25px 0;
  border-radius: 20px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeIn 0.8s ease-in;
  scroll-margin-top: 100px; /* Account for sticky header */
}

section:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

/* Specific styles for each section with vibrant gradients */
#home {
  background: linear-gradient(135deg, #e0e7ff 0%, #e9d5ff 100%);
  border-left: 5px solid #667eea;
}

#about {
  background: linear-gradient(135deg, #ddd6fe 0%, #e9d5ff 100%);
  border-left: 5px solid #8b5cf6;
}

#services {
  background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
  border-left: 5px solid #7c3aed;
}

#service1 {
  background: linear-gradient(135deg, #e9d5ff 0%, #f3e8ff 100%);
  border-left: 5px solid #a855f7;
}

#service2 {
  background: linear-gradient(135deg, #ddd6fe 0%, #e9d5ff 100%);
  border-left: 5px solid #667eea;
  color: #1a1a1a;
}

#service2 h2, #service2 p, #service2 ul, #service2 li, #service2 strong, #service2 em {
  color: #1a1a1a;
}

#service3 {
  background: linear-gradient(135deg, #e0e7ff 0%, #f5f3ff 100%);
  border-left: 5px solid #6366f1;
}

#contact {
  background: linear-gradient(135deg, #e9d5ff 0%, #f3e8ff 100%);
  border-left: 5px solid #8b5cf6;
}

/* Additional styles for headings and paragraphs */
section h1, section h2 {
  font-size: 2.5em;
  margin-bottom: 15px;
  color: #1a1a1a;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.3);
}

section h2 {
  font-size: 2em;
}

section p {
  font-size: 1.1em;
  line-height: 1.8;
  color: #2d3436;
}

section ul {
  color: #2d3436;
}

section strong {
  color: #1a1a1a;
}

/* Form styling */
form {
  margin-top: 20px;
}

label {
  font-weight: 600;
  color: #1a1a1a;
  font-size: 1.1em;
}

textarea, input[type="text"], input[type="email"] {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  margin-bottom: 20px;
  border: 2px solid #636e72;
  border-radius: 10px;
  font-size: 1em;
  transition: border-color 0.3s ease;
  color: #1a1a1a;
  background: #fff;
}

textarea::placeholder, input[type="text"]::placeholder, input[type="email"]::placeholder {
  color: #636e72;
}

textarea:focus, input[type="text"]:focus, input[type="email"]:focus {
  outline: 3px solid #0984e3;
  outline-offset: 2px;
  border-color: #0984e3;
  box-shadow: 0 0 10px rgba(9,132,227,0.3);
}

/* Error states for form validation */
textarea:invalid:not(:placeholder-shown),
input[type="text"]:invalid:not(:placeholder-shown),
input[type="email"]:invalid:not(:placeholder-shown) {
  border-color: #d63031;
}

textarea:invalid:focus:not(:placeholder-shown),
input[type="text"]:invalid:focus:not(:placeholder-shown),
input[type="email"]:invalid:focus:not(:placeholder-shown) {
  outline-color: #d63031;
  box-shadow: 0 0 10px rgba(214, 48, 49, 0.3);
}

/* Required field indicator */
label span[aria-label="required"] {
  color: #d63031;
  font-weight: 700;
}

.form-note {
  font-size: 0.9em;
  color: #636e72;
  margin-top: 10px;
}

input[type="submit"], button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 14px 30px;
  border: none;
  border-radius: 25px;
  font-size: 1.1em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

input[type="submit"]:focus,
button:focus {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

input[type="submit"]:focus-visible,
button:focus-visible {
  outline: 3px solid #2d3436;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(102, 126, 234, 0.3);
}

input[type="submit"]:hover:not(:disabled), 
button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(118,75,162,0.4);
}

/* Links */
a {
  color: #0056b3;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

a:focus {
  outline: 3px solid #0056b3;
  outline-offset: 2px;
  border-radius: 2px;
}

a:focus-visible {
  outline: 3px solid #0056b3;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(0, 86, 179, 0.2);
}

a:hover {
  color: #003d82;
  text-decoration: underline;
}

a:focus {
  outline: 2px solid #0056b3;
  outline-offset: 2px;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Additional responsive styles for content */
@media (max-width: 768px) {
  main {
    width: 95%;
    padding: 10px;
  }
  
  main > h1 {
    font-size: 2.5em;
  }
  
  section h1, section h2 {
    font-size: 1.8em;
  }
}