/* ---
Modern Plumbing Website CSS
--- */

/* 1. Global Styles & Variables
-------------------------------------------------- */
:root {
  --primary-color: #c00000;
  --secondary-color: #1a202c;
  --accent-color: #2d3748;
  --background-color: #f7fafc;
  --white: #ffffff;
  --border-color: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --border-radius: 8px;
  --transition: all 0.3s ease-in-out;
  --max-width: 1200px;
  --font-family: "Roboto", sans-serif;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  color: var(--secondary-color);
  background-color: var(--background-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 5rem 0;
}

/* Ensure all headings have explicit font-sizes to prevent browser warnings */
h1 {
  font-size: 2rem; /* Default fallback size */
}

h2 {
  font-size: 1.75rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.1rem;
}

h6 {
  font-size: 1rem;
}

/* Specific rules for headings within sectioning elements to prevent deprecation warnings */
section h1,
article h1,
aside h1,
nav h1 {
  font-size: 2rem;
}

section h2,
article h2,
aside h2,
nav h2 {
  font-size: 1.75rem;
}

section h3,
article h3,
aside h3,
nav h3 {
  font-size: 1.5rem;
}

section h4,
article h4,
aside h4,
nav h4 {
  font-size: 1.25rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  font-size: 1.1rem;
  color: #718096;
  max-width: 600px;
  margin: 0 auto;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 2. Header & Navigation
-------------------------------------------------- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--white);
  z-index: 1000;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
  padding: 0 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  width: 45px;
  height: 45px;
  object-fit: contain;
  border-radius: 50%;
}

.logo-text {
  display: flex;
  flex-direction: column;
  color: var(--primary-color);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
}

.logo-subtitle {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--secondary-color);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--secondary-color);
  font-weight: 500;
  padding: 0.5rem;
  position: relative;
  transition: var(--transition);
}

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

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

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

.nav-cta {
  background: var(--primary-color);
  color: var(--white) !important;
  padding: 10px 20px !important;
  border-radius: var(--border-radius);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.nav-cta:hover {
  background: #a00000;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.nav-cta .material-symbols-outlined {
  font-size: 1.2rem;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.mobile-menu-toggle .material-symbols-outlined {
  font-size: 2rem;
  color: var(--secondary-color);
}

/* 3. Hero Section
-------------------------------------------------- */
#home {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  padding-top: 70px; /* Header height */
  background: linear-gradient(rgba(26, 32, 44, 0.7), rgba(26, 32, 44, 0.7)),
    url("/images/portf 1.webp") no-repeat center center/cover;
  position: relative;
}

.hero-content {
  max-width: 800px;
  animation: fadeIn 1s ease-in-out;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-badge .material-symbols-outlined {
  color: #48bb78; /* Green check */
  font-size: 1.2rem;
}

#home h1 {
  font-size: 3.5rem !important;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

section h1 {
  font-size: 2rem !important;
}

/* Hero section override */
section#home h1 {
  font-size: 3.5rem !important;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  margin-bottom: 2.5rem;
  opacity: 0.9;
  color: var(--white);
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--white);
}

.btn-primary:hover {
  background: #a00000;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.hero-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  max-width: 700px;
  margin: 0 auto;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: var(--border-radius);
}

.feature-item .material-symbols-outlined {
  color: var(--primary-color);
  font-size: 1.5rem;
}

/* 4. About Section
-------------------------------------------------- */
#about {
  background: var(--white);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.about-image img {
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.about-text .section-title,
.about-text .section-subtitle {
  text-align: left;
  margin-left: 0;
  margin-right: 0;
}

.benefits-list {
  list-style: none;
  margin-top: 1.5rem;
}

.benefits-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
}

.benefits-list .material-symbols-outlined {
  color: var(--primary-color);
}

