html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

img,
svg,
video {
  max-width: 100%;
}

@media (max-width: 1024px) {
  header nav {
    padding-inline: 20px !important;
  }

  main > section:not(:first-child) {
    padding-block: 80px !important;
  }

  main > section,
  footer {
    padding-inline: 20px !important;
  }
}

@media (max-width: 640px) {
  header nav {
    height: 60px !important;
    padding-inline: 16px !important;
  }

  header nav button {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
  }

  main > section:first-child {
    min-height: max(680px, 100svh) !important;
    align-items: flex-start !important;
  }

  main > section:first-child > div:nth-of-type(2) {
    padding: 108px 16px 64px !important;
  }

  main > section:first-child h1 {
    font-size: 40px !important;
    line-height: 1.08 !important;
    letter-spacing: 0 !important;
    margin-bottom: 18px !important;
  }

  main > section:first-child p {
    font-size: 16px !important;
    line-height: 1.6 !important;
    margin-bottom: 28px !important;
  }

  main > section:first-child a[href="#contact"],
  main > section:first-child a[href^="tel:"] {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  main > section:first-child > div:last-child {
    display: none !important;
  }

  main > section:not(:first-child) {
    padding-block: 60px !important;
  }

  main > section,
  footer {
    padding-inline: 16px !important;
  }

  main section h2 {
    font-size: 28px !important;
    line-height: 1.18 !important;
    letter-spacing: 0 !important;
  }

  #services > div > div:first-child,
  #portfolio > div > div:first-child,
  #pricing > div > div:nth-child(-n + 2) {
    margin-bottom: 36px !important;
  }

  #services .p-8,
  #pricing .p-8 {
    padding: 22px !important;
  }

  #services .min-h-\[400px\] {
    min-height: 460px !important;
  }

  #services .grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  #about .py-4 {
    display: grid !important;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: start !important;
    gap: 6px 10px !important;
  }

  #about .py-4 > span:last-child {
    grid-column: 2;
    margin-left: 0 !important;
    text-align: left;
    line-height: 1.45;
  }

  #portfolio article .p-6 {
    padding: 20px !important;
  }

  #portfolio .aspect-\[21\/9\] {
    aspect-ratio: 4 / 3 !important;
  }

  #pricing .items-baseline {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  #contact input,
  #contact select,
  #contact textarea {
    min-height: 48px;
    font-size: 16px !important;
  }

  #contact button[type="submit"] {
    min-height: 50px;
    font-size: 16px !important;
  }

  footer {
    padding-top: 48px !important;
    padding-bottom: max(24px, env(safe-area-inset-bottom)) !important;
  }

  [role="dialog"] {
    left: 12px !important;
    right: 12px !important;
    bottom: max(12px, env(safe-area-inset-bottom)) !important;
    width: auto !important;
    max-width: none !important;
  }

  [role="dialog"] button {
    min-height: 44px;
  }
}

@media (max-width: 359px) {
  main > section:first-child > div:nth-of-type(2) {
    padding-top: 92px !important;
  }

  main > section:first-child h1 {
    font-size: 34px !important;
  }

  main section h2 {
    font-size: 25px !important;
  }

  #services .p-8,
  #pricing .p-8,
  #portfolio article .p-6 {
    padding: 18px !important;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  main > section:first-child {
    min-height: 620px !important;
  }

  main > section:first-child > div:nth-of-type(2) {
    padding-top: 92px !important;
  }
}
