/* General Reset and Body */
* { margin: 0; padding: 0; box-sizing: border-box; }
body, html { font-family: 'Open Sans', sans-serif; color: #1e293b; line-height: 1.6; scroll-behavior: smooth; background-color: #f9fafb; overflow-x: hidden; }
.container { width: 90%; max-width: 1200px; margin: 0 auto; padding: 0 15px; }

/* ======================================== */
/* Focus Styles (Accessibility)             */
/* ======================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.service-card:focus-visible {
    outline: 3px solid #FFD700; /* Gold outline */
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(16, 22, 28, 0.5);
}
a:focus, button:focus, input:focus, textarea:focus, .service-card:focus {
    outline: none;
}

/* ======================================== */
/* Header Styling                           */
/* ======================================== */
.header { background: #10161c; padding: 0.75rem 0; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; }
body { padding-top: 60px; } /* Adjusted based on header height */
.header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo-img { width: 140px; height: auto; display: block; }

/* Navigation Area */
.nav-center {
    /* Holds the nav links */
    /* On mobile, this container is hidden by the media query below */
}
.nav-links { list-style: none; display: flex; gap: 0.75rem; margin: 0; padding: 0; flex-wrap: nowrap; justify-content: flex-end; }
.nav-links a { text-decoration: none; color: white; font-weight: 600; font-size: 0.9rem; transition: background-color 0.3s, color 0.3s; padding: 0.4rem 0.6rem; border-radius: 5px; display: inline-block; white-space: nowrap; }
.nav-links a:hover, .nav-links a:focus-visible { background-color: #f1f5f9; color: #1e293b; }

/* ======================================== */
/* Mobile Navigation Toggle (Hamburger)     */
/* ======================================== */
.nav-toggle {
    /* --- THIS RULE HIDES THE BUTTON ON DESKTOP --- */
    display: none;
    /* --------------------------------------------- */
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 1010; /* Ensure it's clickable */
}
.hamburger {
    display: block;
    position: relative;
    width: 25px;
    height: 3px;
    background-color: white;
    transition: transform 0.3s ease-in-out, background-color 0.1s ease;
}
.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: white;
    transition: transform 0.3s ease-in-out, top 0.3s ease-in-out, bottom 0.3s ease-in-out;
}
.hamburger::before { top: -8px; }
.hamburger::after { bottom: -8px; }

/* Hamburger Animation when Active */
.nav-toggle[aria-expanded="true"] .hamburger { background-color: transparent; }
.nav-toggle[aria-expanded="true"] .hamburger::before { transform: rotate(45deg); top: 0; }
.nav-toggle[aria-expanded="true"] .hamburger::after { transform: rotate(-45deg); bottom: 0; }


/* Hero Section */
.hero { background: url('../images/Drone_01.jpeg') no-repeat center center/cover; min-height: 85vh; position: relative; display: flex; align-items: center; justify-content: center; text-align: center; color: white; }
.hero-overlay { background: rgba(16, 22, 28, 0.6); width: 100%; padding: 6rem 2rem; opacity: 0; transition: opacity 1s ease-in-out; }
.hero-overlay.loaded { opacity: 1; }
.hero h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); margin-bottom: 1rem; font-weight: 700; }
.hero p { font-size: clamp(1.1rem, 3vw, 1.4rem); margin-bottom: 2rem; font-weight: 400; max-width: 650px; margin-left: auto; margin-right: auto; }