/* 5. Services Section
-------------------------------------------------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.service-card {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--border-radius);
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.service-icon {
  margin-bottom: 1.5rem;
}

.service-icon img {
  width: 64px;
  height: 64px;
  margin: 0 auto;
}

.service-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--secondary-color);
}

.services-cta {
  text-align: center;
  margin-top: 3rem;
  background: var(--accent-color);
  color: var(--white);
  padding: 3rem;
  border-radius: var(--border-radius);
}

.services-cta h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.services-cta p {
  margin-bottom: 2rem;
}

/* 6. Portfolio Section
-------------------------------------------------- */
#portfolio {
  background: var(--white);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.portfolio-item img {
  transition: transform 0.4s ease;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portfolio-item:hover img {
  transform: scale(1.1);
}

.portfolio-item::after {
  content: " View Project";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(192, 0, 0, 0.9);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: scale(0.8);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.portfolio-item:hover::after {
  opacity: 1;
  transform: scale(1);
}

/* Mobile touch support for portfolio */
@media (hover: none) and (pointer: coarse) {
  .portfolio-item::after {
    content: " Tap to View";
    opacity: 0.9;
    background: rgba(192, 0, 0, 0.7);
    transform: scale(1);
    font-size: 0.9rem;
  }

  .portfolio-item:active::after {
    background: rgba(192, 0, 0, 0.95);
  }
}

/* 7. Testimonials Section
-------------------------------------------------- */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.testimonial-card {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary-color);
}

/* Star Rating Styles */
.rating {
  display: inline-block;
  margin-bottom: 1rem;
  pointer-events: none;
}

.rating input {
  display: none;
}

.rating label {
  float: right;
  color: #ccc;
  font-size: 30px;
  transition: color 0.3s;
  cursor: default;
  pointer-events: none;
}

.rating label:before {
  content: "\2605";
}

.rating input:checked ~ label,
.rating input:checked ~ label ~ label {
  color: #ff0f0f;
}

.testimonial-card p {
  font-style: italic;
  margin-bottom: 1rem;
  color: #4a5568;
}

.testimonial-card h3 {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--secondary-color);
}

/* 8. Contact Section
-------------------------------------------------- */
#contact {
  background: var(--accent-color);
  color: var(--white);
}

#contact .section-title,
#contact .section-subtitle {
  color: var(--white);
}

.contact-container {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
  background: var(--secondary-color);
  padding: 3rem;
  border-radius: var(--border-radius);
}

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

.contact-details {
  margin-top: 2rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-item .material-symbols-outlined {
  font-size: 1.8rem;
  color: var(--primary-color);
}

.contact-item a {
  color: var(--white);
  text-decoration: none;
  transition: var(--transition);
}

.contact-item a:hover {
  color: var(--primary-color);
}

.contact-item h4 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  color: var(--white);
}

.contact-form .form-group {
  margin-bottom: 1.5rem;
}

.contact-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #4a5568;
  border-radius: var(--border-radius);
  background: #2d3748;
  color: var(--white);
  font-family: var(--font-family);
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(192, 0, 0, 0.5);
}

.form-note {
  font-size: 0.9rem;
  margin-top: 1rem;
  color: #a0aec0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-feedback {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: var(--border-radius);
  display: none;
}

.form-feedback.success {
  background: #2f855a;
  color: var(--white);
}

.form-feedback.error {
  background: #c53030;
  color: var(--white);
}

/* 9. Footer
-------------------------------------------------- */
footer {
  background: var(--secondary-color);
  color: #a0aec0;
  padding: 4rem 0 2rem 0;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.footer-content h4 {
  color: var(--white);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.footer-content p,
.footer-content li {
  margin-bottom: 0.5rem;
}

.footer-content ul {
  list-style: none;
}

.footer-content a {
  color: #a0aec0;
  text-decoration: none;
  transition: var(--transition);
}

.footer-content a:hover {
  color: var(--primary-color);
}

.footer-contact ul li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #4a5568;
}

/* 10. Modal (for Portfolio)
-------------------------------------------------- */
.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  animation: zoomIn 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-image {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--border-radius);
  transition: opacity 0.3s ease;
  display: block;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 20px;
  color: #fff;
  font-size: 2.5rem;
  font-weight: bold;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1002;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

.modal-prev,
.modal-next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 2rem;
  padding: 1rem;
  user-select: none;
  transition: 0.2s ease;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1002;
}

.modal-prev:hover,
.modal-next:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.modal-prev {
  left: 20px;
}

.modal-next {
  right: 20px;
}

