.machinery-photo {
  padding: 0;
  overflow: hidden;
  min-height: 320px;
  background: #173424;
}

.machinery-photo img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  object-position: center;
  display: block;
}

@media (min-width: 1120px) {
  .gallery-section .section-copy {
    max-width: none;
    white-space: nowrap;
  }
}

@media (min-width: 761px) {
  .gallery-section {
    scroll-margin-top: 84px;
    padding-top: clamp(42px, 4.2vw, 62px);
    padding-bottom: clamp(44px, 4.2vw, 64px);
  }

  .gallery-section .section-tag {
    margin-bottom: 5px;
  }

  .gallery-section h2 {
    margin-bottom: 10px;
    font-size: clamp(1.72rem, 2.45vw, 2.25rem);
    line-height: 1.02;
  }

  .gallery-section .section-copy {
    margin-bottom: clamp(16px, 1.8vw, 22px);
    line-height: 1.45;
  }

  .gallery-section .gallery-grid {
    gap: clamp(12px, 1.45vw, 18px);
  }

  .gallery-section .gallery-card {
    aspect-ratio: 16 / 9;
    padding: clamp(16px, 1.4vw, 22px);
  }

  .machinery {
    padding-top: clamp(54px, 5vw, 76px);
  }
}

@media (min-width: 1180px) {
  .gallery-section .gallery-card {
    aspect-ratio: 16 / 8.6;
  }
}

@media (min-width: 900px) {
  .gallery-section h2 {
    white-space: nowrap;
  }
}

.steps-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(34px, 3.4vw, 48px);
}

.lead-form {
  padding: 20px;
}

.form-grid {
  gap: 6px 10px;
}