/* Buttons */
.btn { background-color: #FFD700; color: #1e293b; padding: 0.85rem 1.75rem; border: none; border-radius: 50px; font-size: 1rem; font-weight: 600; cursor: pointer; text-decoration: none; transition: background-color 0.3s, transform 0.2s, color 0.3s, border-color 0.3s; display: inline-block; }
.btn:hover, .btn:focus-visible { background-color: #e6c300; transform: translateY(-2px); }
.hero .btn { background-color: #10161c; color: white; border: none; }
.hero .btn:hover, .hero .btn:focus-visible { background-color: #2a3a4f; border-color: none; color: #FFD700; transform: translateY(-2px); }

/* General Section */
.section { padding: 5rem 0; }
.section h2 { text-align: center; font-size: clamp(2rem, 4vw, 2.5rem); margin-bottom: 3rem; font-weight: 700; }
.section p { margin-bottom: 1rem; }
.section h3 { margin-top: 2.5rem; margin-bottom: 1rem; font-size: 1.5rem; }
.section ul { margin-top: 1rem; margin-bottom: 1rem; }
.section li { margin-bottom: 0.75rem; line-height: 1.8; }

/* Section Colors & Specific Styles */
.about { background: #10161c; color: #e2e8f0; } /* Dark */
.about h2, .about h3 { color: white; }
.about p { color: #e2e8f0; margin-bottom: 1.2rem; }
.about .container { max-width: 850px; }

.problem { background: #f1f5f9; color: #1e293b; } /* Light */
.problem h2 { color: #1e293b; }
.problem .container { max-width: 850px; }
.problem-intro { font-size: 1.1rem; line-height: 1.7; margin-bottom: 2rem; text-align: center; max-width: 700px; margin-left: auto; margin-right: auto; color: #475569; }
.problem-list { list-style: none; padding: 0; margin: 2rem auto 0; max-width: 700px; text-align: left; }
.problem-list li { font-size: 1rem; line-height: 1.8; margin-bottom: 1rem; padding-left: 30px; position: relative; }
.problem-list li::before { content: "\2713"; color: #FFD700; font-size: 1.2rem; position: absolute; left: 0; top: 4px; font-weight: bold; }
.problem-list li strong { font-weight: 600; color: #10161c; }

.advantage { background: #10161c; color: #e2e8f0; } /* Dark */
.advantage h2 { color: white; }
.advantage .container { max-width: 850px; }
.advantage-intro { font-size: 1.1rem; line-height: 1.7; margin-bottom: 2rem; text-align: center; max-width: 700px; margin-left: auto; margin-right: auto; color: #cbd5e1; }
.advantage-list { list-style: none; padding: 0; margin: 2rem auto 0; max-width: 700px; text-align: left; }
.advantage-list li { font-size: 1rem; line-height: 1.8; margin-bottom: 1rem; padding-left: 30px; position: relative; }
.advantage-list li::before { content: "\2728"; color: #FFD700; font-size: 1.2rem; position: absolute; left: 0; top: 4px; }
.advantage-list li strong { font-weight: 600; color: #f1f5f9; }

.services { background: #f1f5f9; color: #1e293b; } /* Light */
.services h2 { color: #1e293b; margin-bottom: 1rem; }
.services-summary { font-size: 1.1rem; color: #1e293b; margin-bottom: 1rem; max-width: 700px; margin-left: auto; margin-right: auto; text-align: center; }
.service-instruction { text-align: center; font-style: italic; color: #64748b; margin-bottom: 2.5rem; font-size: 0.95rem; }
.service-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; max-width: 900px; margin: 0 auto; }
.service-card { background: #10161c; color: #e2e8f0; border-radius: 10px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); cursor: pointer; overflow: hidden; position: relative; transition: box-shadow 0.3s ease; min-height: 320px; }
.service-card:hover { box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); }
.service-card img { width: 100%; height: 200px; object-fit: cover; display: block; position: relative; z-index: 2; transition: opacity 0.5s ease-out, visibility 0s 0s; opacity: 1; visibility: visible; }
.service-card h3 { font-size: 1.5rem; font-weight: 600; color: white; margin: 0; padding: 1.5rem 1rem; position: relative; z-index: 2; transition: opacity 0.5s ease-out, visibility 0s 0s; opacity: 1; visibility: visible; background: #10161c; text-align: center; }
.service-details { position: absolute; top: 0; left: 0; width: 100%; height: 100%; padding: 1.5rem; text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: center; opacity: 0; visibility: hidden; z-index: 1; transition: opacity 0.5s ease-in, visibility 0s 0.5s; background: #10161c; overflow-y: auto; }
.service-details h4 { font-size: 1.6rem; font-weight: 600; margin-top: 0; margin-bottom: 1rem; color: white; }
.service-details ul { list-style: none; padding: 0; margin: 0; line-height: 1.7; }
.service-details li { margin-bottom: 0.5rem; font-size: 0.95rem; color: #cbd5e1; }
.service-card.active { box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25); }
.service-card.active img, .service-card.active h3 { opacity: 0; visibility: hidden; z-index: 1; transition: opacity 0.5s ease-out, visibility 0s 0.5s; }
.service-card.active .service-details { opacity: 1; visibility: visible; z-index: 2; transition: opacity 0.5s 0.1s ease-in, visibility 0s 0.1s; }

.person { background: #10161c; color: #e2e8f0; } /* Dark */
.person h2 { color: white; }
.person .container { max-width: 900px; }
.person-details { display: flex; align-items: center; gap: 2.5rem; max-width: 800px; margin: 0 auto; background: #2a3a4f; padding: 2rem; border-radius: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.person-image { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; border: 4px solid #FFD700; flex-shrink: 0; }
.person-info { text-align: left; }
.person-info h3 { font-size: 1.8rem; margin-bottom: 0.5rem; color: white; }
.person-info p:first-of-type { font-weight: 600; color: #FFD700; margin-bottom: 1rem; }
.person-info p { font-size: 1rem; line-height: 1.7; margin-bottom: 1rem; color: #cbd5e1; }
.person-info p:last-child { margin-bottom: 0; }

.portfolio { background: #f1f5f9; color: #1e293b; position: relative; } /* Light */
.portfolio h2 { color: #1e293b; margin-bottom: 1rem; }
.portfolio-summary { font-size: 1.1rem; color: #1e293b; margin-bottom: 3rem; max-width: 700px; margin-left: auto; margin-right: auto; text-align: center; }
.gallery { width: 100%; max-width: 800px; height: 450px; margin: 0 auto 2rem; position: relative; overflow: hidden; border-radius: 10px; background-color: #e2e8f0; }
.gallery-item { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; visibility: hidden; transition: opacity 0.6s ease-in-out, visibility 0s 0.6s; }
.gallery-item.gallery-item--visible { opacity: 1; visibility: visible; z-index: 2; transition: opacity 0.6s ease-in-out, visibility 0s 0s; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(16, 22, 28, 0.6); color: white; border: none; padding: 0.8rem 1rem; cursor: pointer; z-index: 10; border-radius: 5px; transition: background-color 0.3s; }
.gallery-nav:hover, .gallery-nav:focus-visible { background: rgba(16, 22, 28, 0.9); }
.gallery-nav.left { left: 15px; }
.gallery-nav.right { right: 15px; }
.gallery-preview { position: absolute; bottom: 30px; right: 30px; transform: none; width: 300px; height: 180px; opacity: 0.85; z-index: 5; border-radius: 8px; overflow: hidden; border: 3px solid rgba(255, 255, 255, 0.7); background-color: #333; transition: opacity 0.3s; }
.gallery-preview:hover { opacity: 1; }
.gallery-preview img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity 0.5s ease-in-out; }

/* Footer / Contact Section */
.contact-footer { background: #10161c; color: #e2e8f0; padding: 4rem 0 2rem; margin-top: 0; } /* Dark */
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; margin-bottom: 2.5rem; }
.footer-column h3 { color: white; font-size: 1.3rem; margin-bottom: 1.5rem; position: relative; padding-bottom: 0.5rem; text-align: left;}
.footer-column h3::after { content: ''; position: absolute; bottom: 0; left: 0; width: 50px; height: 3px; background-color: #FFD700; }
.footer-form form { display: flex; flex-direction: column; gap: 1rem; }
.footer-form input, .footer-form textarea { padding: 0.9rem 1rem; border: 1px solid #475569; border-radius: 8px; font-size: 0.95rem; background-color: #1e293b; color: white; width: 100%; }
.footer-form input::placeholder, .footer-form textarea::placeholder { color: #94a3b8; }
.footer-form textarea { resize: vertical; }
.footer-form button[type="submit"] { background-color: #2a3a4f; color: white; padding: 0.9rem; font-size: 1rem; font-weight: 600; border: none; border-radius: 8px; cursor: pointer; transition: background-color 0.3s, transform 0.2s, color 0.3s; margin-top: 0.25rem; }
.footer-form button[type="submit"]:hover, .footer-form button[type="submit"]:focus-visible { background-color: #3d526f; color: #FFD700; transform: translateY(-2px); }
.footer-links ul { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.8rem; line-height: 1.4; }
.footer-links a { color: #cbd5e1; text-decoration: none; transition: color 0.3s, padding-left 0.3s; }
.footer-links a:hover, .footer-links a:focus-visible { color: #FFD700; padding-left: 5px; }
.footer-details p { margin-bottom: 1.2rem; line-height: 1.7; color: #cbd5e1; }
.footer-details strong { color: white; display: block; margin-bottom: 0.25rem; }
.footer-details a { color: #cbd5e1; text-decoration: none; transition: color 0.3s; }
.footer-details a:hover, .footer-details a:focus-visible { color: #FFD700; }
.footer-divider { border: none; height: 1px; background-color: #334155; margin: 2.5rem auto; width: 100%; }
.copyright { text-align: center; margin-top: 0; margin-bottom: 0; font-size: 0.85rem; color: #94a3b8; }
/* Status message area in footer form */
.form-status { margin-top: 1rem; text-align: left; min-height: 1.5em; font-weight: bold; font-size: 0.9rem;}
.form-status.success { color: #4ade80; }
.form-status.error { color: #f87171; }

/* Floating Action Button Styles */
.floating-buttons { position: fixed; bottom: 25px; right: 25px; z-index: 999; display: flex; flex-direction: column; gap: 15px; }
.btn-float { background-color: #FFD700; color: #10161c; width: 80px; height: 80px; border-radius: 50%; border: none; display: flex; justify-content: center; align-items: center; font-size: 2rem; text-decoration: none; box-shadow: 0 4px 8px rgba(0,0,0,0.25); cursor: pointer; transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s; line-height: 1; }
.btn-float:hover, .btn-float:focus-visible { background-color: #e6c300; transform: scale(1.1); box-shadow: 0 6px 12px rgba(0,0,0,0.3); }
.btn-float-top { font-weight: bold; }

/* Contact Panel Styles */
.contact-panel { position: fixed; bottom: 25px; right: 25px; z-index: 1010; width: 90%; max-width: 400px; background: #10161c; color: #e2e8f0; border-radius: 10px; box-shadow: 0 5px 20px rgba(0,0,0,0.3); padding: 1.5rem 2rem; opacity: 0; visibility: hidden; transform: translateX(calc(100% + 30px)); transition: opacity 0.4s ease-out, transform 0.4s ease-out, visibility 0s 0.4s; }
.contact-panel.active { opacity: 1; visibility: visible; transform: translateX(0); transition: opacity 0.4s ease-out, transform 0.4s ease-out, visibility 0s 0s; }
.panel-close { position: absolute; top: 8px; right: 12px; background: none; border: none; font-size: 2rem; color: #aaa; cursor: pointer; line-height: 1; padding: 0; transition: color 0.2s; }
.panel-close:hover { color: #fff; }
.contact-panel h2 { color: white; text-align: center; margin-bottom: 0.5rem; font-size: 1.8rem; }
.contact-panel p { text-align: center; color: #cbd5e1; margin-bottom: 1.5rem; font-size: 0.9rem; }
.contact-panel form { display: flex; flex-direction: column; gap: 0.8rem; }
.contact-panel input, .contact-panel textarea { background-color: #1e293b; border: 1px solid #475569; padding: 0.8rem 1rem; border-radius: 8px; font-size: 1rem; color: white; width: 100%; }
.contact-panel input::placeholder, .contact-panel textarea::placeholder { color: #94a3b8; }
.contact-panel textarea { resize: vertical; }
.contact-panel button[type="submit"] { background-color: #2a3a4f; color: white; padding: 0.9rem; font-size: 1rem; font-weight: 600; border: none; border-radius: 8px; cursor: pointer; transition: background-color 0.3s, transform 0.2s, color 0.3s; margin-top: 0.5rem; }
.contact-panel button[type="submit"]:hover, .contact-panel button[type="submit"]:focus-visible { background-color: #3d526f; color: #FFD700; transform: translateY(-2px); }
.panel-form-status { margin-top: 1rem; text-align: center; min-height: 1.5em; font-weight: bold; }
.panel-form-status.success { color: #4ade80; }
.panel-form-status.error { color: #f87171; }

/* Privacy & Terms Page Specific Styles */
.privacy-section, .terms-section { background-color: #f1f5f9; color: #1e293b; padding-top: 4rem; padding-bottom: 4rem; }
.privacy-section .container, .terms-section .container { max-width: 850px; }
.privacy-section h1, .terms-section h1 { text-align: left; color: #10161c; margin-bottom: 2rem; font-size: 2.2rem; }
.privacy-section h2, .terms-section h2 { text-align: left; color: #10161c; font-size: 1.6rem; margin-top: 2.5rem; margin-bottom: 1rem; border-bottom: 2px solid #d1dce8; padding-bottom: 0.3rem; }
.privacy-section p, .terms-section p { margin-bottom: 1.2rem; line-height: 1.7; }
.privacy-section ul, .terms-section ul { list-style-position: outside; padding-left: 25px; margin-bottom: 1.2rem; }
.privacy-section li, .terms-section li { margin-bottom: 0.6rem; }
.privacy-section a, .terms-section a { color: #115e59; text-decoration: none; font-weight: 600; }
.privacy-section a:hover, .terms-section a:hover { text-decoration: underline; color: #0f766e; }
.privacy-section strong, .terms-section strong { font-weight: 600; color: #10161c; }


/* ======================================== */
/* Media Queries                            */
/* Adjustments for different screen sizes   */
/* ======================================== */

/* --- Medium Screens (Tablets, smaller laptops) --- */
@media (max-width: 992px) {
    .footer-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
    .footer-column { text-align: center; }
    .footer-column h3::after { left: 50%; transform: translateX(-50%); }
    .footer-details p { text-align: center; }
    .footer-links ul { text-align: center; }

    /* --- Mobile Nav Changes Start --- */
    .nav-toggle { display: block; } /* Show hamburger */
    .nav-center {
        /* Hide desktop nav links container by default */
        display: none;
        position: fixed; /* Make it overlay */
        top: 0; left: 0; width: 100%; height: 100vh;
        background-color: rgba(16, 22, 28, 0.98); /* Dark background */
        flex-direction: column; /* Stack items vertically */
        justify-content: center; align-items: center;
        z-index: 1005; /* Below header z-index, above content */
        transform: translateY(-100%); /* Start off-screen */
        transition: transform 0.4s ease-in-out;
        padding-top: 60px; /* Account for header */
    }
    .nav-center.active { /* Style when mobile menu is open */
         display: flex; /* Show the container */
         transform: translateY(0); /* Slide in */
    }
    .nav-links { /* Adjust mobile nav link layout */
        flex-direction: column; align-items: center; gap: 1.5rem;
    }
    .nav-links a { font-size: 1.3rem; padding: 0.5rem 1rem; }
    .nav-links a:hover, .nav-links a:focus-visible { background-color: #FFD700; color: #10161c; }
    /* --- Mobile Nav Changes End --- */
}

/* --- Small Screens (Tablets - Portrait) --- */
@media (max-width: 768px) {
  body { padding-top: 60px; } /* Re-adjust if header height changes */
  .header .container { flex-wrap: wrap; justify-content: space-between; }
  /* .nav-center styles handled by 992px breakpoint */
  .hero h1 { font-size: 2.2rem; }
  .hero p { font-size: 1rem; }
  .section { padding: 3rem 0; }
  .about .container, .problem .container, .advantage .container, .privacy-section .container, .terms-section .container { max-width: 90%; }
  .person-details { flex-direction: column; text-align: center; padding: 1.5rem; max-width: 90%; }
  .person-info { text-align: center; }
  .gallery { height: 300px; }
  .gallery-nav { padding: 0.5rem 0.8rem; }
  .gallery-preview { width: 150px; height: 90px; bottom: 15px; right: 15px; border-width: 2px; }
  .service-grid { grid-template-columns: 1fr; max-width: 450px; }
  .service-card { min-height: 300px; }
  .floating-buttons { bottom: 15px; right: 15px; gap: 10px; }
  .btn-float { width: 65px; height: 65px; font-size: 1.7rem; }
  .contact-panel { max-width: 350px; bottom: 15px; right: 15px; padding: 1.2rem 1.5rem; }
  .contact-panel.active { transform: translateX(0); }
  .contact-panel h2 { font-size: 1.6rem; }
  .contact-panel textarea { rows: 3; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* --- Extra Small Screens (Mobile) --- */
@media (max-width: 480px) {
    body { padding-top: 60px; }
    .header .container { justify-content: space-between; } /* Logo left, hamburger right */
    .logo-img { width: 120px; }
    /* .nav-center hidden by 992px breakpoint */
    .gallery-preview { display: none; }
    .service-grid { max-width: 100%; padding: 0 10px; }
    .service-card { min-height: 280px; }
    .floating-buttons { bottom: 10px; right: 10px; gap: 8px; }
    .btn-float { width: 60px; height: 60px; font-size: 1.6rem; }
    .contact-panel { max-width: 95%; width: auto; bottom: 10px; right: 10px; left: 10px; padding: 1rem 1.2rem; transform: translateY(calc(100% + 20px)); } /* Slide from bottom */
    .contact-panel.active { transform: translateY(0); }
    .contact-panel h2 { font-size: 1.5rem; }
    .panel-close { top: 5px; right: 10px; font-size: 2rem; }
}

```

---

**`js/scripts.js`**

*(No changes needed)*

```javascript
document.addEventListener('DOMContentLoaded', function() {
  // console.log('DOM Loaded, running scripts...');

  // Mobile Navigation Toggle
  const navToggle = document.getElementById('nav-toggle');
  const mainNav = document.getElementById('main-nav');
  if (navToggle && mainNav) {
      navToggle.addEventListener('click', () => {
          mainNav.classList.toggle('active');
          const isExpanded = mainNav.classList.contains('active');
          navToggle.setAttribute('aria-expanded', isExpanded);
      });
  } else { console.warn('Mobile navigation elements not found.'); }

  // Service Card Interaction
  const serviceCards = document.querySelectorAll('.service-card');
  const servicesSection = document.getElementById('services');
  if (serviceCards.length > 0 && servicesSection) {
      serviceCards.forEach(card => {
          card.addEventListener('click', function(event) {
              if (event.target.closest('a, button')) return;
              this.classList.toggle('active');
          });
           card.addEventListener('keydown', function(event) {
              if (event.key === 'Enter' || event.key === ' ') { event.preventDefault(); this.click(); }
          });
          card.setAttribute('tabindex', '0');
      });
      servicesSection.addEventListener('click', function(event) {
          if (!event.target.closest('.service-card')) { /* Optional: Close active cards */ }
      });
  } else { /* console.log('Service cards or section not found.'); */ }

  // Gallery Navigation
  const galleryContainer = document.querySelector('.gallery');
  const galleryItems = document.querySelectorAll('.gallery-item');
  const previewImage = document.querySelector('.gallery-preview img');
  const leftButton = document.querySelector('.gallery-nav.left');
  const rightButton = document.querySelector('.gallery-nav.right');
  let currentIndex = 0;
  function updateGallery(newIndex) {
      if (galleryItems.length === 0) return;
      currentIndex = (newIndex + galleryItems.length) % galleryItems.length;
      galleryItems.forEach((item, index) => { item.classList.toggle('gallery-item--visible', index === currentIndex); });
      if (previewImage && galleryItems.length > 1) {
          previewImage.style.display = 'block';
          const nextIndex = (currentIndex + 1) % galleryItems.length;
          const nextImageElement = galleryItems[nextIndex].querySelector('img');
          previewImage.src = nextImageElement?.src || '';
      } else if (previewImage) { previewImage.style.display = 'none'; }
  }
  function moveLeft() { updateGallery(currentIndex - 1); }
  function moveRight() { updateGallery(currentIndex + 1); }
  if (leftButton && rightButton && galleryItems.length > 0) {
      leftButton.addEventListener('click', moveLeft);
      rightButton.addEventListener('click', moveRight);
      updateGallery(0);
  }

  // Hero Section Fade-in
  const heroOverlay = document.querySelector('.hero-overlay');
  if (heroOverlay) { setTimeout(() => { heroOverlay.classList.add('loaded'); }, 100); }

  // Back to Top Button Logic
  const backToTopButton = document.getElementById('back-to-top');
  if (backToTopButton) {
      window.addEventListener('scroll', () => { if(backToTopButton){ backToTopButton.style.display = (window.scrollY > 300) ? 'flex' : 'none'; } });
      backToTopButton.addEventListener('click', () => { window.scrollTo({ top: 0, behavior: 'smooth' }); });
  }

  // Contact Panel Logic
  const contactPanel = document.getElementById('contact-panel');
  const openPanelButton = document.getElementById('open-contact-panel');
  const closePanelButton = document.getElementById('panel-close-button');
  const panelFormStatus = document.getElementById('panel-form-status');

  const closePanel = () => {
      if (!contactPanel) return;
      contactPanel.classList.remove('active');
       if(panelFormStatus) { setTimeout(() => { if(!contactPanel.classList.contains('active')) { panelFormStatus.textContent = ''; panelFormStatus.className = 'panel-form-status'; } }, 400); }
  };

  if (contactPanel && openPanelButton && closePanelButton) {
      const openPanel = () => {
          if (!contactPanel) { console.error("Cannot open panel: contactPanel element not found!"); return; }
          contactPanel.classList.add('active');
      };
      openPanelButton.addEventListener('click', openPanel);
      closePanelButton.addEventListener('click', closePanel);
      window.addEventListener('keydown', (event) => { if (event.key === 'Escape' && contactPanel && contactPanel.classList.contains('active')) { closePanel(); } });
  } else { console.error('Contact Panel elements (panel, open button, or close button) not found!'); }

  // Contact Form Validation & Placeholder Submission
    const handleFormSubmit = (formElement, statusElement) => {
        if (!formElement || !statusElement) {
            // console.log("Form or Status element not found for submission handler.");
            return;
        }
        formElement.addEventListener('submit', function(event) {
            event.preventDefault();
            let isValid = true; let firstErrorField = null;
            statusElement.textContent = ''; statusElement.className = 'panel-form-status'; // Use panel class for simplicity
            const requiredFields = formElement.querySelectorAll('[required]');
            requiredFields.forEach(field => {
                field.style.border = '1px solid #475569'; let fieldError = false;
                if (!field.value.trim()) { isValid = false; fieldError = true; statusElement.textContent = 'Please fill out all required fields.'; }
                if (field.type === 'email' && field.value.trim() && !/\S+@\S+\.\S+/.test(field.value)) { isValid = false; fieldError = true; statusElement.textContent = 'Please enter a valid email address.'; }
                if (fieldError) { field.style.border = '2px solid #f87171'; if (!firstErrorField) firstErrorField = field; }
            });
            if (!isValid) { statusElement.classList.add('error'); if (firstErrorField) firstErrorField.focus(); return; }

            // --- Placeholder for Backend ---
            statusElement.textContent = 'Sending...';
            console.warn("SUBMISSION NOT IMPLEMENTED - Using placeholder timeout.");
            setTimeout(() => {
                const success = Math.random() > 0.3;
                if (success) {
                    statusElement.textContent = 'Message Sent Successfully!'; statusElement.classList.add('success'); formElement.reset();
                    if (formElement.id === 'panel-contact-form') { setTimeout(() => { if (typeof closePanel === 'function' && contactPanel?.classList.contains('active')) { closePanel(); } }, 2000); }
                    else { setTimeout(() => { statusElement.textContent = ''; statusElement.className = 'form-status'; }, 3000); }
                } else {
                    statusElement.textContent = 'Error sending message. Please try again.'; statusElement.classList.add('error');
                }
            }, 1500);
            // --- End Placeholder ---
        });
    };

  // Attach handler to Panel Form
  const panelContactForm = document.getElementById('panel-contact-form');
  handleFormSubmit(panelContactForm, panelFormStatus);

  // Attach handler to Footer Form
  const footerContactForm = document.getElementById('footer-contact-form');
  const footerFormStatusElement = document.getElementById('footer-form-status');
  handleFormSubmit(footerContactForm, footerFormStatusElement);

 // console.log('Scripts finished loading.');

}); // End DOMContentLoaded
```