.modal-caption {
  text-align: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  padding: 15px 20px;
  margin-top: 10px;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 500;
  max-width: 100%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Mobile modal improvements */
@media (max-width: 768px) {
  .modal-image {
    max-height: 70vh;
    width: 100%;
    object-fit: contain;
  }

  .modal-close {
    top: 20px;
    right: 20px;
    font-size: 2rem;
    width: 40px;
    height: 40px;
  }

  .modal-prev,
  .modal-next {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    padding: 0.5rem;
  }

  .modal-prev {
    left: 10px;
  }

  .modal-next {
    right: 10px;
  }

  .modal-caption {
    padding: 12px 15px;
    font-size: 0.9rem;
    margin-top: 8px;
  }
}

/* Very small mobile screens */
@media (max-width: 480px) {
  .modal-content {
    max-width: 95%;
    margin: 20px auto;
  }

  .modal-image {
    max-height: 60vh;
  }

  .modal-prev,
  .modal-next {
    width: 35px;
    height: 35px;
    font-size: 1.2rem;
  }

  .modal-caption {
    padding: 10px 12px;
    font-size: 0.8rem;
    margin-top: 6px;
  }
}

/* 11. Responsive Styles
-------------------------------------------------- */

/* Large tablets and small laptops */
@media (max-width: 1024px) {
  .container {
    padding: 0 1rem;
  }

  nav {
    padding: 0 1rem;
  }

  .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

/* Tablets */
@media (max-width: 992px) {
  .about-content,
  .contact-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-features {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
  }

  .portfolio-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .testimonials-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

/* Mobile landscape and small tablets */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  /* Navigation improvements */
  .material-symbols-outlined {
    font-size: 1.4rem !important;
    line-height: 1;
    vertical-align: middle;
    display: inline-block;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  .nav-links {
    position: fixed;
    top: 70px;
    right: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: var(--white);
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 2rem;
    gap: 1.5rem;
    transition: right 0.3s ease-in-out;
    box-shadow: var(--shadow);
    z-index: 999;
    overflow-y: auto;
  }

  .nav-links.active {
    right: 0;
  }

  .nav-links a {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    text-align: left;
  }

  .nav-cta {
    margin: 1rem 2rem;
    width: calc(100% - 4rem);
    justify-content: center;
    padding: 1rem 2rem !important;
    font-size: 1.1rem !important;
  }

  .mobile-menu-toggle {
    display: block;
  }

  /* Hero section improvements */
  #home {
    padding-top: 70px;
    min-height: 90vh;
  }

  #home h1 {
    font-size: 2.2rem;
    line-height: 1.3;
  }

  .hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: 2rem;
  }

  .hero-badge {
    font-size: 0.85rem;
    padding: 8px 16px;
    margin-bottom: 1rem;
  }

  .hero-features {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 2rem;
  }

  .feature-item {
    padding: 0.75rem;
    font-size: 0.9rem;
  }

  /* Section spacing improvements */
  section {
    padding: 3rem 0;
  }

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

  .section-subtitle {
    font-size: 1rem;
  }

  /* Services improvements */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .service-card {
    padding: 1.5rem;
  }

  .services-cta {
    padding: 2rem 1.5rem;
  }

  .services-cta h3 {
    font-size: 1.5rem;
  }

  /* About section improvements */
  .about-content {
    gap: 2rem;
  }

  .about-image {
    order: -1;
  }

  /* Portfolio improvements */
  .portfolio-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
  }

  /* Contact improvements */
  .contact-container {
    padding: 1.5rem;
    gap: 2rem;
  }

  .contact-info {
    order: 2;
  }

  .contact-form {
    order: 1;
  }

  /* Modal improvements */
  .modal-content {
    max-width: 95%;
  }

  .modal-nav {
    font-size: 2rem;
  }

  .modal-prev {
    left: -40px;
  }

  .modal-next {
    right: -40px;
  }
}