.field label {
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.field input,
.field select,
.field textarea {
  min-height: 42px;
  padding: 8px 11px;
  border-radius: 12px;
}

.field textarea {
  min-height: 86px;
}

.field-meta {
  margin-top: 3px;
  font-size: 0.8rem;
}

.field-error:empty {
  min-height: 0;
  margin-top: 0;
}

@media (max-width: 1100px) and (min-width: 761px) {
  .steps-grid {
    gap: 32px;
  }

  .step-card {
    padding: 18px;
  }

  .machinery {
    padding-top: 58px;
  }

  .contact-grid {
    gap: 22px;
  }

  .lead-form {
    padding: 18px;
  }

  .form-grid {
    gap: 6px 9px;
  }

  .field label {
    margin-bottom: 4px;
    font-size: 0.88rem;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: 40px;
    padding: 8px 10px;
  }

  .field textarea {
    min-height: 78px;
  }

  .field-error {
    min-height: 0.82rem;
    margin-top: 2px;
    font-size: 0.78rem;
  }
}

@media (max-width: 760px) {
  /* Keep the hero photo natural: no full-screen darkening layer on mobile. */
  .hero::before {
    background: none;
  }

  .hero {
    min-height: clamp(470px, 68svh, 610px);
  }

  .hero-grid {
    min-height: clamp(470px, 68svh, 610px);
    gap: clamp(10px, 3vw, 16px);
    padding-top: clamp(18px, 5vw, 30px);
    padding-bottom: clamp(14px, 4vw, 24px);
  }

  /* Best practice: protect text locally instead of dimming the whole background image. */
  .hero-copy {
    width: min(100%, 340px);
    padding: clamp(10px, 3vw, 13px);
    border: 1px solid rgba(245, 214, 126, 0.16);
    background: linear-gradient(135deg, rgba(27, 39, 28, 0.16), rgba(27, 39, 28, 0.24));
    box-shadow: 0 12px 30px rgba(30, 17, 3, 0.10);
    backdrop-filter: blur(1.5px);
  }

  .hero-copy h1,
  .hero-copy .lead,
  .hero-copy .eyebrow {
    text-shadow: 0 3px 18px rgba(30, 17, 3, 0.56);
  }

  .hero h1 {
    margin-bottom: clamp(6px, 1.8vw, 9px);
    font-size: clamp(1.82rem, 8.6vw, 2.55rem);
    line-height: 0.96;
  }

  .lead {
    font-size: clamp(0.72rem, 2.25vw, 0.84rem);
    line-height: 1.3;
  }

  .eyebrow {
    margin-bottom: clamp(5px, 1.4vw, 8px);
    font-size: clamp(0.54rem, 1.65vw, 0.66rem);
    letter-spacing: 0.11em;
  }

  .hero-cta {
    padding: clamp(7px, 2.4vw, 10px);
    gap: 8px;
    border-radius: 16px;
  }

  .hero-cta .button {
    min-height: 38px;
    padding: 7px 10px;
    font-size: clamp(0.74rem, 2.1vw, 0.86rem);
  }

  .gallery-section,
  .steps-section,
  .contact-section {
    padding: clamp(36px, 8vw, 48px) 0;
  }

  .section-tag {
    margin-bottom: 7px;
    font-size: 0.72rem;
    letter-spacing: 0.13em;
  }

  h2 {
    margin-bottom: 12px;
    font-size: clamp(1.55rem, 7vw, 2.15rem);
  }

  .section-copy {
    margin-bottom: 18px;
    line-height: 1.55;
  }

  .gallery-grid,
  .steps-grid {
    gap: 12px;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }

  .step-card {
    min-height: 0;
    padding: 15px;
    gap: 8px;
  }

  .step-number {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
  }

  .gallery-card span,
  .step-card h3 {
    font-size: 1.05rem;
  }

  .gallery-card small,
  .step-card p {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .gallery-card {
    aspect-ratio: 16 / 10;
    padding: 16px;
  }

  .machinery {
    padding: 18px 0 48px;
  }

  .machinery-panel {
    padding: 24px;
    border-radius: 22px;
  }

  .machinery-grid {
    gap: 24px;
  }

  .machinery-photo,
  .machinery-photo img {
    min-height: 250px;
  }

  .equipment-list {
    margin-bottom: 18px;
    line-height: 1.6;
  }

  .lead-form {
    padding: 12px;
  }

  .form-grid {
    gap: 6px;
  }

  .field label {
    margin-bottom: 3px;
    font-size: 0.84rem;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: 40px;
    padding: 7px 10px;
    border-radius: 11px;
  }

  .field textarea {
    min-height: 72px;
  }

  .field-meta {
    margin-top: 2px;
    font-size: 0.74rem;
  }

  .field-error {
    min-height: 0.75rem;
    margin-top: 2px;
    font-size: 0.74rem;
  }

  .submit-button {
    min-height: 42px;
  }

  .form-status {
    margin: 8px 0 6px;
  }

  .form-fallback {
    margin-top: 5px;
    font-size: 0.82rem;
  }

  .contact-copy p {
    margin-bottom: 10px;
    line-height: 1.5;
  }

  .phone-link {
    margin: 2px 0 12px;
    font-size: clamp(1.35rem, 6vw, 1.75rem);
  }

  .prefooter {
    padding: 18px 0;
  }

  .prefooter-row {
    gap: 12px;
  }

  .prefooter-row strong {
    margin-bottom: 4px;
    font-size: 1.2rem;
  }

  .prefooter-row p {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .site-footer {
    padding: 22px 0 20px;
  }

  .footer-grid {
    gap: 14px;
  }

  .footer-grid p {
    margin-top: 6px;
    line-height: 1.45;
  }

  .footer-bottom {
    margin-top: 14px;
    padding-top: 10px;
    font-size: 0.8rem;
  }
}

@media (max-width: 420px) {
  .hero {
    min-height: clamp(450px, 70svh, 580px);
  }

  .hero-grid {
    min-height: clamp(450px, 70svh, 580px);
  }

  .hero-copy {
    width: min(100%, 305px);
    padding: 9px;
  }

  .hero h1 {
    font-size: clamp(1.68rem, 9.2vw, 2.25rem);
  }

  .lead {
    font-size: clamp(0.68rem, 2.7vw, 0.8rem);
  }

  .step-card,
  .gallery-card {
    padding: 14px;
  }

  .machinery-panel {
    padding: 20px;
  }
}

/* Final responsive tuning */
@media (min-width: 1180px) {
  .steps-section {
    padding-top: clamp(76px, 7vw, 104px);
    padding-bottom: clamp(76px, 7vw, 104px);
  }

  .steps-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(38px, 3.2vw, 56px);
  }

  .step-card {
    min-height: clamp(245px, 22vw, 300px);
    padding: clamp(26px, 2.2vw, 34px);
  }

  .step-number {
    width: 54px;
    height: 54px;
    font-size: 1.05rem;
  }

  .step-card h3 {
    margin-top: 18px;
    font-size: clamp(1.22rem, 1.1vw, 1.38rem);
  }

  .step-card p {
    font-size: clamp(0.98rem, 0.35vw + 0.9rem, 1.08rem);
    line-height: 1.62;
  }
}

@media (min-width: 980px) and (max-width: 1179px) {
  .steps-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(24px, 2.4vw, 34px);
  }

  .step-card {
    min-height: 225px;
    padding: 22px;
  }
}

@media (min-width: 761px) and (max-width: 979px) {
  .steps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }

  .step-card {
    min-height: 190px;
    padding: 22px;
  }
}

@media (max-width: 760px) {
  .hero,
  .hero-grid {
    min-height: clamp(540px, 78svh, 700px);
  }
}

@media (max-width: 420px) {
  .hero,
  .hero-grid {
    min-height: clamp(520px, 80svh, 680px);
  }
}
