/* ===== HAMBURGER BUTTON (hidden on desktop) ===== */
.hamburger {
  display: none;
}

/* ===== MOBILE NAV OVERLAY ===== */
.mobile-nav {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--white);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Hidden state */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-12px);
  /* Closing: fade out, then hide visibility after transition ends */
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0.35s;
}

.mobile-nav.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  /* Opening: show visibility immediately, animate the rest */
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s linear 0s;
}

.mobile-nav ul {
  list-style: none;
  text-align: center;
  padding: 0;
}

.mobile-nav ul li {
  margin-bottom: 32px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Stagger items in when nav opens */
.mobile-nav.open ul li {
  opacity: 1;
  transform: translateY(0);
}

.mobile-nav.open ul li:nth-child(1) { transition-delay: 0.08s; }
.mobile-nav.open ul li:nth-child(2) { transition-delay: 0.14s; }
.mobile-nav.open ul li:nth-child(3) { transition-delay: 0.20s; }
.mobile-nav.open ul li:nth-child(4) { transition-delay: 0.26s; }

.mobile-nav ul li a {
  font-family: var(--heading-font);
  font-size: 22px;
  font-weight: 700;
  color: var(--black);
  text-decoration: none;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: opacity 0.3s ease;
}

.mobile-nav ul li a:hover {
  opacity: 0.5;
}

.mobile-nav ul li a.active,
.mobile-nav ul li.current-menu-item > a,
.mobile-nav ul li.current_page_item > a,
.mobile-nav ul li.current-menu-ancestor > a {
  border-bottom: 2px solid var(--lime);
  padding-bottom: 4px;
}

/* ===== TABLET (≤1024px) ===== */
@media (max-width: 1024px) {
  .container {
    padding: 0 40px;
  }

  .hero-content h1 {
    font-size: 56px;
  }

  .services-inner {
    gap: 40px;
  }

  .about-hero-inner,
  .founder-inner,
  .strategic-inner,
  .contact-info-inner {
    gap: 40px;
  }

  .footer-grid {
    gap: 40px;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .offer-grid {
    gap: 16px;
  }

  .offer-card {
    flex: 0 0 calc(50% - 8px);
  }

  .stats-grid {
    gap: 24px;
  }

  .stat-item h3 {
    font-size: 42px;
  }
}

/* ===== MOBILE (≤768px) ===== */
@media (max-width: 768px) {

  /* ----- CONTAINER ----- */
  .container {
    padding: 0 20px;
  }

  /* ----- HEADER ----- */
  .site-header {
    padding: 18px 20px;
  }

  .site-header.scrolled {
    padding: 14px 20px;
  }

  /* Hide desktop nav */
  .nav {
    display: none;
  }

  /* Show hamburger */
  .hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 1001;
    position: relative;
  }

  .hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transform-origin: center;
    /* Each span transitions independently */
    transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1),
                opacity   0.2s ease,
                background 0.3s ease,
                width      0.3s ease;
  }

  /* Dark hamburger for pages with white header */
  .about-page .hamburger span,
  .portfolio-page .hamburger span,
  .category-page .hamburger span,
  .project-detail-page .hamburger span {
    background: var(--black);
  }

  /* Dark hamburger when header is scrolled */
  .site-header.scrolled .hamburger span {
    background: var(--black);
  }

  /* ── Hamburger → X animation ── */

  /* Top bar: slide down and rotate into / */
  .hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
    background: var(--black);
    transition-delay: 0.05s;
  }

  /* Middle bar: shrink to nothing */
  .hamburger.open span:nth-child(2) {
    opacity: 0;
    width: 0;
    transition-delay: 0s;
  }

  /* Bottom bar: slide up and rotate into \ */
  .hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
    background: var(--black);
    transition-delay: 0.05s;
  }

  /* ----- HERO ----- */
  .hero-content h1 {
    font-size: 38px;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
  }

  .hero-content p {
    font-size: 15px;
  }

  /* ----- INTRO ----- */
  .intro {
    padding: 40px 0;
  }

  .intro-card {
    padding: 28px 20px;
  }

  .intro-card h2 {
    font-size: 22px;
    margin-bottom: 16px;
  }

  .intro-card p {
    font-size: 14px;
  }

  /* ----- STATS ----- */
  .stats {
    padding: 50px 0;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }

  .stat-item h3 {
    font-size: 36px;
  }

  .stat-item p {
    font-size: 12px;
  }

  /* ----- SERVICES ----- */
  .services {
    padding: 60px 0;
  }

  .services-inner {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .services-right {
    display: none;
  }

  .services-left h2 {
    font-size: 26px;
    margin-bottom: 28px;
  }

  /* ----- CLIENTS ----- */
  .clients {
    padding: 50px 0;
  }

  .clients h2 {
    font-size: 26px;
    margin-bottom: 28px;
  }

  .client-item {
    min-width: calc(50% - 30px);
    padding: 16px;
    min-height: 90px;
  }

  .client-item img {
    max-height: 80px;
  }

  .clients-slider-wrapper {
    gap: 16px;
  }

  .slider-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: var(--light-gray);
    border-radius: 50%;
    position: relative;
    z-index: 5;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    pointer-events: auto;
    cursor: pointer;
    flex-shrink: 0;
  }

  .slider-btn:disabled {
    opacity: 0.3;
  }

  /* ----- FOOTER ----- */
  .site-footer {
    padding: 40px 0 20px;
  }

  .footer-top {
    margin-bottom: 36px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    margin-bottom: 32px;
  }

  .footer-bottom {
    flex-direction: column-reverse;
    gap: 16px;
    align-items: center;
    text-align: center;
  }

  /* ===== ABOUT PAGE ===== */

  .about-hero {
    padding: 100px 0 50px;
  }

  .about-hero-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .about-hero-text h1 {
    font-size: 44px;
  }

  .about-img-grid img {
    height: 130px;
  }

  .founder {
    padding: 50px 0;
  }

  .founder-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .founder-image img {
    height: 320px;
  }

  .founder-text h2 {
    font-size: 24px;
  }

  .founder-text p {
    font-size: 14px;
  }

  .mission-vision {
    padding: 50px 0;
  }

  .mission-vision h2 {
    font-size: 26px;
    margin-bottom: 28px;
  }

  .mv-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .mv-card {
    padding: 28px 24px;
  }

  .strategic {
    padding: 60px 0;
  }

  .strategic-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .strategic-text h2 {
    font-size: 22px;
  }

  .strategic-text p {
    font-size: 14px;
  }

  .strategic-image img {
    height: 280px;
  }

  .about-services {
    padding: 50px 0;
  }

  .section-title {
    font-size: 26px;
    margin-bottom: 36px;
  }

  .service-row {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 48px;
    direction: ltr;
  }

  .service-row.reverse {
    direction: ltr;
  }

  .service-row.reverse > * {
    direction: ltr;
  }

  /* On mobile reverse rows: image still first */
  .service-row.reverse .service-image {
    order: -1;
  }

  .service-image img {
    height: 240px;
  }

  .service-text h3 {
    font-size: 20px;
  }

  .service-text p {
    font-size: 14px;
  }

  .what-we-offer {
    padding: 50px 0;
  }

  .what-header {
    margin-bottom: 28px;
  }

  .what-header h2 {
    font-size: 22px;
  }

  .offer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .offer-card img {
    height: 160px;
    margin-bottom: 12px;
  }

  .offer-card h4 {
    font-size: 14px;
  }

  .offer-card p {
    font-size: 12px;
  }

  /* ===== CONTACT PAGE ===== */

  .contact-hero {
    height: 45vh;
    min-height: 300px;
  }

  .contact-hero-content h1 {
    font-size: 40px;
  }

  .contact-hero-content p {
    font-size: 15px;
  }

  .get-in-touch {
    padding: 50px 0;
  }

  .form-header h2 {
    font-size: 22px;
    letter-spacing: 1px;
  }

  .form-header p {
    font-size: 14px;
  }

  .contact-form {
    padding: 28px 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 0;
  }

  .form-group {
    margin-bottom: 18px;
  }

  .contact-info-section {
    padding: 50px 0;
  }

  .contact-info-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .contact-info-image img {
    height: 260px;
  }

  .contact-info-details h3 {
    font-size: 17px;
    margin-bottom: 28px;
  }

  /* ===== PORTFOLIO PAGE ===== */

  .portfolio-hero {
    height: 45vh;
    min-height: 300px;
  }

  .portfolio-hero-content h1 {
    font-size: 40px;
  }

  .portfolio-hero-content p {
    font-size: 15px;
    margin-bottom: 18px;
  }

  .project-categories {
    padding: 50px 0;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  /* ===== CATEGORY PAGE ===== */

  .category-hero {
    height: 35vh;
    min-height: 240px;
  }

  .category-hero-content h1 {
    font-size: 36px;
  }

  .projects-grid {
    padding: 50px 0;
  }

  .projects-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .project-card img {
    height: 180px;
  }

  .project-info {
    padding: 10px 14px;
  }

  .project-info h3 {
    font-size: 13px;
    margin-bottom: 4px;
  }

  /* ===== PROJECT DETAIL PAGE ===== */

  .project-detail {
    padding: 50px 0;
  }

  .project-detail > .container > h1 {
    font-size: 26px;
  }

  .project-detail-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 20px;
  }

  .project-images img {
    height: 260px;
  }

  .project-detail-inner .project-info h2 {
    font-size: 22px;
  }

  .project-detail-inner .project-info p {
    font-size: 14px;
  }
}

/* ===== SMALL MOBILE (≤480px) ===== */
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .hero-content h1 {
    font-size: 30px;
  }

  .about-hero-text h1 {
    font-size: 36px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .stat-item h3 {
    font-size: 30px;
  }

  .offer-card {
    flex: 0 0 80%;
  }

  .category-grid,
  .projects-list {
    grid-template-columns: 1fr;
  }

  .portfolio-hero-content h1,
  .contact-hero-content h1 {
    font-size: 32px;
  }

  .category-hero-content h1 {
    font-size: 28px;
  }

  .about-img-grid img {
    height: 110px;
  }
}