/* Mobile portrait */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .container {
    padding: 0 0.75rem;
  }

  /* Navigation */
  .material-symbols-outlined {
    font-size: 1.2rem !important;
    line-height: 1;
    vertical-align: middle;
    display: inline-block;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  nav {
    height: 60px;
    padding: 0 0.75rem;
  }

  .logo-text {
    font-size: 1.1rem;
  }

  .logo-subtitle {
    font-size: 0.65rem;
  }

  .nav-links {
    top: 60px;
    height: calc(100vh - 60px);
  }

  /* Hero section */
  #home {
    padding-top: 60px;
    min-height: 85vh;
  }

  #home h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
  }

  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }

  .btn {
    padding: 12px 24px;
    font-size: 0.95rem;
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .hero-badge {
    margin-top: 10px;
    font-size: 0.8rem;
    padding: 6px 12px;
  }

  /* Section spacing */
  section {
    padding: 2.5rem 0;
  }

  .section-header {
    margin-bottom: 2rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .section-subtitle {
    font-size: 0.95rem;
  }

  /* Services */
  .service-card {
    padding: 1.25rem;
  }

  .service-card h3 {
    font-size: 1.1rem;
  }

  .services-cta {
    padding: 1.5rem 1rem;
  }

  .services-cta h3 {
    font-size: 1.3rem;
  }

  /* Portfolio */
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Testimonials */
  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .testimonial-card {
    padding: 1.25rem;
  }

  /* Contact */
  .contact-container {
    padding: 1rem;
  }

  .contact-item {
    font-size: 0.9rem;
  }

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

  .contact-form .btn {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    display: block;
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.5rem;
  }

  .footer-contact ul {
    justify-content: center;
  }

  footer {
    padding: 3rem 0 1.5rem 0;
  }

  /* Modal */
  .modal-content {
    max-width: 98%;
    max-height: 85vh;
  }

  .modal-close {
    top: -30px;
    right: -10px;
    font-size: 2rem;
  }

  .modal-nav {
    display: none; /* Hide navigation arrows on very small screens */
  }
}

/* Extra small devices */
@media (max-width: 320px) {
  .container {
    padding: 0 0.5rem;
  }

  nav {
    padding: 0 0.5rem;
  }

  #home h1 {
    font-size: 1.6rem;
  }

  .hero-subtitle {
    font-size: 0.9rem;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .service-card,
  .testimonial-card {
    padding: 1rem;
  }
}

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

@keyframes zoomIn {
  from {
    transform: scale(0.8);
  }
  to {
    transform: scale(1);
  }
}

.fade-in-element {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-element.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Utility reveal animations (scroll/load-in) */
:root {
  --reveal-duration: 2000ms;
  --reveal-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* base hidden state */
.reveal,
.reveal-up,
.reveal-down,
.reveal-left,
.reveal-right,
.reveal-zoom,
.reveal-fade {
  opacity: 0;
  will-change: transform, opacity;
  transition: transform var(--reveal-duration) var(--reveal-ease), opacity var(--reveal-duration) var(--reveal-ease);
}

/* initial offsets */
.reveal-up { transform: translateY(24px); }
.reveal-down { transform: translateY(-24px); }
.reveal-left { transform: translateX(-24px); }
.reveal-right { transform: translateX(24px); }
.reveal-zoom { transform: scale(0.96); }
.reveal-fade,
.reveal { transform: none; }

/* visible state (supports either .visible or .is-visible) */
.visible,
.is-visible {
  opacity: 1 !important;
  transform: none !important;
}

/* stagger helper: apply on container, JS sets delays, but provide sensible default */
[data-stagger] > * {
  transition-delay: 0ms;
}

/* Reduced motion: disable transform animations and shorten transitions */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-up,
  .reveal-down,
  .reveal-left,
  .reveal-right,
  .reveal-zoom,
  .reveal-fade,
  .fade-in-element {
    transition: opacity 150ms ease-out;
    transform: none !important;
  }
}

/* 13. Hover & Focus Interactions
-------------------------------------------------- */
/* Only apply rich hover effects on devices that support hover */
@media (hover: hover) and (pointer: fine) {
  /* Buttons: subtle lift + glow */
  .btn {
    transition: transform 220ms var(--reveal-ease, ease), box-shadow 220ms var(--reveal-ease, ease), background-color 220ms ease, color 220ms ease;
  }

  .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12), 0 10px 24px rgba(192, 0, 0, 0.20);
  }

  .btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
  }

  /* Nav links: smoother underline and color */
  .nav-links a::after {
    height: 2px;
    transition: width 240ms var(--reveal-ease, ease), background-color 240ms ease;
  }

  /* Service cards: stronger lift + icon motion */
  .service-card {
    transition: transform 260ms var(--reveal-ease, ease), box-shadow 260ms var(--reveal-ease, ease);
  }

  .service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 14px 28px -8px rgba(0, 0, 0, 0.22), 0 10px 12px -8px rgba(0, 0, 0, 0.12);
  }

  .service-icon img {
    transition: transform 300ms var(--reveal-ease, ease);
  }

  .service-card:hover .service-icon img {
    transform: scale(1.08) rotate(1deg);
  }

  /* Portfolio: slight tilt + existing zoom/overlay */
  .portfolio-item {
    transition: transform 320ms var(--reveal-ease, ease), box-shadow 320ms var(--reveal-ease, ease);
  }

  .portfolio-item:hover {
    transform: translateY(-4px) rotateZ(0.3deg);
    box-shadow: 0 18px 35px -12px rgba(0, 0, 0, 0.35);
  }

  /* Testimonials: lift */
  .testimonial-card {
    transition: transform 260ms var(--reveal-ease, ease), box-shadow 260ms var(--reveal-ease, ease);
  }

  .testimonial-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 28px -10px rgba(0, 0, 0, 0.22), 0 10px 12px -8px rgba(0, 0, 0, 0.12);
  }

  /* Contact items: nudge and icon emphasis */
  .contact-item {
    transition: transform 220ms var(--reveal-ease, ease);
  }

  .contact-item:hover {
    transform: translateX(4px);
  }

  .contact-item .material-symbols-outlined {
    transition: color 220ms ease, transform 220ms var(--reveal-ease, ease);
  }

  .contact-item:hover .material-symbols-outlined {
    color: #ff4040; /* lighter variant of primary */
    transform: scale(1.05);
  }
}

/* Focus rings for keyboard navigation */
.btn:focus-visible,
.nav-links a:focus-visible,
.footer-content a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(192, 0, 0, 0.35);
  border-radius: 6px;
}

/* Final override to fix h1 deprecation warning - place at end of file */
* h1 {
  font-size: 2rem !important;
}

section * h1,
article * h1,
aside * h1,
nav * h1 {
  font-size: 2rem !important;
}

#home h1,
section#home h1,
main section#home h1 {
  font-size: 3.5rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  margin-bottom: 1.5rem !important;
}
